251 lines
1.9 MiB
251 lines
1.9 MiB
var p$=Object.defineProperty;var h$=(t,e,n)=>e in t?p$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var hl=(t,e,n)=>h$(t,typeof e!="symbol"?e+"":e,n);import{dr as kg,eP as ed,dn as zo,eQ as IN,db as tm,eR as z_,eS as lp,eT as nm,eU as Qy,eV as Ku,ef as qd,dc as qa,eW as v$,dd as Kd,ea as hj,eX as m$,eY as H_,eZ as Qu,e6 as S1,e8 as N2,dk as rm,au as Zd,e_ as om,e$ as im,eg as Kg,f0 as k2,di as Yo,f1 as A1,dM as M1,ee as sp,dS as Ri,f2 as Pg,dj as Nh,f3 as Zg,f4 as X_,dR as Jd,dh as Es,df as _i,f5 as g$,f6 as vj,eE as ec,ed as Ll,f7 as y$,f8 as _$,f9 as Jg,fa as T1,fb as mj,dL as am,fc as gj,bL as tc,dg as Y_,at as kh,dQ as w_,dO as Hv,e9 as b$,ec as FN,eb as w$,as as yj,fd as _j,fe as E$,dm as C1,de as x$,ei as uw,ff as O$,fg as bj,fh as wj,fi as S$,fj as Ej,fk as A$,dp as M$,fl as T$,fm as C$,fn as N$,fo as cw,fp as k$,el as P$,fq as xj,dN as Oj,eh as P2,fr as Sj,fs as R2,ft as R$,dl as q_,fu as Aj,fv as D$,fw as Mj,fx as Tj,fy as j$,fz as L$,fA as I$,em as E_,eC as F$,fB as B$,fC as $$,aw as U$,fD as V$,fE as W$,fF as D2,fG as G$,fH as Cj,fI as z$,fJ as H$,ai as X$,eF as to,fK as Y$,ax as dw,fL as uA,fM as q$,fN as K$,fO as ws,fP as Z$,fQ as J$,av as Xv,fR as Q$,eG as Yv,fS as e9,eD as Vv,fT as Nj,fU as t9,fV as n9,fW as r9,ay as _r,aB as He,aV as K_,aD as ne,aE as Ne,aW as mn,aX as Ir,aH as k,aI as ee,aY as No,aF as bt,aG as j,b2 as Wn,c$ as cA,bX as mh,dw as BN,aJ as _e,bY as j2,aK as ft,b1 as Bn,aS as gn,cf as Ph,fX as ml,aQ as ja,aA as kj,aO as hr,aP as Pj,b6 as bo,b8 as Ql,bc as Rj,ch as Eh,cq as fw,fY as pw,bW as u0,aT as oi,aN as nc,aZ as Me,b7 as Rg,ce as Gs,cF as Dj,cj as x_,c1 as Xi,aC as Pt,c0 as L2,aM as kr,fZ as O_,ci as bs,d5 as Z_,bB as Dg,aU as Rh,f_ as o9,f$ as i9,g0 as jj,g1 as Lj,g2 as a9,g3 as l9,g4 as s9,g5 as u9,g6 as c9,g7 as Go,du as I2,dv as d9,cu as f9,bD as xh,dJ as p9,b3 as Oh,g8 as yu,cJ as h9,g9 as $N,ga as Lv,gb as v9,gc as F2,gd as B2,ge as m9,gf as g9,b4 as Ij,bZ as dA,az as y9,er as UN,cY as _9,bG as Qf,bH as Vs,bI as Bc,bK as Yl,bJ as sh}from"./admin-DBW881Vd.js";import{t as VN,a as WN,g as b9,i as Qd,n as w9,c as $2,l as c0,d as E9}from"./data-DQPbDZPO.js";import{_ as dp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-CeMFmgi0.js";import{G as U2,d as x9,e as O9,f as S9,_ as Fj,c as Bj,b as A9,a as M9}from"./ToolDialog.vue_vue_type_style_index_0_lang-BnK4Bpqe.js";import{d as $j,c as lm,v as J_,e as T9,g as Uj,f as C9,a as ri,r as Vj}from"./reduce-DUOz4PWt.js";import{c as N9,a as k9,b as P9,e as Wj,f as Sh,m as R9,d as D9,h as hw}from"./min-C3Ljkllm.js";import{c as V2,b as N1,i as W2,p as Gj,n as G2,a as j9,d as z2,e as L9,f as I9,g as F9,h as B9,u as $9,j as U9,k as V9,l as zj,m as W9,r as G9,o as z9,q as H9,s as X9,t as Xo}from"./uniqBy-DYd3ZOQf.js";import{d as Hj,e as Y9,g as q9,h as K9,i as Z9,z as J9,s as Q9,m as e7,a as t7,b as n7,f as r7,c as o7,r as i7,u as a7}from"./zipObject-Qzmklie6.js";import{l as Xj,_ as Yj}from"./vue-draggable-plus-C7R4ksW6.js";import{_ as l7}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-DifCv9YD.js";import{_ as Fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const qj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kme}},Symbol.toStringTag,{value:"Module"}));var s7=NaN;function GN(t){return typeof t=="number"?t:kg(t)?s7:+t}function k1(t,e){return function(n,o){var r;if(n===void 0&&o===void 0)return e;if(n!==void 0&&(r=n),o!==void 0){if(r===void 0)return o;typeof n=="string"||typeof o=="string"?(n=ed(n),o=ed(o)):(n=GN(n),o=GN(o)),r=t(n,o)}return r}}var u7=k1(function(t,e){return t+e},0),c7="Expected a function";function d7(t,e){if(typeof e!="function")throw new TypeError(c7);return t=zo(t),function(){if(--t<1)return e.apply(this,arguments)}}var vw=IN&&new IN,Kj=vw?function(t,e){return vw.set(t,e),t}:tm;function S_(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=z_(t.prototype),o=t.apply(n,e);return lp(o)?o:n}}var f7=1;function p7(t,e,n){var o=e&f7,r=S_(t);function i(){var a=this&&this!==nm&&this instanceof i?r:t;return a.apply(o?n:this,arguments)}return i}var h7=Math.max;function Zj(t,e,n,o){for(var r=-1,i=t.length,a=n.length,s=-1,l=e.length,f=h7(i-a,0),h=Array(l+f),v=!o;++s<l;)h[s]=e[s];for(;++r<a;)(v||r<i)&&(h[n[r]]=t[r]);for(;f--;)h[s++]=t[r++];return h}var v7=Math.max;function Jj(t,e,n,o){for(var r=-1,i=t.length,a=-1,s=n.length,l=-1,f=e.length,h=v7(i-s,0),v=Array(h+f),b=!o;++r<h;)v[r]=t[r];for(var E=r;++l<f;)v[E+l]=e[l];for(;++a<s;)(b||r<i)&&(v[E+n[a]]=t[r++]);return v}function m7(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}function P1(){}var g7=4294967295;function $o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g7,this.__views__=[]}$o.prototype=z_(P1.prototype);$o.prototype.constructor=$o;var H2=vw?function(t){return vw.get(t)}:Qy,Og={},y7=Object.prototype,_7=y7.hasOwnProperty;function H0(t){for(var e=t.name+"",n=Og[e],o=_7.call(Og,e)?n.length:0;o--;){var r=n[o],i=r.func;if(i==null||i==t)return r.name}return e}function rc(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}rc.prototype=z_(P1.prototype);rc.prototype.constructor=rc;function Qj(t){if(t instanceof $o)return t.clone();var e=new rc(t.__wrapped__,t.__chain__);return e.__actions__=Ku(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var b7=Object.prototype,w7=b7.hasOwnProperty;function ge(t){if(qd(t)&&!qa(t)&&!(t instanceof $o)){if(t instanceof rc)return t;if(w7.call(t,"__wrapped__"))return Qj(t)}return new rc(t)}ge.prototype=P1.prototype;ge.prototype.constructor=ge;function fA(t){var e=H0(t),n=ge[e];if(typeof n!="function"||!(e in $o.prototype))return!1;if(t===n)return!0;var o=H2(n);return!!o&&t===o[0]}var eL=v$(Kj),E7=/\{\n\/\* \[wrapped with (.+)\] \*/,x7=/,? & /;function O7(t){var e=t.match(E7);return e?e[1].split(x7):[]}var S7=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function A7(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(S7,`{
|
||
/* [wrapped with `+e+`] */
|
||
`)}var M7=1,T7=2,C7=8,N7=16,k7=32,P7=64,R7=128,D7=256,j7=512,L7=[["ary",R7],["bind",M7],["bindKey",T7],["curry",C7],["curryRight",N7],["flip",j7],["partial",k7],["partialRight",P7],["rearg",D7]];function I7(t,e){return Kd(L7,function(n){var o="_."+n[0];e&n[1]&&!hj(t,o)&&t.push(o)}),t.sort()}function tL(t,e,n){var o=e+"";return m$(t,A7(o,I7(O7(o),n)))}var F7=4,B7=8,zN=32,HN=64;function nL(t,e,n,o,r,i,a,s,l,f){var h=e&B7,v=h?a:void 0,b=h?void 0:a,E=h?i:void 0,O=h?void 0:i;e|=h?zN:HN,e&=~(h?HN:zN),e&F7||(e&=-4);var w=[t,e,r,E,v,O,b,s,l,f],S=n.apply(void 0,w);return fA(t)&&eL(S,w),S.placeholder=o,tL(S,t,e)}function Qg(t){var e=t;return e.placeholder}var $7=Math.min;function U7(t,e){for(var n=t.length,o=$7(e.length,n),r=Ku(t);o--;){var i=e[o];t[o]=H_(i,n)?r[i]:void 0}return t}var XN="__lodash_placeholder__";function Ah(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n];(a===e||a===XN)&&(t[n]=XN,i[r++]=n)}return i}var V7=1,W7=2,G7=8,z7=16,H7=128,X7=512;function R1(t,e,n,o,r,i,a,s,l,f){var h=e&H7,v=e&V7,b=e&W7,E=e&(G7|z7),O=e&X7,w=b?void 0:S_(t);function S(){for(var M=arguments.length,T=Array(M),$=M;$--;)T[$]=arguments[$];if(E)var D=Qg(S),P=m7(T,D);if(o&&(T=Zj(T,o,r,E)),i&&(T=Jj(T,i,a,E)),M-=P,E&&M<f){var B=Ah(T,D);return nL(t,e,R1,S.placeholder,n,T,B,s,l,f-M)}var F=v?n:this,I=b?F[t]:t;return M=T.length,s?T=U7(T,s):O&&M>1&&T.reverse(),h&&l<M&&(T.length=l),this&&this!==nm&&this instanceof S&&(I=w||S_(I)),I.apply(F,T)}return S}function Y7(t,e,n){var o=S_(t);function r(){for(var i=arguments.length,a=Array(i),s=i,l=Qg(r);s--;)a[s]=arguments[s];var f=i<3&&a[0]!==l&&a[i-1]!==l?[]:Ah(a,l);if(i-=f.length,i<n)return nL(t,e,R1,r.placeholder,void 0,a,f,void 0,void 0,n-i);var h=this&&this!==nm&&this instanceof r?o:t;return Qu(h,this,a)}return r}var q7=1;function K7(t,e,n,o){var r=e&q7,i=S_(t);function a(){for(var s=-1,l=arguments.length,f=-1,h=o.length,v=Array(h+l),b=this&&this!==nm&&this instanceof a?i:t;++f<h;)v[f]=o[f];for(;l--;)v[f++]=arguments[++s];return Qu(b,r?n:this,v)}return a}var YN="__lodash_placeholder__",YO=1,Z7=2,J7=4,qN=8,jy=128,KN=256,Q7=Math.min;function eU(t,e){var n=t[1],o=e[1],r=n|o,i=r<(YO|Z7|jy),a=o==jy&&n==qN||o==jy&&n==KN&&t[7].length<=e[8]||o==(jy|KN)&&e[7].length<=e[8]&&n==qN;if(!(i||a))return t;o&YO&&(t[2]=e[2],r|=n&YO?0:J7);var s=e[3];if(s){var l=t[3];t[3]=l?Zj(l,s,e[4]):s,t[4]=l?Ah(t[3],YN):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?Jj(l,s,e[6]):s,t[6]=l?Ah(t[5],YN):e[6]),s=e[7],s&&(t[7]=s),o&jy&&(t[8]=t[8]==null?e[8]:Q7(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=r,t}var tU="Expected a function",ZN=1,nU=2,JN=8,QN=16,ek=32,rU=64,tk=Math.max;function fp(t,e,n,o,r,i,a,s){var l=e&nU;if(!l&&typeof t!="function")throw new TypeError(tU);var f=o?o.length:0;if(f||(e&=-97,o=r=void 0),a=a===void 0?a:tk(zo(a),0),s=s===void 0?s:zo(s),f-=r?r.length:0,e&rU){var h=o,v=r;o=r=void 0}var b=l?void 0:H2(t),E=[t,e,n,o,r,h,v,i,a,s];if(b&&eU(E,b),t=E[0],e=E[1],n=E[2],o=E[3],r=E[4],s=E[9]=E[9]===void 0?l?0:t.length:tk(E[9]-f,0),!s&&e&(JN|QN)&&(e&=-25),!e||e==ZN)var O=p7(t,e,n);else e==JN||e==QN?O=Y7(t,e,s):(e==ek||e==(ZN|ek))&&!r.length?O=K7(t,e,n,o):O=R1.apply(void 0,E);var w=b?Kj:eL;return tL(w(O,E),t,e)}var oU=128;function rL(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,fp(t,oU,void 0,void 0,void 0,void 0,e)}var iU=S1(function(t,e){N2(e,rm(e),t)}),pA=S1(function(t,e,n,o){N2(e,rm(e),t,o)}),aU=S1(function(t,e,n,o){N2(e,Zd(e),t,o)});function X2(t,e){for(var n=-1,o=e.length,r=Array(o),i=t==null;++n<o;)r[n]=i?void 0:om(t,e[n]);return r}var lU=im(X2),sU="[object DOMException]",uU="[object Error]";function Y2(t){if(!qd(t))return!1;var e=Kg(t);return e==uU||e==sU||typeof t.message=="string"&&typeof t.name=="string"&&!k2(t)}var oL=Yo(function(t,e){try{return Qu(t,void 0,e)}catch(n){return Y2(n)?n:new Error(n)}}),cU="Expected a function";function iL(t,e){var n;if(typeof e!="function")throw new TypeError(cU);return t=zo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var dU=1,fU=32,D1=Yo(function(t,e,n){var o=dU;if(n.length){var r=Ah(n,Qg(D1));o|=fU}return fp(t,o,e,n,r)});D1.placeholder={};var pU=im(function(t,e){return Kd(e,function(n){n=A1(n),M1(t,n,D1(t[n],t))}),t}),hU=1,vU=2,mU=32,q2=Yo(function(t,e,n){var o=hU|vU;if(n.length){var r=Ah(n,Qg(q2));o|=mU}return fp(e,o,t,n,r)});q2.placeholder={};function Dh(t,e,n){var o=t.length;return n=n===void 0?o:n,!e&&n>=o?t:sp(t,e,n)}var gU="\\ud800-\\udfff",yU="\\u0300-\\u036f",_U="\\ufe20-\\ufe2f",bU="\\u20d0-\\u20ff",wU=yU+_U+bU,EU="\\ufe0e\\ufe0f",xU="\\u200d",OU=RegExp("["+xU+gU+wU+EU+"]");function ey(t){return OU.test(t)}function SU(t){return t.split("")}var aL="\\ud800-\\udfff",AU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",TU="\\u20d0-\\u20ff",CU=AU+MU+TU,NU="\\ufe0e\\ufe0f",kU="["+aL+"]",hA="["+CU+"]",vA="\\ud83c[\\udffb-\\udfff]",PU="(?:"+hA+"|"+vA+")",lL="[^"+aL+"]",sL="(?:\\ud83c[\\udde6-\\uddff]){2}",uL="[\\ud800-\\udbff][\\udc00-\\udfff]",RU="\\u200d",cL=PU+"?",dL="["+NU+"]?",DU="(?:"+RU+"(?:"+[lL,sL,uL].join("|")+")"+dL+cL+")*",jU=dL+cL+DU,LU="(?:"+[lL+hA+"?",hA,sL,uL,kU].join("|")+")",IU=RegExp(vA+"(?="+vA+")|"+LU+jU,"g");function FU(t){return t.match(IU)||[]}function td(t){return ey(t)?FU(t):SU(t)}function fL(t){return function(e){e=Ri(e);var n=ey(e)?td(e):void 0,o=n?n[0]:e.charAt(0),r=n?Dh(n,1).join(""):e.slice(1);return o[t]()+r}}var K2=fL("toUpperCase");function pL(t){return K2(Ri(t).toLowerCase())}function Z2(t){return function(e){return t==null?void 0:t[e]}}var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$U=Z2(BU),UU=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,VU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",GU="\\u20d0-\\u20ff",zU=VU+WU+GU,HU="["+zU+"]",XU=RegExp(HU,"g");function hL(t){return t=Ri(t),t&&t.replace(UU,$U).replace(XU,"")}var YU=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qU(t){return t.match(YU)||[]}var KU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZU(t){return KU.test(t)}var vL="\\ud800-\\udfff",JU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",eV="\\u20d0-\\u20ff",tV=JU+QU+eV,mL="\\u2700-\\u27bf",gL="a-z\\xdf-\\xf6\\xf8-\\xff",nV="\\xac\\xb1\\xd7\\xf7",rV="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oV="\\u2000-\\u206f",iV=" \\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",yL="A-Z\\xc0-\\xd6\\xd8-\\xde",aV="\\ufe0e\\ufe0f",_L=nV+rV+oV+iV,bL="['’]",nk="["+_L+"]",lV="["+tV+"]",wL="\\d+",sV="["+mL+"]",EL="["+gL+"]",xL="[^"+vL+_L+wL+mL+gL+yL+"]",uV="\\ud83c[\\udffb-\\udfff]",cV="(?:"+lV+"|"+uV+")",dV="[^"+vL+"]",OL="(?:\\ud83c[\\udde6-\\uddff]){2}",SL="[\\ud800-\\udbff][\\udc00-\\udfff]",fg="["+yL+"]",fV="\\u200d",rk="(?:"+EL+"|"+xL+")",pV="(?:"+fg+"|"+xL+")",ok="(?:"+bL+"(?:d|ll|m|re|s|t|ve))?",ik="(?:"+bL+"(?:D|LL|M|RE|S|T|VE))?",AL=cV+"?",ML="["+aV+"]?",hV="(?:"+fV+"(?:"+[dV,OL,SL].join("|")+")"+ML+AL+")*",vV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gV=ML+AL+hV,yV="(?:"+[sV,OL,SL].join("|")+")"+gV,_V=RegExp([fg+"?"+EL+"+"+ok+"(?="+[nk,fg,"$"].join("|")+")",pV+"+"+ik+"(?="+[nk,fg+rk,"$"].join("|")+")",fg+"?"+rk+"+"+ok,fg+"+"+ik,mV,vV,wL,yV].join("|"),"g");function bV(t){return t.match(_V)||[]}function TL(t,e,n){return t=Ri(t),e=n?void 0:e,e===void 0?ZU(t)?bV(t):qU(t):t.match(e)||[]}var wV="['’]",EV=RegExp(wV,"g");function ty(t){return function(e){return $j(TL(hL(e).replace(EV,"")),t,"")}}var xV=ty(function(t,e,n){return e=e.toLowerCase(),t+(n?pL(e):e)}),OV=nm.isFinite,SV=Math.min;function J2(t){var e=Math[t];return function(n,o){if(n=Pg(n),o=o==null?0:SV(zo(o),292),o&&OV(n)){var r=(Ri(n)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+o));return r=(Ri(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-o))}return e(n)}}var AV=J2("ceil");function CL(t){var e=ge(t);return e.__chain__=!0,e}var MV=Math.ceil,TV=Math.max;function CV(t,e,n){(n?Nh(t,e,n):e===void 0)?e=1:e=TV(zo(e),0);var o=t==null?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(MV(o/e));r<o;)a[i++]=sp(t,r,r+=e);return a}var NV=1,kV=4;function PV(t,e){return e=typeof e=="function"?e:void 0,Zg(t,NV|kV,e)}var RV=4;function DV(t,e){return e=typeof e=="function"?e:void 0,Zg(t,RV,e)}function jV(){return new rc(this.value(),this.__chain__)}function LV(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return X_(qa(n)?Ku(n):[n],Jd(e,1))}var IV="Expected a function";function FV(t){var e=t==null?0:t.length,n=_i;return t=e?Es(t,function(o){if(typeof o[1]!="function")throw new TypeError(IV);return[n(o[0]),o[1]]}):[],Yo(function(o){for(var r=-1;++r<e;){var i=t[r];if(Qu(i[0],this,o))return Qu(i[1],this,o)}})}function NL(t,e,n){var o=n.length;if(t==null)return!o;for(t=Object(t);o--;){var r=n[o],i=e[r],a=t[r];if(a===void 0&&!(r in t)||!i(a))return!1}return!0}function BV(t){var e=Zd(t);return function(n){return NL(n,t,e)}}var $V=1;function UV(t){return BV(Zg(t,$V))}function VV(t,e){return e==null||NL(t,e,Zd(e))}var WV=Object.prototype,GV=WV.hasOwnProperty,zV=V2(function(t,e,n){GV.call(t,n)?++t[n]:M1(t,n,1)});function HV(t,e){var n=z_(t);return e==null?n:g$(n,e)}var XV=8;function Q2(t,e,n){e=n?void 0:e;var o=fp(t,XV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=Q2.placeholder,o}Q2.placeholder={};var YV=16;function eM(t,e,n){e=n?void 0:e;var o=fp(t,YV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=eM.placeholder,o}eM.placeholder={};function qV(t,e){return t==null||t!==t?e:t}function kL(t,e,n,o,r,i){return lp(t)&&lp(e)&&(i.set(e,t),vj(t,e,void 0,kL,i),i.delete(e)),t}var PL=S1(function(t,e,n,o){vj(t,e,n,o)}),KV=Yo(function(t){return t.push(void 0,kL),Qu(PL,void 0,t)}),ZV="Expected a function";function RL(t,e,n){if(typeof t!="function")throw new TypeError(ZV);return setTimeout(function(){t.apply(void 0,n)},e)}var JV=Yo(function(t,e){return RL(t,1,e)}),QV=Yo(function(t,e,n){return RL(t,Pg(e)||0,n)}),eW=Yo(function(t,e){var n=ec(e);return Ll(n)&&(n=void 0),Ll(t)?N1(t,Jd(e,1,Ll,!0),_i(n)):[]}),tW=Yo(function(t,e){var n=ec(e);return Ll(n)&&(n=void 0),Ll(t)?N1(t,Jd(e,1,Ll,!0),void 0,n):[]}),nW=k1(function(t,e){return t/e},1);function j1(t,e,n,o){for(var r=t.length,i=o?r:-1;(o?i--:++i<r)&&e(t[i],i,t););return n?sp(t,o?0:i,o?i+1:r):sp(t,o?i+1:0,o?r:i)}function rW(t,e){return t&&t.length?j1(t,_i(e),!0,!0):[]}function oW(t,e){return t&&t.length?j1(t,_i(e),!0):[]}function iW(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var DL=y$(!0);function tM(t,e){return t&&DL(t,e,Zd)}var jL=_$(tM,!0);function aW(t,e){var n=qa(t)?iW:jL;return n(t,lm(e))}function lW(t,e,n){t=Ri(t),e=ed(e);var o=t.length;n=n===void 0?o:Jg(zo(n),0,o);var r=n;return n-=e.length,n>=0&&t.slice(n,r)==e}function sW(t,e){return Es(e,function(n){return[n,t[n]]})}function uW(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=[o,o]}),n}var cW="[object Map]",dW="[object Set]";function LL(t){return function(e){var n=T1(e);return n==cW?mj(e):n==dW?uW(e):sW(e,t(e))}}var pp=LL(Zd),fW=LL(rm),pW={"&":"&","<":"<",">":">",'"':""","'":"'"},hW=Z2(pW),IL=/[&<>"']/g,vW=RegExp(IL.source);function FL(t){return t=Ri(t),t&&vW.test(t)?t.replace(IL,hW):t}var BL=/[\\^$.*+?()[\]{}|]/g,mW=RegExp(BL.source);function gW(t){return t=Ri(t),t&&mW.test(t)?t.replace(BL,"\\$&"):t}var yW=4294967295;function $L(t){return t?Jg(zo(t),0,yW):0}function _W(t,e,n,o){var r=t.length;for(n=zo(n),n<0&&(n=-n>r?0:r+n),o=o===void 0||o>r?r:zo(o),o<0&&(o+=r),o=n>o?0:$L(o);n<o;)t[n++]=e;return t}function bW(t,e,n,o){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&Nh(t,e,n)&&(n=0,o=r),_W(t,e,n,o)):[]}function UL(t,e,n){var o;return n(t,function(r,i,a){if(e(r,i,a))return o=i,!1}),o}function wW(t,e){return UL(t,_i(e),am)}var EW=N9(gj);function xW(t,e){return UL(t,_i(e),tM)}var OW=1/0;function SW(t,e){return Jd(tc(t,e),OW)}function AW(t,e,n){return n=n===void 0?1:zo(n),Jd(tc(t,e),n)}function MW(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:zo(e),Jd(t,e)):[]}var TW=512;function CW(t){return fp(t,TW)}var NW=J2("floor"),kW="Expected a function",PW=8,RW=32,DW=128,jW=256;function VL(t){return im(function(e){var n=e.length,o=n,r=rc.prototype.thru;for(t&&e.reverse();o--;){var i=e[o];if(typeof i!="function")throw new TypeError(kW);if(r&&!a&&H0(i)=="wrapper")var a=new rc([],!0)}for(o=a?o:n;++o<n;){i=e[o];var s=H0(i),l=s=="wrapper"?H2(i):void 0;l&&fA(l[0])&&l[1]==(DW|PW|RW|jW)&&!l[4].length&&l[9]==1?a=a[H0(l[0])].apply(a,l[3]):a=i.length==1&&fA(i)?a[s]():a.thru(i)}return function(){var f=arguments,h=f[0];if(a&&f.length==1&&qa(h))return a.plant(h).value();for(var v=0,b=n?e[v].apply(this,f):h;++v<n;)b=e[v].call(this,b);return b}})}var LW=VL(),IW=VL(!0);function FW(t,e){return t==null?t:DL(t,lm(e),rm)}function BW(t,e){return t&&tM(t,lm(e))}function L1(t,e){return Y_(e,function(n){return kh(t[n])})}function $W(t){return t==null?[]:L1(t,Zd(t))}function UW(t){return t==null?[]:L1(t,rm(t))}function I1(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Pg(e),n=Pg(n)),t(e,n)}}var VW=I1(Hj),WW=I1(function(t,e){return t>=e}),GW=Math.max,zW=Math.min;function HW(t,e,n){return t>=zW(e,n)&&t<GW(e,n)}function XW(t,e,n){return e=w_(e),n===void 0?(n=e,e=0):n=w_(n),t=Pg(t),HW(t,e,n)}function YW(t){var e=t==null?0:t.length;return e?sp(t,0,-1):[]}var qW=Math.min;function nM(t,e,n){for(var o=n?w$:hj,r=t[0].length,i=t.length,a=i,s=Array(i),l=1/0,f=[];a--;){var h=t[a];a&&e&&(h=Es(h,Hv(e))),l=qW(h.length,l),s[a]=!n&&(e||r>=120&&h.length>=120)?new b$(a&&h):void 0}h=t[0];var v=-1,b=s[0];e:for(;++v<r&&f.length<l;){var E=h[v],O=e?e(E):E;if(E=n||E!==0?E:0,!(b?FN(b,O):o(f,O,n))){for(a=i;--a;){var w=s[a];if(!(w?FN(w,O):o(t[a],O,n)))continue e}b&&b.push(O),f.push(E)}}return f}function rM(t){return Ll(t)?t:[]}var KW=Yo(function(t){var e=Es(t,rM);return e.length&&e[0]===t[0]?nM(e):[]}),ZW=Yo(function(t){var e=ec(t),n=Es(t,rM);return e===ec(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?nM(n,_i(e)):[]}),JW=Yo(function(t){var e=ec(t),n=Es(t,rM);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?nM(n,void 0,e):[]});function QW(t,e,n,o){return am(t,function(r,i,a){e(o,n(r),i,a)}),o}function WL(t,e){return function(n,o){return QW(n,t,e(o),{})}}var eG=Object.prototype,tG=eG.toString,nG=WL(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=tG.call(e)),t[e]=n},yj(tm)),GL=Object.prototype,rG=GL.hasOwnProperty,oG=GL.toString,iG=WL(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=oG.call(e)),rG.call(t,e)?t[e].push(n):t[e]=[n]},_i);function Q_(t,e,n){e=_j(e,t),t=E$(t,e);var o=t==null?t:t[A1(ec(e))];return o==null?void 0:Qu(o,t,n)}var aG=Yo(Q_),lG=Yo(function(t,e,n){var o=-1,r=typeof e=="function",i=C1(t)?Array(t.length):[];return x$(t,function(a){i[++o]=r?Qu(e,a,n):Q_(a,e,n)}),i}),sG="[object ArrayBuffer]";function uG(t){return qd(t)&&Kg(t)==sG}var ak=uw&&uw.isArrayBuffer,cG=ak?Hv(ak):uG,dG="[object Boolean]";function mw(t){return t===!0||t===!1||qd(t)&&Kg(t)==dG}var fG="[object Date]";function pG(t){return qd(t)&&Kg(t)==fG}var lk=uw&&uw.isDate,hG=lk?Hv(lk):pG;function vG(t){return qd(t)&&t.nodeType===1&&!k2(t)}function mG(t,e,n){n=typeof n=="function"?n:void 0;var o=n?n(t,e):void 0;return o===void 0?O$(t,e,void 0,n):!!o}var gG=nm.isFinite;function yG(t){return typeof t=="number"&&gG(t)}function zL(t){return typeof t=="number"&&t==zo(t)}function _G(t,e){return t===e||bj(t,e,wj(e))}function bG(t,e,n){return n=typeof n=="function"?n:void 0,bj(t,e,wj(e),n)}var wG="[object Number]";function HL(t){return typeof t=="number"||qd(t)&&Kg(t)==wG}function EG(t){return HL(t)&&t!=+t}var xG=S$?kh:Ej,OG="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function SG(t){if(xG(t))throw new Error(OG);return A$(t)}var sk=9007199254740991;function AG(t){return zL(t)&&t>=-sk&&t<=sk}var MG="[object WeakMap]";function TG(t){return qd(t)&&T1(t)==MG}var CG="[object WeakSet]";function NG(t){return qd(t)&&Kg(t)==CG}var kG=1;function PG(t){return _i(typeof t=="function"?t:Zg(t,kG))}var RG=Array.prototype,DG=RG.join;function jG(t,e){return t==null?"":DG.call(t,e)}var LG=ty(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),IG=V2(function(t,e,n){M1(t,n,e)});function FG(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}var BG=Math.max,$G=Math.min;function UG(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=o;return n!==void 0&&(r=zo(n),r=r<0?BG(o+r,0):$G(r,o-1)),e===e?FG(t,e,r):M$(t,T$,r,!0)}var VG=ty(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),WG=fL("toLowerCase"),GG=I1(k9),zG=I1(function(t,e){return t<=e});function XL(t,e){var n={};return e=_i(e),am(t,function(o,r,i){M1(n,e(o,r,i),o)}),n}var HG=1;function XG(t){return C$(Zg(t,HG))}var YG=1;function qG(t,e){return N$(t,Zg(e,YG))}function KG(t,e){return t&&t.length?P9(t,_i(e),Hj):void 0}function oM(t,e){for(var n,o=-1,r=t.length;++o<r;){var i=e(t[o]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var ZG=NaN;function YL(t,e){var n=t==null?0:t.length;return n?oM(t,e)/n:ZG}function JG(t){return YL(t,tm)}function QG(t,e){return YL(t,_i(e))}var ez=Yo(function(t,e){return function(n){return Q_(n,t,e)}}),tz=Yo(function(t,e){return function(n){return Q_(t,n,e)}});function nz(t,e,n){var o=Zd(e),r=L1(e,o),i=!(lp(n)&&"chain"in n)||!!n.chain,a=kh(t);return Kd(r,function(s){var l=e[s];t[s]=l,a&&(t.prototype[s]=function(){var f=this.__chain__;if(i||f){var h=t(this.__wrapped__),v=h.__actions__=Ku(this.__actions__);return v.push({func:l,args:arguments,thisArg:t}),h.__chain__=f,h}return l.apply(t,X_([this.value()],arguments))})}),t}var rz=k1(function(t,e){return t*e},1);function oz(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var iz="[object Map]",az="[object Set]",qO=cw?cw.iterator:void 0;function qL(t){if(!t)return[];if(C1(t))return W2(t)?td(t):Ku(t);if(qO&&t[qO])return oz(t[qO]());var e=T1(t),n=e==iz?mj:e==az?k$:J_;return n(t)}function lz(){this.__values__===void 0&&(this.__values__=qL(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function KL(t,e){var n=t.length;if(n)return e+=e<0?n:0,H_(e,n)?t[e]:void 0}function sz(t,e){return t&&t.length?KL(t,zo(e)):void 0}function uz(t){return t=zo(t),Yo(function(e){return KL(e,t)})}function cz(t,e){return Gj(t,G2(_i(e)))}function dz(t){return iL(2,t)}function fz(t,e,n,o){return t==null?[]:(qa(e)||(e=e==null?[]:[e]),n=o?void 0:n,qa(n)||(n=n==null?[]:[n]),Y9(t,e,n))}function iM(t){return im(function(e){return e=Es(e,Hv(_i)),Yo(function(n){var o=this;return t(e,function(r){return Qu(r,o,n)})})})}var pz=iM(Es),hz=Yo,vz=Math.min,mz=hz(function(t,e){e=e.length==1&&qa(e[0])?Es(e[0],Hv(_i)):Es(Jd(e,1),Hv(_i));var n=e.length;return Yo(function(o){for(var r=-1,i=vz(o.length,n);++r<i;)o[r]=e[r].call(this,o[r]);return Qu(t,this,o)})}),gz=iM(j9),yz=iM(P$),_z=9007199254740991,bz=Math.floor;function mA(t,e){var n="";if(!t||e<1||e>_z)return n;do e%2&&(n+=t),e=bz(e/2),e&&(t+=t);while(e);return n}var wz=xj("length"),ZL="\\ud800-\\udfff",Ez="\\u0300-\\u036f",xz="\\ufe20-\\ufe2f",Oz="\\u20d0-\\u20ff",Sz=Ez+xz+Oz,Az="\\ufe0e\\ufe0f",Mz="["+ZL+"]",gA="["+Sz+"]",yA="\\ud83c[\\udffb-\\udfff]",Tz="(?:"+gA+"|"+yA+")",JL="[^"+ZL+"]",QL="(?:\\ud83c[\\udde6-\\uddff]){2}",e3="[\\ud800-\\udbff][\\udc00-\\udfff]",Cz="\\u200d",t3=Tz+"?",n3="["+Az+"]?",Nz="(?:"+Cz+"(?:"+[JL,QL,e3].join("|")+")"+n3+t3+")*",kz=n3+t3+Nz,Pz="(?:"+[JL+gA+"?",gA,QL,e3,Mz].join("|")+")",uk=RegExp(yA+"(?="+yA+")|"+Pz+kz,"g");function Rz(t){for(var e=uk.lastIndex=0;uk.test(t);)++e;return e}function ny(t){return ey(t)?Rz(t):wz(t)}var Dz=Math.ceil;function gw(t,e){e=e===void 0?" ":ed(e);var n=e.length;if(n<2)return n?mA(e,t):e;var o=mA(e,Dz(t/ny(e)));return ey(e)?Dh(td(o),0,t).join(""):o.slice(0,t)}var jz=Math.ceil,Lz=Math.floor;function Iz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return gw(Lz(r),n)+t+gw(jz(r),n)}function Fz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o<e?t+gw(e-o,n):t}function Bz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o<e?gw(e-o,n)+t:t}var $z=/^\s+/,Uz=nm.parseInt;function Vz(t,e,n){return n||e==null?e=0:e&&(e=+e),Uz(Ri(t).replace($z,""),e||0)}var Wz=32,F1=Yo(function(t,e){var n=Ah(e,Qg(F1));return fp(t,Wz,void 0,e,n)});F1.placeholder={};var Gz=64,aM=Yo(function(t,e){var n=Ah(e,Qg(aM));return fp(t,Gz,void 0,e,n)});aM.placeholder={};var zz=V2(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function Hz(t){for(var e,n=this;n instanceof P1;){var o=Qj(n);o.__index__=0,o.__values__=void 0,e?r.__wrapped__=o:e=o;var r=o;n=n.__wrapped__}return r.__wrapped__=t,e}function Xz(t){return function(e){return t==null?void 0:Oj(t,e)}}function Yz(t,e,n,o){for(var r=n-1,i=t.length;++r<i;)if(o(t[r],e))return r;return-1}var qz=Array.prototype,ck=qz.splice;function lM(t,e,n,o){var r=o?Yz:P2,i=-1,a=e.length,s=t;for(t===e&&(e=Ku(e)),n&&(s=Es(t,Hv(n)));++i<a;)for(var l=0,f=e[i],h=n?n(f):f;(l=r(s,h,l,o))>-1;)s!==t&&ck.call(s,l,1),ck.call(t,l,1);return t}function r3(t,e){return t&&t.length&&e&&e.length?lM(t,e):t}var Kz=Yo(r3);function Zz(t,e,n){return t&&t.length&&e&&e.length?lM(t,e,_i(n)):t}function Jz(t,e,n){return t&&t.length&&e&&e.length?lM(t,e,void 0,n):t}var Qz=Array.prototype,eH=Qz.splice;function o3(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;H_(r)?eH.call(t,r,1):Sj(t,r)}}return t}var tH=im(function(t,e){var n=t==null?0:t.length,o=X2(t,e);return o3(t,Es(e,function(r){return H_(r,n)?+r:r}).sort(q9)),o}),nH=Math.floor,rH=Math.random;function sM(t,e){return t+nH(rH()*(e-t+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function lH(t,e,n){if(n&&typeof n!="boolean"&&Nh(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=w_(t),e===void 0?(e=t,t=0):e=w_(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=aH();return iH(t+r*(e-t+oH("1e-"+((r+"").length-1))),e)}return sM(t,e)}var sH=K9(!0),uH=256,cH=im(function(t,e){return fp(t,uH,void 0,void 0,void 0,e)});function dH(t,e,n,o){var r=t==null?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function fH(t,e,n){var o=qa(t)?dH:T9,r=arguments.length<3;return o(t,_i(e),n,r,jL)}function pH(t,e){var n=[];if(!(t&&t.length))return n;var o=-1,r=[],i=t.length;for(e=_i(e);++o<i;){var a=t[o];e(a,o,t)&&(n.push(a),r.push(o))}return o3(t,r),n}function hH(t,e,n){return(n?Nh(t,e,n):e===void 0)?e=1:e=zo(e),mA(Ri(t),e)}function vH(){var t=arguments,e=Ri(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var mH="Expected a function";function gH(t,e){if(typeof t!="function")throw new TypeError(mH);return e=e===void 0?e:zo(e),Yo(t,e)}function yH(t,e,n){e=_j(e,t);var o=-1,r=e.length;for(r||(r=1,t=void 0);++o<r;){var i=t==null?void 0:t[A1(e[o])];i===void 0&&(o=r,i=n),t=kh(i)?i.call(t):i}return t}var _H=Array.prototype,bH=_H.reverse;function _A(t){return t==null?t:bH.call(t)}var wH=J2("round");function i3(t){var e=t.length;return e?t[sM(0,e-1)]:void 0}function EH(t){return i3(J_(t))}function xH(t){var e=qa(t)?i3:EH;return e(t)}function B1(t,e){var n=-1,o=t.length,r=o-1;for(e=e===void 0?o:e;++n<e;){var i=sM(n,r),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function OH(t,e){return B1(Ku(t),Jg(e,0,t.length))}function SH(t,e){var n=J_(t);return B1(n,Jg(e,0,n.length))}function AH(t,e,n){(n?Nh(t,e,n):e===void 0)?e=1:e=zo(e);var o=qa(t)?OH:SH;return o(t,e)}function MH(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:R2(t,e,n,o)}function TH(t){return B1(Ku(t))}function CH(t){return B1(J_(t))}function NH(t){var e=qa(t)?TH:CH;return e(t)}var kH="[object Map]",PH="[object Set]";function RH(t){if(t==null)return 0;if(C1(t))return W2(t)?ny(t):t.length;var e=T1(t);return e==kH||e==PH?t.size:R$(t).length}function DH(t,e,n){var o=t==null?0:t.length;return o?(n&&typeof n!="number"&&Nh(t,e,n)?(e=0,n=o):(e=e==null?0:zo(e),n=n===void 0?o:zo(n)),sp(t,e,n)):[]}var jH=ty(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),LH=4294967295,IH=LH-1,FH=Math.floor,BH=Math.min;function uM(t,e,n,o){var r=0,i=t==null?0:t.length;if(i===0)return 0;e=n(e);for(var a=e!==e,s=e===null,l=kg(e),f=e===void 0;r<i;){var h=FH((r+i)/2),v=n(t[h]),b=v!==void 0,E=v===null,O=v===v,w=kg(v);if(a)var S=o||O;else f?S=O&&(o||b):s?S=O&&b&&(o||!E):l?S=O&&b&&!E&&(o||!w):E||w?S=!1:S=o?v<=e:v<e;S?r=h+1:i=h}return BH(i,IH)}var $H=4294967295,UH=$H>>>1;function $1(t,e,n){var o=0,r=t==null?o:t.length;if(typeof e=="number"&&e===e&&r<=UH){for(;o<r;){var i=o+r>>>1,a=t[i];a!==null&&!kg(a)&&(n?a<=e:a<e)?o=i+1:r=i}return r}return uM(t,e,tm,n)}function VH(t,e){return $1(t,e)}function WH(t,e,n){return uM(t,e,_i(n))}function GH(t,e){var n=t==null?0:t.length;if(n){var o=$1(t,e);if(o<n&&q_(t[o],e))return o}return-1}function zH(t,e){return $1(t,e,!0)}function HH(t,e,n){return uM(t,e,_i(n),!0)}function XH(t,e){var n=t==null?0:t.length;if(n){var o=$1(t,e,!0)-1;if(q_(t[o],e))return o}return-1}function a3(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!q_(s,l)){var l=s;i[r++]=a===0?0:a}}return i}function YH(t){return t&&t.length?a3(t):[]}function qH(t,e){return t&&t.length?a3(t,_i(e)):[]}var KH=4294967295;function ZH(t,e,n){return n&&typeof n!="number"&&Nh(t,e,n)&&(e=n=void 0),n=n===void 0?KH:n>>>0,n?(t=Ri(t),t&&(typeof e=="string"||e!=null&&!z2(e))&&(e=ed(e),!e&&ey(t))?Dh(td(t),0,n):t.split(e,n)):[]}var JH="Expected a function",QH=Math.max;function eX(t,e){if(typeof t!="function")throw new TypeError(JH);return e=e==null?0:QH(zo(e),0),Yo(function(n){var o=n[e],r=Dh(n,0,e);return o&&X_(r,o),Qu(t,this,r)})}var tX=ty(function(t,e,n){return t+(n?" ":"")+K2(e)});function nX(t,e,n){return t=Ri(t),n=n==null?0:Jg(zo(n),0,t.length),e=ed(e),t.slice(n,n+e.length)==e}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=k1(function(t,e){return t-e},0);function lX(t){return t&&t.length?oM(t,tm):0}function sX(t,e){return t&&t.length?oM(t,_i(e)):0}function uX(t){var e=t==null?0:t.length;return e?sp(t,1,e):[]}function cX(t,e,n){return t&&t.length?(e=n||e===void 0?1:zo(e),sp(t,0,e<0?0:e)):[]}function dX(t,e,n){var o=t==null?0:t.length;return o?(e=n||e===void 0?1:zo(e),e=o-e,sp(t,e<0?0:e,o)):[]}function fX(t,e){return t&&t.length?j1(t,_i(e),!1,!0):[]}function pX(t,e){return t&&t.length?j1(t,_i(e)):[]}function hX(t,e){return e(t),t}var l3=Object.prototype,vX=l3.hasOwnProperty;function dk(t,e,n,o){return t===void 0||q_(t,l3[n])&&!vX.call(o,n)?e:t}var mX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gX(t){return"\\"+mX[t]}var s3=/<%=([\s\S]+?)%>/g,yX=/<%-([\s\S]+?)%>/g,_X=/<%([\s\S]+?)%>/g,bA={escape:yX,evaluate:_X,interpolate:s3,variable:"",imports:{_:{escape:FL}}},bX="Invalid `variable` option passed into `_.template`",wX=/\b__p \+= '';/g,EX=/\b(__p \+=) '' \+/g,xX=/(__e\(.*?\)|\b__t\)) \+\n'';/g,OX=/[()=,{}\[\]\/\s]/,SX=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,d0=/($^)/,AX=/['\n\r\u2028\u2029\\]/g,MX=Object.prototype,fk=MX.hasOwnProperty;function TX(t,e,n){var o=bA.imports._.templateSettings||bA;n&&Nh(t,e,n)&&(e=void 0),t=Ri(t),e=pA({},e,o,dk);var r=pA({},e.imports,o.imports,dk),i=Zd(r),a=Uj(r,i),s,l,f=0,h=e.interpolate||d0,v="__p += '",b=RegExp((e.escape||d0).source+"|"+h.source+"|"+(h===s3?SX:d0).source+"|"+(e.evaluate||d0).source+"|$","g"),E=fk.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
|
||
`:"";t.replace(b,function(S,M,T,$,D,P){return T||(T=$),v+=t.slice(f,P).replace(AX,gX),M&&(s=!0,v+=`' +
|
||
__e(`+M+`) +
|
||
'`),D&&(l=!0,v+=`';
|
||
`+D+`;
|
||
__p += '`),T&&(v+=`' +
|
||
((__t = (`+T+`)) == null ? '' : __t) +
|
||
'`),f=P+S.length,S}),v+=`';
|
||
`;var O=fk.call(e,"variable")&&e.variable;if(!O)v=`with (obj) {
|
||
`+v+`
|
||
}
|
||
`;else if(OX.test(O))throw new Error(bX);v=(l?v.replace(wX,""):v).replace(EX,"$1").replace(xX,"$1;"),v="function("+(O||"obj")+`) {
|
||
`+(O?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+v+`return __p
|
||
}`;var w=oL(function(){return Function(i,E+"return "+v).apply(void 0,a)});if(w.source=v,Y2(w))throw w;return w}function U1(t,e){return e(t)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function kX(t,e){if(t=zo(t),t<1||t>CX)return[];var n=KO,o=NX(t,KO);e=lm(e),t-=KO;for(var r=Aj(o,e);++n<t;)e(n);return r}function PX(){return this}function u3(t,e){var n=t;return n instanceof $o&&(n=n.value()),$j(e,function(o,r){return r.func.apply(r.thisArg,X_([o],r.args))},n)}function RX(){return u3(this.__wrapped__,this.__actions__)}function DX(t){return Ri(t).toLowerCase()}function jX(t){return qa(t)?Es(t,A1):kg(t)?[t]:Ku(D$(Ri(t)))}var pk=9007199254740991;function LX(t){return t?Jg(zo(t),-pk,pk):t===0?t:0}function IX(t){return Ri(t).toUpperCase()}function FX(t,e,n){var o=qa(t),r=o||Mj(t)||Tj(t);if(e=_i(e),n==null){var i=t&&t.constructor;r?n=o?new i:[]:lp(t)?n=kh(i)?z_(j$(t)):{}:n={}}return(r?Kd:am)(t,function(a,s,l){return e(n,a,s,l)}),n}function c3(t,e){for(var n=t.length;n--&&P2(e,t[n],0)>-1;);return n}function d3(t,e){for(var n=-1,o=t.length;++n<o&&P2(e,t[n],0)>-1;);return n}function BX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return L$(t);if(!t||!(e=ed(e)))return t;var o=td(t),r=td(e),i=d3(o,r),a=c3(o,r)+1;return Dh(o,i,a).join("")}function $X(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.slice(0,I$(t)+1);if(!t||!(e=ed(e)))return t;var o=td(t),r=c3(o,td(e))+1;return Dh(o,0,r).join("")}var UX=/^\s+/;function VX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.replace(UX,"");if(!t||!(e=ed(e)))return t;var o=td(t),r=d3(o,td(e));return Dh(o,r).join("")}var WX=30,GX="...",zX=/\w*$/;function HX(t,e){var n=WX,o=GX;if(lp(e)){var r="separator"in e?e.separator:r;n="length"in e?zo(e.length):n,o="omission"in e?ed(e.omission):o}t=Ri(t);var i=t.length;if(ey(t)){var a=td(t);i=a.length}if(n>=i)return t;var s=n-ny(o);if(s<1)return o;var l=a?Dh(a,0,s).join(""):t.slice(0,s);if(r===void 0)return l+o;if(a&&(s+=l.length-s),z2(r)){if(t.slice(s).search(r)){var f,h=l;for(r.global||(r=RegExp(r.source,Ri(zX.exec(r))+"g")),r.lastIndex=0;f=r.exec(h);)var v=f.index;l=l.slice(0,v===void 0?s:v)}}else if(t.indexOf(ed(r),s)!=s){var b=l.lastIndexOf(r);b>-1&&(l=l.slice(0,b))}return l+o}function XX(t){return rL(t,1)}var YX={"&":"&","<":"<",">":">",""":'"',"'":"'"},qX=Z2(YX),f3=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(f3.source);function ZX(t){return t=Ri(t),t&&KX.test(t)?t.replace(f3,qX):t}var JX=Yo(function(t){var e=ec(t);return Ll(e)&&(e=void 0),E_(Jd(t,1,Ll,!0),_i(e))}),QX=Yo(function(t){var e=ec(t);return e=typeof e=="function"?e:void 0,E_(Jd(t,1,Ll,!0),void 0,e)});function eY(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?E_(t,void 0,e):[]}function tY(t,e){return t==null?!0:Sj(t,e)}var nY=Math.max;function cM(t){if(!(t&&t.length))return[];var e=0;return t=Y_(t,function(n){if(Ll(n))return e=nY(n.length,e),!0}),Aj(e,function(n){return Es(t,xj(n))})}function p3(t,e){if(!(t&&t.length))return[];var n=cM(t);return e==null?n:Es(n,function(o){return Qu(e,void 0,o)})}function h3(t,e,n,o){return R2(t,e,n(Oj(t,e)),o)}function rY(t,e,n){return t==null?t:h3(t,e,lm(n))}function oY(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:h3(t,e,lm(n),o)}var iY=ty(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function aY(t){return t==null?[]:Uj(t,rm(t))}var lY=Yo(function(t,e){return Ll(t)?N1(t,e):[]});function sY(t,e){return F1(lm(e),t)}var uY=im(function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(i){return X2(i,t)};return e>1||this.__actions__.length||!(o instanceof $o)||!H_(n)?this.thru(r):(o=o.slice(n,+n+(e?1:0)),o.__actions__.push({func:U1,args:[r],thisArg:void 0}),new rc(o,this.__chain__).thru(function(i){return e&&!i.length&&i.push(void 0),i}))});function cY(){return CL(this)}function dY(){var t=this.__wrapped__;if(t instanceof $o){var e=t;return this.__actions__.length&&(e=new $o(this)),e=e.reverse(),e.__actions__.push({func:U1,args:[_A],thisArg:void 0}),new rc(e,this.__chain__)}return this.thru(_A)}function dM(t,e,n){var o=t.length;if(o<2)return o?E_(t[0]):[];for(var r=-1,i=Array(o);++r<o;)for(var a=t[r],s=-1;++s<o;)s!=r&&(i[r]=N1(i[r]||a,t[s],e,n));return E_(Jd(i,1),e,n)}var fY=Yo(function(t){return dM(Y_(t,Ll))}),pY=Yo(function(t){var e=ec(t);return Ll(e)&&(e=void 0),dM(Y_(t,Ll),_i(e))}),hY=Yo(function(t){var e=ec(t);return e=typeof e=="function"?e:void 0,dM(Y_(t,Ll),void 0,e)}),vY=Yo(cM);function mY(t,e){return Z9(t||[],e||[],R2)}var gY=Yo(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,p3(t,n)});const mr={chunk:CV,compact:L9,concat:LV,difference:I9,differenceBy:eW,differenceWith:tW,drop:F9,dropRight:B9,dropRightWhile:rW,dropWhile:oW,fill:bW,findIndex:Wj,findLastIndex:gj,flatten:F$,flattenDeep:B$,flattenDepth:MW,fromPairs:$$,head:V9,indexOf:zj,initial:YW,intersection:KW,intersectionBy:ZW,intersectionWith:JW,join:jG,lastIndexOf:UG,nth:sz,pull:Kz,pullAll:r3,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:_A,slice:DH,sortedIndex:VH,sortedIndexBy:WH,sortedIndexOf:GH,sortedLastIndex:zH,sortedLastIndexBy:HH,sortedLastIndexOf:XH,sortedUniq:YH,sortedUniqBy:qH,tail:uX,take:cX,takeRight:dX,takeRightWhile:fX,takeWhile:pX,union:U$,unionBy:JX,unionWith:QX,uniq:$9,uniqBy:U9,uniqWith:eY,unzip:cM,unzipWith:p3,without:lY,xor:fY,xorBy:pY,xorWith:hY,zip:vY,zipObject:J9,zipObjectDeep:mY,zipWith:gY},Di={countBy:zV,every:z9,filter:C9,find:Sh,findLast:EW,flatMap:V$,flatMapDeep:SW,flatMapDepth:AW,forEach:ri,forEachRight:aW,groupBy:W9,includes:H9,invokeMap:lG,keyBy:IG,map:tc,orderBy:fz,partition:zz,reduce:Vj,reduceRight:fH,reject:G9,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X9,sortBy:Q9},yY={now:W$},Ta={after:d7,ary:rL,before:iL,bind:D1,bindKey:q2,curry:Q2,curryRight:eM,debounce:D2,defer:JV,delay:QV,flip:CW,memoize:G$,once:dz,overArgs:mz,partial:F1,partialRight:aM,rearg:cH,rest:gH,spread:eX,throttle:Cj,unary:XX,wrap:sY},Vr={castArray:z$,clone:X$,cloneDeep:to,cloneDeepWith:PV,cloneWith:DV,conformsTo:VV,eq:q_,gt:VW,gte:WW,isArguments:Y$,isArrayBuffer:cG,isArrayLike:C1,isArrayLikeObject:Ll,isBoolean:mw,isBuffer:Mj,isDate:hG,isElement:vG,isEmpty:dw,isEqual:uA,isEqualWith:mG,isError:Y2,isFinite:yG,isFunction:kh,isInteger:zL,isLength:q$,isMap:K$,isMatch:_G,isMatchWith:bG,isNaN:EG,isNative:SG,isNil:ws,isNull:Z$,isNumber:HL,isObjectLike:qd,isPlainObject:k2,isRegExp:z2,isSafeInteger:AG,isSet:J$,isString:W2,isSymbol:kg,isTypedArray:Tj,isUndefined:Xv,isWeakMap:TG,isWeakSet:NG,lt:GG,lte:zG,toArray:qL,toFinite:w_,toLength:$L,toNumber:Pg,toPlainObject:H$,toSafeInteger:LX,toString:Ri},Ss={add:u7,ceil:AV,divide:nW,floor:NW,max:e7,maxBy:KG,mean:JG,meanBy:QG,min:R9,minBy:t7,multiply:rz,round:wH,subtract:aX,sum:lX,sumBy:sX},fM={clamp:Q$,inRange:XW,random:lH},io={assign:Xo,assignIn:iU,assignInWith:pA,assignWith:aU,at:lU,create:HV,defaults:D9,defaultsDeep:KV,findKey:wW,findLastKey:xW,forIn:r7,forInRight:FW,forOwn:o7,forOwnRight:BW,functions:$W,functionsIn:UW,get:om,has:hw,hasIn:t9,invert:nG,invertBy:iG,invoke:aG,keysIn:rm,mapKeys:XL,mapValues:n7,merge:Yv,mergeWith:PL,omit:e9,omitBy:cz,pick:Vv,pickBy:Gj,result:yH,set:Nj,setWith:MH,toPairs:pp,toPairsIn:fW,transform:FX,unset:tY,update:rY,updateWith:oY,values:J_,valuesIn:aY},ef={at:uY,chain:CL,commit:jV,next:lz,plant:Hz,reverse:dY,tap:hX,toIterator:PX,value:RX,wrapperChain:cY},pi={camelCase:xV,capitalize:pL,deburr:hL,endsWith:lW,escape:FL,escapeRegExp:gW,kebabCase:LG,lowerCase:VG,lowerFirst:WG,pad:Iz,padEnd:Fz,padStart:Bz,parseInt:Vz,repeat:hH,replace:vH,snakeCase:jH,split:ZH,startCase:tX,startsWith:nX,template:TX,templateSettings:bA,toLower:DX,toUpper:IX,trim:BX,trimEnd:$X,trimStart:VX,truncate:HX,unescape:ZX,upperCase:iY,upperFirst:K2,words:TL},bi={attempt:oL,bindAll:pU,cond:FV,conforms:UV,constant:yj,defaultTo:qV,flow:LW,flowRight:IW,iteratee:PG,matches:XG,matchesProperty:qG,method:ez,methodOf:tz,noop:Qy,nthArg:uz,over:pz,overEvery:gz,overSome:yz,property:n9,propertyOf:Xz,range:i7,rangeRight:sH,stubArray:r9,stubFalse:Ej,stubObject:rX,stubString:oX,stubTrue:iX,times:kX,toPath:jX,uniqueId:a7};function _Y(){var t=new $o(this.__wrapped__);return t.__actions__=Ku(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ku(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ku(this.__views__),t}function bY(){if(this.__filtered__){var t=new $o(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var wY=Math.max,EY=Math.min;function xY(t,e,n){for(var o=-1,r=n.length;++o<r;){var i=n[o],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=EY(e,t+a);break;case"takeRight":t=wY(t,e-a);break}}return{start:t,end:e}}var OY=1,SY=2,AY=Math.min;function MY(){var t=this.__wrapped__.value(),e=this.__dir__,n=qa(t),o=e<0,r=n?t.length:0,i=xY(0,r,this.__views__),a=i.start,s=i.end,l=s-a,f=o?s:a-1,h=this.__iteratees__,v=h.length,b=0,E=AY(l,this.__takeCount__);if(!n||!o&&r==l&&E==l)return u3(t,this.__actions__);var O=[];e:for(;l--&&b<E;){f+=e;for(var w=-1,S=t[f];++w<v;){var M=h[w],T=M.iteratee,$=M.type,D=T(S);if($==SY)S=D;else if(!D){if($==OY)continue e;break e}}O[b++]=S}return O}/**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/var TY="4.17.23",CY=2,NY=1,kY=3,v3=4294967295,PY=Array.prototype,RY=Object.prototype,m3=RY.hasOwnProperty,hk=cw?cw.iterator:void 0,DY=Math.max,vk=Math.min,pM=(function(t){return function(e,n,o){if(o==null){var r=lp(n),i=r&&Zd(n),a=i&&i.length&&L1(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}})(nz);ge.after=Ta.after;ge.ary=Ta.ary;ge.assign=io.assign;ge.assignIn=io.assignIn;ge.assignInWith=io.assignInWith;ge.assignWith=io.assignWith;ge.at=io.at;ge.before=Ta.before;ge.bind=Ta.bind;ge.bindAll=bi.bindAll;ge.bindKey=Ta.bindKey;ge.castArray=Vr.castArray;ge.chain=ef.chain;ge.chunk=mr.chunk;ge.compact=mr.compact;ge.concat=mr.concat;ge.cond=bi.cond;ge.conforms=bi.conforms;ge.constant=bi.constant;ge.countBy=Di.countBy;ge.create=io.create;ge.curry=Ta.curry;ge.curryRight=Ta.curryRight;ge.debounce=Ta.debounce;ge.defaults=io.defaults;ge.defaultsDeep=io.defaultsDeep;ge.defer=Ta.defer;ge.delay=Ta.delay;ge.difference=mr.difference;ge.differenceBy=mr.differenceBy;ge.differenceWith=mr.differenceWith;ge.drop=mr.drop;ge.dropRight=mr.dropRight;ge.dropRightWhile=mr.dropRightWhile;ge.dropWhile=mr.dropWhile;ge.fill=mr.fill;ge.filter=Di.filter;ge.flatMap=Di.flatMap;ge.flatMapDeep=Di.flatMapDeep;ge.flatMapDepth=Di.flatMapDepth;ge.flatten=mr.flatten;ge.flattenDeep=mr.flattenDeep;ge.flattenDepth=mr.flattenDepth;ge.flip=Ta.flip;ge.flow=bi.flow;ge.flowRight=bi.flowRight;ge.fromPairs=mr.fromPairs;ge.functions=io.functions;ge.functionsIn=io.functionsIn;ge.groupBy=Di.groupBy;ge.initial=mr.initial;ge.intersection=mr.intersection;ge.intersectionBy=mr.intersectionBy;ge.intersectionWith=mr.intersectionWith;ge.invert=io.invert;ge.invertBy=io.invertBy;ge.invokeMap=Di.invokeMap;ge.iteratee=bi.iteratee;ge.keyBy=Di.keyBy;ge.keys=Zd;ge.keysIn=io.keysIn;ge.map=Di.map;ge.mapKeys=io.mapKeys;ge.mapValues=io.mapValues;ge.matches=bi.matches;ge.matchesProperty=bi.matchesProperty;ge.memoize=Ta.memoize;ge.merge=io.merge;ge.mergeWith=io.mergeWith;ge.method=bi.method;ge.methodOf=bi.methodOf;ge.mixin=pM;ge.negate=G2;ge.nthArg=bi.nthArg;ge.omit=io.omit;ge.omitBy=io.omitBy;ge.once=Ta.once;ge.orderBy=Di.orderBy;ge.over=bi.over;ge.overArgs=Ta.overArgs;ge.overEvery=bi.overEvery;ge.overSome=bi.overSome;ge.partial=Ta.partial;ge.partialRight=Ta.partialRight;ge.partition=Di.partition;ge.pick=io.pick;ge.pickBy=io.pickBy;ge.property=bi.property;ge.propertyOf=bi.propertyOf;ge.pull=mr.pull;ge.pullAll=mr.pullAll;ge.pullAllBy=mr.pullAllBy;ge.pullAllWith=mr.pullAllWith;ge.pullAt=mr.pullAt;ge.range=bi.range;ge.rangeRight=bi.rangeRight;ge.rearg=Ta.rearg;ge.reject=Di.reject;ge.remove=mr.remove;ge.rest=Ta.rest;ge.reverse=mr.reverse;ge.sampleSize=Di.sampleSize;ge.set=io.set;ge.setWith=io.setWith;ge.shuffle=Di.shuffle;ge.slice=mr.slice;ge.sortBy=Di.sortBy;ge.sortedUniq=mr.sortedUniq;ge.sortedUniqBy=mr.sortedUniqBy;ge.split=pi.split;ge.spread=Ta.spread;ge.tail=mr.tail;ge.take=mr.take;ge.takeRight=mr.takeRight;ge.takeRightWhile=mr.takeRightWhile;ge.takeWhile=mr.takeWhile;ge.tap=ef.tap;ge.throttle=Ta.throttle;ge.thru=U1;ge.toArray=Vr.toArray;ge.toPairs=io.toPairs;ge.toPairsIn=io.toPairsIn;ge.toPath=bi.toPath;ge.toPlainObject=Vr.toPlainObject;ge.transform=io.transform;ge.unary=Ta.unary;ge.union=mr.union;ge.unionBy=mr.unionBy;ge.unionWith=mr.unionWith;ge.uniq=mr.uniq;ge.uniqBy=mr.uniqBy;ge.uniqWith=mr.uniqWith;ge.unset=io.unset;ge.unzip=mr.unzip;ge.unzipWith=mr.unzipWith;ge.update=io.update;ge.updateWith=io.updateWith;ge.values=io.values;ge.valuesIn=io.valuesIn;ge.without=mr.without;ge.words=pi.words;ge.wrap=Ta.wrap;ge.xor=mr.xor;ge.xorBy=mr.xorBy;ge.xorWith=mr.xorWith;ge.zip=mr.zip;ge.zipObject=mr.zipObject;ge.zipObjectDeep=mr.zipObjectDeep;ge.zipWith=mr.zipWith;ge.entries=io.toPairs;ge.entriesIn=io.toPairsIn;ge.extend=io.assignIn;ge.extendWith=io.assignInWith;pM(ge,ge);ge.add=Ss.add;ge.attempt=bi.attempt;ge.camelCase=pi.camelCase;ge.capitalize=pi.capitalize;ge.ceil=Ss.ceil;ge.clamp=fM.clamp;ge.clone=Vr.clone;ge.cloneDeep=Vr.cloneDeep;ge.cloneDeepWith=Vr.cloneDeepWith;ge.cloneWith=Vr.cloneWith;ge.conformsTo=Vr.conformsTo;ge.deburr=pi.deburr;ge.defaultTo=bi.defaultTo;ge.divide=Ss.divide;ge.endsWith=pi.endsWith;ge.eq=Vr.eq;ge.escape=pi.escape;ge.escapeRegExp=pi.escapeRegExp;ge.every=Di.every;ge.find=Di.find;ge.findIndex=mr.findIndex;ge.findKey=io.findKey;ge.findLast=Di.findLast;ge.findLastIndex=mr.findLastIndex;ge.findLastKey=io.findLastKey;ge.floor=Ss.floor;ge.forEach=Di.forEach;ge.forEachRight=Di.forEachRight;ge.forIn=io.forIn;ge.forInRight=io.forInRight;ge.forOwn=io.forOwn;ge.forOwnRight=io.forOwnRight;ge.get=io.get;ge.gt=Vr.gt;ge.gte=Vr.gte;ge.has=io.has;ge.hasIn=io.hasIn;ge.head=mr.head;ge.identity=tm;ge.includes=Di.includes;ge.indexOf=mr.indexOf;ge.inRange=fM.inRange;ge.invoke=io.invoke;ge.isArguments=Vr.isArguments;ge.isArray=qa;ge.isArrayBuffer=Vr.isArrayBuffer;ge.isArrayLike=Vr.isArrayLike;ge.isArrayLikeObject=Vr.isArrayLikeObject;ge.isBoolean=Vr.isBoolean;ge.isBuffer=Vr.isBuffer;ge.isDate=Vr.isDate;ge.isElement=Vr.isElement;ge.isEmpty=Vr.isEmpty;ge.isEqual=Vr.isEqual;ge.isEqualWith=Vr.isEqualWith;ge.isError=Vr.isError;ge.isFinite=Vr.isFinite;ge.isFunction=Vr.isFunction;ge.isInteger=Vr.isInteger;ge.isLength=Vr.isLength;ge.isMap=Vr.isMap;ge.isMatch=Vr.isMatch;ge.isMatchWith=Vr.isMatchWith;ge.isNaN=Vr.isNaN;ge.isNative=Vr.isNative;ge.isNil=Vr.isNil;ge.isNull=Vr.isNull;ge.isNumber=Vr.isNumber;ge.isObject=lp;ge.isObjectLike=Vr.isObjectLike;ge.isPlainObject=Vr.isPlainObject;ge.isRegExp=Vr.isRegExp;ge.isSafeInteger=Vr.isSafeInteger;ge.isSet=Vr.isSet;ge.isString=Vr.isString;ge.isSymbol=Vr.isSymbol;ge.isTypedArray=Vr.isTypedArray;ge.isUndefined=Vr.isUndefined;ge.isWeakMap=Vr.isWeakMap;ge.isWeakSet=Vr.isWeakSet;ge.join=mr.join;ge.kebabCase=pi.kebabCase;ge.last=ec;ge.lastIndexOf=mr.lastIndexOf;ge.lowerCase=pi.lowerCase;ge.lowerFirst=pi.lowerFirst;ge.lt=Vr.lt;ge.lte=Vr.lte;ge.max=Ss.max;ge.maxBy=Ss.maxBy;ge.mean=Ss.mean;ge.meanBy=Ss.meanBy;ge.min=Ss.min;ge.minBy=Ss.minBy;ge.stubArray=bi.stubArray;ge.stubFalse=bi.stubFalse;ge.stubObject=bi.stubObject;ge.stubString=bi.stubString;ge.stubTrue=bi.stubTrue;ge.multiply=Ss.multiply;ge.nth=mr.nth;ge.noop=bi.noop;ge.now=yY.now;ge.pad=pi.pad;ge.padEnd=pi.padEnd;ge.padStart=pi.padStart;ge.parseInt=pi.parseInt;ge.random=fM.random;ge.reduce=Di.reduce;ge.reduceRight=Di.reduceRight;ge.repeat=pi.repeat;ge.replace=pi.replace;ge.result=io.result;ge.round=Ss.round;ge.sample=Di.sample;ge.size=Di.size;ge.snakeCase=pi.snakeCase;ge.some=Di.some;ge.sortedIndex=mr.sortedIndex;ge.sortedIndexBy=mr.sortedIndexBy;ge.sortedIndexOf=mr.sortedIndexOf;ge.sortedLastIndex=mr.sortedLastIndex;ge.sortedLastIndexBy=mr.sortedLastIndexBy;ge.sortedLastIndexOf=mr.sortedLastIndexOf;ge.startCase=pi.startCase;ge.startsWith=pi.startsWith;ge.subtract=Ss.subtract;ge.sum=Ss.sum;ge.sumBy=Ss.sumBy;ge.template=pi.template;ge.times=bi.times;ge.toFinite=Vr.toFinite;ge.toInteger=zo;ge.toLength=Vr.toLength;ge.toLower=pi.toLower;ge.toNumber=Vr.toNumber;ge.toSafeInteger=Vr.toSafeInteger;ge.toString=Vr.toString;ge.toUpper=pi.toUpper;ge.trim=pi.trim;ge.trimEnd=pi.trimEnd;ge.trimStart=pi.trimStart;ge.truncate=pi.truncate;ge.unescape=pi.unescape;ge.uniqueId=bi.uniqueId;ge.upperCase=pi.upperCase;ge.upperFirst=pi.upperFirst;ge.each=Di.forEach;ge.eachRight=Di.forEachRight;ge.first=mr.head;pM(ge,(function(){var t={};return am(ge,function(e,n){m3.call(ge.prototype,n)||(t[n]=e)}),t})(),{chain:!1});ge.VERSION=TY;(ge.templateSettings=pi.templateSettings).imports._=ge;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){ge[t].placeholder=ge});Kd(["drop","take"],function(t,e){$o.prototype[t]=function(n){n=n===void 0?1:DY(zo(n),0);var o=this.__filtered__&&!e?new $o(this):this.clone();return o.__filtered__?o.__takeCount__=vk(n,o.__takeCount__):o.__views__.push({size:vk(n,v3),type:t+(o.__dir__<0?"Right":"")}),o},$o.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});Kd(["filter","map","takeWhile"],function(t,e){var n=e+1,o=n==NY||n==kY;$o.prototype[t]=function(r){var i=this.clone();return i.__iteratees__.push({iteratee:_i(r),type:n}),i.__filtered__=i.__filtered__||o,i}});Kd(["head","last"],function(t,e){var n="take"+(e?"Right":"");$o.prototype[t]=function(){return this[n](1).value()[0]}});Kd(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");$o.prototype[t]=function(){return this.__filtered__?new $o(this):this[n](1)}});$o.prototype.compact=function(){return this.filter(tm)};$o.prototype.find=function(t){return this.filter(t).head()};$o.prototype.findLast=function(t){return this.reverse().find(t)};$o.prototype.invokeMap=Yo(function(t,e){return typeof t=="function"?new $o(this):this.map(function(n){return Q_(n,t,e)})});$o.prototype.reject=function(t){return this.filter(G2(_i(t)))};$o.prototype.slice=function(t,e){t=zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $o(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=zo(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};$o.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};$o.prototype.toArray=function(){return this.take(v3)};am($o.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=ge[o?"take"+(e=="last"?"Right":""):e],i=o||/^find/.test(e);r&&(ge.prototype[e]=function(){var a=this.__wrapped__,s=o?[1]:arguments,l=a instanceof $o,f=s[0],h=l||qa(a),v=function(M){var T=r.apply(ge,X_([M],s));return o&&b?T[0]:T};h&&n&&typeof f=="function"&&f.length!=1&&(l=h=!1);var b=this.__chain__,E=!!this.__actions__.length,O=i&&!b,w=l&&!E;if(!i&&h){a=w?a:new $o(this);var S=t.apply(a,s);return S.__actions__.push({func:U1,args:[v],thisArg:void 0}),new rc(S,b)}return O&&w?t.apply(this,s):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(t){var e=PY[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);ge.prototype[t]=function(){var r=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],r)}return this[n](function(a){return e.apply(qa(a)?a:[],r)})}});am($o.prototype,function(t,e){var n=ge[e];if(n){var o=n.name+"";m3.call(Og,o)||(Og[o]=[]),Og[o].push({name:e,func:n})}});Og[R1(void 0,CY).name]=[{name:"wrapper",func:void 0}];$o.prototype.clone=_Y;$o.prototype.reverse=bY;$o.prototype.value=MY;ge.prototype.at=ef.at;ge.prototype.chain=ef.wrapperChain;ge.prototype.commit=ef.commit;ge.prototype.next=ef.next;ge.prototype.plant=ef.plant;ge.prototype.reverse=ef.reverse;ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=ef.value;ge.prototype.first=ge.prototype.head;hk&&(ge.prototype[hk]=ef.toIterator);const jY="data:image/svg+xml,%3csvg%20width='27'%20height='20'%20viewBox='0%200%2027%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.6667%203.33329H3.66667V16.6666H23.6667V3.33329ZM3.66667%201.66663C2.74619%201.66663%202%202.41282%202%203.33329V16.6666C2%2017.5871%202.74619%2018.3333%203.66667%2018.3333H23.6667C24.5871%2018.3333%2025.3333%2017.5871%2025.3333%2016.6666V3.33329C25.3333%202.41282%2024.5871%201.66663%2023.6667%201.66663H3.66667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2196%206.91331H18.2767L19.4%209.89549L20.4758%206.91331L22.5375%206.83044L19.4%2014.8138L17.3565%2014.8966L18.437%2012.3756L16.2196%206.91331Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1034%207.06327C13.1302%207.04839%2013.1574%207.03404%2013.1848%207.02023C13.5166%206.84295%2013.8759%206.77344%2014.2468%206.77344C14.9611%206.77344%2015.5729%206.97047%2015.9992%207.43635C16.419%207.89521%2016.5934%208.54454%2016.5934%209.3101V12.9168H14.7001V9.4001C14.7001%209.01738%2014.6103%208.80651%2014.5052%208.69229C14.4059%208.58445%2014.2319%208.49677%2013.9067%208.49677C13.7078%208.49677%2013.5468%208.55932%2013.4114%208.69473C13.2534%208.85274%2013.1382%209.08146%2013.1034%209.41091V12.9168H11.2101V6.91344H13.1034V7.06327Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.01665%2012.6833V12.9168H10.83V9.2001C10.83%208.50266%2010.6523%207.90623%2010.247%207.47482L10.2458%207.47354C9.77726%206.97898%209.08554%206.77344%208.26332%206.77344C7.58671%206.77344%206.97894%206.88784%206.50606%207.18452C5.95355%207.51308%205.61381%208.04132%205.48446%208.69979L5.39493%209.15558L6.60828%209.25958C6.45695%209.32645%206.3157%209.40545%206.18578%209.49774C5.6067%209.89006%205.31665%2010.4724%205.31665%2011.1801C5.31665%2011.727%205.52656%2012.1949%205.95194%2012.5464C6.34831%2012.8992%206.87585%2013.0568%207.48332%2013.0568C7.99851%2013.0568%208.45994%2012.9557%208.86073%2012.7671L8.86966%2012.7628C8.91982%2012.7377%208.96882%2012.7112%209.01665%2012.6833ZM7.33362%209.04021C7.60234%208.98907%207.88998%208.96154%208.19236%208.95358L8.93243%208.93444C8.90662%208.77431%208.84911%208.68249%208.7882%208.62627C8.69958%208.54447%208.527%208.46677%208.19332%208.46677C7.90772%208.46677%207.72064%208.51963%207.60769%208.58739L7.60328%208.59004C7.46993%208.66783%207.38847%208.77506%207.35134%208.95452L7.33362%209.04021ZM8.93782%2010.5386L8.28478%2010.5566L8.28191%2010.5567C7.83203%2010.566%207.5658%2010.6502%207.4222%2010.7499C7.3054%2010.831%207.23998%2010.9409%207.23998%2011.1401C7.23998%2011.2037%207.25413%2011.2438%207.32642%2011.2991L7.3313%2011.3029L7.33606%2011.3067C7.40443%2011.3623%207.52395%2011.4134%207.72332%2011.4134C8.07815%2011.4134%208.36218%2011.3062%208.60462%2011.1017C8.80129%2010.9357%208.90794%2010.7499%208.93782%2010.5386Z'%20fill='%23646A73'/%3e%3c/svg%3e",LY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.6667%203.33329H3.33335V16.6666H16.6667V3.33329ZM3.33335%201.66663C2.41288%201.66663%201.66669%202.41282%201.66669%203.33329V16.6666C1.66669%2017.5871%202.41288%2018.3333%203.33335%2018.3333H16.6667C17.5872%2018.3333%2018.3334%2017.5871%2018.3334%2016.6666V3.33329C18.3334%202.41282%2017.5872%201.66663%2016.6667%201.66663H3.33335Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.33%205.83667H15.2233V13.95H13.33V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.83%205.83667H12.7233V13.95H10.83V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.51665%2013.7165V13.95H10.33V10.2333C10.33%209.53587%2010.1523%208.93943%209.747%208.50803L9.7458%208.50675C9.27726%208.01218%208.58554%207.80664%207.76332%207.80664C7.08671%207.80664%206.47894%207.92104%206.00606%208.21772C5.45355%208.54628%205.11381%209.07452%204.98446%209.733L4.89493%2010.1888L6.10828%2010.2928C5.95695%2010.3597%205.8157%2010.4386%205.68578%2010.5309C5.1067%2010.9233%204.81665%2011.5057%204.81665%2012.2133C4.81665%2012.7602%205.02656%2013.2281%205.45194%2013.5796C5.84831%2013.9324%206.37585%2014.09%206.98332%2014.09C7.49851%2014.09%207.95994%2013.9889%208.36073%2013.8003L8.36966%2013.796C8.41982%2013.7709%208.46882%2013.7444%208.51665%2013.7165ZM6.83361%2010.0734C7.10234%2010.0223%207.38998%209.99474%207.69236%209.98678L8.43243%209.96764C8.40662%209.80751%208.3491%209.71569%208.2882%209.65948C8.19958%209.57767%208.027%209.49997%207.69332%209.49997C7.40772%209.49997%207.22064%209.55283%207.10769%209.6206L7.10328%209.62324C6.96993%209.70103%206.88847%209.80826%206.85134%209.98773L6.83361%2010.0734ZM8.43782%2011.5718L7.78478%2011.5898L7.78191%2011.5899C7.33203%2011.5992%207.0658%2011.6834%206.9222%2011.7831C6.8054%2011.8642%206.73998%2011.9741%206.73998%2012.1733C6.73998%2012.2369%206.75413%2012.277%206.82642%2012.3323L6.8313%2012.3361L6.83606%2012.3399C6.90443%2012.3955%207.02395%2012.4466%207.22332%2012.4466C7.57815%2012.4466%207.86218%2012.3394%208.10462%2012.1349C8.30129%2011.9689%208.40794%2011.7831%208.43782%2011.5718Z'%20fill='%23646A73'/%3e%3c/svg%3e",IY={class:"list flex-wrap"},FY=["onClick","onMousedown"],BY=["src"],$Y=["title"],UY={class:"flex-between"},VY={class:"flex align-center"},WY=["src"],GY=["title"],zY={key:0,class:"status-tag",style:{"margin-left":"auto"}},HY=_r({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=t,o=e,r=He(""),i=He([]);function a(s,l){return l.length?s.filter(f=>f.name.toLowerCase().includes(l.toLowerCase())):s}return K_([()=>r.value,()=>n.list],()=>{i.value=a(n.list,r.value)}),(s,l)=>{const f=ne("el-input"),h=ne("el-avatar"),v=ne("el-tag"),b=ne("el-text"),E=ne("el-popover"),O=ne("el-empty");return Ne(),mn(Ir,null,[k(f,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=w=>r.value=w),modelModifiers:{trim:!0},placeholder:s.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),ee("div",IY,[i.value.length?(Ne(!0),mn(Ir,{key:0},No(i.value,w=>(Ne(),bt(E,{key:w.id,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(S=>o("clickNodes",w),["stop"]),onMousedown:gn(S=>o("onmousedown",w),["stop"])},[Wn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(w==null?void 0:w.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,BY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[1]||(l[1]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"ml-8 ellipsis",title:w.name},_e(w.name),9,$Y)],40,FY)]),default:j(()=>[ee("div",UY,[ee("div",VY,[Wn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(w==null?void 0:w.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,WY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[2]||(l[2]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"font-medium ml-8 break-all",title:w.name},_e(w.name),9,GY)]),w.type?(Ne(),mn("div",zY,[Wn(j2)(w.type)?(Ne(),bt(v,{key:0,class:"warning-tag"},{default:j(()=>[ft(_e(s.$t("views.application.workflow")),1)]),_:1})):(Ne(),bt(v,{key:1,class:"blue-tag"},{default:j(()=>[ft(_e(s.$t("views.application.simple")),1)]),_:1}))])):Bn("",!0)]),k(b,{type:"info",size:"small",class:"mt-4"},{default:j(()=>[ft(_e(w.desc),1)]),_:2},1024)]),_:2},1024))),128)):(Ne(),bt(O,{key:1,description:s.$t("common.noData")},null,8,["description"]))])],64)}}}),mk=Ph(HY,[["__scopeId","data-v-deb1c287"]]),XY={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},YY={key:0},qY={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},KY=["onClick","onMousedown"],ZY={class:"lighter"},JY={class:"flex align-center mb-8"},QY={class:"lighter color-text-primary"},eq={key:1,class:"ml-16 mt-8"},tq=_r({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=ml("workflowMode"),o=ja(),{user:r,folder:i}=kj(),a=b9(n||nc.Application),s=He(""),l=t,f=e,h=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),v=hr(()=>Pj.tool[h.value]),b=He(!1),E=He("base"),O=hr(()=>{if(!s.value)return a||[];const X=s.value.toLowerCase();return(a||[]).reduce((Y,W)=>{const Q=W.list.filter(J=>J.label.toLowerCase().includes(X));return Q.length&&Y.push({...W,list:Q}),Y},[])});function w(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.addNode(X),f("clickNodes",X)}function S(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(j2(Y.type)?(Y.work_flow.nodes[0].properties.node_data.file_upload_setting,X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id}):X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.onmousedown(X),f("onmousedown",X)}const M=He([]),T=He([]);async function $(){var Y;const X=await i.asyncGetFolder(u0.TOOL,{},b);M.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})}async function D(){var Y,W,Q,J;const X=await oi({type:"tool",isShared:((Y=i.currentFolder)==null?void 0:Y.id)==="share",systemType:"workspace"}).getToolList({folder_id:((W=i.currentFolder)==null?void 0:W.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});T.value=((Q=X.data)==null?void 0:Q.tools)||X.data||[],T.value=(J=T.value)==null?void 0:J.filter(ie=>ie.is_active)}const P=He([]),B=He([]);function F(){i.asyncGetFolder(u0.APPLICATION,{},b).then(X=>{var Y;P.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})})}async function I(){var Y;const X=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((Y=i.currentFolder)==null?void 0:Y.id)||r.getWorkspaceId()});B.value=X.data.filter(W=>W.resource_type==="application"&&W.id!==l.id&&W.is_publish)}function V(X){i.setCurrentFolder(X),E.value==="tool"?D():I()}async function z(X){console.log(X),X==="tool"?(await $(),D()):X==="application"&&(F(),I())}return bo(()=>{}),(X,Y)=>{const W=ne("search"),Q=ne("el-icon"),J=ne("el-input"),ie=ne("el-text"),Se=ne("el-popover"),Ae=ne("el-scrollbar"),Pe=ne("el-tab-pane"),De=ne("folder-tree"),ze=ne("LayoutContainer"),Ye=ne("el-tabs");return Ql((Ne(),mn("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:Rj({width:E.value==="base"?"400px":"640px"})},[k(Ye,{modelValue:E.value,"onUpdate:modelValue":Y[5]||(Y[5]=Be=>E.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Ql(ee("div",XY,[k(J,{modelValue:s.value,"onUpdate:modelValue":Y[0]||(Y[0]=Be=>s.value=Be),class:"mr-12 ml-12",placeholder:X.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[k(Q,{class:"el-input__icon"},{default:j(()=>[k(W)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Eh,E.value==="base"]]),k(Pe,{label:X.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:j(()=>[k(Ae,{height:"400"},{default:j(()=>[O.value.length>0?(Ne(),mn("div",YY,[(Ne(!0),mn(Ir,null,No(O.value,(Be,Je)=>(Ne(),mn(Ir,{key:Je},[k(ie,{type:"info",size:"small",class:"color-secondary ml-12"},{default:j(()=>[ft(_e(Be.label),1)]),_:2},1024),ee("div",qY,[(Ne(!0),mn(Ir,null,No(Be.list,(gt,le)=>(Ne(),bt(Se,{key:le,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(Ze=>w(gt),["stop"]),onMousedown:gn(Ze=>S(gt),["stop"])},[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:20})),ee("div",ZY,_e(gt.label),1)],40,KY)]),default:j(()=>[ee("div",JY,[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:32})),ee("div",QY,_e(gt.label),1)]),k(ie,{type:"info",size:"small",class:"color-secondary lighter"},{default:j(()=>[ft(_e(gt.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(Ne(),mn("div",eq,[k(ie,{type:"info"},{default:j(()=>[ft(_e(X.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.tool.title"),name:"tool"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).TOOL,data:M.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,shareTitle:X.$t("views.shared.shared_tool"),showShared:v.value.is_share(),canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey","shareTitle","showShared"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(mk,{list:T.value,onClickNodes:Y[1]||(Y[1]=Be=>w(Wn(VN),Be,"tool")),onOnmousedown:Y[2]||(Y[2]=Be=>S(Wn(VN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.application.title"),name:"application"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).APPLICATION,data:P.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(mk,{list:B.value,onClickNodes:Y[3]||(Y[3]=Be=>w(Wn(WN),Be,"application")),onOnmousedown:Y[4]||(Y[4]=Be=>S(Wn(WN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Eh,t.show]])}}}),g3=Ph(tq,[["__scopeId","data-v-a8dfaa84"]]),nq={class:"flex-between"},rq={class:"ellipsis-1 break-all"},oq={key:0,src:jY,alt:""},iq={key:1,src:LY,alt:""},aq={style:{width:"280px"},class:"p-12-16"},lq={class:"mt-8 lighter"},sq={class:"title-decoration-1 mb-8 mt-8"},uq=["onMouseenter"],cq={class:"break-all"},dq={class:"dialog-footer"},fq=_r({__name:"NodeContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",nc.Application);const e=ja(),{params:{id:n}}=e,o=He({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=He(!1),i=He(),a=He(),s=He(!1),l=He({title:""}),f=hr({set:z=>{Me.set(P.nodeModel.properties,"condition",z)},get:()=>P.nodeModel.properties.condition?P.nodeModel.properties.condition:(Me.set(P.nodeModel.properties,"condition","AND"),!0)}),h=hr({set:z=>{Me.set(P.nodeModel.properties,"showNode",z)},get:()=>P.nodeModel.properties.showNode!==void 0?P.nodeModel.properties.showNode:(Me.set(P.nodeModel.properties,"showNode",!0),!0)}),v=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},b=hr(()=>P.nodeModel.properties.status?P.nodeModel.properties.status:200);function E(){l.value.title=P.nodeModel.properties.stepName,s.value=!0}const O=async z=>{z&&await z.validate(X=>{var Y;X&&((Y=P.nodeModel.graphModel.nodes.filter(W=>W.id!==P.nodeModel.id))!=null&&Y.some(W=>W.properties.stepName===l.value.title)?Xi(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(P.nodeModel.properties,"stepName",l.value.title),s.value=!1,z.resetFields()))})},w=z=>{z!=null&&z.shiftKey||P.nodeModel.graphModel.clearSelectElements(),Me.set(P.nodeModel,"isSelected",!P.nodeModel.isSelected),Me.set(P.nodeModel,"isHovered",!P.nodeModel.isSelected),P.nodeModel.graphModel.toFront(P.nodeModel.id)},S=He(null),M=()=>{P.nodeModel.graphModel.clearSelectElements();const z=P.nodeModel.graphModel.cloneNode(P.nodeModel.id);Me.set(z,"isSelected",!0),Me.set(z,"isHovered",!0),P.nodeModel.graphModel.toFront(z.id)},T=()=>{L2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{P.nodeModel.type===kr.LoopNode&&P.nodeModel.graphModel.getNodeOutgoingNode(P.nodeModel.id).forEach(X=>{X.type==="loop-body-node"&&P.nodeModel.graphModel.deleteNode(X.id)}),P.nodeModel.graphModel.deleteNode(P.nodeModel.id)}),P.nodeModel.graphModel.eventCenter.emit("delete_node")},$=z=>{z.height&&(P.nodeModel.virtual||(o.value.stepContainerHeight=z.height,P.nodeModel.setHeight(o.value.stepContainerHeight)))};function D(z){var W,Q,J;const X=z.properties.width?z.properties.width:214,Y=P.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((W=i.value)==null?void 0:W.x)+X/2+200,y:((Q=i.value)==null?void 0:Q.y)-z.height});P.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:P.nodeModel.id,sourceAnchorId:(J=i.value)==null?void 0:J.id,targetNodeId:Y.id,targetAnchorId:Y.id+"_left"}),V()}const P=t,B=hr(()=>{var z;return P.nodeModel.properties.config.fields?(z=P.nodeModel.properties.config.fields)==null?void 0:z.map(Y=>({label:Y.label,value:Y.value,globeLabel:`{{${P.nodeModel.properties.stepName}.${Y.value}}}`,globeValue:`{{context['${P.nodeModel.id}'].${Y.value}}}`})):[]});function F(z){return![kr.Start,kr.Base,kr.LoopStartNode.toString()].includes(z)}const I=z=>{r.value=!0,i.value=z},V=()=>{r.value=!1,i.value=void 0};return bo(()=>{Me.set(P.nodeModel,"openNodeMenu",z=>{r.value?V():I(z)})}),(z,X)=>{var se;const Y=ne("ArrowDownBold"),W=ne("el-icon"),Q=ne("el-button"),J=ne("el-option"),ie=ne("el-select"),Se=ne("el-dropdown"),Ae=ne("AppIcon"),Pe=ne("el-dropdown-item"),De=ne("el-dropdown-menu"),ze=ne("el-alert"),Ye=ne("el-tooltip"),Be=ne("el-collapse-transition"),Je=ne("el-input"),gt=ne("el-form-item"),le=ne("el-form"),Ze=ne("el-dialog"),pe=Rg("resize");return Ne(),mn("div",{onMousedown:w,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gs(["step-container app-card p-16",{isSelected:P.nodeModel.isSelected,error:b.value!==200}]),style:{overflow:"visible"}},[Ql((Ne(),mn("div",null,[ee("div",nq,[ee("div",{class:"flex align-center",onDragstart:X[0]||(X[0]=gn(()=>{},["prevent"])),onDrag:X[1]||(X[1]=gn(()=>{},["prevent"])),onDragover:X[2]||(X[2]=gn(()=>{},["prevent"])),onDragend:X[3]||(X[3]=gn(()=>{},["prevent"])),style:{width:"69%"}},[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(se=t.nodeModel)==null?void 0:se.properties.node_data},null,8,["item"])),ee("h4",rq,_e(t.nodeModel.properties.stepName),1)],32),ee("div",{onMousemove:X[6]||(X[6]=gn(()=>{},["stop"])),onMousedown:X[7]||(X[7]=gn(()=>{},["stop"])),onKeydown:X[8]||(X[8]=gn(()=>{},["stop"])),onClick:X[9]||(X[9]=gn(()=>{},["stop"]))},[k(Q,{text:"",onClick:X[4]||(X[4]=we=>h.value=!h.value)},{default:j(()=>[k(W,{class:Gs(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[k(Y)]),_:1},8,["class"])]),_:1}),F(t.nodeModel.type)?(Ne(),bt(Se,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:j(()=>[ee("div",aq,[ee("h5",null,_e(z.$t("views.applicationWorkflow.condition.title")),1),ee("p",lq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),k(ie,{modelValue:f.value,"onUpdate:modelValue":X[5]||(X[5]=we=>f.value=we),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(J,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(J,{label:z.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(z.$t("views.applicationWorkflow.condition.text")),1)])])]),default:j(()=>[k(Q,{text:""},{default:j(()=>[f.value==="OR"?(Ne(),mn("img",oq)):Bn("",!0),f.value==="AND"?(Ne(),mn("img",iq)):Bn("",!0)]),_:1})]),_:1})):Bn("",!0),F(t.nodeModel.type)?(Ne(),bt(Se,{key:1,teleported:!1,trigger:"click"},{dropdown:j(()=>[k(De,{style:{"min-width":"80px"}},{default:j(()=>[k(Pe,{onClick:E,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.rename")),1)]),_:1}),k(Pe,{onClick:M,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.copy")),1)]),_:1}),k(Pe,{onClick:T,class:"border-t p-8"},{default:j(()=>[ft(_e(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:j(()=>[k(Q,{text:""},{default:j(()=>[k(Ae,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):Bn("",!0)],32)]),k(Be,null,{default:j(()=>[Ql(ee("div",{onMousedown:X[11]||(X[11]=gn(()=>{},["stop"])),onKeydown:X[12]||(X[12]=gn(()=>{},["stop"])),onClick:X[13]||(X[13]=gn(()=>{},["stop"])),class:"mt-16"},[b.value!=200?(Ne(),bt(ze,{key:0,class:"mb-16",title:P.nodeModel.type==="application-node"?z.$t("views.applicationWorkflow.tip.applicationNodeError"):z.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):Bn("",!0),Dj(z.$slots,"default",{},void 0,!0),B.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",sq,_e(z.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(B.value,(we,$e)=>(Ne(),mn("div",{key:$e,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:rt=>S.value=$e,onMouseleave:X[10]||(X[10]=rt=>S.value=null)},[ee("span",cq,_e(we.label)+" "+_e("{"+we.value+"}"),1),S.value===$e?(Ne(),bt(Ye,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(Q,{link:"",onClick:rt=>Wn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[k(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,uq))),128))],64)):Bn("",!0)],544),[[Eh,h.value]])]),_:3})])),[[pe,$]])],2),k(Be,null,{default:j(()=>[r.value?(Ne(),bt(g3,{key:0,onMousemove:X[14]||(X[14]=gn(()=>{},["stop"])),onMousedown:X[15]||(X[15]=gn(()=>{},["stop"])),onClick:X[16]||(X[16]=gn(()=>{},["stop"])),onWheel:v,show:r.value,id:Wn(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:D},null,8,["show","id"])):Bn("",!0)]),_:1}),k(Ze,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:s.value,"onUpdate:modelValue":X[21]||(X[21]=we=>s.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:X[22]||(X[22]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",dq,[k(Q,{onClick:X[19]||(X[19]=gn(we=>s.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),k(Q,{type:"primary",onClick:X[20]||(X[20]=we=>O(a.value))},{default:j(()=>[ft(_e(z.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(le,{"label-position":"top",ref_key:"titleFormRef",ref:a,model:l.value},{default:j(()=>[k(gt,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(Je,{modelValue:l.value.title,"onUpdate:modelValue":X[17]||(X[17]=we=>l.value.title=we),onBlur:X[18]||(X[18]=we=>l.value.title=l.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=Ph(fq,[["__scopeId","data-v-4532ca06"]]),pq={class:"title-decoration-1 mb-8"},hq={class:"flex-between w-full"},vq={class:"flex-between"},mq={class:"flex align-center"},gq={class:"flex align-center"},yq={class:"mr-4"},_q={class:"flex-between"},bq={class:"flex-between mb-16"},wq={key:0,class:"w-full mb-16"},Eq={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},xq={class:"flex align-center",style:{"line-height":"20px"}},Oq=["src"],Sq=["title"],Aq={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Mq={class:"flex align-center",style:{"line-height":"20px"}},Tq={class:"ellipsis"},Cq={class:"flex-between mb-16"},Nq={class:"lighter"},kq={key:2,class:"w-full mb-16"},Pq={class:"flex align-center",style:{"line-height":"20px"}},Rq=["src"],Dq=["title"],jq={class:"flex-between"},Lq={class:"mr-4"},Iq={class:"flex"},Fq={class:"flex-between w-full"},Bq={class:"flex align-center"},$q={class:"mr-4"},Uq=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function a(Be){Me.set(b.nodeModel.properties.node_data,"system",Be)}function s(Be){Me.set(b.nodeModel.properties.node_data,"prompt",Be)}const l=Be=>{var Je;Be?(Je=w.value)==null||Je.reset_default(Be,o):V({})},h={model_id:"",system:"",prompt:`${Pt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}:
|
||
{{${Pt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}}
|
||
${Pt("views.problem.title")}:
|
||
{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:1,is_result:!0,temperature:null,max_tokens:null,dialogue_type:"WORKFLOW",model_setting:{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}},v=hr({get:()=>b.nodeModel.properties.node_data?(b.nodeModel.properties.node_data.model_setting||Me.set(b.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}),b.nodeModel.properties.node_data):(Me.set(b.nodeModel.properties,"node_data",h),b.nodeModel.properties.node_data),set:Be=>{Me.set(b.nodeModel.properties,"node_data",Be)}}),b=t,E=He(),O=He(null),w=He(),S=He(),M=()=>{var Be;return(Be=E.value)==null?void 0:Be.validate().catch(Je=>Promise.reject({node:b.nodeModel,errMessage:Je}))},T=e();function $(){var Je;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(Be).then(gt=>{O.value=Me.groupBy(gt==null?void 0:gt.data,"provider")})}const D=Be=>{var Je;Be&&((Je=w.value)==null||Je.open(Be,o,v.value.model_params_setting))},P=He(),B=Be=>{var Je;Be&&((Je=P.value)==null||Je.open(Be,o))},F=Be=>{Me.set(b.nodeModel.properties.node_data,"system",Be)},I=()=>{var Be;(Be=S.value)==null||Be.open(v.value.model_setting)};function V(Be){Me.set(b.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let Je=Me.cloneDeep(b.nodeModel.properties.node_data.model_setting);Je={...Je,...Be},Me.set(b.nodeModel.properties.node_data,"model_setting",Je)}const X=He();function Y(){const Be={mcp_servers:v.value.mcp_servers,mcp_tool_ids:v.value.mcp_tool_ids,mcp_source:v.value.mcp_source};X.value.open(Be,ze.value)}function W(Be){Me.set(b.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),Me.set(b.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const Q=He();function J(){Q.value.open(v.value.tool_ids)}function ie(Be){Me.set(b.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function Se(Be){const Je=b.nodeModel.properties.node_data.tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"tool_ids",Je)}function Ae(Be){const Je=b.nodeModel.properties.node_data.mcp_tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Je)}const Pe=He([]);function De(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{Pe.value=[...gt.data.shared_tools,...gt.data.tools].filter(le=>le.is_active)})}const ze=He([]);function Ye(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ze.value=[...gt.data.shared_tools,...gt.data.tools].filter(le=>le.is_active)})}return bo(()=>{var Be,Je,gt,le;$(),typeof((Be=b.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&Qd(b.nodeModel)&&Me.set(b.nodeModel.properties.node_data,"is_result",!0),Me.set(b.nodeModel,"validate",M),v.value.dialogue_type||(v.value.dialogue_type="WORKFLOW"),(Je=b.nodeModel.properties.node_data)!=null&&Je.mcp_tool_id&&(Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",[(gt=b.nodeModel.properties.node_data)==null?void 0:gt.mcp_tool_id]),Me.set(b.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((le=b.nodeModel.properties.node_data)==null?void 0:le.mcp_output_enable)===void 0&&Me.set(b.nodeModel.properties.node_data,"mcp_output_enable",!0),De(),Ye()}),(Be,Je)=>{const gt=ne("AppIcon"),le=ne("el-button"),Ze=ne("ModelSelect"),pe=ne("el-form-item"),se=ne("el-tooltip"),we=ne("MdEditorMagnify"),$e=ne("el-option"),rt=ne("el-select"),pt=ne("el-input-number"),Lt=ne("el-switch"),Jt=ne("el-avatar"),en=ne("ToolIcon"),zt=ne("Close"),it=ne("el-icon"),ae=ne("el-form"),re=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pq,_e(Be.$t("views.applicationWorkflow.nodeSetting")),1),k(re,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ae,{onSubmit:Je[16]||(Je[16]=gn(()=>{},["prevent"])),model:v.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:E,"hide-required-asterisk":""},{default:j(()=>{var je,vt;return[k(pe,{label:Be.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:Be.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hq,[ee("div",null,[ee("span",null,[ft(_e(Be.$t("views.application.form.aiModel.label")),1),Je[17]||(Je[17]=ee("span",{class:"color-danger"},"*",-1))])]),k(le,{disabled:!v.value.model_id,type:"primary",link:"",onClick:Je[0]||(Je[0]=q=>D(v.value.model_id)),onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Ze,{onChange:l,onWheel:i,teleported:!1,modelValue:v.value.model_id,"onUpdate:modelValue":Je[1]||(Je[1]=q=>v.value.model_id=q),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:O.value,onSubmitModel:$,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(pe,null,{label:j(()=>[ee("div",vq,[ee("div",mq,[ee("span",null,_e(Be.$t("views.application.form.roleSettings.label")),1),k(se,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(le,{type:"primary",link:"",onClick:Je[2]||(Je[2]=q=>B(v.value.model_id)),disabled:!v.value.model_id},{default:j(()=>[k(gt,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(we,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:v.value.system,"onUpdate:modelValue":Je[3]||(Je[3]=q=>v.value.system=q),style:{height:"100px"},onSubmitDialog:a,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(pe,{label:Be.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:Be.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",gq,[ee("div",yq,[ee("span",null,[ft(_e(Be.$t("views.application.form.prompt.label")),1),Je[18]||(Je[18]=ee("span",{class:"color-danger"},"*",-1))])]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(we,{onWheel:i,title:Be.$t("views.application.form.prompt.label"),modelValue:v.value.prompt,"onUpdate:modelValue":Je[4]||(Je[4]=q=>v.value.prompt=q),style:{height:"150px"},onSubmitDialog:s,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(pe,{label:Be.$t("views.application.form.historyRecord.label")},{label:j(()=>[ee("div",_q,[ee("div",null,_e(Be.$t("views.application.form.historyRecord.label")),1),k(rt,{modelValue:v.value.dialogue_type,"onUpdate:modelValue":Je[5]||(Je[5]=q=>v.value.dialogue_type=q),type:"small",style:{width:"100px"}},{default:j(()=>[k($e,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k($e,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(pt,{modelValue:v.value.dialogue_number,"onUpdate:modelValue":Je[6]||(Je[6]=q=>v.value.dialogue_number=q),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),ee("div",bq,[Je[19]||(Je[19]=ee("div",{class:"lighter"},"MCP",-1)),ee("div",null,[v.value.mcp_enable?(Ne(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:Y,onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.mcp_enable,"onUpdate:modelValue":Je[7]||(Je[7]=q=>v.value.mcp_enable=q)},null,8,["modelValue"])])]),((je=v.value.mcp_tool_ids)==null?void 0:je.length)>0?(Ne(),mn("div",wq,[(Ne(!0),mn(Ir,null,No(v.value.mcp_tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Ne(),mn(Ir,{key:kt},[Wn(bs)(ze.value,q,"id")?(Ne(),mn("div",Eq,[ee("div",xq,[(Rt=Wn(bs)(ze.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bs)(ze.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Oq)]}),_:2},1024)):(Ne(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(ze.value,q,"id"))==null?void 0:Gt.name},_e(((Pn=Wn(bs)(ze.value,q,"id"))==null?void 0:Pn.name)||Be.$t("common.custom")+" MCP"),9,Sq)]),k(le,{text:"",onClick:qt=>Ae(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])):Bn("",!0)],64)}),128))])):Bn("",!0),v.value.mcp_servers&&v.value.mcp_servers.length>0?(Ne(),mn("div",Aq,[ee("div",Mq,[k(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Tq,_e(Be.$t("common.custom")+" MCP"),1)]),k(le,{text:"",onClick:Je[8]||(Je[8]=q=>v.value.mcp_servers="")},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):Bn("",!0),ee("div",Cq,[ee("div",Nq,_e(Be.$t("views.tool.title")),1),ee("div",null,[v.value.tool_enable?(Ne(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:J,onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.tool_enable,"onUpdate:modelValue":Je[9]||(Je[9]=q=>v.value.tool_enable=q)},null,8,["modelValue"])])]),((vt=v.value.tool_ids)==null?void 0:vt.length)>0?(Ne(),mn("div",kq,[(Ne(!0),mn(Ir,null,No(v.value.tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Ne(),mn("div",{key:kt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Pq,[(Rt=Wn(bs)(Pe.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bs)(Pe.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Rq)]}),_:2},1024)):(Ne(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(Pe.value,q,"id"))==null?void 0:Gt.name},_e((Pn=Wn(bs)(Pe.value,q,"id"))==null?void 0:Pn.name),9,Dq)]),k(le,{text:"",onClick:qt=>Se(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])}),128))])):Bn("",!0),v.value.mcp_enable||v.value.tool_enable?(Ne(),bt(pe,{key:3,onClick:Je[11]||(Je[11]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",jq,[ee("span",Lq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Iq,[k(Lt,{class:"ml-8",size:"small",modelValue:v.value.mcp_output_enable,"onUpdate:modelValue":Je[10]||(Je[10]=q=>v.value.mcp_output_enable=q)},null,8,["modelValue"])])])]),_:1})):Bn("",!0),k(pe,{onClick:Je[13]||(Je[13]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Fq,[ee("div",null,[ee("span",null,_e(Be.$t("views.application.form.reasoningContent.label")),1)]),ee("div",null,[v.value.model_setting.reasoning_content_enable?(Ne(),bt(le,{key:0,type:"primary",link:"",onClick:I,onRefreshForm:V,class:"mr-4"},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.model_setting.reasoning_content_enable,"onUpdate:modelValue":Je[12]||(Je[12]=q=>v.value.model_setting.reasoning_content_enable=q)},null,8,["modelValue"])])])]),_:1}),k(pe,{onClick:Je[15]||(Je[15]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Bq,[ee("div",$q,[ee("span",null,_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Lt,{size:"small",modelValue:v.value.is_result,"onUpdate:modelValue":Je[14]||(Je[14]=q=>v.value.is_result=q)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:w,onRefresh:V},null,512),k(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:P},null,512),k(x9,{ref_key:"ReasoningParamSettingDialogRef",ref:S,onRefresh:z},null,512),k(O9,{ref_key:"mcpServersDialogRef",ref:X,onRefresh:W},null,512),k(S9,{ref_key:"toolDialogRef",ref:Q,onRefresh:ie},null,512)]),_:1},8,["nodeModel"])}}});var gk={width:40,height:40},yk={width:40,height:40},_k={width:40,height:40},bk={width:100,height:80},wk={width:100,height:80},V1,xo,y3,Iv,Ek,_3,b3,w3,hM,wA,EA,yw={},_w=[],Vq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eb=Array.isArray;function op(t,e){for(var n in e)t[n]=e[n];return t}function vM(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lr(t,e,n){var o,r,i,a={};for(i in e)i=="key"?o=e[i]:i=="ref"?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?V1.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return X0(t,a,o,r,null)}function X0(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++y3,__i:-1,__u:0};return r==null&&xo.vnode!=null&&xo.vnode(i),i}function W1(){return{current:null}}function jg(t){return t.children}function ko(t,e){this.props=t,this.context=e}function Lg(t,e){if(e==null)return t.__?Lg(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Lg(t):null}function Wq(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],r=[],i=op({},e);i.__v=e.__v+1,xo.vnode&&xo.vnode(i),mM(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,n??Lg(e),!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,S3(o,i,r),e.__e=e.__=null,i.__e!=n&&E3(i)}}function E3(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),E3(t)}function xk(t){(!t.__d&&(t.__d=!0)&&Iv.push(t)&&!bw.__r++||Ek!=xo.debounceRendering)&&((Ek=xo.debounceRendering)||_3)(bw)}function bw(){for(var t,e=1;Iv.length;)Iv.length>e&&Iv.sort(b3),t=Iv.shift(),e=Iv.length,Wq(t);bw.__r=0}function x3(t,e,n,o,r,i,a,s,l,f,h){var v,b,E,O,w,S,M,T=o&&o.__k||_w,$=e.length;for(l=Gq(n,e,T,l,$),v=0;v<$;v++)(E=n.__k[v])!=null&&(b=E.__i!=-1&&T[E.__i]||yw,E.__i=v,S=mM(t,E,b,r,i,a,s,l,f,h),O=E.__e,E.ref&&b.ref!=E.ref&&(b.ref&&gM(b.ref,null,E),h.push(E.ref,E.__c||O,E)),w==null&&O!=null&&(w=O),(M=!!(4&E.__u))||b.__k===E.__k?l=O3(E,l,t,M):typeof E.type=="function"&&S!==void 0?l=S:O&&(l=O.nextSibling),E.__u&=-7);return n.__e=w,l}function Gq(t,e,n,o,r){var i,a,s,l,f,h=n.length,v=h,b=0;for(t.__k=new Array(r),i=0;i<r;i++)(a=e[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[i]=X0(null,a,null,null,null):eb(a)?a=t.__k[i]=X0(jg,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[i]=X0(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[i]=a,l=i+b,a.__=t,a.__b=t.__b+1,s=null,(f=a.__i=zq(a,n,l,v))!=-1&&(v--,(s=n[f])&&(s.__u|=2)),s==null||s.__v==null?(f==-1&&(r>h?b--:r<h&&b++),typeof a.type!="function"&&(a.__u|=4)):f!=l&&(f==l-1?b--:f==l+1?b++:(f>l?b--:b++,a.__u|=4))):t.__k[i]=null;if(v)for(i=0;i<h;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lg(s)),M3(s,s));return o}function O3(t,e,n,o){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=O3(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=Lg(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ww(t,e){return e=e||[],t==null||typeof t=="boolean"||(eb(t)?t.some(function(n){ww(n,e)}):e.push(t)),e}function zq(t,e,n,o){var r,i,a,s=t.key,l=t.type,f=e[n],h=f!=null&&(2&f.__u)==0;if(f===null&&s==null||h&&s==f.key&&l==f.type)return n;if(o>(h?1:0)){for(r=n-1,i=n+1;r>=0||i<e.length;)if((f=e[a=r>=0?r--:i++])!=null&&(2&f.__u)==0&&s==f.key&&l==f.type)return a}return-1}function Ok(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Vq.test(e)?n:n+"px"}function f0(t,e,n,o,r){var i,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Ok(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Ok(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(w3,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=hM,t.addEventListener(e,i?EA:wA,i)):t.removeEventListener(e,i?EA:wA,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Sk(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=hM++;else if(e.t<n.u)return;return n(xo.event?xo.event(e):e)}}}function mM(t,e,n,o,r,i,a,s,l,f){var h,v,b,E,O,w,S,M,T,$,D,P,B,F,I,V=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(h=xo.__b)&&h(e);e:if(typeof V=="function")try{if(M=e.props,T="prototype"in V&&V.prototype.render,$=(h=V.contextType)&&o[h.__c],D=h?$?$.props.value:h.__:o,n.__c?S=(v=e.__c=n.__c).__=v.__E:(T?e.__c=v=new V(M,D):(e.__c=v=new ko(M,D),v.constructor=V,v.render=Xq),$&&$.sub(v),v.state||(v.state={}),v.__n=o,b=v.__d=!0,v.__h=[],v._sb=[]),T&&v.__s==null&&(v.__s=v.state),T&&V.getDerivedStateFromProps!=null&&(v.__s==v.state&&(v.__s=op({},v.__s)),op(v.__s,V.getDerivedStateFromProps(M,v.__s))),E=v.props,O=v.state,v.__v=e,b)T&&V.getDerivedStateFromProps==null&&v.componentWillMount!=null&&v.componentWillMount(),T&&v.componentDidMount!=null&&v.__h.push(v.componentDidMount);else{if(T&&V.getDerivedStateFromProps==null&&M!==E&&v.componentWillReceiveProps!=null&&v.componentWillReceiveProps(M,D),e.__v==n.__v||!v.__e&&v.shouldComponentUpdate!=null&&v.shouldComponentUpdate(M,v.__s,D)===!1){e.__v!=n.__v&&(v.props=M,v.state=v.__s,v.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(z){z&&(z.__=e)}),_w.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break e}v.componentWillUpdate!=null&&v.componentWillUpdate(M,v.__s,D),T&&v.componentDidUpdate!=null&&v.__h.push(function(){v.componentDidUpdate(E,O,w)})}if(v.context=D,v.props=M,v.__P=t,v.__e=!1,P=xo.__r,B=0,T)v.state=v.__s,v.__d=!1,P&&P(e),h=v.render(v.props,v.state,v.context),_w.push.apply(v.__h,v._sb),v._sb=[];else do v.__d=!1,P&&P(e),h=v.render(v.props,v.state,v.context),v.state=v.__s;while(v.__d&&++B<25);v.state=v.__s,v.getChildContext!=null&&(o=op(op({},o),v.getChildContext())),T&&!b&&v.getSnapshotBeforeUpdate!=null&&(w=v.getSnapshotBeforeUpdate(E,O)),F=h!=null&&h.type===jg&&h.key==null?A3(h.props.children):h,s=x3(t,eb(F)?F:[F],e,n,o,r,i,a,s,l,f),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),S&&(v.__E=v.__=null)}catch(z){if(e.__v=null,l||i!=null)if(z.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(I=i.length;I--;)vM(i[I]);xA(e)}else e.__e=n.__e,e.__k=n.__k,z.then||xA(e);xo.__e(z,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=Hq(n.__e,e,n,o,r,i,a,l,f);return(h=xo.diffed)&&h(e),128&e.__u?void 0:s}function xA(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(xA))}function S3(t,e,n){for(var o=0;o<n.length;o++)gM(n[o],n[++o],n[++o]);xo.__c&&xo.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(i){i.call(r)})}catch(i){xo.__e(i,r.__v)}})}function A3(t){return typeof t!="object"||t==null||t.__b>0?t:eb(t)?t.map(A3):op({},t)}function Hq(t,e,n,o,r,i,a,s,l){var f,h,v,b,E,O,w,S=n.props||yw,M=e.props,T=e.type;if(T=="svg"?r="http://www.w3.org/2000/svg":T=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((E=i[f])&&"setAttribute"in E==!!T&&(T?E.localName==T:E.nodeType==3)){t=E,i[f]=null;break}}if(t==null){if(T==null)return document.createTextNode(M);t=document.createElementNS(r,T,M.is&&M),s&&(xo.__m&&xo.__m(e,i),s=!1),i=null}if(T==null)S===M||s&&t.data==M||(t.data=M);else{if(i=i&&V1.call(t.childNodes),!s&&i!=null)for(S={},f=0;f<t.attributes.length;f++)S[(E=t.attributes[f]).name]=E.value;for(f in S)E=S[f],f=="dangerouslySetInnerHTML"?v=E:f=="children"||f in M||f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M||f0(t,f,null,E,r);for(f in M)E=M[f],f=="children"?b=E:f=="dangerouslySetInnerHTML"?h=E:f=="value"?O=E:f=="checked"?w=E:s&&typeof E!="function"||S[f]===E||f0(t,f,E,S[f],r);if(h)s||v&&(h.__html==v.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(v&&(t.innerHTML=""),x3(e.type=="template"?t.content:t,eb(b)?b:[b],e,n,o,T=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&Lg(n,0),s,l),i!=null)for(f=i.length;f--;)vM(i[f]);s||(f="value",T=="progress"&&O==null?t.removeAttribute("value"):O!=null&&(O!==t[f]||T=="progress"&&!O||T=="option"&&O!=S[f])&&f0(t,f,O,S[f],r),f="checked",w!=null&&w!=t[f]&&f0(t,f,w,S[f],r))}return t}function gM(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){xo.__e(r,n)}}function M3(t,e,n){var o,r;if(xo.unmount&&xo.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||gM(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){xo.__e(i,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&M3(o[r],e,n||typeof t.type!="function");n||vM(t.__e),t.__c=t.__=t.__e=void 0}function Xq(t,e,n){return this.constructor(t,n)}function Yq(t,e,n){var o,r,i,a;e==document&&(e=document.documentElement),xo.__&&xo.__(t,e),r=(o=!1)?null:e.__k,i=[],a=[],mM(e,t=e.__k=Lr(jg,null,[t]),r||yw,yw,e.namespaceURI,r?null:e.firstChild?V1.call(e.childNodes):null,i,r?r.__e:e.firstChild,o,a),S3(i,t,a)}V1=_w.slice,xo={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(s){t=s}throw t}},y3=0,ko.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=op({},this.state),typeof t=="function"&&(t=t(op({},n),this.props)),t&&op(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),xk(this))},ko.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),xk(this))},ko.prototype.render=jg,Iv=[],_3=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b3=function(t,e){return t.__v.__b-e.__v.__b},bw.__r=0,w3=/(PointerCapture)$|Capture$/i,hM=0,wA=Sk(!1),EA=Sk(!0);var qq="An invariant failed, however the error is obfuscated because this is a production build.",Ew=[];Object.freeze(Ew);var yM={};Object.freeze(yM);function Hs(){return++yr.mobxGuid}function Qo(t){throw Wv(!1,t),"X"}function Wv(t,e){if(!t)throw new Error("[mobx] "+(e||qq))}function T3(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var p0=function(){};function Kq(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function _M(t){return t!==null&&typeof t=="object"}function ry(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Zq(t){if(iy(t)||Ys(t))return t;if(Array.isArray(t))return new Map(t);if(ry(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return Qo("Cannot convert to map from '"+t+"'")}function oy(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Jq(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Qq(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable!==!1&&n.writable!==!1}function jh(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(o){return _M(o)&&o[n]===!0}}function iy(t){return t instanceof Map}function tb(t){return t instanceof Set}function C3(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach(function(o){Object.getOwnPropertyDescriptor(t,o).enumerable&&e.add(o)}),Array.from(e)}function gh(t){return t&&t.toString?t.toString():new String(t).toString()}function N3(t){return t===null?null:typeof t=="object"?""+t:t}var eK=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,eo=Symbol("mobx administration"),ay=(function(){function t(e){e===void 0&&(e="Atom@"+Hs()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ii.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.reportObserved=function(){return U3(this)},t.prototype.reportChanged=function(){Kc(),EK(this),Zc()},t.prototype.toString=function(){return this.name},t})(),bM=jh("Atom",ay);function wM(t,e,n){e===void 0&&(e=p0),n===void 0&&(n=p0);var o=new ay(t);return e!==p0&&jK(o,e),n!==p0&&X3(o,n),o}function tK(t,e){return rI(t,e)}function nK(t,e){return Object.is(t,e)}var Ig={structural:tK,default:nK};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var OA=function(t,e){return OA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)o.hasOwnProperty(r)&&(n[r]=o[r])},OA(t,e)};function rK(t,e){OA(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var xw=function(){return xw=Object.assign||function(e){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xw.apply(this,arguments)};function Vd(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function _g(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function EM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_g(arguments[e]));return t}var Ow=Symbol("mobx did run lazy initializers"),Gy=Symbol("mobx pending decorators"),oK={},iK={};function aK(t,e){var n=e?oK:iK;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return qv(this),this[t]},set:function(o){qv(this),this[t]=o}})}function qv(t){var e,n;if(t[Ow]!==!0){var o=t[Gy];if(o){oy(t,Ow,!0);var r=EM(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=Vd(r),a=i.next();!a.done;a=i.next()){var s=a.value,l=o[s];l.propertyCreator(t,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function k3(t,e){return function(){var o,r=function(a,s,l,f){if(f===!0)return e(a,s,l,a,o),null;if(!Object.prototype.hasOwnProperty.call(a,Gy)){var h=a[Gy];oy(a,Gy,xw({},h))}return a[Gy][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:o},aK(s,t)};return lK(arguments)?(o=Ew,r.apply(null,arguments)):(o=Array.prototype.slice.call(arguments),r)}}function lK(t){return(t.length===2||t.length===3)&&(typeof t[1]=="string"||typeof t[1]=="symbol")||t.length===4&&t[3]===!0}function nb(t,e,n){return Ug(t)?t:Array.isArray(t)?Ut.array(t,{name:n}):ry(t)?Ut.object(t,void 0,{name:n}):iy(t)?Ut.map(t,{name:n}):tb(t)?Ut.set(t,{name:n}):t}function sK(t,e,n){return t==null||rd(t)||tf(t)||Ys(t)||oc(t)?t:Array.isArray(t)?Ut.array(t,{name:n,deep:!1}):ry(t)?Ut.object(t,void 0,{name:n,deep:!1}):iy(t)?Ut.map(t,{name:n,deep:!1}):tb(t)?Ut.set(t,{name:n,deep:!1}):Qo(!1)}function G1(t){return t}function uK(t,e,n){return rI(t,e)?e:t}function z1(t){Wv(t);var e=k3(!0,function(o,r,i,a,s){var l=i?i.initializer?i.initializer.call(o):i.value:void 0;MM(o).addObservableProp(r,l,t)}),n=e;return n.enhancer=t,n}var P3={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(P3);function pg(t){return t==null?P3:typeof t=="string"?{name:t,deep:!0,proxy:!0}:t}var xM=z1(nb),cK=z1(sK),R3=z1(G1),dK=z1(uK);function h0(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?G1:nb}function fK(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return xM.apply(null,arguments);if(Ug(t))return t;var o=ry(t)?Ut.object(t,e,n):Array.isArray(t)?Ut.array(t,e):iy(t)?Ut.map(t,e):tb(t)?Ut.set(t,e):t;if(o!==t)return o;Qo(!1)}var Ak={box:function(t,e){arguments.length>2&&Ly("box");var n=pg(e);return new zv(t,h0(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ly("array");var n=pg(e);return KK(t,h0(n),n.name)},map:function(t,e){arguments.length>2&&Ly("map");var n=pg(e);return new AM(t,h0(n),n.name)},set:function(t,e){arguments.length>2&&Ly("set");var n=pg(e);return new tI(t,h0(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ly("object");var o=pg(n);if(o.proxy===!1)return NA({},t,e,o);var r=q3(o),i=NA({},void 0,void 0,o),a=XK(i);return K3(a,t,e,r),a},ref:R3,shallow:cK,deep:xM,struct:dK},Ut=fK;Object.keys(Ak).forEach(function(t){return Ut[t]=Ak[t]});function Ly(t){Qo("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var Sw=k3(!1,function(t,e,n,o,r){var i=n.get,a=n.set,s=r[0]||{};MM(t).addComputedProp(t,e,xw({get:i,set:a,context:t},s))}),pK=Sw({equals:Ig.structural}),Ai=function(e,n,o){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Sw.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=e,r.set=typeof n=="function"?n:r.set,r.name=r.name||e.name||"",new Bg(r)};Ai.struct=pK;var ii;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(ii||(ii={}));var Wd;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Wd||(Wd={}));var Aw=(function(){function t(e){this.cause=e}return t})();function zy(t){return t instanceof Aw}function SA(t){switch(t.dependenciesState){case ii.UP_TO_DATE:return!1;case ii.NOT_TRACKING:case ii.STALE:return!0;case ii.POSSIBLY_STALE:{for(var e=OM(!0),n=ly(),o=t.observing,r=o.length,i=0;i<r;i++){var a=o[i];if($g(a)){if(yr.disableErrorBoundaries)a.get();else try{a.get()}catch{return bh(n),e_(e),!0}if(t.dependenciesState===ii.STALE)return bh(n),e_(e),!0}}return L3(t),bh(n),e_(e),!1}}}function Fg(t){var e=t.observers.size>0;yr.computationDepth>0&&e&&Qo(!1),!yr.allowStateChanges&&(e||yr.enforceActions==="strict")&&Qo(!1)}function D3(t,e,n){var o=OM(!0);L3(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++yr.runId;var r=yr.trackingDerivation;yr.trackingDerivation=t;var i;if(yr.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(a){i=new Aw(a)}return yr.trackingDerivation=r,hK(t),e_(o),i}function hK(t){for(var e=t.observing,n=t.observing=t.newObserving,o=ii.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;a<i;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}for(n.length=r,t.newObserving=null,i=e.length;i--;){var s=e[i];s.diffValue===0&&B3(s,t),s.diffValue=0}for(;r--;){var s=n[r];s.diffValue===1&&(s.diffValue=0,wK(s,t))}o!==ii.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}function AA(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)B3(e[n],t);t.dependenciesState=ii.NOT_TRACKING}function j3(t){var e=ly();try{return t()}finally{bh(e)}}function ly(){var t=yr.trackingDerivation;return yr.trackingDerivation=null,t}function bh(t){yr.trackingDerivation=t}function OM(t){var e=yr.allowStateReads;return yr.allowStateReads=t,e}function e_(t){yr.allowStateReads=t}function L3(t){if(t.dependenciesState!==ii.UP_TO_DATE){t.dependenciesState=ii.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=ii.UP_TO_DATE}}var Mw=0,vK=1,Mk=Object.getOwnPropertyDescriptor(function(){},"name");Mk&&Mk.configurable;function Gv(t,e,n){var o=function(){return I3(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function I3(t,e,n,o){var r=mK();try{return e.apply(n,o)}catch(i){throw r.error=i,i}finally{gK(r)}}function mK(t,e,n){var o=Zu(),r=0,i=ly();Kc();var a=H1(!0),s=OM(!0),l={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:s,notifySpy:o,startTime:r,actionId:vK++,parentActionId:Mw};return Mw=l.actionId,l}function gK(t){Mw!==t.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=t.parentActionId,t.error!==void 0&&(yr.suppressReactionErrors=!0),X1(t.prevAllowStateChanges),e_(t.prevAllowStateReads),Zc(),bh(t.prevDerivation),yr.suppressReactionErrors=!1}function H1(t){var e=yr.allowStateChanges;return yr.allowStateChanges=t,e}function X1(t){yr.allowStateChanges=t}var zv=(function(t){rK(e,t);function e(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hs()),a===void 0&&(a=Ig.default);var s=t.call(this,r)||this;return s.enhancer=o,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=o(n,void 0,r),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){this.value,n=this.prepareNewValue(n),n!==yr.UNCHANGED&&this.setNewValue(n)},e.prototype.prepareNewValue=function(n){if(Fg(this),Gd(this)){var o=zd(this,{object:this,type:"update",newValue:n});if(!o)return yr.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?yr.UNCHANGED:n},e.prototype.setNewValue=function(n){var o=this.value;this.value=n,this.reportChanged(),Jc(this)&&Qc(this,{type:"update",object:this,newValue:n,oldValue:o})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return rb(this,n)},e.prototype.observe=function(n,o){return o&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),ob(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return N3(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ay),yK=jh("ObservableValue",zv),Bg=(function(){function t(e){this.dependenciesState=ii.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ii.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.value=new Aw(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Wd.NONE,Wv(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+Hs(),e.set&&(this.setter=Gv(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Ig.structural:Ig.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){OK(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&Qo("Cycle detected in computation "+this.name+": "+this.derivation),yr.inBatch===0&&this.observers.size===0&&!this.keepAlive?SA(this)&&(this.warnAboutUntrackedRead(),Kc(),this.value=this.computeValue(!1),Zc()):(U3(this),SA(this)&&this.trackAndCompute()&&xK(this));var e=this.value;if(zy(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(zy(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Wv(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Wv(!1,!1)},t.prototype.trackAndCompute=function(){var e=this.value,n=this.dependenciesState===ii.NOT_TRACKING,o=this.computeValue(!0),r=n||zy(e)||zy(o)||!this.equals(e,o);return r&&(this.value=o),r},t.prototype.computeValue=function(e){this.isComputing=!0,yr.computationDepth++;var n;if(e)n=D3(this,this.derivation,this.scope);else if(yr.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(o){n=new Aw(o)}return yr.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(AA(this),this.value=void 0)},t.prototype.observe=function(e,n){var o=this,r=!0,i=void 0;return PK(function(){var a=o.get();if(!r||n){var s=ly();e({type:"update",object:o,newValue:a,oldValue:i}),bh(s)}r=!1,i=a})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return N3(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(),$g=jh("ComputedValue",Bg),Y0=(function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t})(),_K={};function MA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_K}var q0=!0,F3=!1,yr=(function(){var t=MA();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(q0=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Y0().version&&(q0=!1),q0?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Y0):(setTimeout(function(){F3||Qo("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Y0)})();function bK(){(yr.pendingReactions.length||yr.inBatch||yr.isRunningReactions)&&Qo("isolateGlobalState should be called before MobX is running any reactions"),F3=!0,q0&&(--MA().__mobxInstanceCount===0&&(MA().__mobxGlobals=void 0),yr=new Y0)}function TA(){return yr}function wK(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function B3(t,e){t.observers.delete(e),t.observers.size===0&&$3(t)}function $3(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,yr.pendingUnobservations.push(t))}function Kc(){yr.inBatch++}function Zc(){if(--yr.inBatch===0){G3();for(var t=yr.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Bg&&n.suspend())}yr.pendingUnobservations=[]}}function U3(t){var e=yr.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.size===0&&yr.inBatch>0&&$3(t),!1)}function EK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.isTracing!==Wd.NONE&&V3(e,t),e.onBecomeStale()),e.dependenciesState=ii.STALE}))}function xK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.POSSIBLY_STALE?e.dependenciesState=ii.STALE:e.dependenciesState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.UP_TO_DATE)}))}function OK(t){t.lowestObserverState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.dependenciesState=ii.POSSIBLY_STALE,e.isTracing!==Wd.NONE&&V3(e,t),e.onBecomeStale())}))}function V3(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Wd.BREAK){var n=[];W3(IK(t),n,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+t.name+`'
|
||
|
||
You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(t instanceof Bg?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+n.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function W3(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(o){return W3(o,e,n+1)})}var A_=(function(){function t(e,n,o,r){e===void 0&&(e="Reaction@"+Hs()),r===void 0&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=o,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=ii.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Wd.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,yr.pendingReactions.push(this),G3())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Kc(),this._isScheduled=!1,SA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Zu()}catch(e){this.reportExceptionInDerivation(e)}}Zc()}},t.prototype.track=function(e){if(!this.isDisposed){Kc(),this._isRunning=!0;var n=D3(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&AA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),Zc()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(yr.disableErrorBoundaries)throw e;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";yr.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(o,e),yr.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Kc(),AA(this),Zc()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[eo]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),GK(this,e)},t})(),Tk=100,CA=function(t){return t()};function G3(){yr.inBatch>0||yr.isRunningReactions||CA(SK)}function SK(){yr.isRunningReactions=!0;for(var t=yr.pendingReactions,e=0;t.length>0;){++e===Tk&&(console.error("Reaction doesn't converge to a stable state after "+Tk+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o<r;o++)n[o].runReaction()}yr.isRunningReactions=!1}var Tw=jh("Reaction",A_);function AK(t){var e=CA;CA=function(n){return t(function(){return e(n)})}}function Zu(){return!1}function MK(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function TK(){Qo(!1)}function Ck(t){return function(e,n,o){if(o){if(o.value)return{value:Gv(t,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Gv(t,r.call(this))}}}return CK(t).apply(this,arguments)}}function CK(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(r){oy(this,n,Bt(t,r))}})}}function NK(t,e,n,o){return o===!0?(ZO(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ZO(this,e,n.value||n.initializer.call(this)),this[e]},set:TK}:{enumerable:!1,configurable:!0,set:function(r){ZO(this,e,r)},get:function(){}}}var Bt=function(e,n,o,r){if(arguments.length===1&&typeof e=="function")return Gv(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Gv(e,n);if(arguments.length===1&&typeof e=="string")return Ck(e);if(r===!0)oy(e,n,Gv(e.name||n,o.value,this));else return Ck(n).apply(null,arguments)};Bt.bound=NK;function kK(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",o=typeof t=="function"?t:e;return I3(n,o,this,void 0)}function ZO(t,e,n){oy(t,e,Gv(e,n.bind(t)))}function PK(t,e){e===void 0&&(e=yM);var n=e&&e.name||t.name||"Autorun@"+Hs(),o=!e.scheduler&&!e.delay,r;if(o)r=new A_(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var i=z3(e),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(s)}))},e.onError,e.requiresObservable)}function s(){t(r)}return r.schedule(),r.getDisposer()}var RK=function(t){return t()};function z3(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:RK}function H3(t,e,n){n===void 0&&(n=yM);var o=n.name||"Reaction@"+Hs(),r=Bt(o,n.onError?DK(n.onError,e):e),i=!n.scheduler&&!n.delay,a=z3(n),s=!0,l=!1,f,h=n.compareStructural?Ig.structural:n.equals||Ig.default,v=new A_(o,function(){s||i?b():l||(l=!0,a(b))},n.onError,n.requiresObservable);function b(){if(l=!1,!v.isDisposed){var E=!1;v.track(function(){var O=t(v);E=s||!h(f,O),f=O}),s&&n.fireImmediately&&r(f,v),!s&&E===!0&&r(f,v),s&&(s=!1)}}return v.schedule(),v.getDisposer()}function DK(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function jK(t,e,n){return Y3("onBecomeObserved",t,e)}function X3(t,e,n){return Y3("onBecomeUnobserved",t,e)}function Y3(t,e,n,o){var r=Mh(e),i=n,a=t+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var s=r[t];return typeof s!="function"?Qo(!1):function(){var l=r[a];l&&(l.delete(i),l.size===0&&delete r[a])}}function LK(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bK(),e!==void 0){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:Qo("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}yr.enforceActions=l,yr.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(yr.computedRequiresReaction=!!n),a!==void 0&&(yr.reactionRequiresObservable=!!a),s!==void 0&&(yr.observableRequiresReaction=!!s,yr.allowStateReads=!yr.observableRequiresReaction),o!==void 0&&(yr.computedConfigurable=!!o),r!==void 0&&(r===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),yr.disableErrorBoundaries=!!r),i&&AK(i)}function NA(t,e,n,o){o=pg(o);var r=q3(o);return qv(t),MM(t,o.name,r.enhancer),e&&K3(t,e,n,r),t}function q3(t){return t.defaultDecorator||(t.deep===!1?R3:xM)}function K3(t,e,n,o){var r,i,a,s,l;Kc();try{var a=eK(e);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var l=h.value,v=Object.getOwnPropertyDescriptor(e,l),b=n&&l in n?n[l]:v.get?Sw:o,E=b(t,l,v,!0);E&&Object.defineProperty(t,l,E)}}catch(w){r={error:w}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}finally{Zc()}}function IK(t,e){return Z3(Mh(t,e))}function Z3(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Kq(t.observing).map(Z3)),e}function J3(t,e){if(t==null)return!1;if(e!==void 0){if(rd(t)===!1||!t[eo].values.has(e))return!1;var n=Mh(t,e);return $g(n)}return $g(t)}function FK(t){return arguments.length>1?Qo(!1):J3(t)}function Nk(t,e){return typeof e!="string"?Qo(!1):J3(t,e)}function BK(t,e){return t==null?!1:rd(t)||!!t[eo]||bM(t)||Tw(t)||$g(t)}function Ug(t){return arguments.length!==1&&Qo(!1),BK(t)}function Vg(t){return rd(t)?t[eo].getKeys():Ys(t)||oc(t)?Array.from(t.keys()):tf(t)?t.map(function(e,n){return n}):Qo(!1)}function $K(t){return rd(t)?Vg(t).map(function(e){return t[e]}):Ys(t)?Vg(t).map(function(e){return t.get(e)}):oc(t)?Array.from(t.values()):tf(t)?t.slice():Qo(!1)}function UK(t){return rd(t)?Vg(t).map(function(e){return[e,t[e]]}):Ys(t)?Vg(t).map(function(e){return[e,t.get(e)]}):oc(t)?Array.from(t.entries()):tf(t)?t.map(function(e,n){return[n,e]}):Qo(!1)}function SM(t,e,n){if(arguments.length===2&&!oc(t)){Kc();var o=e;try{for(var r in o)SM(t,r,o[r])}finally{Zc()}return}if(rd(t)){var i=t[eo],a=i.values.get(e);a?i.write(e,n):i.addObservableProp(e,n,i.defaultEnhancer)}else if(Ys(t))t.set(e,n);else if(oc(t))t.add(e);else if(tf(t))typeof e!="number"&&(e=parseInt(e,10)),Wv(e>=0,"Not a valid index: '"+e+"'"),Kc(),e>=t.length&&(t.length=e+1),t[e]=n,Zc();else return Qo(!1)}function Q3(t,e,n,o){return VK(t,e,n)}function VK(t,e,n){return Y1(t).observe(e,n)}var WK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tg(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function ch(t,e,n){if(!e.recurseEverything&&!Ug(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yK(t))return ch(t.get(),e,n);Ug(t)&&Vg(t);var o=e.detectCycles===!0;if(o&&t!==null&&n.has(t))return n.get(t);if(tf(t)||Array.isArray(t)){var r=tg(n,t,[],e),i=t.map(function(E){return ch(E,e,n)});r.length=i.length;for(var a=0,s=i.length;a<s;a++)r[a]=i[a];return r}if(oc(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=tg(n,t,new Set,e);return t.forEach(function(E){l.add(ch(E,e,n))}),l}else{var f=tg(n,t,[],e);return t.forEach(function(E){f.push(ch(E,e,n))}),f}if(Ys(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var h=tg(n,t,new Map,e);return t.forEach(function(E,O){h.set(O,ch(E,e,n))}),h}else{var v=tg(n,t,{},e);return t.forEach(function(E,O){v[O]=ch(E,e,n)}),v}var b=tg(n,t,{},e);return C3(t).forEach(function(E){b[E]=ch(t[E],e,n)}),b}function Hc(t,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=WK),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var n;return e.detectCycles&&(n=new Map),ch(t,e,n)}function GK(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var o=zK(t);if(!o)return Qo(!1);o.isTracing===Wd.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled"),o.isTracing=n?Wd.BREAK:Wd.LOG}function zK(t){switch(t.length){case 0:return yr.trackingDerivation;case 1:return Mh(t[0]);case 2:return Mh(t[0],t[1])}}function Yc(t,e){e===void 0&&(e=void 0),Kc();try{return t.apply(e)}finally{Zc()}}function v0(t){return t[eo]}function m0(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"}var HK={has:function(t,e){if(e===eo||e==="constructor"||e===Ow)return!0;var n=v0(t);return m0(e)?n.has(e):e in t},get:function(t,e){if(e===eo||e==="constructor"||e===Ow)return t[e];var n=v0(t),o=n.values.get(e);if(o instanceof ay){var r=o.get();return r===void 0&&n.has(e),r}return m0(e)&&n.has(e),t[e]},set:function(t,e,n){return m0(e)?(SM(t,e,n),!0):!1},deleteProperty:function(t,e){if(!m0(e))return!1;var n=v0(t);return n.remove(e),!0},ownKeys:function(t){var e=v0(t);return e.keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return Qo("Dynamic observable objects cannot be frozen"),!1}};function XK(t){var e=new Proxy(t,HK);return t[eo].proxy=e,e}function Gd(t){return t.interceptors!==void 0&&t.interceptors.length>0}function rb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),T3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function zd(t,e){var n=ly();try{for(var o=EM(t.interceptors||[]),r=0,i=o.length;r<i&&(e=o[r](e),Wv(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);r++);return e}finally{bh(n)}}function Jc(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function ob(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),T3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function Qc(t,e){var n=ly(),o=t.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r<i;r++)o[r](e);bh(n)}}var YK=1e4,qK={get:function(t,e){return e===eo?t[eo]:e==="length"?t[eo].getArrayLength():typeof e=="number"?rp.get.call(t,e):typeof e=="string"&&!isNaN(e)?rp.get.call(t,parseInt(e)):rp.hasOwnProperty(e)?rp[e]:t[e]},set:function(t,e,n){return e==="length"&&t[eo].setArrayLength(n),typeof e=="number"&&rp.set.call(t,e,n),typeof e=="symbol"||isNaN(e)?t[e]=n:rp.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return Qo("Observable arrays cannot be frozen"),!1}};function KK(t,e,n,o){n===void 0&&(n="ObservableArray@"+Hs()),o===void 0&&(o=!1);var r=new eI(n,e,o);Jq(r.values,eo,r);var i=new Proxy(r.values,qK);if(r.proxy=i,t&&t.length){var a=H1(!0);r.spliceWithArray(0,0,t),X1(a)}return i}var eI=(function(){function t(e,n,o){this.owned=o,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new ay(e||"ObservableArray@"+Hs()),this.enhancer=function(r,i){return n(r,i,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ob(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var o=new Array(e-n),r=0;r<e-n;r++)o[r]=void 0;this.spliceWithArray(n,0,o)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},t.prototype.spliceWithArray=function(e,n,o){var r=this;Fg(this.atom);var i=this.values.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),arguments.length===1?n=i-e:n==null?n=0:n=Math.max(0,Math.min(n,i-e)),o===void 0&&(o=Ew),Gd(this)){var a=zd(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:o});if(!a)return Ew;n=a.removedCount,o=a.added}o=o.length===0?o:o.map(function(l){return r.enhancer(l,void 0)});var s=this.spliceItemsIntoValues(e,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(e,o,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(e,n,o){var r;if(o.length<YK)return(r=this.values).splice.apply(r,EM([e,n],o));var i=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(o,this.values.slice(e+n)),i},t.prototype.notifyArrayChildUpdate=function(e,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:o}:null;this.atom.reportChanged(),i&&Qc(this,a)},t.prototype.notifyArraySplice=function(e,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"splice",index:e,removed:o,added:n,removedCount:o.length,addedCount:n.length}:null;this.atom.reportChanged(),i&&Qc(this,a)},t})(),rp={intercept:function(t){return this[eo].intercept(t)},observe:function(t,e){e===void 0&&(e=!1);var n=this[eo];return n.observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[eo];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=this[eo];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(t);case 2:return r.spliceWithArray(t,e)}return r.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){var o=this[eo];return o.spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[eo];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[eo].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[eo];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[eo],n=e.dehanceValues(e.values).indexOf(t);return n>-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[eo];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[eo],o=n.values;if(t<o.length){Fg(n.atom);var r=o[t];if(Gd(n)){var i=zd(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}e=n.enhancer(e,r);var a=e!==r;a&&(o[t]=e,n.notifyArrayChildUpdate(t,e,r))}else if(t===o.length)n.spliceWithArray(t,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(t){typeof Array.prototype[t]=="function"&&(rp[t]=function(){var e=this[eo];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})});["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(t){typeof Array.prototype[t]=="function"&&(rp[t]=function(e,n){var o=this,r=this[eo];r.atom.reportObserved();var i=r.dehanceValues(r.values);return i[t](function(a,s){return e.call(n,a,s,o)},n)})});["reduce","reduceRight"].forEach(function(t){rp[t]=function(){var e=this,n=this[eo];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(r,i,a){return i=n.dehanceValue(i),o(r,i,a,e)},n.values[t].apply(n.values,arguments)}});var ZK=jh("ObservableArrayAdministration",eI);function tf(t){return _M(t)&&ZK(t[eo])}var kk,JK={},AM=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableMap@"+Hs()),this.enhancer=n,this.name=o,this[kk]=JK,this._keysAtom=wM(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!yr.trackingDerivation)return this._has(e);var o=this._hasMap.get(e);if(!o){var r=o=new zv(this._has(e),G1,this.name+"."+gh(e)+"?",!1);this._hasMap.set(e,r),X3(r,function(){return n._hasMap.delete(e)})}return o.get()},t.prototype.set=function(e,n){var o=this._has(e);if(Gd(this)){var r=zd(this,{type:o?"update":"add",object:this,newValue:n,name:e});if(!r)return this;n=r.newValue}return o?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(Fg(this._keysAtom),Gd(this)){var o=zd(this,{type:"delete",object:this,name:e});if(!o)return!1}if(this._has(e)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return Yc(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),i&&Qc(this,o),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var o=this._hasMap.get(e);o&&o.setNewValue(n)},t.prototype._updateValue=function(e,n){var o=this._data.get(e);if(n=o.prepareNewValue(n),n!==yr.UNCHANGED){var r=Zu(),i=Jc(this),a=i||r?{type:"update",object:this,oldValue:o.value,name:e,newValue:n}:null;o.setNewValue(n),i&&Qc(this,a)}},t.prototype._addValue=function(e,n){var o=this;Fg(this._keysAtom),Yc(function(){var s=new zv(n,o.enhancer,o.name+"."+gh(e),!1);o._data.set(e,s),n=s.value,o._updateHasMapEntry(e,!0),o._keysAtom.reportChanged()});var r=Zu(),i=Jc(this),a=i||r?{type:"add",object:this,name:e,newValue:n}:null;i&&Qc(this,a)},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var e=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:e.get(i)}}})},t.prototype.entries=function(){var e=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t.prototype[kk=eo,Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=_g(a.value,2),l=s[0],f=s[1];e.call(n,f,l,this)}}catch(h){o={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},t.prototype.merge=function(e){var n=this;return Ys(e)&&(e=e.toJS()),Yc(function(){var o=H1(!0);try{ry(e)?C3(e).forEach(function(r){return n.set(r,e[r])}):Array.isArray(e)?e.forEach(function(r){var i=_g(r,2),a=i[0],s=i[1];return n.set(a,s)}):iy(e)?(e.constructor!==Map&&Qo("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(r,i){return n.set(i,r)})):e!=null&&Qo("Cannot initialize map from "+e)}finally{X1(o)}}),this},t.prototype.clear=function(){var e=this;Yc(function(){j3(function(){var n,o;try{for(var r=Vd(e.keys()),i=r.next();!i.done;i=r.next()){var a=i.value;e.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},t.prototype.replace=function(e){var n=this;return Yc(function(){var o,r,i,a,s=Zq(e),l=new Map,f=!1;try{for(var h=Vd(n._data.keys()),v=h.next();!v.done;v=h.next()){var b=v.value;if(!s.has(b)){var E=n.delete(b);if(E)f=!0;else{var O=n._data.get(b);l.set(b,O)}}}}catch(I){o={error:I}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}try{for(var w=Vd(s.entries()),S=w.next();!S.done;S=w.next()){var M=_g(S.value,2),b=M[0],O=M[1],T=n._data.has(b);if(n.set(b,O),n._data.has(b)){var $=n._data.get(b);l.set(b,$),T||(f=!0)}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}if(!f)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var D=n._data.keys(),P=l.keys(),B=D.next(),F=P.next();!B.done;){if(B.value!==F.value){n._keysAtom.reportChanged();break}B=D.next(),F=P.next()}n._data=l}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e,n,o={};try{for(var r=Vd(this),i=r.next();!i.done;i=r.next()){var a=_g(i.value,2),s=a[0],l=a[1];o[typeof s=="symbol"?s:gh(s)]=l}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return gh(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t})(),Ys=jh("ObservableMap",AM),Pk,QK={},tI=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableSet@"+Hs()),this.name=o,this[Pk]=QK,this._data=new Set,this._atom=wM(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(r,i){return n(r,i,o)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;Yc(function(){j3(function(){var n,o;try{for(var r=Vd(e._data.values()),i=r.next();!i.done;i=r.next()){var a=i.value;e.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},t.prototype.forEach=function(e,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=a.value;e.call(n,s,s,this)}}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(Fg(this._atom),Gd(this)){var o=zd(this,{type:"add",object:this,newValue:e});if(!o)return this}if(!this.has(e)){Yc(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var r=Zu(),i=Jc(this),o=i||r?{type:"add",object:this,newValue:e}:null;i&&Qc(this,o)}return this},t.prototype.delete=function(e){var n=this;if(Gd(this)){var o=zd(this,{type:"delete",object:this,oldValue:e});if(!o)return!1}if(this.has(e)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:e}:null;return Yc(function(){n._atom.reportChanged(),n._data.delete(e)}),i&&Qc(this,o),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=Array.from(this.keys()),o=Array.from(this.values());return Cw({next:function(){var r=e;return e+=1,r<o.length?{value:[n[r],o[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,o=Array.from(this._data.values());return Cw({next:function(){return n<o.length?{value:e.dehanceValue(o[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return oc(e)&&(e=e.toJS()),Yc(function(){var o=H1(!0);try{Array.isArray(e)?(n.clear(),e.forEach(function(r){return n.add(r)})):tb(e)?(n.clear(),e.forEach(function(r){return n.add(r)})):e!=null&&Qo("Cannot initialize set from "+e)}finally{X1(o)}}),this},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[Pk=eo,Symbol.iterator]=function(){return this.values()},t})(),oc=jh("ObservableSet",tI),nI=(function(){function t(e,n,o,r){n===void 0&&(n=new Map),this.target=e,this.values=n,this.name=o,this.defaultEnhancer=r,this.keysAtom=new ay(o+".keys")}return t.prototype.read=function(e){return this.values.get(e).get()},t.prototype.write=function(e,n){var o=this.target,r=this.values.get(e);if(r instanceof Bg){r.set(n);return}if(Gd(this)){var i=zd(this,{type:"update",object:this.proxy||o,name:e,newValue:n});if(!i)return;n=i.newValue}if(n=r.prepareNewValue(n),n!==yr.UNCHANGED){var a=Jc(this),s=Zu(),i=a||s?{type:"update",object:this.proxy||o,oldValue:r.value,name:e,newValue:n}:null;r.setNewValue(n),a&&Qc(this,i)}},t.prototype.has=function(e){var n=this.pendingKeys||(this.pendingKeys=new Map),o=n.get(e);if(o)return o.get();var r=!!this.values.get(e);return o=new zv(r,G1,this.name+"."+gh(e)+"?",!1),n.set(e,o),o.get()},t.prototype.addObservableProp=function(e,n,o){o===void 0&&(o=this.defaultEnhancer);var r=this.target;if(Gd(this)){var i=zd(this,{object:this.proxy||r,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}var a=new zv(n,o,this.name+"."+gh(e),!1);this.values.set(e,a),n=a.value,Object.defineProperty(r,e,eZ(e)),this.notifyPropertyAddition(e,n)},t.prototype.addComputedProp=function(e,n,o){var r=this.target;o.name=o.name||this.name+"."+gh(n),this.values.set(n,new Bg(o)),(e===r||Qq(e,n))&&Object.defineProperty(e,n,tZ(n))},t.prototype.remove=function(e){if(this.values.has(e)){var n=this.target;if(Gd(this)){var o=zd(this,{object:this.proxy||n,name:e,type:"remove"});if(!o)return}try{Kc();var r=Jc(this),i=Zu(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var o=r||i?{type:"remove",object:this.proxy||n,oldValue:s,name:e}:null;r&&Qc(this,o)}finally{Zc()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.notifyPropertyAddition=function(e,n){var o=Jc(this),r=Zu(),i=o||r?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(o&&Qc(this,i),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var e,n;this.keysAtom.reportObserved();var o=[];try{for(var r=Vd(this.values),i=r.next();!i.done;i=r.next()){var a=_g(i.value,2),s=a[0],l=a[1];l instanceof zv&&o.push(s)}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o},t})();function MM(t,e,n){if(e===void 0&&(e=""),n===void 0&&(n=nb),Object.prototype.hasOwnProperty.call(t,eo))return t[eo];ry(t)||(e=(t.constructor.name||"ObservableObject")+"@"+Hs()),e||(e="ObservableObject@"+Hs());var o=new nI(t,new Map,gh(e),n);return oy(t,eo,o),o}var Rk=Object.create(null),Dk=Object.create(null);function eZ(t){return Rk[t]||(Rk[t]={configurable:!0,enumerable:!0,get:function(){return this[eo].read(t)},set:function(e){this[eo].write(t,e)}})}function jk(t){var e=t[eo];return e||(qv(t),t[eo])}function tZ(t){return Dk[t]||(Dk[t]={configurable:yr.computedConfigurable,enumerable:!1,get:function(){return jk(this).read(t)},set:function(e){jk(this).write(t,e)}})}var nZ=jh("ObservableObjectAdministration",nI);function rd(t){return _M(t)?(qv(t),nZ(t[eo])):!1}function Mh(t,e){if(typeof t=="object"&&t!==null){if(tf(t))return e!==void 0&&Qo(!1),t[eo].atom;if(oc(t))return t[eo];if(Ys(t)){var n=t;if(e===void 0)return n._keysAtom;var o=n._data.get(e)||n._hasMap.get(e);return o||Qo(!1),o}if(qv(t),e&&!t[eo]&&t[e],rd(t)){if(!e)return Qo(!1);var o=t[eo].values.get(e);return o||Qo(!1),o}if(bM(t)||$g(t)||Tw(t))return t}else if(typeof t=="function"&&Tw(t[eo]))return t[eo];return Qo(!1)}function Y1(t,e){if(t||Qo("Expecting some object"),e!==void 0)return Y1(Mh(t,e));if(bM(t)||$g(t)||Tw(t)||Ys(t)||oc(t))return t;if(qv(t),t[eo])return t[eo];Qo(!1)}function rZ(t,e){var n;return e!==void 0?n=Mh(t,e):rd(t)||Ys(t)||oc(t)?n=Y1(t):n=Mh(t),n.name}var Lk=Object.prototype.toString;function rI(t,e,n){return n===void 0&&(n=-1),kA(t,e,n)}function kA(t,e,n,o,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var i=typeof t;if(i!=="function"&&i!=="object"&&typeof e!="object")return!1;var a=Lk.call(t);if(a!==Lk.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Ik(t),e=Ik(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,f=e.constructor;if(l!==f&&!(typeof l=="function"&&l instanceof l&&typeof f=="function"&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),o=o||[],r=r||[];for(var h=o.length;h--;)if(o[h]===t)return r[h]===e;if(o.push(t),r.push(e),s){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!kA(t[h],e[h],n-1,o,r))return!1}else{var v=Object.keys(t),b=void 0;if(h=v.length,Object.keys(e).length!==h)return!1;for(;h--;)if(b=v[h],!(oZ(e,b)&&kA(t[b],e[b],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function Ik(t){return tf(t)?t.slice():iy(t)||Ys(t)||tb(t)||oc(t)?Array.from(t.entries()):t}function oZ(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Cw(t){return t[Symbol.iterator]=iZ,t}function iZ(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:MK,extras:{getDebugName:rZ},$mobx:eo});function aZ(t){return!(t.prototype&&t.prototype.render)&&!ko.isPrototypeOf(t)}function oI(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,o=n===void 0?"":n,r=e.suffix,i=r===void 0?"":r,a=t.displayName||t.name||t.constructor&&t.constructor.name||"<component>";return o+a+i}var Fk=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},iI=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},aI=(function(){function t(e,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}})(),lI=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},sI=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Bk=console;function lZ(t){var e=TA().allowStateChanges;return TA().allowStateChanges=t,e}function sZ(t){TA().allowStateChanges=t}function uZ(t,e,n,o,r){var i=lZ(t),a=void 0;try{a=e(n,o,r)}finally{sZ(i)}return a}function $k(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=t[e],r=uI[e],i=o?n===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function Uk(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":Fk(t))!=="object"||(typeof e>"u"?"undefined":Fk(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var uI={componentWillMount:function(){var e=this,n=oI(this),o=!1,r=!1;function i(v){var b=this[v],E=wM("reactive "+v);Object.defineProperty(this,v,{configurable:!0,enumerable:!0,get:function(){return E.reportObserved(),b},set:function(w){!r&&Uk(b,w)?(b=w,o=!0,E.reportChanged(),o=!1):b=w}})}i.call(this,"props"),i.call(this,"state");var a=this.render.bind(this),s=null,l=!1,f=function(){return s=new A_(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var b=!0;try{r=!0,o||ko.prototype.forceUpdate.call(e),b=!1}finally{r=!1,b&&s.dispose()}}}),s.reactComponent=e,h.$mobx=s,e.render=h,h(e.props,e.state,e.context)},h=function(b,E,O){l=!1;var w=void 0,S=void 0;if(s.track(function(){try{S=uZ(!1,a,b,E,O)}catch(M){w=M}}),w)throw w;return S};this.render=f},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:Uk(this.props,e)}};function TM(t){if(arguments.length>1&&Bk.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&Bk.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aZ(t)){var e,n;return TM((n=e=(function(r){lI(i,r);function i(){return iI(this,i),sI(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return aI(i,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),i})(ko),e.displayName=oI(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var o=t.prototype||t;return cZ(o),t.isMobXReactObserver=!0,t}function cZ(t){$k(t,"componentWillMount",!0),$k(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=uI.shouldComponentUpdate)}var dZ=TM(function(t){var e=t.children;return e[0]()});dZ.displayName="Observer";var fZ=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pZ(t,e){return e={exports:{}},t(e,e.exports),e.exports}pZ(function(t,e){(function(n,o){t.exports=o()})(fZ,(function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,f=l&&l(Object);return function h(v,b,E){if(typeof b!="string"){if(f){var O=l(b);O&&O!==f&&h(v,O,E)}var w=i(b);a&&(w=w.concat(a(b)));for(var S=0;S<w.length;++S){var M=w[S];if(!n[M]&&!o[M]&&(!E||!E[M])){var T=s(b,M);try{r(v,M,T)}catch{}}}return v}return v}}))});var Vk={children:!0,key:!0,ref:!0},Wk=console;(function(t){lI(e,t);function e(){return iI(this,e),sI(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return aI(e,[{key:"render",value:function(o){var r=o.children;return r.length>1?Lr("div",null," ",r," "):r[0]}},{key:"getChildContext",value:function(){var o={},r=this.context.mobxStores;if(r)for(var i in r)o[i]=r[i];for(var a in this.props)!Vk[a]&&a!=="suppressChangedStoreWarning"&&(o[a]=this.props[a]);return{mobxStores:o}}},{key:"componentWillReceiveProps",value:function(o){if(Object.keys(o).length!==Object.keys(this.props).length&&Wk.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!o.suppressChangedStoreWarning)for(var r in o)!Vk[r]&&this.props[r]!==o[r]&&Wk.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(ko);if(!ko)throw new Error("mobx-preact requires Preact to be available");var $d,JO,Gk,cI=[],jl=xo,zk=jl.__b,Hk=jl.__r,Xk=jl.diffed,Yk=jl.__c,qk=jl.unmount,Kk=jl.__;function hZ(){for(var t;t=cI.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(K0),e.__h.some(PA),e.__h=[]}catch(n){e.__h=[],jl.__e(n,t.__v)}}}jl.__b=function(t){$d=null,zk&&zk(t)},jl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Kk&&Kk(t,e)},jl.__r=function(t){Hk&&Hk(t);var e=($d=t.__c).__H;e&&(JO===$d?(e.__h=[],$d.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(K0),e.__h.some(PA),e.__h=[])),JO=$d},jl.diffed=function(t){Xk&&Xk(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(cI.push(e)!==1&&Gk===jl.requestAnimationFrame||((Gk=jl.requestAnimationFrame)||vZ)(hZ)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=$d=null},jl.__c=function(t,e){e.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||PA(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],jl.__e(o,n.__v)}}),Yk&&Yk(t,e)},jl.unmount=function(t){qk&&qk(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{K0(o)}catch(r){e=r}}),n.__H=void 0,e&&jl.__e(e,n.__v))};var Zk=typeof requestAnimationFrame=="function";function vZ(t){var e,n=function(){clearTimeout(o),Zk&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);Zk&&(e=requestAnimationFrame(n))}function K0(t){var e=$d,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),$d=e}function PA(t){var e=$d;t.__c=t.__(),$d=e}function mZ(t,e){for(var n in e)t[n]=e[n];return t}function Jk(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function Qk(t,e){this.props=t,this.context=e}(Qk.prototype=new ko).isPureReactComponent=!0,Qk.prototype.shouldComponentUpdate=function(t,e){return Jk(this.props,t)||Jk(this.state,e)};var eP=xo.__b;xo.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),eP&&eP(t)};var gZ=xo.__e;xo.__e=function(t,e,n,o){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}gZ(t,e,n,o)};var tP=xo.unmount;function dI(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=mZ({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return dI(o,e,n)})),t}function fI(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return fI(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function QO(){this.__u=0,this.o=null,this.__b=null}function pI(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function g0(){this.i=null,this.l=null}xo.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),tP&&tP(t)},(QO.prototype=new ko).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=pI(o.__v),i=!1,a=function(){i||o.__z||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(!--o.__u){if(o.state.__a){var f=o.state.__a;o.__v.__k[0]=fI(f,f.__c.__P,f.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.o.pop();)h.__P=s,h.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},QO.prototype.componentWillUnmount=function(){this.o=[]},QO.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=dI(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Lr(jg,null,t.fallback);return r&&(r.__u&=-33),[Lr(jg,null,e.__a?null:t.children),r]};var nP=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(g0.prototype=new ko).__a=function(t){var e=this,n=pI(e.__v),o=e.l.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),nP(e,t,o)):r()};n?n(i):i()}},g0.prototype.render=function(t){this.i=null,this.l=new Map;var e=ww(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},g0.prototype.componentDidUpdate=g0.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){nP(t,n,e)})};var yZ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_Z=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bZ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,wZ=/[A-Z0-9]/g,EZ=typeof document<"u",xZ=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function rP(t,e,n){return e.__k==null&&(e.textContent=""),Yq(t,e),typeof n=="function"&&n(),t?t.__c:null}ko.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ko.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var oP=xo.event;function OZ(){}function SZ(){return this.cancelBubble}function AZ(){return this.defaultPrevented}xo.event=function(t){return oP&&(t=oP(t)),t.persist=OZ,t.isPropagationStopped=SZ,t.isDefaultPrevented=AZ,t.nativeEvent=t};var MZ={enumerable:!1,configurable:!0,get:function(){return this.class}},iP=xo.vnode;xo.vnode=function(t){typeof t.type=="string"&&(function(e){var n=e.props,o=e.type,r={},i=o.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||EZ&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||xZ(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":bZ.test(a)&&(a=l):l=a="oninput":i&&_Z.test(a)?a=a.replace(wZ,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&r[a=l]&&(a="oninputCapture"),r[a]=s}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.value.indexOf(f.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.multiple?r.defaultValue.indexOf(f.props.value)!=-1:r.defaultValue==f.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",MZ)):n.className&&(r.class=r.className=n.className),e.props=r})(t),t.$$typeof=yZ,iP&&iP(t)};var aP=xo.__r;xo.__r=function(t){aP&&aP(t),t.__c};var lP=xo.diffed;xo.diffed=function(t){lP&&lP(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var TZ=0;function $t(t,e,n,o,r,i){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var f={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TZ,__i:-1,__u:0,__source:r,__self:i};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return xo.vnode&&xo.vnode(f),f}var CZ=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},M_;(function(t){function e(n){var o=CZ(n,[]),r=n.container;if(!r)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Xo({},t.defaults,o)}t.get=e})(M_||(M_={}));(function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(M_||(M_={}));var sP={node:!1,edge:!1},NZ={node:!0,edge:!0},kZ=function(t){return!t||typeof t=="boolean"?t===!0?to(NZ):to(sP):Yv(to(sP),t)},PZ=function(){return om(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function Jl(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}var y0=200,RZ=9999,DZ=10,Wo;(function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Wo||(Wo={}));var da;(function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"})(da||(da={}));var _o;(function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"})(_o||(_o={}));var pr;(function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_FOCUS="node:focus",t.NODE_BLUR="node:blur",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_FOCUS="edge:focus",t.EDGE_BLUR="edge:blur",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_CLICK="anchor:click",t.ANCHOR_MOUSEDOWN="anchor:mousedown",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated",t.EDIT_CONFIG_CHANGED="editConfig:changed"})(pr||(pr={}));var vl;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(vl||(vl={}));var ni;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(ni||(ni={}));var Ju;(function(t){t.TEXT="text",t.LABEL="label"})(Ju||(Ju={}));var jZ=0,ac=(function(){function t(e){var n=e.onDragStart,o=n===void 0?Qy:n,r=e.onDragging,i=r===void 0?Qy:r,a=e.onDragEnd,s=a===void 0?Qy:a,l=e.eventType,f=l===void 0?"":l,h=e.eventCenter,v=e.step,b=v===void 0?1:v,E=e.isStopPropagation,O=E===void 0?!0:E,w=e.model,S=e.data,M=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(T){var $,D,P=window==null?void 0:window.document;if(T.button===jZ){M.isStopPropagation&&T.stopPropagation(),M.isStartDragging=!0,M.startX=T.clientX,M.startY=T.clientY,P.addEventListener("mousemove",M.handleMouseMove,!1),P.addEventListener("mouseup",M.handleMouseUp,!1);var B=($=M.model)===null||$===void 0?void 0:$.getData();(D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_MOUSEDOWN")],{e:T,data:M.data||B}),M.startTime=new Date().getTime()}},this.handleMouseMove=function(T){var $,D;if(M.isStopPropagation&&T.stopPropagation(),!!M.isStartDragging&&(M.sumDeltaX+=T.clientX-M.startX,M.sumDeltaY+=T.clientY-M.startY,M.startX=T.clientX,M.startY=T.clientY,M.step<=1||Math.abs(M.sumDeltaX)>M.step||Math.abs(M.sumDeltaY)>M.step)){var P=M.sumDeltaX%M.step,B=M.sumDeltaY%M.step,F=M.sumDeltaX-P,I=M.sumDeltaY-B;M.sumDeltaX=P,M.sumDeltaY=B;var V=($=M.model)===null||$===void 0?void 0:$.getData();M.isDragging||((D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_DRAGSTART")],{e:T,data:M.data||V}),M.onDragStart({event:T})),M.isDragging=!0,Promise.resolve().then(function(){var z,X;M.onDragging({deltaX:F,deltaY:I,event:T}),(z=M.eventCenter)===null||z===void 0||z.emit(pr["".concat(M.eventType,"_MOUSEMOVE")],{deltaX:F,deltaY:I,e:T,data:M.data||V}),(X=M.eventCenter)===null||X===void 0||X.emit(pr["".concat(M.eventType,"_DRAG")],{e:T,data:M.data||V})})}},this.handleMouseUp=function(T){var $=window.document;M.isStartDragging=!1,M.isStopPropagation&&T.stopPropagation(),Promise.resolve().then(function(){var D,P,B;$.removeEventListener("mousemove",M.handleMouseMove,!1),$.removeEventListener("mouseup",M.handleMouseUp,!1);var F=(D=M.model)===null||D===void 0?void 0:D.getData();(P=M.eventCenter)===null||P===void 0||P.emit(pr["".concat(M.eventType,"_MOUSEUP")],{e:T,data:M.data||F}),M.isDragging&&(M.isDragging=!1,M.onDragEnd({event:T}),(B=M.eventCenter)===null||B===void 0||B.emit(pr["".concat(M.eventType,"_DROP")],{e:T,data:M.data||F}))})},this.cancelDrag=function(){var T=window==null?void 0:window.document;T.removeEventListener("mousemove",M.handleMouseMove,!1),T.removeEventListener("mouseup",M.handleMouseUp,!1),M.onDragEnd({event:void 0}),M.isDragging=!1},this.destroy=function(){M.isStartDragging&&M.cancelDrag()},this.onDragStart=o,this.onDragging=i,this.onDragEnd=s,this.step=b,this.isStopPropagation=O,this.eventType=f,this.eventCenter=h,this.model=w,this.data=S}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t})(),LZ=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}},IZ=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},FZ=function(t){var e=t.points,n=Kv(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},BZ=function(t){var e=t.path,n=CM(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},$Z=function(t){if(t.modelType===_o.LINE_EDGE)return IZ(t);if(t.modelType===_o.POLYLINE_EDGE)return FZ(t);if(t.modelType===_o.BEZIER_EDGE)return BZ(t)},UZ=function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(r===0)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0?{x:i,y:a}:!1},T_=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=n.x,l=n.y,f=(l-a)/(s-i),h=a-f*i;return(o>=i&&o<=s||o<=i&&o>=s)&&(r>=a&&r<=l||r<=a&&r>=l)&&Math.abs(r-f*o-h)<Number.EPSILON},C_=function(t){var e=t.start,n=t.end,o=t.offset,r=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),l=Math.atan(o/r),f=Math.sqrt(r*r+o*o);return i==="start"?n.x>=e.x?(a.leftX=e.x+f*Math.sin(s+l),a.leftY=e.y-f*Math.cos(s+l),a.rightX=e.x-f*Math.sin(s-l),a.rightY=e.y+f*Math.cos(s-l)):(a.leftX=e.x-f*Math.sin(s+l),a.leftY=e.y+f*Math.cos(s+l),a.rightX=e.x+f*Math.sin(s-l),a.rightY=e.y-f*Math.cos(s-l)):i==="end"&&(n.x>=e.x?(a.leftX=n.x+f*Math.sin(s-l),a.leftY=n.y-f*Math.cos(s-l),a.rightX=n.x-f*Math.sin(s+l),a.rightY=n.y+f*Math.cos(s+l)):(a.leftX=n.x-f*Math.sin(s-l),a.leftY=n.y+f*Math.cos(s-l),a.rightX=n.x+f*Math.sin(s+l),a.rightY=n.y-f*Math.cos(s+l))),a},bg=function(){return bg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},bg.apply(this,arguments)},Yu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yh=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},VZ=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},RA=function(t){var e=[],n={};return t.forEach(function(o){var r="".concat(o.x,"-").concat(o.y);o.id=r,n[r]=o}),Object.keys(n).forEach(function(o){e.push(n[o])}),e},Nw=function(t,e){return t.width===0&&t.height===0?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},WZ=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?ni.HORIZONTAL:ni.VERTICAL},kw=function(t,e,n){var o=WZ(n,e);return o===ni.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},uP=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},N_=function(t,e){t===void 0&&(t=[]);var n=[],o=[];t.forEach(function(h){n.push(h.x),o.push(h.y)});var r=Math.min.apply(Math,yh([],Yu(n),!1)),i=Math.max.apply(Math,yh([],Yu(n),!1)),a=Math.min.apply(Math,yh([],Yu(o),!1)),s=Math.max.apply(Math,yh([],Yu(o),!1)),l=i-r,f=s-a;return e&&(l+=e,f+=e),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:f,width:l}},Pw=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},_0=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},GZ=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},zZ=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},HZ=function(t,e){return yh(yh([],Yu(GZ(t,e.x)),!1),Yu(zZ(t,e.y)),!1)},DA=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},XZ=function(t,e){var n=-2,o=0;return e.forEach(function(r){r&&(t.x===r.x&&(o+=n),t.y===r.y&&(o+=n))}),o},cP=function(t,e,n,o,r){return DA(t,e)+DA(t,n)+XZ(t,[e,n,o,r])},hI=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&hI(t,e,n,n[o],r+1)},YZ=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Hy=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*s),f=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&f>=0&&f<=1},dP=function(t,e,n){if(n.width===0&&n.height===0)return!1;var o=Yu(Pw(n),4),r=o[0],i=o[1],a=o[2],s=o[3];return Hy(t,e,r,i)||Hy(t,e,r,s)||Hy(t,e,i,a)||Hy(t,e,a,s)},qZ=function(t,e,n,o){var r=[];return t.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!dP(i,e,n)&&!dP(i,e,o)&&r.push(i)}),RA(r)},KZ=function(t,e,n,o,r,i,a){var s=[],l=[e],f={},h={},v={};e.id&&(h[e.id]=0,v[e.id]=cP(e,n,e));var b={};t.forEach(function(w){w.id&&(b[w.id]=w)});for(var E=function(){var w,S=1/0;if(l.forEach(function(T){T.id&&v[T.id]<S&&(S=v[T.id],w=T)}),w===n&&n.id){var M=[];return hI(M,b,f,n.id),{value:M}}if(!w)return{value:[e,n]};YZ(l,w),s.push(w),qZ(t,w,o,r).forEach(function(T){var $;if(s.indexOf(T)===-1&&(l.indexOf(T)===-1&&l.push(T),w!=null&&w.id&&(T!=null&&T.id))){var D=(($=h[w.id])!==null&&$!==void 0?$:0)+DA(w,T);if(h[T.id]&&D>=h[T.id])return;f[T.id]=w.id,h[T.id]=D,v[T.id]=h[T.id]+cP(T,n,e,i,a)}})};l.length;){var O=E();if(typeof O=="object")return O.value}return[e,n]},fP=function(t){return gu(t)},vI=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],r=t[e+1];n.x===o.x&&o.x===r.x||n.y===o.y&&o.y===r.y?t.splice(e,1):e++}return t},pP=function(t,e,n,o,r){var i=fP(n),a=fP(o),s=Nw(i,r),l=Nw(a,r),f=kw(s,i,t),h=kw(l,a,e);if(VZ(s,l)){var v=JZ(t,e,f,h);return yh(yh([t,f],Yu(v),!1),[h,e],!1)}var b=N_([f,h]),E=uP(s,b),O=uP(l,b),w=[];w=w.concat(Pw(E)),w=w.concat(Pw(O));var S={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[b,E,O].forEach(function(T){w=w.concat(HZ(T,S).filter(function($){return _0($,s)&&_0($,l)}))}),[{x:f.x,y:h.y},{x:h.x,y:f.y}].forEach(function(T){_0(T,s)&&_0(T,l)&&w.push(T)}),w.unshift(f),w.push(h),w=RA(w);var M=KZ(w,f,h,i,a,t,e);return M.unshift(t),M.push(e),M.length>2&&(M=vI(M)),RA(M)},ZZ=function(t){if(t.length===1){var e=Yu(t,1),n=e[0];return[n,n]}else{for(var o=t[0],r=t[1],i=qc(o.x,o.y,r.x,r.y),a=1;a<t.length-1;a++){var s=t[a],l=t[a+1],f=qc(s.x,s.y,l.x,l.y);f>i&&(i=f,o=s,r=l)}return[o,r]}},hP=function(t,e,n){var o=ip(t,n),r=ip(e,n);return o&&r},vP=function(t,e,n){var o=ip(t,n),r=ip(e,n),i=o&&r,a=o||r;return!i&&a},mP=function(t,e,n){for(var o=void 0,r=gu(n),i=Pw(r),a=0;a<i.length;a++){var s=Hy(t,e,i[a],i[(a+1)%i.length]);s&&(o=[i[a],i[(a+1)%i.length]])}if(o)return UZ(t,e,o[0],o[1])},Rw=function(t,e){var n=void 0;return t.x===e.x?n=ni.VERTICAL:t.y===e.y&&(n=ni.HORIZONTAL),n},Kv=function(t){var e=t.split(" "),n=[];return e&&e.forEach(function(o){var r=Yu(o.split(","),2),i=r[0],a=r[1];n.push({x:Number(i),y:Number(a)})}),n},JZ=function(t,e,n,o){var r=[],i=Rw(t,n),a=Rw(e,o);if(i===a)t.y===n.y?(r.push({x:n.x,y:(n.y+o.y)/2}),r.push({x:o.x,y:(n.y+o.y)/2})):(r.push({x:(n.x+o.x)/2,y:n.y}),r.push({x:(n.x+o.x)/2,y:o.y}));else{var s={x:n.x,y:o.y},l=T_(s,t,n),f=T_(s,e,o);if(l||f)s={x:o.x,y:n.y};else{var h=gP(s,t,n),v=gP(s,e,o);h&&v&&(s={x:o.x,y:n.y})}r.push(s)}return r},gP=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},mI=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:o>=1&&o<=126||o>=65376&&o<=65439?e+=1:e+=2}return e},QZ=function(t){var e=t.start,n=t.end,o;if(e.x===n.x&&e.y===n.y)o="";else{var r={start:e,end:n,offset:10,verticalLength:5},i=C_(bg(bg({},r),{type:"start"})),a=C_(bg(bg({},r),{type:"end"}));o="M".concat(i.leftX," ").concat(i.leftY,`
|
||
L`).concat(i.rightX," ").concat(i.rightY,`
|
||
L`).concat(a.rightX," ").concat(a.rightY,`
|
||
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},yP=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=gu(o),s=gu(r),l=Nw(a,i),f=Nw(s,i),h=kw(l,a,e),v=kw(f,s,n);return{sNext:h,ePre:v}},CM=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=b0(e[0]),o=b0(e[1]),r=b0(e[2]),i=b0(e[3]);return[n,o,r,i]},b0=function(t){var e=Yu(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],o=e[1];return{x:+n,y:+o}},_P=function(t,e){var n=Yu(t,4),o=n[0],r=n[1],i=n[2],a=n[3],s=WJ(o,r,i,a,e);return[s,t[3]]},gI=function(t,e){for(var n=t.x,o=t.y,r=Kv(e),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach(function(b){var E=b.start,O=b.end;if(E.x===O.x){var w={x:E.x,y:o},S=T_(w,E,O);if(S){var M=Math.abs(E.x-n);M<i&&(i=M,a=w)}}else if(E.y===O.y){var w={x:n,y:E.y},S=T_(w,E,O);if(S){var M=Math.abs(E.y-o);M<i&&(i=M,a=w)}}}),!a){var f=s[0],h=f.start,v=f.end;a={x:h.x+(v.x-h.x)/2,y:h.y+(v.y-h.y)/2}}return a},eJ=function(t){return Vv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},bP=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function tJ(t,e){return typeof e!="function"?function(n,o,r){return Object.assign({type:t.edgeType},r)}:function(n,o,r){var i=e(n,o,r);return i?typeof i=="string"?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:t.edgeType}}}var nJ=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return ri(e,function(i){var a=mI(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},ng=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},w0=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};function Wg(t,e,n){return n&&e*Math.round(t/e)||t}function rJ(t,e,n){if(!t)return[];var o=Math.min.apply(Math,w0([],ng(t.map(function(w){return w[0]})),!1)),r=Math.max.apply(Math,w0([],ng(t.map(function(w){return w[0]})),!1)),i=Math.min.apply(Math,w0([],ng(t.map(function(w){return w[1]})),!1)),a=Math.max.apply(Math,w0([],ng(t.map(function(w){return w[1]})),!1)),s=-o,l=-i,f=t.map(function(w){var S=ng(w,2),M=S[0],T=S[1];return[M+s,T+l]}),h=r-o,v=a-i,b=e?e/h:1,E=n?n/v:1,O=Math.min(b,E);return f.map(function(w){var S=ng(w,2),M=S[0],T=S[1];return[M*O,T*O]})}var eS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tS=function(t,e,n){var o=eS(t,2),r=o[0],i=o[1],a=eS(e,2),s=a[0],l=a[1],f=eS(n,2),h=f[0],v=f[1];return r>s&&r<h&&i>l&&i<v},yI=function(t,e){var n=e.multipleSelectKey,o=!1;switch(n){case"meta":o=t.metaKey;break;case"alt":o=t.altKey;break;case"shift":o=t.shiftKey;break;case"ctrl":o=t.ctrlKey;break;default:o=!1;break}return o},NM=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();function wP(t,e){return t instanceof Il&&e instanceof Il}var _I=(function(t){NM(e,t);function e(n,o,r){var i=t.call(this,3)||this;return i[0]=n,i[1]=o,i[2]=r,i.x=n,i.y=o,i.z=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.add=function(n){if(wP(this,n))return new Il(this.x+n.x,this.y+n.y);var o=this.z+n.z;return new jA((this.x+n.x)/o,(this.y+n.y)/o)},e.prototype.subtract=function(n){if(wP(this,n))return new Il(this.x-n.x,this.y-n.y);var o=this.z-n.z;return o===0?new Il(this.x-n.x,this.y-n.y):new jA((this.x-n.x)/o,(this.y-n.y)/o)},e})(Array),Il=(function(t){NM(e,t);function e(n,o,r){var i=t.call(this,n,o,r??0)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(n){var o=this;return n.reduce(function(r,i,a){return r+i*o[a]})},e.prototype.cross=function(n){return new e(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var n=this.getLength();return new e(this.x/n,this.y/n)},e.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},e.prototype.angle=function(n){var o=this.crossZ(n),r=Math.acos(this.normalize().dot(n.normalize()));return o>=0?r:-r},e})(_I),jA=(function(t){NM(e,t);function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.toString=function(){return"Point"},e})(_I),q1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),rg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},nS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ib=(function(t){q1(e,t);function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.call(this,n.length)||this;return r.fill(new Array(3)),n.forEach(function(i,a){r[a]=i}),r.columns=n[0].length,r.rows=n.length,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.getRow=function(n){return this[n]},e.prototype.getColumn=function(n){return nS([],rg(this.map(function(o){return o[n]})),!1)},e.prototype.transpose=function(){for(var n=[],o=0;o<this.columns;o++)n.push(this.getColumn(o));return new(e.bind.apply(e,nS([void 0],rg(n),!1)))},e.prototype.cross=function(n){var o=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var r=0;r<this.rows;r++)for(var i=this.getRow(r),a=function(l){var f=n.getColumn(l);o[r][l]=i.reduce(function(h,v,b){return h+v*f[b]},0)},s=0;s<n.columns;s++)a(s);return new(e.bind.apply(e,nS([void 0],rg(o),!1)))},e.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},e.prototype.toPoints=function(){return this.map(function(n){return new jA(n[0],n[1])})},e.prototype.toString=function(){var n=rg(this[0],2),o=n[0],r=n[1],i=rg(this[1],2),a=i[0],s=i[1],l=rg(this[2],2),f=l[0],h=l[1];return"matrix(".concat(o," ").concat(r," ").concat(a," ").concat(s," ").concat(f," ").concat(h,")")},e.prototype.translate=function(n,o){return this.cross(new Dw(n,o))},e.prototype.rotate=function(n){return this.cross(new oJ(n))},e.prototype.scale=function(n,o){return this.cross(new iJ(n,o))},e})(Array),oJ=(function(t){q1(e,t);function e(n){var o=t.call(this,new Il(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Il(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Il(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.inverse=function(){return this.transpose()},e})(ib),iJ=(function(t){q1(e,t);function e(n,o){var r=t.call(this,new Il(n,0,0),new Il(0,o,0),new Il(0,0,1))||this;return r.sx=n,r.sy=o,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e})(ib),Dw=(function(t){q1(e,t);function e(n,o){var r=t.call(this,new Il(1,0,0),new Il(0,1,0),new Il(n,o,1))||this;return r.tx=n,r.ty=o,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e})(ib);LK({});var jw=function(){return jw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},jw.apply(this,arguments)},aJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LA=function(t){var e=t.anchors;return e},Lw=function(t,e){for(var n=e.nodes,o,r=n.length-1;r>=0;r--){var i=n[r],a=uJ(t,i);if(a){var s=i.getTargetAnchor(t);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!o||lJ(i,o.node,e))&&(o=l)}}}return o},lJ=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},sJ=function(t,e){for(var n=LA(e),o,r=Number.MAX_SAFE_INTEGER,i=0;i<n.length;i++){var a=qc(t.x,t.y,n[i].x,n[i].y);a<r&&(r=a,o={index:i,anchor:jw(jw({},n[i]),{x:n[i].x,y:n[i].y,id:n[i].id})})}return o},qc=function(t,e,n,o){return Math.hypot(t-n,e-o)},ip=function(t,e,n){n===void 0&&(n=0);var o=!1,r=gu(e),i=aJ(new ib([t.x,t.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=i[0],s=i[1],l={x:a,y:s};return l.x>=r.minX-n&&l.x<=r.maxX+n&&l.y>=r.minY-n&&l.y<=r.maxY+n&&(o=!0),o},uJ=function(t,e){return ip(t,e,5)},gu=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},cJ=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]},EP=function(t,e,n){var o=cJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var s=qc(t.x,t.y,a.x,a.y);s<i&&(i=s,r=a)}),IA(t,e,r)},IA=function(t,e,n){var o,r=n.x,i=n.y,a=n.r;if(e===ni.HORIZONTAL){var s=r-Math.sqrt(a*a-(t.y-i)*(t.y-i)),l=r+Math.sqrt(a*a-(t.y-i)*(t.y-i)),f=Math.abs(s-t.x)<Math.abs(l-t.x)?s:l;o={x:f,y:t.y}}else if(e===ni.VERTICAL){var h=i-Math.sqrt(a*a-(t.x-r)*(t.x-r)),v=i+Math.sqrt(a*a-(t.x-r)*(t.x-r)),b=Math.abs(h-t.y)<Math.abs(v-t.y)?h:v;o={x:t.x,y:b}}return o},xP=function(t,e){var n=e,o=!1,r=n.x,i=n.y,a=n.width,s=n.height,l=n.radius,f={minX:r-a/2+l,maxX:r+a/2-l,minY:i-s/2+l,maxY:i+s/2-l};return t.y===i+s/2||t.y===i-s/2?o=t.x>f.minX&&t.x<f.maxX:(t.x===r+a/2||t.x===r-a/2)&&(o=t.y>f.minY&&t.y<f.maxY),o},OP=function(t,e,n){var o,r=n,i=r.x,a=r.y,s=r.rx,l=r.ry;if(e===ni.HORIZONTAL){var f=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),h=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),v=Math.abs(f-t.x)<Math.abs(h-t.x)?f:h;o={x:v,y:t.y}}else if(e===ni.VERTICAL){var b=a-Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),E=a+Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),O=Math.abs(b-t.y)<Math.abs(E-t.y)?b:E;o={x:t.x,y:O}}return o},E0=function(t,e,n){for(var o=n.pointsPosition,r=Number.MAX_SAFE_INTEGER,i,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach(function(l){var f=l.start,h=l.end,v=f,b=h;f.x>h.x&&(v=h,b=f);var E={x:t.x,y:t.y};if(v.x===b.x&&e===ni.HORIZONTAL&&(E={x:v.x,y:t.y}),v.y===b.y&&e===ni.VERTICAL&&(E={x:t.x,y:v.y}),v.x!==b.x&&v.y!==b.y){var O=(b.y-v.y)/(b.x-v.x),w=(v.x*b.y-b.x*v.y)/(v.x-b.x);e===ni.HORIZONTAL?E={x:(t.y-w)/O,y:t.y}:e===ni.VERTICAL&&(E={x:t.x,y:O*t.x+w})}var S=T_(E,f,h);if(S){var M=qc(E.x,E.y,t.x,t.y);M<r&&(r=M,i=E)}}),i},dJ=function(t){var e=Vv(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},SP=function(t,e,n,o){var r=t.x,i=t.y;return e.x>t.x?r=t.x+n/2:e.x<t.x&&(r=t.x-n/2),e.y>t.y?i=t.y+o/2:e.y<t.y&&(i=t.y-o/2),{x:r,y:i}},bI=function(t){var e=t.rows,n=t.style,o=t.rowsLength,r=t.className,i=document.createElement("div");i.className=r,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),o>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},AP=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach(function(i){var a=mI(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},Iw=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let x0;const fJ=new Uint8Array(16);function pJ(){if(!x0&&(x0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!x0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return x0(fJ)}const Rl=[];for(let t=0;t<256;++t)Rl.push((t+256).toString(16).slice(1));function hJ(t,e=0){return Rl[t[e+0]]+Rl[t[e+1]]+Rl[t[e+2]]+Rl[t[e+3]]+"-"+Rl[t[e+4]]+Rl[t[e+5]]+"-"+Rl[t[e+6]]+Rl[t[e+7]]+"-"+Rl[t[e+8]]+Rl[t[e+9]]+"-"+Rl[t[e+10]]+Rl[t[e+11]]+Rl[t[e+12]]+Rl[t[e+13]]+Rl[t[e+14]]+Rl[t[e+15]]}const vJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MP={randomUUID:vJ};function mJ(t,e,n){if(MP.randomUUID&&!t)return MP.randomUUID();t=t||{};const o=t.random||(t.rng||pJ)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,hJ(o)}var wh=function(){return mJ()},t_=new Map,wI=function(t){var e=wh();function n(){t();var r=t_.get(e);if(r){var i=window.requestAnimationFrame(n);t_.set(e,i)}}var o=window.requestAnimationFrame(n);return t_.set(e,o),e},Fw=function(t){var e=t_.get(t);e&&(window.cancelAnimationFrame(e),t_.delete(t))},k_=function(){return k_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},k_.apply(this,arguments)},gJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function EI(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,f=l===void 0?"currentColor":l,h=t.overflowMode,v=h===void 0?"default":h,b=t.textWidth,E=b===void 0?void 0:b,O=t.model,w={x:n,y:r,fill:f,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(ri(pp(t),function(P){var B=gJ(P,2),F=B[0],I=B[1];typeof I!="object"&&(w[F]=I)}),i){var S=String(i).split(/[\r\n]/g),M=S.length;if(v!=="default"){var T=O.BaseType,$=O.modelType;if(T===da.NODE&&$!==_o.TEXT_NODE||T===da.EDGE&&E)return yJ(t)}if(M>1){var D=S.map(function(P,B){var F=s+2,I=(B-(M-1)/2)*F;return $t("tspan",{className:"lf-text-tspan",x:n,y:r+I,children:P})});return $t("text",k_({},w,{children:D}))}return $t("text",k_({},w,{children:i}))}return null}function yJ(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,f=t.fontFamily,h=f===void 0?"":f,v=t.wrapPadding,b=v===void 0?"0, 0":v,E=t.overflowMode,O=r.width,w=r.height,S=r.textHeight,M=i||O,T=String(o).split(/[\r\n]/g),$=T.length,D=bI({rows:T,style:{fontSize:"".concat(s,"px"),width:"".concat(M,"px"),fontFamily:h,lineHeight:l,padding:b},rowsLength:$,className:"lf-get-text-height"}),P=w>D?w:D;S&&(P=S);var B=E==="ellipsis";return B&&(P=s+2),$t("g",{children:$t("foreignObject",{width:M,height:P,x:e-M/2,y:n-P/2,style:{overflow:"visible",textAlign:"left"},children:$t("div",{className:"lf-node-text-auto-wrap",style:{minHeight:P,width:M,padding:b},children:$t("div",{className:B?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:B?T.join(""):"",style:k_({},t),children:T.map(function(F){return $t("div",{className:"lf-node-text--auto-wrap-inner",children:F})})})})})})}var FA=function(){return FA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},FA.apply(this,arguments)},_J=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Gg(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(pp(t),function(n){var o=_J(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("line",FA({},e))}var BA=function(){return BA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},BA.apply(this,arguments)},bJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function qu(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,f=e-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(pp(t),function(b){var E=bJ(b,2),O=E[0],w=E[1];typeof w!="object"&&(v[O]=w)}),i?v.className="lf-basic-shape ".concat(i):v.className="lf-basic-shape",l&&(v.rx=l,v.ry=l),v.x=f,v.y=h,$t("rect",BA({},v))}var $A=function(){return $A=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},$A.apply(this,arguments)},wJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function P_(t){var e={d:""};return ri(pp(t),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("path",$A({},e))}var UA=function(){return UA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},UA.apply(this,arguments)},EJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zg(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.r,a=i===void 0?4:i,s=t.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(f){var h=EJ(f,2),v=h[0],b=h[1];typeof b!="object"&&(l[v]=b)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",$t("circle",UA({},l))}var VA=function(){return VA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},VA.apply(this,arguments)},xJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function OJ(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.rx,a=i===void 0?4:i,s=t.ry,l=s===void 0?4:s,f=t.className,h={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(v){var b=xJ(v,2),E=b[0],O=b[1];typeof O!="object"&&(h[E]=O)}),f?h.className="lf-basic-shape ".concat(f):h.className="lf-basic-shape",$t("ellipse",VA({},h))}var Bw=function(){return Bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bw.apply(this,arguments)},SJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function AJ(t,e){var n=t.map(function(T){return{x:T[0],y:T[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(e),i="",a=0;a<o;a++){var s=n[(a-1+o)%o],l=n[a],f=n[(a+1)%o],h={x:l.x-s.x,y:l.y-s.y},v={x:f.x-l.x,y:f.y-l.y},b=Math.hypot(h.x,h.y),E=Math.hypot(v.x,v.y),O={x:h.x/b,y:h.y/b},w={x:v.x/E,y:v.y/E},S={x:l.x-O.x*r,y:l.y-O.y*r},M={x:l.x+w.x*r,y:l.y+w.y*r};a===0?i+="M ".concat(S.x," ").concat(S.y," "):i+="L ".concat(S.x," ").concat(S.y," "),i+="Q ".concat(l.x," ").concat(l.y," ").concat(M.x," ").concat(M.y," ")}return i+="Z",i}function kM(t){var e=t.points,n=e===void 0?[]:e,o=t.className,r=t.radius,i={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(ri(pp(t),function(s){var l=SJ(s,2),f=l[0],h=l[1];typeof h!="object"&&(i[f]=h)}),o?i.classNmae="lf-basic-shape ".concat(o):i.className="lf-basic-shape",r){var a=AJ(n,r);return i.d=a,$t("path",Bw({},i))}else return i.points=n.map(function(s){return s.join(",")}).join(" "),$t("polygon",Bw({},i))}var WA=function(){return WA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},WA.apply(this,arguments)},MJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function TJ(t){var e=t.className,n={points:"",fill:"none"};return ri(pp(t),function(o){var r=MJ(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(n[i]=a)}),e&&(n.className="".concat(e)),$t("polyline",WA({},n))}var xI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),R_=function(){return R_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},R_.apply(this,arguments)},CJ=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},NJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ho;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(Ho||(Ho={}));var kJ=(function(t){xI(e,t);function e(n){var o=t.call(this)||this;o.isShiftPressed=!1,o.bindKeyboardEvents=function(){document.addEventListener("keydown",o.handleKeyDown),document.addEventListener("keyup",o.handleKeyUp)},o.handleKeyDown=function(s){s.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(s){s.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var s=o.nodeModel,l=s.id,f=s.anchors,h=o.graphModel.getNodeEdges(l);ri(h,function(v){if(v.sourceNodeId===l){var b=Sh(f,function(E){return E.id===v.sourceAnchorId});b&&v.updateStartPoint({x:b.x,y:b.y})}else if(v.targetNodeId===l){var b=Sh(f,function(O){return O.id===v.targetAnchorId});b&&v.updateEndPoint({x:b.x,y:b.y})}})},o.triggerResizeEvent=function(s,l,f,h,v,b){o.graphModel.eventCenter.emit(pr.NODE_RESIZE,{preData:s,data:l,deltaX:f,deltaY:h,index:v,model:b})},o.recalcResizeInfo=function(s,l,f,h,v){f===void 0&&(f=1),h===void 0&&(h=!1),v===void 0&&(v=!1);var b=to(l),E=b.deltaX,O=b.deltaY,w=b.width,S=b.height,M=b.PCTResizeInfo;if(M){var T=4,$=0,D=0;switch(s){case Ho.LEFT_TOP:D=(E*-1-O)/T;break;case Ho.RIGHT_TOP:D=(E-O)/T;break;case Ho.RIGHT_BOTTOM:D=(E+O)/T;break;case Ho.LEFT_BOTTOM:D=(E*-1+O)/T;break}D!==0&&($=Math.round(D/M.ResizeBasis.basisHeight*1e5)/1e3),M.ResizePCT.widthPCT=Math.max(Math.min(M.ResizePCT.widthPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit),M.ResizePCT.heightPCT=Math.max(Math.min(M.ResizePCT.heightPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit);var P=Math.round(M.ResizePCT.widthPCT*M.ResizeBasis.basisWidth/100),B=Math.round(M.ResizePCT.heightPCT*M.ResizeBasis.basisHeight/100);switch(s){case Ho.LEFT_TOP:E=w-P,O=S-B;break;case Ho.RIGHT_TOP:E=P-w,O=S-B;break;case Ho.RIGHT_BOTTOM:E=P-w,O=B-S;break;case Ho.LEFT_BOTTOM:E=w-P,O=B-S;break}return b}switch(s){case Ho.LEFT_TOP:b.width=h?w:w-E*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_TOP:b.width=h?w:w+E*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_BOTTOM:b.width=h?w:w+E*f,b.height=v?S:S+O*f;break;case Ho.LEFT_BOTTOM:b.width=h?w:w-E*f,b.height=v?S:S+O*f;break}return b},o.resizeNode=function(s){var l=s.deltaX,f=s.deltaY,h=o.index,v=o.props,b=v.model,E=v.graphModel,O=v.x,w=v.y;OI({x:O,y:w,deltaX:l,deltaY:f,index:h,nodeModel:b,graphModel:E,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.graphModel.transformModel,v=NJ(h.fixDeltaXY(l,f),2),b=v[0],E=v[1];o.resizeNode({deltaX:b,deltaY:E})},o.onDragEnd=function(){var s=o.nodeModel.x,l=o.nodeModel.y;o.nodeModel.moveTo(s,l),o.updateEdgePointByAnchors()};var r=n.index,i=n.model,a=n.graphModel;return o.index=r,o.nodeModel=i,o.graphModel=a,o.dragHandler=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:a.gridSize}),o.bindKeyboardEvents(),o}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,f=s.height,h=CJ(s,["width","height"]);return $t("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[$t(qu,R_({className:"lf-resize-control-content",x:o,y:r,width:l??7,height:f??7},h)),$t(qu,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e})(ko),PJ=(function(t){xI(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=gu(o),a=i.minX,s=i.minY,l=i.maxX,f=i.maxY,h=[{index:Ho.LEFT_TOP,direction:"nw",x:a,y:s},{index:Ho.RIGHT_TOP,direction:"ne",x:l,y:s},{index:Ho.RIGHT_BOTTOM,direction:"se",x:l,y:f},{index:Ho.LEFT_BOTTOM,direction:"sw",x:a,y:f}];return tc(h,function(v){return $t(kJ,R_({},v,{model:o,graphModel:r}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,R_({},s,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e})(ko);function RJ(t,e){var n=t.x,o=t.y,r=e.x,i=e.y,a={x:n+(r-n)/2,y:o+(i-o)/2};return a}function Xy(t,e,n){var o=DJ(n),r=t.x-e.x,i=t.y-e.y,a=r*Math.cos(o)-i*Math.sin(o)+e.x,s=r*Math.sin(o)+i*Math.cos(o)+e.y;return{x:a,y:s}}function DJ(t){return t*Math.PI/180}function jJ(t){return t/Math.PI*180}function LJ(t,e,n,o,r,i,a,s){r===void 0&&(r=!1),i===void 0&&(i=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},f=RJ(l,e),h=Xy(e,f,-o),v=Xy(l,f,-o);if(r){var b=Math.abs(h.x-v.x),E=b-a;f.x>h.x?f.x=f.x+E/2:f.x=f.x-E/2}if(i){var O=Math.abs(h.y-v.y),w=O-s;f.y>h.y?f.y=f.y+w/2:f.y=f.y-w/2}if(r||i){var S=Xy(v,f,o),M=S.x-l.x,T=S.y-l.y;f.x=f.x-M,f.y=f.y-T,v=Xy(l,f,-o),h={x:f.x-(v.x-f.x),y:f.y-(v.y-f.y)}}var $=Math.abs(h.x-v.x),D=Math.abs(h.y-v.y);return r&&($=a),i&&(D=s),{width:$,height:D,center:f}}function IJ(t,e,n,o,r,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var f=e.deltaX,h=e.deltaY,v=e.width,b=e.height,E=jJ(n),O={x:o,y:r},w={x:i,y:a},S=Xy(O,w,E),M={x:S.x+f,y:S.y+h},T=LJ(S,M,w,E,s,l,v,b),$=T.width,D=T.height,P=T.center;return e.width=$*t,e.height=D*t,e.deltaX=(P.x-w.x)*2,e.deltaY=(P.y-w.y)*2,e}var FJ=function(t,e,n,o,r,i,a,s,l,f,h){n===void 0&&(n=1),o===void 0&&(o=!1),r===void 0&&(r=!1),i===void 0&&(i=0),h===void 0&&(h=!1);var v=to(e),b=v.deltaX,E=v.deltaY,O=v.width,w=v.height,S=v.PCTResizeInfo;if(S){var M=4,T=0,$=0;switch(t){case Ho.LEFT_TOP:$=(b*-1-E)/M;break;case Ho.RIGHT_TOP:$=(b-E)/M;break;case Ho.RIGHT_BOTTOM:$=(b+E)/M;break;case Ho.LEFT_BOTTOM:$=(b*-1+E)/M;break}$!==0&&(T=Math.round($/S.ResizeBasis.basisHeight*1e5)/1e3),S.ResizePCT.widthPCT=Math.max(Math.min(S.ResizePCT.widthPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit),S.ResizePCT.heightPCT=Math.max(Math.min(S.ResizePCT.heightPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit);var D=Math.round(S.ResizePCT.widthPCT*S.ResizeBasis.basisWidth/100),P=Math.round(S.ResizePCT.heightPCT*S.ResizeBasis.basisHeight/100);switch(t){case Ho.LEFT_TOP:b=O-D,E=w-P;break;case Ho.RIGHT_TOP:b=D-O,E=w-P;break;case Ho.RIGHT_BOTTOM:b=D-O,E=P-w;break;case Ho.LEFT_BOTTOM:b=O-D,E=P-w;break}return v}if(i%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return IJ(n,v,i,a,s,l,f,o,r);if(h){var B=O/w,F=0,I=O,V=w;switch(t){case Ho.LEFT_TOP:F=Math.abs(b)>Math.abs(E)?-b:-E,B>=1?(I=O+F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=w-V;break;case Ho.RIGHT_TOP:F=Math.abs(b)>Math.abs(E)?b:-E,B>=1?(I=O+F,V=I/B):(V=w-F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=w-V;break;case Ho.RIGHT_BOTTOM:F=Math.abs(b)>Math.abs(E)?b:E,B>=1?(I=O+F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=V-w;break;case Ho.LEFT_BOTTOM:F=Math.abs(b)>Math.abs(E)?-b:E,B>=1?(I=O-F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=V-w;break}return v}switch(t){case Ho.LEFT_TOP:v.width=o?O:O-b*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_TOP:v.width=o?O:O+b*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_BOTTOM:v.width=o?O:O+b*n,v.height=r?w:w+E*n;break;case Ho.LEFT_BOTTOM:v.width=o?O:O-b*n,v.height=r?w:w+E*n;break}return v},BJ=function(t,e){var n=t.id,o=t.anchors,r=e.getNodeEdges(n);ri(r,function(i){if(i.sourceNodeId===n){var a=Sh(o,function(s){return s.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===n){var a=Sh(o,function(l){return l.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},$J=function(t,e,n,o,r,i,a){a.eventCenter.emit(pr.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})},OI=function(t){var e=t.x,n=t.y,o=t.deltaX,r=t.deltaY,i=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,f=t.forceProportional,h=f===void 0?!1:f,v=a.r,b=a.rx,E=a.ry,O=a.width,w=a.height,S=a.PCTResizeInfo,M=a.minWidth,T=a.minHeight,$=a.maxWidth,D=a.maxHeight,P=a.rotate,B=a.x,F=a.y,I=M===$,V=T===D,z={width:v||b||O,height:v||E||w,deltaX:o,deltaY:r,PCTResizeInfo:S},X=v||b&&E?1/2:1,Y=e,W=n,Q=FJ(i,z,X,I,V,P,Y,W,B,F,h);if(Q.width<M||Q.width>$||Q.height<T||Q.height>D){l==null||l();return}(P%(2*Math.PI)==0||S||Y===void 0||W===void 0)&&(Q.deltaX=I?0:Q.deltaX,Q.deltaY=V?0:Q.deltaY);var J=a.getData(),ie=a.resize(Q);J.x===ie.x&&J.y===ie.y||(BJ(a,s),$J(J,ie,o,r,i,a,s))},UJ=100,VJ={x:1,y:0};function WJ(t,e,n,o,r){for(var i=function(E){if(E<0||E>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-E,3)+3*e.x*E*Math.pow(1-E,2)+3*n.x*Math.pow(E,2)*(1-E)+o.x*Math.pow(E,3),y:t.y*Math.pow(1-E,3)+3*e.y*E*Math.pow(1-E,2)+3*n.y*Math.pow(E,2)*(1-E)+o.y*Math.pow(E,3)}},a=0,s=2,l=o.x,f=o.y,h=o;a<r&&s<50;){h=i(1-s/UJ);var v=h.x,b=h.y;a=qc(l,f,v,b),s++}return h}function GJ(t,e){return t.x*e.y-t.y*e.x}function zJ(t,e){var n=[t.x,t.y,t.z],o=[e.x,e.y,e.z];return o.reduce(function(r,i,a){return r+i*n[a]})}function HJ(t,e){var n=GJ(t,e),o=Math.acos(zJ(TP(t),TP(e)));return n>=0?o:-o}function TP(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function XJ(t){return HJ(VJ,t)}function YJ(t){return t*(180/Math.PI)}var SI={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qJ={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},KJ={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},ZJ={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},D_={colorful:ZJ,dark:KJ,radius:qJ,default:SI},JJ={background:"#23272e"},QJ={background:"#fefeff"},GA={background:"#ffffff"},j_={colorful:QJ,dark:JJ,radius:GA,default:GA},eQ={color:"#66676a",thickness:1},tQ={color:"#dadada",thickness:1},zA={color:"#acacac",thickness:1},L_={colorful:tQ,dark:eQ,radius:zA,default:zA},AI=function(t,e){var n=to(SI);return e&&(n=Yv(n,D_[e])),t&&(n=Yv(n,t)),n},nQ=function(t,e){if(D_[t]){console.warn("theme mode ".concat(t," already exists"));return}D_[t]=e,j_[t]=e.background||GA,L_[t]=e.grid||zA},rQ=function(t){delete D_[t],delete j_[t],delete L_[t]},oQ=function(){var t={colorful:{},dark:{},radius:{},default:{}};Xo(D_,t),Xo(j_,t),Xo(L_,t)},iQ=AI,aQ=1e3,lQ=999,I_=function(){return++aQ},sQ=function(){return--lQ},Da=function(){return Da=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Da.apply(this,arguments)},Pr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},K1=(function(){function t(e,n){var o;this.BaseType=da.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=Wo.DEFAULT,this.modelType=_o.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Xo(this,eJ(e));var s=this.graphModel,l=s.overlapMode,f=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||I_()),this.setAnchors(),this.initPoints(),this.formatText(e),f.on("overlap:change",function(h){var v=h.overlapMode;n.updateZIndexByOverlap(v,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Da(Da({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Da({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return to(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return to(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?n.stroke:e.stroke;return Da(Da(Da({},e),{fill:r,stroke:r}),o)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return to(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,o){var r,i,a=LA(e);if(o){if(r=Sh(a,function(s){return s.id===o}),r)return r;console.warn("未在节点上找到指定的起点锚点".concat(o,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=bP(s,n);(i===void 0||l<i)&&(i=l,r=s)}),r},t.prototype.getEndAnchor=function(e,n){var o=this,r,i,a=LA(e);if(n){if(r=Sh(a,function(s){return s.id===n}),r)return r;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(o.startPoint){var l=bP(s,o.startPoint);(i===void 0||l<i)&&(i=l,r=s)}}),r},t.prototype.getProperties=function(){return Hc(this.properties)},t.prototype.getData=function(){var e=this.properties;Ug(e)&&(e=Hc(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:Xo({},this.startPoint),endPoint:Xo({},this.endPoint)};[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var o=this.text,r=o.x,i=o.y,a=o.value;return a&&(n.text={x:r,y:i,value:a}),n},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(e,n){SM(this.properties,e,Jl(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=Da(Da({},Hc(this.properties)),Jl(e)),this.setAttributes()},t.prototype.changeEdgeId=function(e){var n=this.arrowConfig,o=n.markerEnd,r=n.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),o&&o==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},t.prototype.setStyle=function(e,n){var o;this.style=Da(Da({},this.style),(o={},o[e]=Jl(n),o))},t.prototype.setStyles=function(e){this.style=Da(Da({},this.style),Jl(e))},t.prototype.updateStyles=function(e){this.style=Da({},Jl(e))},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.edgeTextDraggable,s=i.edgeTextEdit,l=this.textPosition,f=l.x,h=l.y,v=e.text,b={value:"",x:f,y:h,draggable:a,editable:s};v&&(typeof v=="string"?b=Da(Da({},b),{value:v}):(b=Da(Da({},b),{x:(n=v.x)!==null&&n!==void 0?n:f,y:(o=v.y)!==null&&o!==void 0?o:h,value:(r=v.value)!==null&&r!==void 0?r:""}),Xv(v.draggable)||(b.draggable=v.draggable),Xv(v.editable)||(b.editable=v.editable))),this.text=b},t.prototype.resetTextPosition=function(){var e=this.textPosition,n=e.x,o=e.y;this.text.x=n,this.text.y=o},t.prototype.moveText=function(e,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+e,y:i+n}},t.prototype.setText=function(e){e&&Xo(this.text,e)},t.prototype.updateText=function(e){this.text=Da(Da({},Hc(this.text)),{value:e})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateStartPoint=function(e){this.startPoint=e},t.prototype.moveStartPoint=function(e,n){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=n)},t.prototype.updateEndPoint=function(e){this.endPoint=e},t.prototype.moveEndPoint=function(e,n){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=n)},t.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(e){Xo(this,e)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var n=e.startPoint,o=e.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:o.x,y:o.y})},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case vl.DEFAULT:this.zIndex=0;break;case vl.EDGE_TOP:this.zIndex=1;break;case vl.INCREASE:this.zIndex=n;break}},t.BaseType=da.EDGE,Pr([Ut],t.prototype,"type",void 0),Pr([Ut],t.prototype,"sourceNodeId",void 0),Pr([Ut],t.prototype,"targetNodeId",void 0),Pr([Ut],t.prototype,"startPoint",void 0),Pr([Ut],t.prototype,"endPoint",void 0),Pr([Ut],t.prototype,"textMode",void 0),Pr([Ut],t.prototype,"text",void 0),Pr([Ut],t.prototype,"properties",void 0),Pr([Ut],t.prototype,"points",void 0),Pr([Ut],t.prototype,"pointsList",void 0),Pr([Ut],t.prototype,"isSelected",void 0),Pr([Ut],t.prototype,"isHovered",void 0),Pr([Ut],t.prototype,"isHitable",void 0),Pr([Ut],t.prototype,"isHittable",void 0),Pr([Ut],t.prototype,"draggable",void 0),Pr([Ut],t.prototype,"visible",void 0),Pr([Ut],t.prototype,"isAnimation",void 0),Pr([Ut],t.prototype,"isShowAdjustPoint",void 0),Pr([Ut],t.prototype,"zIndex",void 0),Pr([Ut],t.prototype,"state",void 0),Pr([Ut],t.prototype,"style",void 0),Pr([Ut],t.prototype,"arrowConfig",void 0),Pr([Ai],t.prototype,"sourceNode",null),Pr([Ai],t.prototype,"targetNode",null),Pr([Ai],t.prototype,"textPosition",null),Pr([Bt],t.prototype,"setProperty",null),Pr([Bt],t.prototype,"deleteProperty",null),Pr([Bt],t.prototype,"setProperties",null),Pr([Bt],t.prototype,"changeEdgeId",null),Pr([Bt],t.prototype,"setStyle",null),Pr([Bt],t.prototype,"setStyles",null),Pr([Bt],t.prototype,"updateStyles",null),Pr([Bt],t.prototype,"setTextMode",null),Pr([Bt],t.prototype,"formatText",null),Pr([Bt],t.prototype,"resetTextPosition",null),Pr([Bt],t.prototype,"moveText",null),Pr([Bt],t.prototype,"setText",null),Pr([Bt],t.prototype,"updateText",null),Pr([Bt],t.prototype,"setAnchors",null),Pr([Bt],t.prototype,"setSelected",null),Pr([Bt],t.prototype,"setHovered",null),Pr([Bt],t.prototype,"setHitable",null),Pr([Bt],t.prototype,"setHittable",null),Pr([Bt],t.prototype,"openEdgeAnimation",null),Pr([Bt],t.prototype,"closeEdgeAnimation",null),Pr([Bt],t.prototype,"setElementState",null),Pr([Bt],t.prototype,"updateStartPoint",null),Pr([Bt],t.prototype,"moveStartPoint",null),Pr([Bt],t.prototype,"updateEndPoint",null),Pr([Bt],t.prototype,"moveEndPoint",null),Pr([Bt],t.prototype,"setZIndex",null),Pr([Bt],t.prototype,"initPoints",null),Pr([Bt],t.prototype,"updateAttributes",null),Pr([Bt],t.prototype,"getAdjustStart",null),Pr([Bt],t.prototype,"getAdjustEnd",null),Pr([Bt],t.prototype,"updateAfterAdjustStartAndEnd",null),Pr([Bt],t.prototype,"updateZIndexByOverlap",null),t})(),uQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fv=function(){return Fv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Fv.apply(this,arguments)},Uu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},rS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},CP=(function(t){uQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return e.prototype.initEdgeData=function(n){this.offset=om(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Fv(Fv(Fv({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,o=0;return this.pointsList.forEach(function(r){var i=r.x,a=r.y;n+=i,o+=a}),{x:n/this.pointsList.length,y:o/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Fv(Fv({},n),{pointsList:o})},e.prototype.getControls=function(){var n=this.startPoint,o=this.endPoint,r=yP({start:n,end:o,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return r},e.prototype.getPath=function(n){var o=rS(n,4),r=o[0],i=o[1],a=o[2],s=o[3];return"M ".concat(r.x," ").concat(r.y,`
|
||
C `).concat(i.x," ").concat(i.y,`,
|
||
`).concat(a.x," ").concat(a.y,`,
|
||
`).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),o=n.sNext,r=n.ePre;this.updatePath(o,r)},e.prototype.updatePath=function(n,o){n=to(n),o=to(o);var r={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!n||!o){var a=this.getControls();n=a.sNext,o=a.ePre}this.pointsList=[r,n,o,i],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];i.x+=n,i.y+=o,this.updatePath(i,a)},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];a.x+=n,a.y+=o,this.updatePath(i,a)},e.prototype.updateAdjustAnchor=function(n,o){var r;o==="sNext"?this.pointsList[1]=n:o==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode,s=yP({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),l=s.sNext,f=s.ePre;this.pointsList=[o,l,f,r],this.initPoints()},Uu([Ut],e.prototype,"offset",void 0),Uu([Ut],e.prototype,"path",void 0),Uu([Bt],e.prototype,"initPoints",null),Uu([Bt],e.prototype,"updatePoints",null),Uu([Bt],e.prototype,"updateStartPoint",null),Uu([Bt],e.prototype,"updateEndPoint",null),Uu([Bt],e.prototype,"moveStartPoint",null),Uu([Bt],e.prototype,"moveEndPoint",null),Uu([Bt],e.prototype,"updateAdjustAnchor",null),Uu([Bt],e.prototype,"getAdjustStart",null),Uu([Bt],e.prototype,"getAdjustEnd",null),Uu([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),cQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n_=function(){return n_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},n_.apply(this,arguments)},NP=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},dQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},kP=(function(t){cQ(e,t);function e(){var n=t.apply(this,dQ([],NP(arguments),!1))||this;return n.modelType=_o.LINE_EDGE,n}return e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return n_(n_(n_({},o),to(n)),to(i))},e.prototype.initEdgeData=function(n){t.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(n){var o=NP(n,2),r=o[0],i=o[1];return"".concat(r.x,",").concat(r.y," ").concat(i.x,",").concat(i.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e})(K1),fQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),r_=function(){return r_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r_.apply(this,arguments)},kl=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},PP=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},F_=(function(t){fQ(e,t);function e(){var n=t.apply(this,pQ([],PP(arguments),!1))||this;return n.modelType=_o.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){var o=om(n,"properties.offset");if(this.offset=typeof o=="number"?o:this.getDefaultOffset(),n.pointsList){var r=this.orthogonalizePath(n.pointsList);n.pointsList=r,this.pointsList=r}t.prototype.initEdgeData.call(this,n)},e.prototype.setAttributes=function(){var n=this.properties.offset;n&&n!==this.offset&&(this.offset=n,this.updatePoints())},e.prototype.orthogonalizePath=function(n){if(!Array.isArray(n)||n.length<2)return n;var o=function(D,P){var B=D[D.length-1];(!B||B.x!==P.x||B.y!==P.y)&&D.push({x:P.x,y:P.y})},r=function(D,P){return D.x===P.x||D.y===P.y},i=function(D,P){return Math.abs(D.x-P.x)+Math.abs(D.y-P.y)},a=[];o(a,n[0]);for(var s,l=0;l<n.length-1;l++){var f=a[a.length-1],h=n[l+1];if(!(!f||!h)){if(r(f,h)){o(a,h),s=f.x===h.x?ni.VERTICAL:ni.HORIZONTAL;continue}var v={x:h.x,y:f.y},b={x:f.x,y:h.y},E=s===ni.VERTICAL?b:s===ni.HORIZONTAL||i(f,v)<=i(f,b)?v:b;(E.x!==f.x||E.y!==f.y)&&o(a,E),o(a,h);var O=a[a.length-2],w=a[a.length-1];s=O&&w?O.x===w.x?ni.VERTICAL:ni.HORIZONTAL:s}}for(var S=[],l=0;l<a.length;l++){var M=a[l-1],T=a[l],h=a[l+1];M&&T&&h&&(M.x===T.x&&T.x===h.x||M.y===T.y&&T.y===h.y)||o(S,T)}S.length>=2&&(S[0]={x:n[0].x,y:n[0].y},S[S.length-1]={x:n[n.length-1].x,y:n[n.length-1].y});var $=S.length<2||S.every(function(D,P,B){return P===0?!0:r(B[P-1],B[P])});return $?S:[{x:n[0].x,y:n[0].y},{x:n[n.length-1].x,y:n[n.length-1].y}]},e.prototype.getDefaultOffset=function(){var n=this.getArrowStyle(),o=typeof n.offset=="number"?n.offset:0;return o+5},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return r_(r_(r_({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){var n,o=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!o){var r=this.dbClickPosition,i=r.x,a=r.y;return{x:i,y:a}}var s=Kv(this.points),l=PP(ZZ(s),2),f=l[0],h=l[1];return{x:(f.x+h.x)/2,y:(f.y+h.y)/2}},e.prototype.getAfterAnchor=function(n,o,r){var i,a;return r.forEach(function(s){var l;n===ni.HORIZONTAL?l=Math.abs(o.y-s.y):n===ni.VERTICAL&&(l=Math.abs(o.x-s.x)),(!a||a>l)&&(a=l,i=s)}),i},e.prototype.getCrossPoint=function(n,o,r){var i;return n===ni.HORIZONTAL?i={x:r.x,y:o.y}:n===ni.VERTICAL&&(i={x:o.x,y:r.y}),i},e.prototype.removeCrossPoints=function(n,o,r){var i=r.map(function(M){return M});if(n===1){var a=i[n],s=i[o],l=i[n-1],f=hP(l,a,this.sourceNode);if(f){var h=vP(a,s,this.sourceNode);if(h){var v=mP(a,s,this.sourceNode);v&&(i[n]=v,i.splice(n-1,1),n--,o--)}}else{var b=this.sourceNode.anchors;b.forEach(function(M){if(M.x===l.x&&M.x===a.x||M.y===l.y&&M.y===a.y){var T=qc(M.x,M.y,a.x,a.y),$=qc(l.x,l.y,a.x,a.y);T<$&&(i[n-1]=M)}})}}if(o===r.length-2){var E=i[n],O=i[o],w=i[o+1],S=hP(O,w,this.targetNode);if(S){var h=vP(E,O,this.targetNode);if(h){var v=mP(E,O,this.targetNode);v&&(i[o]=v,i.splice(o+1,1))}}else{var b=this.targetNode.anchors;b.forEach(function(T){if(T.x===w.x&&T.x===O.x||T.y===w.y&&T.y===O.y){var $=qc(T.x,T.y,O.x,O.y),D=qc(w.x,w.y,O.x,O.y);$<D&&(i[o+1]=T)}})}}return i},e.prototype.getDraggingPoints=function(n,o,r,i,a){var s=a.map(function(h){return h}),l=this.getAfterAnchor(n,r,i),f=this.getCrossPoint(n,r,l);return o==="start"?(s.unshift(f),s.unshift(l)):(s.push(f),s.push(l)),s},e.prototype.updateCrossPoints=function(n){var o=n.map(function(T){return T}),r=n[0],i=n[1],a=n[o.length-2],s=n[o.length-1],l=this,f=l.sourceNode,h=l.targetNode,v=f.modelType,b=h.modelType,E=Rw(r,i),O=o[0];switch(v){case _o.RECT_NODE:if(f.radius!==0){var w=xP(r,f);w||(O=EP(r,E,f))}break;case _o.CIRCLE_NODE:O=IA(r,E,f);break;case _o.ELLIPSE_NODE:O=OP(r,E,f);break;case _o.DIAMOND_NODE:O=E0(r,E,f);break;case _o.POLYGON_NODE:O=E0(r,E,f);break}O&&(o[0]=O);var S=Rw(a,s),M=o[o.length-1];switch(b){case _o.RECT_NODE:if(h.radius!==0){var w=xP(s,h);w||(M=EP(s,S,h))}break;case _o.CIRCLE_NODE:M=IA(s,S,h);break;case _o.ELLIPSE_NODE:M=OP(s,S,h);break;case _o.DIAMOND_NODE:M=E0(s,S,h);break;case _o.POLYGON_NODE:M=E0(s,S,h);break}return M&&(o[o.length-1]=M),o},e.prototype.updatePath=function(n){this.pointsList=this.orthogonalizePath(n),this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Object.assign({},n,{pointsList:o})},e.prototype.getPath=function(n){return n.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=pP({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=this.orthogonalizePath(n),this.points=this.pointsList.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o,this.updatePoints()},e.prototype.updatePointsList=function(n,o){this.pointsList.forEach(function(a){a.x+=n,a.y+=o});var r=this.pointsList[0];this.startPoint=Object.assign({},r);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList,v=h;return f===ni.HORIZONTAL?(h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y},v=this.pointsList.map(function(b){return b})):f===ni.VERTICAL&&(h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y},v=this.pointsList.map(function(b){return b})),this.updatePointsAfterDrag(v),this.draggingPointList=v,!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppend=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList;if(f===ni.HORIZONTAL){h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y};var v=this.pointsList.map(function(S){return S});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var b={x:i.x,y:i.y+o.y},E=ip(b,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x,y:a.y+o.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}else if(f===ni.VERTICAL){h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y};var v=this.pointsList.map(function(M){return M});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var b={x:i.x+o.x,y:i.y},E=ip(b,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x+o.x,y:a.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}return!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=vI(Kv(this.points));this.pointsList=n.map(function(i){return i}),this.draggingPointList=[];var o=n[0];this.startPoint=Xo({},o);var r=n[n.length-1];this.endPoint=Xo({},r)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var o=this.updateCrossPoints(n);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode;this.pointsList=this.orthogonalizePath(pP({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0)),this.initPoints()},kl([Ut],e.prototype,"offset",void 0),kl([Ut],e.prototype,"dbClickPosition",void 0),kl([Bt],e.prototype,"initPoints",null),kl([Bt],e.prototype,"updatePoints",null),kl([Bt],e.prototype,"updateStartPoint",null),kl([Bt],e.prototype,"moveStartPoint",null),kl([Bt],e.prototype,"updateEndPoint",null),kl([Bt],e.prototype,"moveEndPoint",null),kl([Bt],e.prototype,"updatePointsList",null),kl([Bt],e.prototype,"dragAppendStart",null),kl([Bt],e.prototype,"dragAppendSimple",null),kl([Bt],e.prototype,"dragAppend",null),kl([Bt],e.prototype,"dragAppendEnd",null),kl([Bt],e.prototype,"updatePointsAfterDrag",null),kl([Bt],e.prototype,"getAdjustStart",null),kl([Bt],e.prototype,"getAdjustEnd",null),kl([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),il=function(){return il=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},il.apply(this,arguments)},Hr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RP=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lh=(function(){function t(e,n){var o;this.BaseType=da.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=Wo.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=_o.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,o=n.x,r=o===void 0?0:o,i=n.y,a=i===void 0?0:i;this.transform=new Dw(-r,-a).rotate(e).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.formatText(e),Xo(this,dJ(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||I_()),l.on("overlap:change",function(f){var h=f.overlapMode;n.updateZIndexByOverlap(h,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=e.x,f=e.y,h=e.text,v={value:"",x:l,y:f,draggable:a,editable:s};h&&(typeof h=="string"?v.value=h:(v=il(il({},v),{x:(n=h.x)!==null&&n!==void 0?n:l,y:(o=h.y)!==null&&o!==void 0?o:f,value:(r=h.value)!==null&&r!==void 0?r:""}),Xv(h.draggable)||(v.draggable=h.draggable),Xv(h.editable)||(v.editable=h.editable))),e.text=v},t.prototype.resize=function(e){var n=e.width,o=e.height,r=e.deltaX,i=e.deltaY,a=this.isAllowResizeNode(r,i,n,o);return a?(this.move(r/2,i/2),this.width=n,this.height=o,this.setProperties({width:n,height:o}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,o=e.y,r=e.value,i=this.properties;Ug(i)&&(i=Hc(i)),ws(i.width)&&(i.width=this.width),ws(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),r&&(a.text={x:n,y:o,value:r}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return Hc(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return il(il({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,o=n===void 0?{}:n;return il(il({},to(e)),to(o))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return to(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return to(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return to(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return to(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return to(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return to(e)},t.prototype.isAllowConnectedAsSource=function(e,n,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,this,e,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(e,n,o,r){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,e,this,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},t.prototype.isAllowMoveNode=function(e,n){var o,r,i=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=RP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,e,n);if(!v)return!1;if(typeof v=="object"){var b=v;if(!b.x&&!b.y)return!1;i=i&&b.x,a=a&&b.y}}}catch(E){o={error:E}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return{x:i,y:a}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var e=this,n=e.anchorsOffset,o=e.id,r=e.x,i=e.y;return n&&n.length>0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(o,"_").concat(s),x:r+a[0],y:i+a[1]}):(a=a,il(il({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return sJ(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,o=n.x,r=n.y,i=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,f=hQ(new ib([s,l,1]).translate(-o,-r).rotate(i).translate(o,r)[0],2),h=f[0],v=f[1];a.x=h,a.y=v}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!ws(e))for(var n=0;n<this.anchors.length;n++){var o=this.anchors[n];if(o.id===e)return o}},t.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},t.prototype.isAllowMoveByXORY=function(e,n,o){var r,i;if(o)r=!0,i=!0;else{var a=this.isAllowMoveNode(e,n);typeof a=="boolean"?(r=a,i=a):(r=a.x,i=a.y)}return{isAllowMoveX:r,isAllowMoveY:i}},t.prototype.move=function(e,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(e,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY;return i&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(i||a)&&(this.rotate=this._rotate),i||a},t.prototype.getMoveDistance=function(e,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(e,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY,s=0,l=0;return i&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Dw(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},t.prototype.moveTo=function(e,n,o){o===void 0&&(o=!1);var r=e-this.x,i=n-this.y;return!o&&!this.isAllowMoveNode(r,i)?!1:(this.text&&this.moveText(r,i),this.x=e,this.y=n,!0)},t.prototype.moveText=function(e,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+e,y:i+n}},t.prototype.updateText=function(e){this.text=il(il({},Hc(this.text)),{value:e})},t.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},t.prototype.isAllowResizeNode=function(e,n,o,r){var i,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=RP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,e,n,o,r);if(!v)return!1}}catch(b){i={error:b}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!0},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},t.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},t.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},t.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateProperties=function(e,n){var o=Hc(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(pr.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:o,properties:e})},t.prototype.setProperty=function(e,n){var o=Hc(this.properties),r=to(o);Nj(r,e,Jl(n)),this.updateProperties(r,[e])},t.prototype.setProperties=function(e){var n=Hc(this.properties),o=il(il({},n),Jl(e)),r=[];XL(e,function(i,a){(hw(n,a)&&n[a]!==i||!hw(n,a))&&r.push(a)}),this.updateProperties(o,r)},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setStyle=function(e,n){var o;this.style=il(il({},this.style),(o={},o[e]=Jl(n),o))},t.prototype.setStyles=function(e){this.style=il(il({},this.style),Jl(e))},t.prototype.updateStyles=function(e){this.style=il({},Jl(e))},t.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},t.prototype.updateAttributes=function(e){Xo(this,e)},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case vl.DEFAULT:this.zIndex=1;break;case vl.EDGE_TOP:this.zIndex=0;break;case vl.INCREASE:this.zIndex=n;break}},t.BaseType=da.NODE,Hr([Ut],t.prototype,"type",void 0),Hr([Ut],t.prototype,"x",void 0),Hr([Ut],t.prototype,"y",void 0),Hr([Ut],t.prototype,"textMode",void 0),Hr([Ut],t.prototype,"text",void 0),Hr([Ut],t.prototype,"properties",void 0),Hr([Ut],t.prototype,"_width",void 0),Hr([Ut],t.prototype,"_height",void 0),Hr([Ut],t.prototype,"anchorsOffset",void 0),Hr([Ut],t.prototype,"isSelected",void 0),Hr([Ut],t.prototype,"isHovered",void 0),Hr([Ut],t.prototype,"isShowAnchor",void 0),Hr([Ut],t.prototype,"isDragging",void 0),Hr([Ut],t.prototype,"isHitable",void 0),Hr([Ut],t.prototype,"isHittable",void 0),Hr([Ut],t.prototype,"draggable",void 0),Hr([Ut],t.prototype,"visible",void 0),Hr([Ut],t.prototype,"rotatable",void 0),Hr([Ut],t.prototype,"resizable",void 0),Hr([Ut],t.prototype,"zIndex",void 0),Hr([Ut],t.prototype,"state",void 0),Hr([Ut],t.prototype,"autoToFront",void 0),Hr([Ut],t.prototype,"style",void 0),Hr([Ut],t.prototype,"transform",void 0),Hr([Ut],t.prototype,"_rotate",void 0),Hr([Ai],t.prototype,"incoming",null),Hr([Ai],t.prototype,"outgoing",null),Hr([Bt],t.prototype,"setTextMode",null),Hr([Bt],t.prototype,"addNodeMoveRules",null),Hr([Bt],t.prototype,"move",null),Hr([Bt],t.prototype,"getMoveDistance",null),Hr([Bt],t.prototype,"moveTo",null),Hr([Bt],t.prototype,"moveText",null),Hr([Bt],t.prototype,"updateText",null),Hr([Bt],t.prototype,"addNodeResizeRules",null),Hr([Bt],t.prototype,"setSelected",null),Hr([Bt],t.prototype,"setHovered",null),Hr([Bt],t.prototype,"setIsShowAnchor",null),Hr([Bt],t.prototype,"setRotatable",null),Hr([Bt],t.prototype,"setResizable",null),Hr([Bt],t.prototype,"setHitable",null),Hr([Bt],t.prototype,"setHittable",null),Hr([Bt],t.prototype,"setElementState",null),Hr([Bt],t.prototype,"setProperty",null),Hr([Bt],t.prototype,"setProperties",null),Hr([Bt],t.prototype,"deleteProperty",null),Hr([Bt],t.prototype,"setStyle",null),Hr([Bt],t.prototype,"setStyles",null),Hr([Bt],t.prototype,"updateStyles",null),Hr([Bt],t.prototype,"setZIndex",null),Hr([Bt],t.prototype,"updateAttributes",null),Hr([Bt],t.prototype,"updateZIndexByOverlap",null),t})(),vQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),o_=function(){return o_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o_.apply(this,arguments)},oS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},$w=(function(t){vQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.CIRCLE_NODE,r.r=50,r.initNodeData(n),r.setAttributes(),r}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.circle,r=this.properties.style,i=r===void 0?{}:r;return o_(o_(o_({},n),to(o)),to(i))},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.r;return[{x:o,y:r-i,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+i,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.deltaX,i=n.deltaY;return this.move(r/2,i/2),this.r=o,this.setProperties({r:o}),this.getData()},oS([Ut],e.prototype,"r",void 0),oS([Ai],e.prototype,"width",null),oS([Ai],e.prototype,"height",null),e})(Lh),mQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},i_.apply(this,arguments)},og=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},O0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},HA=(function(t){mQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.diamond,r=this.properties.style,i=r===void 0?{}:r;return i_(i_(i_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[[o,r-a],[o+i,r],[o,r+a],[o-i,r]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return tc(this.points,function(n){var o=O0(n,2),r=o[0],i=o[1];return{x:r,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,1),a=i[0];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,2),a=i[1];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return tc(this.points,function(o,r){var i=O0(o,2),a=i[0],s=i[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(r)}})},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},og([Ut],e.prototype,"rx",void 0),og([Ut],e.prototype,"ry",void 0),og([Ai],e.prototype,"points",null),og([Ai],e.prototype,"pointsPosition",null),og([Ai],e.prototype,"width",null),og([Ai],e.prototype,"height",null),e})(Lh),gQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a_=function(){return a_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},a_.apply(this,arguments)},S0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},XA=(function(t){gQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.ellipse,r=this.properties.style,i=r===void 0?{}:r;return a_(a_(a_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[{x:o,y:r-a,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},S0([Ut],e.prototype,"rx",void 0),S0([Ut],e.prototype,"ry",void 0),S0([Ai],e.prototype,"width",null),S0([Ai],e.prototype,"height",null),e})(Lh),yQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l_=function(){return l_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l_.apply(this,arguments)},A0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},M0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Uw=(function(t){yQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.points,r=n.width,i=n.height,a=o||this.points;this.points=rJ(a,r,i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.polygon,r=this.properties.style,i=r===void 0?{}:r;return l_(l_(l_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+o-i/2,y:s[1]+r-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,1),a=i[0];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,2),a=i[1];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=this,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points;return l.map(function(f,h){var v=M0(f,2),b=v[0],E=v[1];return{x:r+b-a/2,y:i+E-s/2,id:"".concat(n.id,"_").concat(h)}})},e.prototype.resize=function(n){var o=this,r=n.width,i=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=tc(this.points,function(f){var h=M0(f,2),v=h[0],b=h[1];return[v*r/o.width,b*i/o.height]});return this.points=l,this.properties.points=l,this.getData()},A0([Ut],e.prototype,"points",void 0),A0([Ai],e.prototype,"pointsPosition",null),A0([Ai],e.prototype,"width",null),A0([Ai],e.prototype,"height",null),e})(Lh),_Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s_.apply(this,arguments)},bQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Hg=(function(t){_Q(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.RECT_NODE,r.radius=0,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height,i=n.radius,a=this.getNodeStyle().radius;ws(o)||(this.width=o),ws(r)||(this.height=r),ws(i)||(this.radius=i),ws(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.rect,r=this.properties.style,i=r===void 0?{}:r;return s_(s_(s_({},n),to(o)),to(i))},bQ([Ut],e.prototype,"radius",void 0),e})(Lh),wQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u_=function(){return u_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u_.apply(this,arguments)},DP=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},EQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},xQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},jP=(function(t){wQ(e,t);function e(){var n=t.apply(this,xQ([],EQ(arguments),!1))||this;return n.modelType=_o.TEXT_NODE,n}return e.prototype.getTextStyle=function(){var n=t.prototype.getTextStyle.call(this),o=this.graphModel.theme.text,r=this.properties.textStyle;return u_(u_(u_({},n),to(o)),to(r))},Object.defineProperty(e.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=AP({rows:n,fontSize:o,rowsLength:n.length}).width;return r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=AP({rows:n,fontSize:o,rowsLength:n.length}).height;return r},enumerable:!1,configurable:!0}),DP([Ai],e.prototype,"width",null),DP([Ai],e.prototype,"height",null),e})(Lh),OQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),YA=(function(t){OQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.HTML_NODE,r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height;o&&(this.width=o),r&&(this.height=r)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e})(Lh),Jo=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},SQ={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},T0=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],AQ=(function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=Ju.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Ju.TEXT,this.edgeTextMode=Ju.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Xo(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);Xo(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,o=e.textDraggable,r=e.textMode,i=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&Xo(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=Vv(SQ,T0);this.stagedConfig=Vv(this,T0),Xo(s,l)}Xv(i)||Xo(s,{nodeTextEdit:i,edgeTextEdit:i}),Xv(o)||Xo(s,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Xo(s,{nodeTextMode:r,edgeTextMode:r}),mw(a)&&Xo(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var f=Vv(e,T0);return Xo(s,f)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return Vv(this,T0)},Jo([Ut],t.prototype,"isSilentMode",void 0),Jo([Ut],t.prototype,"stopZoomGraph",void 0),Jo([Ut],t.prototype,"stopMoveGraph",void 0),Jo([Ut],t.prototype,"stopScrollGraph",void 0),Jo([Ut],t.prototype,"snapGrid",void 0),Jo([Ut],t.prototype,"textMode",void 0),Jo([Ut],t.prototype,"textEdit",void 0),Jo([Ut],t.prototype,"textDraggable",void 0),Jo([Ut],t.prototype,"nodeTextEdit",void 0),Jo([Ut],t.prototype,"nodeTextDraggable",void 0),Jo([Ut],t.prototype,"nodeTextMultiple",void 0),Jo([Ut],t.prototype,"nodeTextVertical",void 0),Jo([Ut],t.prototype,"nodeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextEdit",void 0),Jo([Ut],t.prototype,"edgeTextDraggable",void 0),Jo([Ut],t.prototype,"edgeTextMultiple",void 0),Jo([Ut],t.prototype,"edgeTextVertical",void 0),Jo([Ut],t.prototype,"hideAnchors",void 0),Jo([Ut],t.prototype,"allowRotate",void 0),Jo([Ut],t.prototype,"allowResize",void 0),Jo([Ut],t.prototype,"hoverOutline",void 0),Jo([Ut],t.prototype,"nodeSelectedOutline",void 0),Jo([Ut],t.prototype,"adjustNodePosition",void 0),Jo([Ut],t.prototype,"autoExpand",void 0),Jo([Ut],t.prototype,"adjustEdge",void 0),Jo([Ut],t.prototype,"adjustEdgeMiddle",void 0),Jo([Ut],t.prototype,"adjustEdgeStartAndEnd",void 0),Jo([Ut],t.prototype,"adjustEdgeStart",void 0),Jo([Ut],t.prototype,"adjustEdgeEnd",void 0),Jo([Ut],t.prototype,"edgeSelectedOutline",void 0),Jo([Bt],t.prototype,"updateEditConfig",null),Jo([Bt],t.prototype,"updateTextMode",null),t})(),MQ="*",TQ=(function(){function t(){this._events={}}return t.prototype.on=function(e,n,o){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:n,once:!!o})})},t.prototype.once=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){r=r.trim(),o.on(r,n,!0)})},t.prototype.emit=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[MQ]||[],s=function(l){for(var f=l.length,h=0;h<f;h++)if(l[h]){var v=l[h],b=v.callback,E=v.once;E&&(l.splice(h,1),l.length===0&&delete o._events[r],f--,h--),b.apply(o,[n])}};s(i),s(a)})},t.prototype.off=function(e,n){var o=this;e||(this._events={}),e.split(",").forEach(function(r){if(!n)delete o._events[r];else{for(var i=o._events[r]||[],a=i.length,s=0;s<a;s++)i[s].callback===n&&(i.splice(s,1),a--,s--);i.length===0&&delete o._events[r]}})},t.prototype.getEvents=function(){return this._events},t.prototype.destroy=function(){this._events={}},t})(),CQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qA=function(){return qA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},qA.apply(this,arguments)},NQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},kQ=(function(t){CQ(e,t);function e(n){var o=t.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(s){var l=s.deltaX,f=s.deltaY;o.setState({isDragging:!0});var h=o.props.graphModel,v=h.transformModel,b=h.editConfigModel;b.stopMoveGraph!==!0&&v.translate(l,f)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(s){var l=o.props,f=l.graphModel,h=f.editConfigModel,v=f.transformModel,b=f.gridSize,E=l.graphModel,O=s.deltaX,w=s.deltaY,S=h.stopScrollGraph,M=h.stopZoomGraph;if(!S&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),o.stepScrollX+=O,o.stepScrollY+=w,Math.abs(o.stepScrollX)>=b){var T=o.stepScrollX%b,$=o.stepScrollX-T;v.translate(-$*v.SCALE_X,0),o.stepScrollX=T}if(Math.abs(o.stepScrollY)>=b){var D=o.stepScrollY%b,P=o.stepScrollY-D;v.translate(0,-P*v.SCALE_Y),o.stepScrollY=D}return}if(!M){s.preventDefault();var B=E.getPointByClient({x:s.clientX,y:s.clientY}),F=B.canvasOverlayPosition,I=F.x,V=F.y;v.zoom(s.deltaY<0,[I,V])}},o.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var f=o.props.graphModel,h=f.selectElements;if(h.size>0&&f.clearSelectElements(),o.state.isDragging)return;f.eventCenter.emit(pr.BLANK_CLICK,{e:s})}},o.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var f=o.props.graphModel,h=f.getPointByClient({x:s.clientX,y:s.clientY});f.eventCenter.emit(pr.BLANK_CONTEXTMENU,{e:s,position:h})}},o.mouseDownHandler=function(s){var l=o.props.graphModel,f=l.eventCenter,h=l.editConfigModel,v=l.transformModel.SCALE_X,b=l.gridSize,E=h.adjustEdge,O=h.adjustNodePosition,w=h.stopMoveGraph,S=s.target,M=!E&&!O;(S.getAttribute("name")==="canvas-overlay"||M)&&(w!==!0?(o.stepDrag.setStep(b*v),o.stepDrag.handleMouseDown(s)):f.emit(pr.BLANK_MOUSEDOWN,{e:s}),o.clickHandler(s))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),o.state={isDragging:!1},o}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props,i=r.children,a=r.dnd,s=this.state.isDragging;return $t("svg",qA({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:$t("g",{transform:o,children:i})}))},e=NQ([xs],e),e})(ko),MI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),B_=function(){return B_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},B_.apply(this,arguments)},PQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LP=(function(t){MI(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.bezierModel,l=i.type,f=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,h=f.x,v=f.y;s.updateAdjustAnchor({x:h,y:v},l),a.eventCenter.emit(pr.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var o=n.props.bezierModel;o.isDragging=!1},n.dragHandler=new ac({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,o=this.props.position,r=o.x,i=o.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return $t(zg,B_({className:"lf-bezier-adjust-anchor",x:r,y:i},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e})(ko),DQ=(function(t){MI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,o){var r=n.path,i=n.id,a=CM(r),s=RQ(a,4),l=s[0],f=s[1],h=s[2],v=s[3],b=n.getEdgeStyle().adjustLine,E=[];return E.push($t(Gg,B_({x1:l.x,y1:l.y,x2:f.x,y2:f.y},b))),E.push($t(LP,{position:f,bezierModel:n,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),E.push($t(Gg,B_({x1:v.x,y1:v.y,x2:h.x,y2:h.y},b))),E.push($t(LP,{position:h,bezierModel:n,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),E},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,o=n.edges,r=[],i=0;i<o.length;i++){var a=o[i];a.isSelected&&a.modelType===_o.BEZIER_EDGE&&a.draggable&&r.push(this.getBezierAdjust(a,n))}return r},e.prototype.render=function(){return $t("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=PQ([xs],e),e})(ko),jQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),LQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},IQ=(function(t){jQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return $t("div",{className:"lf-background",children:$t("div",{style:lp(n)?n:{},className:"lf-background-area"})})},e=LQ([xs],e),e})(ko),FQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),BQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Sg=(function(t){FQ(e,t);function e(n){var o=t.call(this,n)||this;return o.id=wh(),o.gridOptions=o.props.graphModel.grid,o}return e.prototype.renderDot=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?2:f,v=Math.min(Math.max(2,h),i/4),b=a?1:0;return $t("g",{fill:l,opacity:b,children:[$t("circle",{cx:0,cy:0,r:v/2}),$t("circle",{cx:0,cy:i,r:v/2}),$t("circle",{cx:i,cy:0,r:v/2}),$t("circle",{cx:i,cy:i,r:v/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?1:f,v=Math.min(Math.max(1,h),i/2),b="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),E=a?1:0;return $t("path",{d:b,stroke:l,strokeWidth:v/2,opacity:E,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,o=n.transformModel,r=n.grid;this.gridOptions=r;var i=this.gridOptions,a=i.type,s=i.size,l=s===void 0?1:s,f=o.SCALE_X,h=o.SKEW_Y,v=o.SKEW_X,b=o.SCALE_Y,E=o.TRANSLATE_X,O=o.TRANSLATE_Y,w=[f,h,v,b,E,O].join(","),S="matrix(".concat(w,")");return $t("div",{className:"lf-grid",children:$t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:S,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),$t("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=BQ([xs],e),e})(ko);(function(t){t.defaultProps={size:DZ,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var o=to(t.defaultProps);return typeof n=="number"?Xo(o,{size:n}):typeof n=="boolean"?Xo(o,{visible:n}):Xo(o,n)}t.getGridOptions=e})(Sg||(Sg={}));var $Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),UQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},VQ=(function(t){$Q(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props.children;return $t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:$t("g",{transform:o,children:r})})},e=UQ([xs],e),e})(ko),WQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),dh=function(){return dh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},dh.apply(this,arguments)},GQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},zQ=(function(t){WQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,o=n.nodes,r=n.editConfigModel,i=r.hoverOutline,a=r.nodeSelectedOutline,s=[];return o.forEach(function(l){if(l.isHovered||l.isSelected){var f=l.isHovered,h=l.isSelected,v=l.x,b=l.y,E=l.width,O=l.height;if(a&&h||i&&f){var w=l.getOutlineStyle()||{},S={};if(Object.keys(w).forEach(function(T){T!=="hover"&&(S[T]=w[T])}),f){var M=w.hover;S=dh(dh({},S),M)}s.push($t(qu,dh({transform:l.transform,className:"lf-outline-node",x:v,y:b,width:E+10,height:O+10},S)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,o=n.edges,r=n.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,s=[],l=0;l<o.length;l++){var f=o[l];(i&&f.isSelected||a&&f.isHovered)&&(f.modelType===_o.LINE_EDGE?s.push(this.getLineOutline(f)):f.modelType===_o.POLYLINE_EDGE?s.push(this.getPolylineOutline(f)):f.modelType===_o.BEZIER_EDGE&&s.push(this.getBezierOutline(f)))}return s},e.prototype.getLineOutline=function(n){var o=n.startPoint,r=n.endPoint,i=(o.x+r.x)/2,a=(o.y+r.y)/2,s=Math.abs(o.x-r.x)+10,l=Math.abs(o.y-r.y)+10,f=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline-edge",x:i,y:a,width:s,height:l},f))},e.prototype.getPolylineOutline=function(n){var o=n.points,r=Kv(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline",x:a,y:s,width:l,height:f},h))},e.prototype.getBezierOutline=function(n){var o=n.path,r=CM(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline",x:a,y:s,width:l,height:f},h))},e.prototype.render=function(){return $t("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=GQ([xs],e),e})(ko),HQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),fh=function(){return fh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},fh.apply(this,arguments)},XQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},YQ=(function(t){HQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,o=n??{},r=o.position,i=o.isShowHorizontal,a=o.isShowVertical,s=n==null?void 0:n.getStyle(),l=r??{},f=l.x,h=f===void 0?0:f,v=l.y,b=v===void 0?0:v,E=fh(fh({x1:-1e5,y1:b,x2:1e5,y2:b},s),{stroke:i?s==null?void 0:s.stroke:"none"}),O=fh(fh({x1:h,y1:-1e5,x2:h,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return $t("g",{className:"lf-snapline",children:[$t(Gg,fh({},E)),$t(Gg,fh({},O))]})},e=XQ([xs],e),e})(ko),qQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ZQ=(function(t){qQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,o=n.tool,r=n.graphModel,i=r.textEditElement,a=o.getTools(),s=a.map(function(l){return Lr(l,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,o=n.tool,r=n.graphModel,i=document.querySelector("#ToolOverlay_".concat(r.flowId)),a=o.getInstance();a.components.forEach(function(s){return s(a,i)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return $t("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=KQ([xs],e),e})(ko),$c=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ig=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},JQ={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},QQ=(function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var o=n.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,o){var r=ig(e,2),i=r[0],a=r[1];return[i+n/this.SCALE_X,a+o/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof e=="number"?(o=e,r=e):e?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),o<this.MINI_SCALE_SIZE||o>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(o-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*n[1]),this.SCALE_X=o,this.SCALE_Y=r,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(pr.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,o,r){var i=ig(this.CanvasPointToHtmlPoint([e,n]),2),a=i[0],s=i[1],l=ig([o/2-a,r/2-s],2),f=l[0],h=l[1];this.TRANSLATE_X+=f,this.TRANSLATE_Y+=h,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=ig(Array.isArray(e)&&e.length===4?e:JQ[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},$c([Ut],t.prototype,"SCALE_X",void 0),$c([Ut],t.prototype,"SKEW_Y",void 0),$c([Ut],t.prototype,"SKEW_X",void 0),$c([Ut],t.prototype,"SCALE_Y",void 0),$c([Ut],t.prototype,"TRANSLATE_X",void 0),$c([Ut],t.prototype,"TRANSLATE_Y",void 0),$c([Ut],t.prototype,"ZOOM_SIZE",void 0),$c([Bt],t.prototype,"zoom",null),$c([Bt],t.prototype,"resetZoom",null),$c([Bt],t.prototype,"translate",null),$c([Bt],t.prototype,"focusOn",null),t})(),eee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),iS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tee=(function(t){eee(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.parentTransform=o.parentTransform,r}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale();n*=r.scaleX,o*=r.scaleY}else n*=this.parentTransform.SCALE_X,o*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:o}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;n=i*n,o=a*o}return{translateX:n,translateY:o}},e.prototype.HtmlPointToCanvasPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[(r-h)/s,(i-v)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[r*s+h,i*l+v]},e.prototype.moveCanvasPointByHtml=function(n,o,r){var i=iS(n,2),a=i[0],s=i[1],l=this.getCumulativeScale(),f=l.scaleX,h=l.scaleY;return[a+o/f,s+r/h]},e.prototype.fixDeltaXY=function(n,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[n/i,o/a]},e})(QQ),Kl=function(){return Kl=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Kl.apply(this,arguments)},dr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},nee=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ol=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hu=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ree=(function(){function t(e){var n=this,o,r;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=vl.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,f=e.grid,h=e.idGenerator,v=e.edgeGenerator,b=e.animation,E=e.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=l,typeof f=="object"&&e.snapGrid&&(this.gridSize=f.size||1),this.customStyles=e.style||{},this.grid=Sg.getGridOptions(f??!1),this.theme=AI(e.style,e.themeMode),this.theme.grid=to(this.grid),this.theme.background=to(this.background),this.edgeType=e.edgeType||"polyline",this.animation=kZ(b),this.overlapMode=e.overlapMode||vl.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(o=e.width)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(e.width),this.height=(r=e.height)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(e.height);var O=new ResizeObserver(D2((function(w){var S,M;try{for(var T=nee(w),$=T.next();!$.done;$=T.next()){var D=$.value;if(D.target===n.rootEl){var P=document.body.contains(n.rootEl);if(!P)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:D.contentRect})}}}catch(B){S={error:B}}finally{try{$&&!$.done&&(M=T.return)&&M.call(T)}finally{if(S)throw S.error}}}),16));O.observe(this.rootEl),this.waitCleanEffects.push(function(){O.disconnect()}),this.eventCenter=new TQ,this.editConfigModel=new AQ(e),this.transformModel=new tee(this.eventCenter,e),this.flowId=wh(),this.idGenerator=h,this.edgeGenerator=tJ(this,v),this.customTrajectory=E}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,n,o){return e[n.id]={index:o,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,n,o){return e[n.id]={index:o,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return hu(hu([],ol(this.nodes),!1),ol(this.edges),!1).reduce(function(e,n){return e[n.id]=n,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var e=function(l){return hu([],ol(l),!1).sort(function(f,h){return f.zIndex-h.zIndex})},n=e(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1)),o=[],r=[-y0,-y0],i=[this.width+y0,this.height+y0],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,r,i,!1,!1))&&o.push(s)}return o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(o){return o.state===Wo.TEXT_EDIT}),n=this.edges.find(function(o){return o.state===Wo.TEXT_EDIT});return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(n){n.isSelected&&e.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&e.set(n.id,n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(n){n.isSelected&&e.push(n)}),e},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(e,n,o,r,i){var a=this;o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1);var s=[];return ri(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(l){var f=a.isElementInArea(l,e,n,o,r);(!i||l.visible)&&f&&s.push(l)}),s},t.prototype.getModel=function(e){return this.modelMap.get(e)},t.prototype.getNodeModelById=function(e){var n;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getPointByClient=function(e){var n=e.x,o=e.y,r=this.rootEl.getBoundingClientRect(),i={x:n-r.left,y:o-r.top},a=ol(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),s=a[0],l=a[1],f={x:s,y:l};return{domOverlayPosition:i,canvasOverlayPosition:f}},t.prototype.isElementInArea=function(e,n,o,r,i){var a;if(r===void 0&&(r=!0),i===void 0&&(i=!0),e.BaseType===da.NODE){e=e;for(var s=gu(e),l=s.minX,f=s.minY,h=s.maxX,v=s.maxY,b=[{x:l,y:f},{x:h,y:f},{x:h,y:v},{x:l,y:v}],E=i,O=0;O<b.length;O++){var w=b[O],S=w.x,M=w.y;if(a=ol(this.transformModel.CanvasPointToHtmlPoint([S,M]),2),S=a[0],M=a[1],tS([S,M],n,o)!==i){E=!i;break}}return E}if(e.BaseType===da.EDGE){e=e;var T=e.startPoint,$=e.endPoint,D=this.transformModel.CanvasPointToHtmlPoint([T.x,T.y]),P=this.transformModel.CanvasPointToHtmlPoint([$.x,$.y]),B=tS(D,n,o),F=tS(P,n,o);return r?B&&F:B||F}return!1},t.prototype.graphDataToModel=function(e){var n=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=tc(e.nodes,function(r){var i=n.getModelAfterSnapToGrid(r);return n.elementsModelMap.set(i.id,i),n.nodeModelMap.set(i.id,i),i}):this.nodes=[],e.edges){var o=this.edgeType;this.edges=tc(e.edges,function(r){var i,a=n.getModel((i=r.type)!==null&&i!==void 0?i:o);if(!a)throw new Error("找不到".concat(r.type,"对应的边。"));var s=new a(r,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},t.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(o){var r=o.getData();r&&!o.virtual&&e.push(r)});var n=[];return this.nodes.forEach(function(o){var r=o.getData();r&&!o.virtual&&n.push(r)}),{nodes:n,edges:e}},t.prototype.modelToHistoryData=function(){for(var e=!1,n=[],o=0;o<this.nodes.length;o++){var r=this.nodes[o];if(r.isDragging){e=!0;break}else n.push(r.getHistoryData())}if(e)return!1;for(var i=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){i=!0;break}l.virtual||a.push(l.getHistoryData())}return i?!1:{nodes:n,edges:a}},t.prototype.getEdgeModelById=function(e){var n;return(n=this.edgesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getElement=function(e){return this.modelsMap[e]},t.prototype.getNodeEdges=function(e){for(var n=[],o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.sourceNodeId===e,a=r.targetNodeId===e;(i||a)&&n.push(r)}return n},t.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var n=this.selectElements,o={nodes:[],edges:[]};return n.forEach(function(r){if(r.BaseType===da.NODE&&o.nodes.push(r.getData()),r.BaseType===da.EDGE){var i=r.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&o.edges.push(i)}}),o},t.prototype.updateAttributes=function(e,n){var o=this.getElement(e);o==null||o.updateAttributes(n)},t.prototype.changeNodeId=function(e,n){return n||(n=wh()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(o){o.sourceNodeId===e&&(o.sourceNodeId=n),o.targetNodeId===e&&(o.targetNodeId=n)}),this.nodesMap[e].model.id=n,this.nodesMap[n]=this.nodesMap[e],n):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},t.prototype.changeEdgeId=function(e,n){return n||(n=wh()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(o){o.id===e&&o.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},t.prototype.getTextModel=function(e){var n=this.editConfigModel,o=n.textMode,r=n.nodeTextMode,i=n.edgeTextMode;if(e.BaseType===da.NODE)return e.textMode||r||o||Ju.TEXT;if(e.BaseType===da.EDGE)return e.textMode||i||o||Ju.TEXT},t.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},t.prototype.setTextMode=function(e,n){this.editConfigModel.updateEditConfig({textMode:e})},t.prototype.setFakeNode=function(e){this.fakeNode=e},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(e,n){return this.modelMap.set(e,n)},t.prototype.toFront=function(e){var n,o,r,i=((n=this.nodesMap[e])===null||n===void 0?void 0:n.model)||((o=this.edgesMap[e])===null||o===void 0?void 0:o.model);if(i){if(this.overlapMode===vl.STATIC)return;if(this.overlapMode===vl.INCREASE){this.setElementZIndex(e,"top");return}(r=this.topElement)===null||r===void 0||r.setZIndex(),i.setZIndex(RZ),this.topElement=i}},t.prototype.setElementZIndex=function(e,n){var o,r,i=((o=this.nodesMap[e])===null||o===void 0?void 0:o.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(i){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=I_()),n==="bottom"&&(a=sQ())),i.setZIndex(a)}},t.prototype.deleteNode=function(e){var n=this.nodesMap[e].model,o=n.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(pr.NODE_DELETE,{data:o,model:n})},t.prototype.addNode=function(e,n,o){n===void 0&&(n=pr.NODE_ADD);var r=Jl(e),i=r.id;i&&this.nodesMap[i]&&delete r.id;var a=this.getModelAfterSnapToGrid(r);this.nodes.push(a);var s=a.getData(),l={data:s};return o&&(l.e=o),this.eventCenter.emit(n,l),a},t.prototype.getModelAfterSnapToGrid=function(e){var n=this.getModel(e.type),o=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var r=e.x,i=e.y;r&&i&&(e.x=Wg(r,this.gridSize,o),e.y=Wg(i,this.gridSize,o),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-r,e.text.y+=e.y-i));var a=new n(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},t.prototype.cloneNode=function(e){var n=this.getNodeModelById(e),o=n==null?void 0:n.getData();if(o){o.x+=30,o.y+=30,o.id="",typeof o.text=="object"&&o.text!==null&&(o.text.x+=30,o.text.y+=30);var r=this.addNode(o);return r.setSelected(!0),n==null||n.setSelected(!1),r.getData()}},t.prototype.moveNode=function(e,n,o,r){var i;r===void 0&&(r=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;i=ol(s.getMoveDistance(n,o,r),2),n=i[0],o=i[1],this.moveEdge(e,n,o)},t.prototype.moveNode2Coordinate=function(e,n,o,r){r===void 0&&(r=!1);var i=this.nodesMap[e];if(!i){console.warn("不存在id为".concat(e,"的节点"));return}var a=i.model,s=a.x,l=a.y,f=n-s,h=o-l;this.moveNode(e,f,h,r)},t.prototype.editText=function(e){this.setElementStateById(e,Wo.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=Jl(e),o=n.type;o||(o=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var r=this.getModel(o);if(!r)throw new Error("找不到".concat(o,"对应的边,请确认是否已注册此类型边。"));var i=new r(Kl(Kl({},n),{type:o}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var a=i.getData();return this.edges.push(i),this.eventCenter.emit(pr.EDGE_ADD,{data:a}),i},t.prototype.moveEdge=function(e,n,o){for(var r=0;r<this.edges.length;r++){var i=this.edges[r],a=i.textPosition,s=a.x,l=a.y,f=this.edges[r].sourceNodeId===e,h=this.edges[r].targetNodeId===e;f&&i.moveStartPoint(n,o),h&&i.moveEndPoint(n,o),(f||h)&&this.handleEdgeTextMove(i,s,l)}},t.prototype.handleEdgeTextMove=function(e,n,o){var r;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===_o.POLYLINE_EDGE&&(!((r=e.text)===null||r===void 0)&&r.value)){var i=e.text,a=gI(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var s=e.textPosition,l=s.x,f=s.y;e.moveText(l-n,f-o)},t.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var o=0;o<this.edges.length;o++)if(this.edges[o].sourceNodeId===e&&this.edges[o].targetNodeId===n){var r=this.edges[o].getData();this.edges.splice(o,1),o--,this.eventCenter.emit(pr.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeById=function(e){var n=this.edgesMap[e];if(n){var o=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(o,1),this.eventCenter.emit(pr.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(pr.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(pr.EDGE_DELETE,{data:o})}},t.prototype.setElementStateById=function(e,n,o){this.nodes.forEach(function(r){r.id===e?r.setElementState(n,o):r.setElementState(Wo.DEFAULT)}),this.edges.forEach(function(r){r.id===e?r.setElementState(n,o):r.setElementState(Wo.DEFAULT)})},t.prototype.updateText=function(e,n){var o=Sh(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(r){return r.id===e});o==null||o.updateText(n)},t.prototype.selectNodeById=function(e,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.nodesMap[e])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},t.prototype.selectEdgeById=function(e,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.edgesMap[e])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},t.prototype.selectElementById=function(e,n){n===void 0&&(n=!1),n||this.clearSelectElements();var o=this.getElement(e);o==null||o.setSelected(!0)},t.prototype.deselectElementById=function(e){var n=this.getElement(e);n&&n.setSelected(!1)},t.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[vl.DEFAULT,vl.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},t.prototype.moveNodes=function(e,n,o,r){var i,a,s,l=this;r===void 0&&(r=!1);for(var f=e.reduce(function($,D){var P,B=(P=l.nodesMap[D])===null||P===void 0?void 0:P.model;return B&&($[D]=B.getMoveDistance(n,o,r)),$},{}),h=0;h<this.edges.length;h++){var v=this.edges[h],b=v.textPosition,E=b.x,O=b.y,w=f[v.sourceNodeId],S=f[v.targetNodeId],M=void 0,T=void 0;w&&S&&v.modelType===_o.POLYLINE_EDGE?(i=ol(w,2),M=i[0],T=i[1],v.updatePointsList(M,T)):(w&&(a=ol(w,2),M=a[0],T=a[1],v.moveStartPoint(M,T)),S&&(s=ol(S,2),M=s[0],T=s[1],v.moveEndPoint(M,T))),(w||S)&&this.handleEdgeTextMove(v,E,O)}},t.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},t.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},t.prototype.setDefaultEdgeType=function(e){this.edgeType=e},t.prototype.changeNodeType=function(e,n){var o=this.getNodeModelById(e);if(!o){console.warn("找不到id为".concat(e,"的节点"));return}var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new i(r,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var f=SP(a,l.startPoint,a.width,a.height);l.updateStartPoint(f)}if(l.targetNodeId===e){var f=SP(a,l.endPoint,a.width,a.height);l.updateEndPoint(f)}})},t.prototype.changeEdgeType=function(e,n){var o=this.getEdgeModelById(e);if(!o){console.warn("找不到id为".concat(e,"的边"));return}if(o.type!==n){var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var a=new i(r,this);this.edges.splice(this.edgesMap[e].index,1,a)}},t.prototype.getNodeIncomingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.targetNodeId===e&&n.push(o)}),n},t.prototype.getNodeOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.sourceNodeId===e&&n.push(o)}),n},t.prototype.getAnchorIncomingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.targetAnchorId===e&&n.push(o)}),n},t.prototype.getAnchorOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.sourceAnchorId===e&&n.push(o)}),n},t.prototype.getNodeIncomingNode=function(e){var n=this,o=[];return this.edges.forEach(function(r){var i;r.targetNodeId===e&&o.push((i=n.nodesMap[r.sourceNodeId])===null||i===void 0?void 0:i.model)}),o},t.prototype.getNodeOutgoingNode=function(e){var n=this,o=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&o.push(n.nodesMap[r.targetNodeId].model)}),o},t.prototype.setTheme=function(e,n){var o;if(n&&(j_[n]&&this.updateBackgroundOptions(Kl(Kl({},typeof this.background=="object"?this.background:{}),j_[n])),L_[n]&&this.updateGridOptions(Sg.getGridOptions(Kl(Kl({},this.grid),L_[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var r=Sg.getGridOptions((o=e.grid)!==null&&o!==void 0?o:!1);this.updateGridOptions(r)}this.theme=iQ(Kl(Kl({},this.customStyles),e),n),this.customStyles=Kl(Kl({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,o=e.grid,r=Kl(Kl({},to(this.theme)),{background:n,grid:o});return r},t.prototype.updateGridOptions=function(e){Yv(this.grid,e)},t.prototype.updateGridSize=function(e){this.gridSize=e},t.prototype.updateBackgroundOptions=function(e){mw(e)||mw(this.background)?this.background=e:this.background=Kl(Kl({},this.background),e)},t.prototype.resize=function(e,n){if(this.rootEl){var o=document.body.contains(this.rootEl);if(o){var r=this.rootEl.offsetParent!==null;if(r)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(n),r&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(i){console.warn("获取画布宽高时发生错误:",i)}}}},t.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},t.prototype.getVirtualRectSize=function(){var e=this.nodes,n=[],o=[];e.forEach(function(b){var E=b.x,O=b.y,w=b.width,S=b.height,M=b.getNodeStyle().strokeWidth,T=M===void 0?0:M,$=E+w/2+T,D=E-w/2-T,P=O+S/2+T,B=O-S/2-T;n=n.concat([$,D].filter(function(F){return!Number.isNaN(F)})),o=o.concat([P,B].filter(function(F){return!Number.isNaN(F)}))});var r=Math.min.apply(Math,hu([],ol(n),!1)),i=Math.max.apply(Math,hu([],ol(n),!1)),a=Math.min.apply(Math,hu([],ol(o),!1)),s=Math.max.apply(Math,hu([],ol(o),!1)),l=i-r||0,f=s-a||0,h=r+l/2,v=a+f/2;return{width:l,height:f,x:h,y:v}},t.prototype.translateCenter=function(){var e=this,n=e.nodes,o=e.width,r=e.height,i=e.rootEl,a=e.transformModel;if(n.length){var s=o||i.clientWidth,l=r||i.clientHeight,f=this.getVirtualRectSize(),h=f.x,v=f.y;a.focusOn(h,v,s,l)}},t.prototype.fitView=function(e,n){e===void 0&&(e=20),n===void 0&&(n=20);var o=this,r=o.nodes,i=o.width,a=o.height,s=o.rootEl,l=o.transformModel;if(r.length){var f=i||s.clientWidth,h=a||s.clientHeight,v=this.getVirtualRectSize(),b=v.width,E=v.height,O=v.x,w=v.y,S=(b+n)/f,M=(E+e)/h,T=1/Math.max(S,M),$=[f/2,h/2];l.zoom(T,$),l.focusOn(O,w,f,h)}},t.prototype.openEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(e){this.partial=e},t.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},dr([Ut],t.prototype,"width",void 0),dr([Ut],t.prototype,"height",void 0),dr([Ut],t.prototype,"theme",void 0),dr([Ut],t.prototype,"grid",void 0),dr([Ut],t.prototype,"edgeType",void 0),dr([Ut],t.prototype,"nodes",void 0),dr([Ut],t.prototype,"edges",void 0),dr([Ut],t.prototype,"fakeNode",void 0),dr([Ut],t.prototype,"overlapMode",void 0),dr([Ut],t.prototype,"background",void 0),dr([Ut],t.prototype,"gridSize",void 0),dr([Ut],t.prototype,"transformModel",void 0),dr([Ut],t.prototype,"editConfigModel",void 0),dr([Ut],t.prototype,"partial",void 0),dr([Ai],t.prototype,"nodesMap",null),dr([Ai],t.prototype,"edgesMap",null),dr([Ai],t.prototype,"modelsMap",null),dr([Ai],t.prototype,"sortElements",null),dr([Ai],t.prototype,"textEditElement",null),dr([Ai],t.prototype,"selectElements",null),dr([Ai],t.prototype,"selectNodes",null),dr([Bt],t.prototype,"setOverlapMode",null),dr([Bt],t.prototype,"setTextMode",null),dr([Bt],t.prototype,"setFakeNode",null),dr([Bt],t.prototype,"removeFakeNode",null),dr([Bt],t.prototype,"setModel",null),dr([Bt],t.prototype,"toFront",null),dr([Bt],t.prototype,"setElementZIndex",null),dr([Bt],t.prototype,"deleteNode",null),dr([Bt],t.prototype,"addNode",null),dr([Bt],t.prototype,"cloneNode",null),dr([Bt],t.prototype,"moveNode",null),dr([Bt],t.prototype,"moveNode2Coordinate",null),dr([Bt],t.prototype,"editText",null),dr([Bt],t.prototype,"addEdge",null),dr([Bt],t.prototype,"moveEdge",null),dr([Bt],t.prototype,"deleteEdgeBySourceAndTarget",null),dr([Bt],t.prototype,"deleteEdgeById",null),dr([Bt],t.prototype,"deleteEdgeBySource",null),dr([Bt],t.prototype,"deleteEdgeByTarget",null),dr([Bt],t.prototype,"setElementStateById",null),dr([Bt],t.prototype,"updateText",null),dr([Bt],t.prototype,"selectNodeById",null),dr([Bt],t.prototype,"selectEdgeById",null),dr([Bt],t.prototype,"selectElementById",null),dr([Bt],t.prototype,"deselectElementById",null),dr([Bt],t.prototype,"clearSelectElements",null),dr([Bt],t.prototype,"moveNodes",null),dr([Bt],t.prototype,"setDefaultEdgeType",null),dr([Bt],t.prototype,"changeNodeType",null),dr([Bt],t.prototype,"changeEdgeType",null),dr([Bt],t.prototype,"getNodeIncomingEdge",null),dr([Bt],t.prototype,"getNodeOutgoingEdge",null),dr([Bt],t.prototype,"getAnchorIncomingEdge",null),dr([Bt],t.prototype,"getAnchorOutgoingEdge",null),dr([Bt],t.prototype,"getNodeIncomingNode",null),dr([Bt],t.prototype,"getNodeOutgoingNode",null),dr([Bt],t.prototype,"setTheme",null),dr([Bt],t.prototype,"getTheme",null),dr([Bt],t.prototype,"resize",null),dr([Bt],t.prototype,"clearData",null),dr([Bt],t.prototype,"translateCenter",null),dr([Bt],t.prototype,"fitView",null),dr([Bt],t.prototype,"openEdgeAnimation",null),dr([Bt],t.prototype,"closeEdgeAnimation",null),dr([Bt],t.prototype,"setPartial",null),t})(),Bv=function(){return Bv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bv.apply(this,arguments)},Iy=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},oee=(function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Bv({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var o=e.x,r=e.y,i=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==e.id&&(Uc(o,l.x,this.epsilon)&&(i=!0),Uc(r,l.y,this.epsilon)&&(a=!0),i&&a))break}return{isShowVertical:i,isShowHorizontal:a,position:{x:o,y:r}}},t.prototype.getHorizontalSnapline=function(e,n){var o=!1,r=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=gu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=gu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=gu(h);if(Uc(v.minY,a==null?void 0:a.minY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.minY,this.epsilon)){o=!0,r=a.minY;break}if(Uc(v.minY,a==null?void 0:a.maxY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.maxY,this.epsilon)){o=!0,r=a.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:Bv(Bv({},this.position),{y:r})}},t.prototype.getVerticalSnapline=function(e,n){var o=!1,r=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=gu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=gu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=gu(h);if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.maxX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.maxX,this.epsilon)){o=!0,r=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:Bv(Bv({},this.position),{x:r})}},t.prototype.getSnapLinePosition=function(e,n){var o=this.getCenterSnapLine(e,n),r=o.isShowHorizontal,i=o.isShowVertical;if(!r){var a=this.getHorizontalSnapline(e,n);a.isShowHorizontal&&(o.isShowHorizontal=a.isShowHorizontal,o.position.y=a.position.y)}if(!i){var s=this.getVerticalSnapline(e,n);s.isShowVertical&&(o.isShowVertical=s.isShowVertical,o.position.x=s.position.x)}return o},t.prototype.setSnaplineInfo=function(e){var n=e.isShowHorizontal,o=e.isShowVertical,r=e.position;this.position=r,this.isShowHorizontal=n,this.isShowVertical=o},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(e){var n=this.graphModel.nodes,o=this.getSnapLinePosition(e,n);this.setSnaplineInfo(o)},Iy([Ut],t.prototype,"isShowHorizontal",void 0),Iy([Ut],t.prototype,"isShowVertical",void 0),Iy([Ut],t.prototype,"position",void 0),Iy([Bt],t.prototype,"clearSnapline",null),Iy([Bt],t.prototype,"setNodeSnapLine",null),t})();function Uc(t,e,n){return Math.abs(t-e)<=n}var iee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),aee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},see=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},uee=(function(t){iee(e,t);function e(){var n=t.apply(this,see([],lee(arguments),!1))||this;return n.handleResize=function(){var o=n.props,r=o.graphModel,i=o.options,a=r.width,s=r.height,l=r.isContainerWidth,f=r.isContainerHeight,h=a,v=s,b=!1;l&&(h=void 0,b=!0),f&&(v=void 0,b=!0),b&&r.resize(h,v),i.width=a,i.height=s},n.throttleResize=Cj(n.handleResize,200),n}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(pr.GRAPH_UPDATED,{data:n})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(n,o,r){r===void 0&&(r="canvas-overlay");var i=this.props.getView,a=i(n.type);return a?$t(a,{model:n,graphModel:o,overlay:r},n.id):null},e.prototype.render=function(){var n=this,o=this.props,r=o.graphModel,i=o.tool,a=o.options,s=o.dnd,l=o.snaplineModel,f={};a.width&&(f.width="".concat(r.width,"px")),a.height&&(f.height="".concat(r.height,"px"));var h=r.fakeNode,v=r.editConfigModel,b=r.background,E=v.adjustEdge;return $t("div",{className:"lf-graph","flow-id":r.flowId,style:f,children:[$t(kQ,{graphModel:r,dnd:s,children:[$t("g",{className:"lf-base",children:tc(r.sortElements,function(O){return n.getComponent(O,r)})}),h?this.getComponent(h,r):""]}),$t(VQ,{graphModel:r,children:[$t(zQ,{graphModel:r}),E?$t(DQ,{graphModel:r}):"",a.snapline!==!1?$t(YQ,{snaplineModel:l}):""]}),$t(ZQ,{graphModel:r,tool:i}),b&&$t(IQ,{background:b}),$t(Sg,{graphModel:r})]})},e=aee([xs],e),e})(ko),cee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Bd=function(){return Bd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bd.apply(this,arguments)},dee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fee=(function(t){cee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(o){var r=o.event,i=n.props,a=i.anchorData,s=i.nodeModel,l=i.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(pr.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=a.transformModel,h=a.eventCenter,v=a.width,b=a.height,E=a.editConfigModel,O=E.autoExpand,w=E.stopMoveGraph;if(r){var S=r.clientX,M=r.clientY,T=a.getPointByClient({x:S,y:M}),$=T.domOverlayPosition,D=$.x,P=$.y,B=T.canvasOverlayPosition,F=B.x,I=B.y;n.t&&Fw(n.t);var V=[],z=10;D<10?V=[z,0]:D+10>v?V=[-z,0]:P<10?V=[0,z]:P+10>b&&(V=[0,-z]),n.setState({endX:F,endY:I,dragging:!0}),n.moveAnchorEnd(F,I),V.length>0&&!w&&O&&(n.t=wI(function(){var X=dee(V,2),Y=X[0],W=X[1];f.translate(Y,W);var Q=n.state,J=Q.endX,ie=Q.endY;n.setState({endX:J-Y,endY:ie-W}),n.moveAnchorEnd(J-Y,ie-W)})),h.emit(pr.ANCHOR_DRAG,{data:l,e:r,nodeModel:s})}},n.onDragEnd=function(o){var r=o.event;n.t&&Fw(n.t);var i=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData;s.eventCenter.emit(pr.ANCHOR_DRAGEND,{data:f,e:r,nodeModel:l,edgeModel:i??void 0})},n.checkEnd=function(o){var r,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=l.x,h=l.y,v=l.id,b=n.state,E=b.endX,O=b.endY,w=b.dragging,S=Lw({x:E,y:O},a);if(n.preTargetNode&&n.preTargetNode.state!==Wo.DEFAULT&&n.preTargetNode.setElementState(Wo.DEFAULT),!!w&&S&&S.node){var M=S.node,T=S.anchor.id,$="".concat(s.id,"_").concat(M.id,"_").concat(T,"_").concat(v),D=n.sourceRuleResults.get($)||{},P=D.isAllPass,B=D.msg,F=n.targetRuleResults.get($)||{},I=F.isAllPass,V=F.msg;if(P&&I){M.setElementState(Wo.DEFAULT);var z=a.getNodeModelById(S.node.id),X=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,s.getData(),z==null?void 0:z.getData()),Y=a.addEdge(Bd(Bd({},X),{sourceNodeId:s.id,sourceAnchorId:v,startPoint:{x:f,y:h},targetNodeId:S.node.id,targetAnchorId:S.anchor.id,endPoint:{x:S.anchor.x,y:S.anchor.y}})),W=n.props.anchorData;return a.eventCenter.emit(pr.ANCHOR_DROP,{data:W,e:o,nodeModel:s,edgeModel:Y}),Y}var Q=M.getData();return a.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Q,msg:V||B||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,o=n.anchorData,r=n.style,i=n.node,a=i.getAnchorShape(o);if(a)return a;var s=o.x,l=o.y,f=Bd(Bd({},r),r==null?void 0:r.hover);return $t("g",{children:[$t(zg,Bd({className:"lf-node-anchor-hover"},f,{x:s,y:l})),$t(zg,Bd({className:"lf-node-anchor"},r,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,o=n.graphModel,r=o.getAnchorIncomingEdge,i=o.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:r(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,o){var r,i,a=this.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData,h=Lw({x:n,y:o},s);if(h){var v=h.node,b=h.anchor.id;if(this.preTargetNode&&this.preTargetNode!==h.node&&this.preTargetNode.setElementState(Wo.DEFAULT),f.id===b)return;this.preTargetNode=v;var E="".concat(l.id,"_").concat(v.id,"_").concat(b,"_").concat(f.id);if(!this.targetRuleResults.has(E)){var O=h.anchor,w=l.isAllowConnectedAsSource(v,f,O),S=v.isAllowConnectedAsTarget(l,f,O);this.sourceRuleResults.set(E,Iw(w)),this.targetRuleResults.set(E,Iw(S))}var M=((r=this.sourceRuleResults.get(E))!==null&&r!==void 0?r:{}).isAllPass,T=((i=this.targetRuleResults.get(E))!==null&&i!==void 0?i:{}).isAllPass;M&&T?v.setElementState(Wo.ALLOW_CONNECT):v.setElementState(Wo.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Wo.DEFAULT&&this.preTargetNode.setElementState(Wo.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,o=n.startX,r=n.startY,i=n.endX,a=n.endY,s=qc(o,r,i,a);return s>10},e.prototype.render=function(){var n=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,s=o.endY,l=this.props,f=l.anchorData,h=l.edgeStyle,v=l.nodeModel,b=l.graphModel,E=f.edgeAddable;return $t("g",{className:"lf-anchor",children:[$t("g",{onClick:function(O){O.stopPropagation(),b.eventCenter.emit(pr.ANCHOR_CLICK,{data:f,e:O,nodeModel:v})},onMouseDown:function(O){b.eventCenter.emit(pr.ANCHOR_MOUSEDOWN,{data:f,e:O,nodeModel:v}),E!==!1&&n.dragHandler.handleMouseDown(O)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Bd({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:s}},h)):$t(Gg,Bd({x1:r,y1:i,x2:a,y2:s},h,{"pointer-events":"none"})))]})},e})(ko),pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KA=function(){return KA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},KA.apply(this,arguments)},hee=(function(t){pee(e,t);function e(n){var o=t.call(this,n)||this;return o.style={},o.onDragging=function(r){var i,a=r.event,s=o.props,l=s.graphModel,f=s.nodeModel,h=s.eventCenter,v=l.selectNodes,b=f.x,E=f.y,O=a.clientX,w=a.clientY,S=l.getPointByClient({x:O,y:w}).canvasOverlayPosition,M=S.x,T=S.y,$=new Il(M-b,T-E),D=((i=o.normal)===null||i===void 0?void 0:i.angle($))-o.defaultAngle,P=new Dw(-b,-E).rotate(D).translate(b,E).toString();f.transform=P,f.rotate=D;var B=tc(v,function(I){return I.id});B.indexOf(f.id)===-1&&(B=[f.id]);var F=Vj(B,function(I,V){var z=l.getNodeModelById(V);return I[V]=z==null?void 0:z.getMoveDistance(0,0,!1),I},{});B.forEach(function(I){var V=l.getNodeEdges(I);V.forEach(function(z){if(F[z.sourceNodeId]){var X=l.getNodeModelById(z.sourceNodeId),Y=X.anchors.find(function(W){return W.id===z.sourceAnchorId});z.updateStartPoint(Y)}if(F[z.targetNodeId]){var X=l.getNodeModelById(z.targetNodeId),Y=X.anchors.find(function(J){return J.id===z.targetAnchorId});z.updateEndPoint(Y)}})}),h.emit(pr.NODE_ROTATE,{e:a,model:f,data:f.getData()})},o.style=n.style,o.stepperDrag=new ac({onDragging:o.onDragging}),o}return e.prototype.render=function(){var n=this,o=this.props.nodeModel,r=o.x,i=o.y,a=o.width,s=o.height,l=r+a/2+20,f=i-s/2-20;return this.normal=new Il(1,0),this.defaultAngle=this.normal.angle(new Il(l-r,f-i)),o.defaultAngle=this.defaultAngle,$t("g",{className:"lf-rotate-control",children:$t("g",{onMouseDown:function(h){n.stepperDrag.handleMouseDown(h)},children:$t(zg,KA({},this.style,{cx:l,cy:f}))})})},e})(ko),aS={exports:{}};/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/var IP;function vee(){return IP||(IP=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)e.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(aS)),aS.exports}var mee=vee();const ZA=Z_(mee);var gee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),JA=function(){return JA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},JA.apply(this,arguments)},yee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TI=(function(t){gee(e,t);function e(n){var o=t.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,s=a.draggable,l=a.model,f=a.graphModel,h=f.editConfigModel.nodeTextDraggable;(s??h)&&(i.stopPropagation(),o.stepperDrag.model=l,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,s=i.deltaY,l=o.props,f=l.model,h=l.graphModel.transformModel;if(a||s){var v=yee(h.fixDeltaXY(a,s),2),b=v[0],E=v[1];f.moveText(b,E)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,s=i.graphModel.eventCenter,l=i.model;a&&l.setElementState(Wo.TEXT_EDIT),s.emit(pr.TEXT_DBCLICK,{data:l.text,model:l})};var r=n.draggable;return o.stepperDrag=new ac({onDragging:o.onDragging,step:1,eventType:"TEXT",isStopPropagation:r}),o}return e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=o.text,s=a.value,l=a.x,f=a.y,h=a.editable,v=a.draggable,b={x:l,y:f,className:"",value:s},E=o.getTextStyle(),O=i.nodeTextDraggable||v;return $t(EI,JA({},b,E,{className:ZA({"lf-element-text":h,"lf-text-draggable":!h&&O,"lf-text-disabled":!h&&!O}),model:o}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return $t("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e})(ko),_ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Wc=function(){return Wc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Wc.apply(this,arguments)},C0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},bee=(function(t){_ee(e,t);function e(n){var o=t.call(this,n)||this;return o.setHoverOn=function(){o.setState({isHovered:!0})},o.setHoverOff=function(){o.setState({isHovered:!1})},o.state={isHovered:!1},o}return e.prototype.getBackground=function(){var n=this.state.isHovered,o=this.props.model,r=o.text,i=o.getTextStyle(),a=i.background||{};if(n&&i.hover&&i.hover.background&&(a=Wc(Wc({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var s=i.fontSize,l=i.textWidth,f=i.lineHeight,h=i.overflowMode,v=a.wrapPadding,b=r==null?void 0:r.value.split(/[\r\n]/g),E=b.length,O=r.x,w=r.y,S={};if(h==="autoWrap"&&l){var M=bI({rows:b,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:f,padding:v},rowsLength:E,className:"lf-get-text-height"});S=Wc(Wc({},a),{x:O,y:w,width:l,height:M})}else{var T=nJ({rows:b,rowsLength:E,fontSize:s}),$=T.width,D=T.height;if(h==="ellipsis"&&($=l,D=s+2),typeof a.wrapPadding=="string"){var P=a.wrapPadding.split(",").filter(function(Pe){return Pe.trim()}).map(function(Pe){return parseFloat(Pe.trim())});if(P.length>0&&P.length<=4){if(P.length===1){var B=C0(P,1),F=B[0];P=[F,F,F,F]}else if(P.length===2){var I=C0(P,2),V=I[0],z=I[1];P=[V,z,V,z]}else if(P.length===3){var X=C0(P,3),Y=X[0],z=X[1],W=X[2];P=[Y,z,W,z]}var Q=C0(P,4),J=Q[0],ie=Q[1],Se=Q[2],Ae=Q[3];$+=ie+Ae,D+=J+Se,O=O+(ie-Ae)/2,w=w+(Se-J)/2}}S=Wc(Wc({},a),{x:O-1,y:w-1,width:$,height:D})}return $t(qu,Wc({},S))}return null},e.prototype.getShape=function(){var n=this.props.model,o=n.text,r=o.x,i=o.y,a=o.value;if(!a)return null;var s=n.getTextStyle(),l=Wc({x:r,y:i,value:a,model:n,className:"lf-element-text"},s);return $t("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$t(EI,Wc({},l))]})},e})(TI),wee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Vw=function(){return Vw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Vw.apply(this,arguments)},Eee=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},N0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ih=(function(t){wee(e,t);function e(n){var o=t.call(this)||this;o.onDragStart=function(l){var f=l.event,h=o.props,v=h.model,b=h.graphModel;if(f){var E=b.getPointByClient({x:f.clientX,y:f.clientY}).canvasOverlayPosition,O=E.x,w=E.y;o.moveOffset={dx:v.x-O,dy:v.y-w}}},o.onDragging=function(l){var f,h,v,b,E=l.event,O=o.props,w=O.model,S=O.graphModel,M=S.editConfigModel,T=M.stopMoveGraph,$=M.autoExpand,D=M.snapGrid,P=S.transformModel,B=S.selectNodes,F=S.width,I=S.height,V=S.gridSize;w.isDragging=!0;var z=E,X=z.clientX,Y=z.clientY,W=o.mouseDownPosition,Q=W.x,J=W.y;(X-Q>V||Y-J>V)&&(w.isDragging=!0);var ie=S.getPointByClient({x:X,y:Y}).canvasOverlayPosition,Se=ie.x,Ae=ie.y,Pe=N0(P.CanvasPointToHtmlPoint([Se,Ae]),2),De=Pe[0],ze=Pe[1];if(Se=Se+((h=(f=o.moveOffset)===null||f===void 0?void 0:f.dx)!==null&&h!==void 0?h:0),Ae=Ae+((b=(v=o.moveOffset)===null||v===void 0?void 0:v.dy)!==null&&b!==void 0?b:0),Se=Wg(Se,V,D),Ae=Wg(Ae,V,D),!F||!I){S.moveNode2Coordinate(w.id,Se,Ae);return}var Ye=De<0||ze<0||De>F||ze>I;if(!($&&!T&&Ye)){var Be=N0(P.CanvasPointToHtmlPoint([Se-w.width/2,Ae-w.height/2]),2),Je=Be[0],gt=Be[1],le=N0(P.CanvasPointToHtmlPoint([Se+w.width/2,Ae+w.height/2]),2),Ze=le[0],pe=le[1],se=Math.max(V,20),we=[];Je<0?we=[se,0]:Ze>S.width?we=[-se,0]:gt<0?we=[0,se]:pe>S.height&&(we=[0,-se]),o.t&&Fw(o.t);var $e=B.map(function(rt){return rt.id});$e.indexOf(w.id)===-1&&($e=[w.id]),we.length>0&&!T&&$?o.t=wI(function(){var rt=N0(we,2),pt=rt[0],Lt=rt[1];P.translate(pt??0,Lt??0);var Jt=-(pt??0)/P.SCALE_X,en=-(Lt??0)/P.SCALE_X;S.moveNodes($e,Jt,en)}):S.moveNodes($e,Se-w.x,Ae-w.y)}},o.onDragEnd=function(){o.t&&Fw(o.t);var l=o.props.model;l.isDragging=!1},o.onMouseOut=function(l){PZ()&&o.setHoverOff(l)},o.handleMouseUp=function(){var l=o.props.model;o.mouseUpDrag=l.isDragging},o.handleClick=function(l){var f=o.mouseUpDrag===!1,h=new Date().getTime();if(o.startTime){var v=h-o.startTime,b=o.props,E=b.model,O=b.graphModel;if(!(!f&&v>300)){f||(o.onDragEnd(),o.handleMouseUp());var w=E.getData(),S=O.getPointByClient({x:l.clientX,y:l.clientY}),M={data:w,e:l,position:S,isSelected:!1,isMultiple:!1},T=l.button===2,$=l.detail===2;if(!T){var D=O.editConfigModel,P=yI(l,D);if(M.isMultiple=P,E.isSelected&&!$&&P?(M.isSelected=!1,E.setSelected(!1)):(O.selectNodeById(E.id,P),M.isSelected=!0,D.isSilentMode||o.toFront()),$)D.nodeTextEdit&&E.text.editable&&D.textMode===Ju.TEXT&&(E.setSelected(!1),O.setElementStateById(E.id,Wo.TEXT_EDIT)),O.eventCenter.emit(pr.NODE_DBCLICK,M);else{O.eventCenter.emit(pr.ELEMENT_CLICK,M),O.eventCenter.emit(pr.NODE_CLICK,M);var B=l.currentTarget,F=!ws(window)&&kh(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(I){return setTimeout(I,0)};F(function(){B.focus()})}}}}},o.handleContextMenu=function(l){l.preventDefault();var f=o.props,h=f.model,v=f.graphModel,b=v.editConfigModel,E=h.getData(),O=v.getPointByClient({x:l.clientX,y:l.clientY});v.setElementStateById(h.id,Wo.SHOW_MENU,O.domOverlayPosition),h.isSelected||v.selectNodeById(h.id),v.eventCenter.emit(pr.NODE_CONTEXTMENU,{data:E,e:l,position:O}),b.isSilentMode||o.toFront()},o.handleMouseDown=function(l){var f=o.props,h=f.model,v=f.graphModel;o.mouseDownPosition={x:l.clientX,y:l.clientY},o.startTime=new Date().getTime();var b=v.editConfigModel;b.adjustNodePosition&&h.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.handleFocus=function(){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(pr.NODE_FOCUS,{data:f.getData()})},o.handleBlur=function(){if(o.props){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(pr.NODE_BLUR,{data:f.getData()})}},o.setHoverOn=function(l){var f=o.props,h=f.model,v=f.graphModel;if(!h.isHovered){var b=h.getData();h.setHovered(!0),v.eventCenter.emit(pr.NODE_MOUSEENTER,{data:b,e:l})}},o.setHoverOff=function(l){var f=o.props,h=f.model,v=f.graphModel,b=h.getData();h.isHovered&&(h.setHovered(!1),v.eventCenter.emit(pr.NODE_MOUSELEAVE,{data:b,e:l}))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter,s=n.model;return o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),o.modelDisposer=H3(function(){return o.props},function(l){l&&l.model&&o.stepDrag.setModel(l.model)}),o}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.isSelected,s=r.isHitable,l=r.isDragging,f=r.isShowAnchor;return s&&(a||f)&&!l?tc(r.anchors,function(h,v){var b=r.getAnchorLineStyle(h),E=r.getAnchorStyle(h);return $t(fee,{anchorData:h,node:n,style:E,edgeStyle:b,anchorIndex:v,nodeModel:r,graphModel:i,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowRotate,l=o.isSelected,f=o.isHitable,h=o.rotatable,v=o.isHovered,b=s&&h,E=o.getRotateControlStyle();if(!a&&f&&(l||v)&&b)return $t(hee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:E})},e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowResize,l=o.isSelected,f=o.isHitable,h=o.resizable,v=o.isHovered,b=s&&h,E=o.getResizeControlStyle();return!a&&f&&(l||v)&&b?$t(PJ,{style:E,model:o,graphModel:r}):null},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.nodeTextDraggable&&r.text.draggable&&(s=!0),$t(TI,{editable:a.nodeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,o=n.state,r=n.isDragging,i=n.isSelected,a="lf-node";switch(o){case Wo.ALLOW_CONNECT:a+=" lf-node-allow";break;case Wo.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,o=n.model,r=n.graphModel;o.autoToFront&&r.toFront(o.id)},e.prototype.render=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.hideAnchors,s=i.adjustNodePosition,l=i.allowRotate,f=i.allowResize,h=r.gridSize,v=r.transformModel.SCALE_X,b=o.isHitable,E=o.draggable,O=o.transform,w=o.getOuterGAttributes(),S=w.className,M=S===void 0?"":S,T=Eee(w,["className"]),$=$t("g",{className:"lf-node-content",children:[$t("g",{transform:O,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),f&&this.getResizeControl()]}),!a&&this.getAnchors()]}),D;return b?(s&&E&&this.stepDrag.setStep(h*v),D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},T,{children:$}))):D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M)},T,{children:$})),D},e.isObserved=!1,e})(ko),xee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),QA=function(){return QA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},QA.apply(this,arguments)},Zv=(function(t){xee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(qu,QA({},o,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},e})(Ih),Oee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e2=function(){return e2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e2.apply(this,arguments)},Ww=(function(t){Oee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.r,a=n.getNodeStyle();return $t(zg,e2({},a,{x:o,y:r,r:i}))},e})(Ih),See=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Gw=function(){return Gw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Gw.apply(this,arguments)},zw=(function(t){See(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle(),h={transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")};return $t("g",Gw({},h,{children:$t(kM,Gw({},f,{points:l,x:r,y:i}))}))},e})(Ih),Aee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t2=function(){return t2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},t2.apply(this,arguments)},n2=(function(t){Aee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t("g",{children:$t(kM,t2({},o,{points:n.points,x:n.x,y:n.y}))})},e})(Ih),Mee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),r2=function(){return r2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r2.apply(this,arguments)},o2=(function(t){Mee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(OJ,r2({},o,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},e})(Ih),Tee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c_=function(){return c_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c_.apply(this,arguments)},FP=(function(t){Tee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBackground=function(){var n=this.props.model,o=n.getTextStyle(),r=n.width,i=n.height,a=n.x,s=n.y,l=c_(c_({},o.background),{x:a,y:s,width:r,height:i});return $t(qu,c_({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return $t("g",{children:this.getBackground()})},e})(Ih),Cee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i2=function(){return i2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},i2.apply(this,arguments)},Nee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},kee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},a2=(function(t){Cee(e,t);function e(){var n=t.apply(this,kee([],Nee(arguments),!1))||this;return n.ref=W1(),n}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(n){this.setHtml(n)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),$t("foreignObject",i2({},s,{x:o-a/2,y:r-i/2,width:a,height:i,ref:this.ref}))},e})(Ih),Pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Gc=function(){return Gc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Gc.apply(this,arguments)},Ree=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},Dee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ud;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ud||(Ud={}));var BP=(function(t){Pee(e,t);function e(n){var o=t.call(this)||this;o.handleMouseDown=function(l){o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.onDragStart=function(){var l=o.props,f=l.x,h=l.y,v=l.edgeModel,b=v.startPoint,E=v.endPoint,O=v.pointsList;o.oldEdge={startPoint:b,endPoint:E,pointsList:O},o.setState({endX:f,endY:h,dragging:!0})},o.onDragging=function(l){var f=l.deltaX,h=l.deltaY,v=o.state,b=v.endX,E=v.endY,O=o.props,w=O.graphModel,S=O.type,M=w.transformModel,T=w.editConfigModel,$=Dee(M.moveCanvasPointByHtml([b,E],f,h),2),D=$[0],P=$[1];o.setState({endX:D,endY:P,dragging:!0});var B=o.props.edgeModel,F=Lw({x:b,y:E},w);if(F&&F.node&&o.isAllowAdjust(F).pass){var I=B.startPoint,V=B.endPoint,z=B.sourceNode,X=B.targetNode,Y=S===Ud.SOURCE?{startPoint:{x:F.anchor.x,y:F.anchor.y},endPoint:{x:V.x,y:V.y},sourceNode:F.node,targetNode:X}:{startPoint:{x:I.x,y:I.y},endPoint:{x:F.anchor.x,y:F.anchor.y},sourceNode:z,targetNode:F.node};B.updateAfterAdjustStartAndEnd(Y)}else S===Ud.SOURCE?B.updateStartPoint({x:D,y:P}):B.updateEndPoint({x:D,y:P});B.text.value&&T.adjustEdge&&B.setText(Object.assign({},B.text,B.textPosition))},o.onDragEnd=function(l){var f,h,v,b=l.event;try{o.setState({dragging:!1});var E=o.props,O=E.graphModel,w=E.edgeModel,S=E.type,M=o.state,T=M.endX,$=M.endY,D=M.dragging,P=Lw({x:T,y:$},O);if(!D)return;var B=!1,F=void 0;if(P&&P.node){var I=o.isAllowAdjust(P),V=I.pass,z=I.msg,X=I.newTargetNode;if(V){var Y=w.getData(),W=Y.text,Q=Y.sourceAnchorId,J=Q===void 0?"":Q,ie=Y.targetAnchorId,Se=ie===void 0?"":ie,Ae=Ree(Y,["text","sourceAnchorId","targetAnchorId"]);if(F=Gc(Gc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(W==null?void 0:W.value)||""}),S===Ud.SOURCE){var Pe=O.getNodeModelById(P.node.id),De=O.getNodeModelById(w.targetNodeId),ze=(f=O.edgeGenerator)===null||f===void 0?void 0:f.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),F);F=Gc(Gc({},ze),{sourceNodeId:P.node.id,sourceAnchorId:P.anchor.id,startPoint:{x:P.anchor.x,y:P.anchor.y},targetNodeId:w.targetNodeId,endPoint:Gc({},w.endPoint)}),w.sourceNodeId===P.node.id&&w.sourceAnchorId===P.anchor.id&&(B=!0)}else if(S===Ud.TARGET){var Pe=O.getNodeModelById(w.sourceNodeId),De=O.getNodeModelById(P.node.id),ze=(h=O.edgeGenerator)===null||h===void 0?void 0:h.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),F);F=Gc(Gc({},ze),{sourceNodeId:w.sourceNodeId,startPoint:Gc({},w.startPoint),targetNodeId:P.node.id,targetAnchorId:P.anchor.id,endPoint:{x:P.anchor.x,y:P.anchor.y}}),w.targetNodeId===P.node.id&&w.targetAnchorId===P.anchor.id&&(B=!0)}}else{B=!0;var Ye=X.getData();O.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Ye,msg:z})}}else B=!0;if(B)o.recoveryEdge();else{var Be=w.getData();O.deleteEdgeById(w.id);var Je=O.addEdge(Gc({},F));O.eventCenter.emit(pr.EDGE_EXCHANGE_NODE,{data:{newEdge:Je.getData(),oldEdge:Be}})}(v=o.preTargetNode)===null||v===void 0||v.setElementState(Wo.DEFAULT)}finally{var O=o.props.graphModel;O.eventCenter.emit(pr.ADJUST_POINT_DRAGEND,{e:b,data:o.stepDragData})}},o.recoveryEdge=function(){var l=o.props.edgeModel,f=o.oldEdge,h=f.startPoint,v=f.endPoint,b=f.pointsList;l.updateStartPoint(h),l.updateEndPoint(v),l.modelType!==_o.LINE_EDGE&&(l.pointsList=b??[],l.initPoints())},o.getAdjustPointStyle=function(){var l=o.props.graphModel.theme,f=l.edgeAdjust;return f},o.state={dragging:!1,endX:0,endY:0},o.targetRuleResults=new Map,o.sourceRuleResults=new Map;var r=n.type,i=n.edgeModel,a=n.graphModel,s=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:o.stepDragData}),o}return e.prototype.isAllowAdjust=function(n){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,s=r.targetNode,l=r.sourceAnchorId,f=r.targetAnchorId,h=o.type,v,b,E,O;if(h===Ud.SOURCE?(v=n.node,b=s,E=n.anchor,O=s.getAnchorInfo(f)):(v=a,b=n.node,O=n.anchor,E=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(Wo.DEFAULT),this.preTargetNode=n.node,O.id===E.id)return{pass:!1,msg:"",newTargetNode:b};var w="".concat(v.id,"_").concat(b.id,"_").concat(E.id,"_").concat(O.id);if(!this.targetRuleResults.has(w)){var S=v.isAllowConnectedAsSource(b,E,O,i),M=b.isAllowConnectedAsTarget(v,E,O,i);this.sourceRuleResults.set(w,Iw(S)),this.targetRuleResults.set(w,Iw(M))}var T=this.sourceRuleResults.get(w),$=T.isAllPass,D=T.msg,P=this.targetRuleResults.get(w),B=P.isAllPass,F=P.msg,I=$&&B?Wo.ALLOW_CONNECT:Wo.NOT_ALLOW_CONNECT;return h===Ud.SOURCE?v.setElementState(I):b.setElementState(I),{pass:$&&B,msg:F||D,newTargetNode:b}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return $t("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":i(o,r,a)})},e})(ko),jee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l2=function(){return l2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l2.apply(this,arguments)};(function(t){jee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var n=this.props,o=n.arrowInfo,r=n.style,i=o.start,a=o.end,s={start:i,end:a,offset:r.offset,verticalLength:r.verticalLength,type:"end"},l=C_(s),f=l.leftX,h=l.leftY,v=l.rightX,b=l.rightY;return l2({d:"M".concat(f," ").concat(h," L").concat(a.x," ").concat(a.y," L").concat(v," ").concat(b," z")},r)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),o=n.d,r=n.strokeWidth,i=n.stroke,a=n.fill;return $t(P_,{d:o,fill:a,strokeWidth:r,stroke:i})},e.prototype.render=function(){return $t("g",{className:"lf-arrow",children:this.getShape()})},e})(ko);var Lee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),d_=function(){return d_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},d_.apply(this,arguments)},Iee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Z1=(function(t){Lee(e,t);function e(){var n=t.call(this)||this;return n.textRef=W1(),n.handleHover=function(o,r){var i=n.props,a=i.model,s=i.graphModel.eventCenter;a.setHovered(o);var l=o?pr.EDGE_MOUSEENTER:pr.EDGE_MOUSELEAVE,f=a.getData();s.emit(l,{data:f,e:r})},n.setHoverOn=function(o){var r=n.props.model.isHovered;r||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,o))},n.setHoverOff=function(o){var r=n.props.model.isHovered;r&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,o))},n.handleContextMenu=function(o){o.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,i=r.model,a=r.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,Wo.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),i.isSelected||a.selectEdgeById(i.id);var f=i==null?void 0:i.getData();a.eventCenter.emit(pr.EDGE_CONTEXTMENU,{data:f,e:o,position:l})},n.handleMouseDown=function(o){o.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var o=n.props.model;n.mouseUpDrag=o.isDragging},n.handleClick=function(o){if(n.startTime&&!n.mouseUpDrag){var r=o.button===2;if(!r){var i=o.detail===2,a=n.props,s=a.model,l=a.graphModel,f=s==null?void 0:s.getData(),h=l.getPointByClient({x:o.clientX,y:o.clientY});if(i){var v=l.editConfigModel,b=l.textEditElement,E=s.id,O=s.text,w=s.modelType;if(b&&b.id===E&&l.setElementStateById(E,Wo.DEFAULT),v.edgeTextEdit&&O.editable&&(s.setSelected(!1),l.setElementStateById(E,Wo.TEXT_EDIT)),w===_o.POLYLINE_EDGE){var S=s,M=l.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,T=M.x,$=M.y;S.dbClickPosition=gI({x:T,y:$},S.points)}l.eventCenter.emit(pr.EDGE_DBCLICK,{data:f,e:o,position:h})}else{l.eventCenter.emit(pr.ELEMENT_CLICK,{data:f,e:o,position:h}),l.eventCenter.emit(pr.EDGE_CLICK,{data:f,e:o,position:h});var D=o.currentTarget,P=!ws(window)&&kh(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(F){return setTimeout(F,0)};P(function(){D.focus()})}var B=l.editConfigModel;l.selectEdgeById(s.id,yI(o,B)),B.isSilentMode||n.toFront()}}},n.handleFocus=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_FOCUS,{data:r.getData()})},n.handleBlur=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_BLUR,{data:r.getData()})},n}return e.prototype.getShape=function(){return $t("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.edgeTextDraggable&&r.text.draggable&&(s=!0),$t(bee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isSelected,a=this.state.hover;return{start:o,end:r,hover:a,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint;return[o,r]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,o=n.id,r=n.getArrowStyle(),i=r.refY,a=i===void 0?0:i,s=r.refX,l=s===void 0?2:s,f=Iee(this.getLastTwoPoints(),2),h=f[0],v=f[1],b="auto";if(h&&v){var E=v.x-h.x,O=v.y-h.y;if(E!==0||O!==0){var w=YJ(XJ({x:E,y:O}));Number.isFinite(w)&&!Number.isNaN(w)&&(b=w)}}return $t("g",{children:$t("defs",{children:[$t("marker",{id:"marker-start-".concat(o),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$t("marker",{id:"marker-end-".concat(o),refX:l,refY:a,overflow:"visible",orient:b,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,s=o.strokeWidth,l=o.offset,f=l===void 0?10:l,h=o.verticalLength,v=o.strokeLinecap,b=o.strokeLinejoin,E=o.transform,O="";switch(n){case"solid":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(3*f/4,",-").concat(h," Z");break;case"hollow":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(-f/4,",0 L").concat(3*f/4,",-").concat(h," L").concat(-f/4,",0 Z");break;case"diamond":O="M".concat(-f/2,",0 L0,").concat(h," L").concat(f/2,",0 L0,-").concat(h," L").concat(-f/2,",0 Z");break;case"circle":O="M".concat(-f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(-f/2,",0 Z");break;default:O="";break}return $t("path",{d:O,stroke:r,fill:a,strokeWidth:s,strokeLinecap:v,strokeLinejoin:b,transform:E})},e.prototype.getStartArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.startArrowType,f=l===void 0?"none":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v})},e.prototype.getEndArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.endArrowType,f=l===void 0?"solid":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zg,d_({className:"lf-edge-adjust-point"},i,{x:n,y:o}))},e.prototype.getAdjustPoints=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.adjustEdgeStartAndEnd,s=i.adjustEdgeStart,l=i.adjustEdgeEnd,f=o.getAdjustStart(),h=o.getAdjustEnd();return $t("g",{children:[a&&s&&$t(BP,d_({type:Ud.SOURCE},f,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&l&&$t(BP,d_({type:Ud.TARGET},h,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return $t("g",{})},e.prototype.getAppend=function(){return $t("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,o=n.graphModel,r=n.model;o.toFront(r.id)},e.prototype.render=function(){var n=this.props.model,o=n.isSelected,r=n.isHitable,i=n.isShowAdjustPoint;return $t("g",{children:[$t("g",{className:["lf-edge",!r&&"pointer-none",o&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&o?this.getAdjustPoints():""]})},e.isObserved=!1,e})(ko),Fee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s2=function(){return s2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s2.apply(this,arguments)},Bee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$P=(function(t){Fee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.getEdgeStyle(),r=n,i=r.path,a=r.isAnimation,s=r.arrowConfig,l=n.getEdgeAnimationStyle(),f=l.strokeDasharray,h=l.stroke,v=l.strokeDashoffset,b=l.animationName,E=l.animationDuration,O=l.animationIterationCount,w=l.animationTimingFunction,S=l.animationDirection;return $t(P_,s2({d:i},o,s,a?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(P_,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,o=this.state.hover,r=n.isSelected,i=n.getArrowStyle().offset,a=n.pointsList.map(function(v){return{x:v.x,y:v.y}}),s=Bee(_P(a,i),2),l=s[0],f=s[1],h={start:l,end:f,hover:o,isSelected:r};return h},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.getArrowStyle().offset,r=n.pointsList.map(function(i){return{x:i.x,y:i.y}});return _P(r,o)},e})(Z1),$ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u2=function(){return u2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u2.apply(this,arguments)},UP=(function(t){$ee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),f=l.strokeDasharray,h=l.stroke,v=l.strokeDashoffset,b=l.animationName,E=l.animationDuration,O=l.animationIterationCount,w=l.animationTimingFunction,S=l.animationDirection;return $t(Gg,u2({},s,{x1:o.x,y1:o.y,x2:r.x,y2:r.y},a,i?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i={start:o,end:r},a=QZ(i),s=a.d,l=a.strokeWidth,f=a.fill,h=a.strokeDasharray,v=a.stroke;return $t(P_,{d:s,fill:f,strokeWidth:l,stroke:v,strokeDasharray:h})},e})(Z1),Uee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),$v=function(){return $v=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},$v.apply(this,arguments)},Vee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$_=(function(t){Uee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var o=n.props.model;o.dragAppendStart(),n.isShowAdjustPointTemp=o.isShowAdjustPoint,o.isShowAdjustPoint=!1},n.onDragging=function(o){var r=o.deltaX,i=o.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var f=l.transformModel,h=l.editConfigModel,v=Vee(f.fixDeltaXY(r,i),2),b=v[0],E=v[1],O=s,w=h.adjustEdgeMiddle;w?n.appendInfo=O.dragAppendSimple(n.appendInfo,{x:b,y:E}):n.appendInfo=O.dragAppend(n.appendInfo,{x:b,y:E})},n.onDragEnd=function(){var o,r=n.props,i=r.model,a=r.graphModel.eventCenter,s=i;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(o=n.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,n.appendInfo=void 0,a.emit(pr.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(o,r){r.draggable&&n.drag.handleMouseDown(o),n.appendInfo=r},n.drag=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,f=s.stroke,h=s.strokeDashoffset,v=s.animationName,b=s.animationDuration,E=s.animationIterationCount,O=s.animationTimingFunction,w=s.animationDirection;return $t(TJ,$v({points:o},a,i,r?{strokeDasharray:l,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:b,animationIterationCount:E,animationTimingFunction:O,animationDirection:w}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.points,r=n.isSelected,i=this.state.hover,a=Kv(o),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:i,isSelected:r}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.points,r=Kv(o),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),[i,a]},e.prototype.getAppendAttributes=function(n){var o=n.start,r=n.end,i;if(o.x===r.x&&o.y===r.y)i="";else{var a={start:o,end:r,offset:10,verticalLength:5},s=C_($v($v({},a),{type:"start"})),l=C_($v($v({},a),{type:"end"}));i="M".concat(s.leftX," ").concat(s.leftY,`
|
||
L`).concat(s.rightX," ").concat(s.rightY,`
|
||
L`).concat(l.rightX," ").concat(l.rightY,`
|
||
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var o=this.getAppendAttributes(n),r=o.d,i=o.strokeWidth,a=o.fill,s=o.strokeDasharray,l=o.stroke;return $t(P_,{d:r,fill:a,strokeWidth:i,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,s=r.draggable,l=[],f=a.length,h=function(E){var O="lf-polyline-append",w={start:{x:a[E].x,y:a[E].y},end:{x:a[E+1].x,y:a[E+1].y},startIndex:E,endIndex:E+1,direction:ni.HORIZONTAL,draggable:!0},S=$t("g",{className:O,children:v.getAppendShape(w)}),M=i.editConfigModel,T=M.adjustEdge,$=M.adjustEdgeMiddle;if(T&&s){var D=w.startIndex,P=w.endIndex,B=$&&(D===0||P===f-1);w.draggable=!B,w.start.x===w.end.x?(w.draggable&&(O+="-ew-resize"),w.direction=ni.VERTICAL):w.start.y===w.end.y&&(w.draggable&&(O+="-ns-resize"),w.direction=ni.HORIZONTAL),S=$t("g",{className:v.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(F){return n.beforeDragStart(F,w)},children:$t("g",{className:O,children:v.getAppendShape(w)})})}l.push(S)},v=this,b=0;b<f-1;b++)h(b);return $t("g",{children:l})},e})(Z1),wg=function(){return wg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},wg.apply(this,arguments)},Wee=(function(){function t(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(r){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY}))))},this.onDragOver=function(r){if(n.lf.graphModel.eventCenter.emit(pr.BLANK_CANVAS_MOUSEMOVE,{e:r}),r.preventDefault(),n.fakeNode){var i=n.clientToLocalPoint({x:r.clientX,y:r.clientY}),a=i.x,s=i.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(pr.NODE_DND_DRAG,{data:l,e:r})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(r){!n.lf.graphModel||!r||!n.nodeConfig||(n.lf.addNode(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY})),pr.NODE_DND_ADD,r),r.preventDefault(),r.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var o=e.lf;this.lf=o}return t.prototype.clientToLocalPoint=function(e){var n=e.x,o=e.y,r=om(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:n,y:o}),a=i.canvasOverlayPosition,s=a.x,l=a.y,f=this.lf.graphModel.editConfigModel.snapGrid;return{x:Wg(s,r,f),y:Wg(l,r,f)}},t.prototype.startDrag=function(e){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t})();function Gee(t,e){t.on("node:mousemove",function(n){var o=n.data;e.setNodeSnapLine(o)}),t.on("node:mouseup",function(){e.clearSnapline()})}var zee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),np=function(){return np=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},np.apply(this,arguments)},Hee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Xee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Yee=(function(t){zee(e,t);function e(n){var o=t.call(this,n)||this;return o.ref=W1(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(Wo.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return e.getDerivedStateFromProps=function(n){var o,r=n.textEditElement,i=n.graphModel,a=i.transformModel,s=i.theme,l=s.inputText,f;if(r){if(!(!((o=r.text)===null||o===void 0)&&o.value)&&r.BaseType===da.EDGE){var h=r.text,v=r.textPosition,b=v.x,E=v.y;h.x=b,h.y=E,r.setText(h)}var O={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===da.EDGE){var w=s.edgeText,S=w.overflowMode,M=w.lineHeight,T=w.wrapPadding,$=w.textWidth;$&&S==="autoWrap"&&(f=np(np({},O),{width:$,minWidth:$,lineHeight:M,padding:T}))}else if(r.BaseType===da.NODE){var D=s.nodeText,S=D.overflowMode,M=D.lineHeight,T=D.wrapPadding,$=D.textWidth,P=r.width,B=r.modelType,F=r.textWidth,I=F||$||P;(B!==_o.TEXT_NODE&&S==="autoWrap"||B===_o.TEXT_NODE&&$)&&(f=np(np({},O),{width:I,minWidth:I,lineHeight:M,padding:T}))}var V=r.text,z=V.x,X=V.y,Y=Xee(a.CanvasPointToHtmlPoint([z,X]),2),W=Y[0],Q=Y[1];return{style:np(np({left:W,top:Q},f),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var o=this.__prevText,r=o.text,i=o.id;n.updateText(i,r),n.eventCenter.emit(pr.TEXT_UPDATE,{data:np({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var o=document.createRange();o.selectNodeContents(n),o.collapse(!1);var r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(o)}},e.prototype.render=function(){var n,o=this.props.graphModel.textEditElement,r=this.state.style;return o?$t("div",{contentEditable:!0,className:"lf-text-input",style:r,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=o.text)===null||n===void 0?void 0:n.value},o.id):null},e.toolName="text-edit-tool",e=Hee([xs],e),e})(ko),qee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Zee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Jee=(function(t){qee(e,t);function e(n){var o=t.call(this,n)||this;o.handleMouseDown=function(s){var l=o.props,f=l.graphModel.gridSize,h=l.lf,v=h.getTransform().SCALE_X;o.stepDrag.setStep(f*v),o.stepDrag.handleMouseDown(s)},o.handleWheelEvent=function(s){var l,f;s.preventDefault();var h=s.deltaX,v=s.deltaY,b=s.clientX,E=s.clientY,O=s.ctrlKey,w=new WheelEvent("wheel",{deltaX:h,deltaY:v,clientX:b,clientY:E,ctrlKey:O});(f=(l=o.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||f===void 0||f.dispatchEvent(w)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.props,v=h.graphModel,b=h.lf,E=b.getTransform(),O=E.SCALE_X,w=E.SCALE_Y,S=v.getSelectElements(!0);v.moveNodes(S.nodes.map(function(M){return M.id}),l/O,f/w)},o.handleContextMenu=function(s){s.preventDefault();var l=o.props,f=l.graphModel,h=l.graphModel,v=h.eventCenter,b=h.selectElements,E=f.getPointByClient({x:s.clientX,y:s.clientY}),O={nodes:[],edges:[]},w=Zee([],lS(b.values()),!1);w.forEach(function(S){S.BaseType===da.NODE&&O.nodes.push(S.getData()),S.BaseType===da.EDGE&&O.edges.push(S.getData())}),v.emit(pr.SELECTION_CONTEXTMENU,{data:O,e:s,position:E})};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),o}return e.prototype.render=function(){var n,o,r=this.props.graphModel,i=r.selectElements,a=r.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,f=s.SCALE_Y;if(!(i.size<=1)){var h=Number.MAX_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER;i.forEach(function(w){var S;w.BaseType===da.NODE&&(S=LZ(w)),w.BaseType===da.EDGE&&(S=$Z(w)),S!==void 0&&(h=Math.min(h,S.x),v=Math.min(v,S.y),b=Math.max(b,S.x1),E=Math.max(E,S.y1))}),n=lS(a.CanvasPointToHtmlPoint([h,v]),2),h=n[0],v=n[1],o=lS(a.CanvasPointToHtmlPoint([b,E]),2),b=o[0],E=o[1];var O={left:"".concat(h-20*l/2,"px"),top:"".concat(v-20*f/2,"px"),width:"".concat(b-h+20*l,"px"),height:"".concat(E-v+20*f,"px"),"border-width":"".concat(2*l,"px")};return $t("div",{className:"lf-multiple-select",style:O,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=Kee([xs],e),e})(ko),sS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Qee=[Yee,Jee],ete=(function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,ri(Qee,function(i){n.isDisabled(i.toolName)||n.registerTool(i.toolName,i)});var o=e.graphModel,r=o.eventCenter;r.on("".concat(pr.GRAPH_TRANSFORM,",").concat(pr.NODE_CLICK,",").concat(pr.BLANK_CLICK," "),function(){var i,a=o.textEditElement,s=o.editConfigModel,l=s.edgeTextEdit,f=s.nodeTextEdit;(l||f)&&a&&((i=o.textEditElement)===null||i===void 0||i.setElementState(Wo.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},sS([Ut],t.prototype,"toolMap",void 0),sS([Bt],t.prototype,"disableTool",null),sS([Bt],t.prototype,"enableTool",null),t})();function tte(t){throw new Error("[mobx-utils] "+t)}function Hw(t,e){e===void 0&&(e="Illegal state"),t||tte(e)}var CI=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(CI(Object.getPrototypeOf(t))||[])},nte=function(t){var e=CI(t),n=e.filter(function(o,r){return e.indexOf(o)===r});return n},rte=function(t){return nte(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},NI="pending",Xw="fulfilled",PM="rejected";function ote(t){switch(this.state){case NI:return t.pending&&t.pending(this.value);case PM:return t.rejected&&t.rejected(this.value);case Xw:return t.fulfilled?t.fulfilled(this.value):this.value}}function VP(t,e){if(Hw(arguments.length<=2,"fromPromise expects up to two arguments"),Hw(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(Bt("observableFromPromise-resolve",function(r){n.value=r,n.state=Xw}),Bt("observableFromPromise-reject",function(r){n.value=r,n.state=PM})),n.isPromiseBasedObservable=!0,n.case=ote;var o=e&&e.state===Xw?e.value:void 0;return NA(n,{value:o,state:NI},{},{deep:!1}),n}(function(t){t.reject=Bt("fromPromise.reject",function(n){var o=t(Promise.reject(n));return o.state=PM,o.value=n,o});function e(n){n===void 0&&(n=void 0);var o=t(Promise.resolve(n));return o.state=Xw,o.value=n,o}t.resolve=Bt("fromPromise.resolve",e)})(VP||(VP={}));var k0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i};(function(){function t(e,n){var o=this;kK(function(){o.current=n,o.subscription=e.subscribe(o)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},k0([Ut.ref],t.prototype,"current",void 0),k0([Bt.bound],t.prototype,"next",null),k0([Bt.bound],t.prototype,"complete",null),k0([Bt.bound],t.prototype,"error",null),t})();var Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Yw.apply(this,arguments)},Fy=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ite=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=Ut.map({}),this.localComputedValues=Ut.map({}),this.isPropertyDirty=function(o){return n.localValues.has(o)},Hw(rd(e),"createViewModel expects an observable object"),rte(e).forEach(function(o){if(!(o===eo||o==="__mobxDidRunLazyInitializers")){if(Hw(ite.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),Nk(e,o)){var r=Y1(e,o).derivation;n.localComputedValues.set(o,Ai(r.bind(n)))}var i=Object.getOwnPropertyDescriptor(e,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(n,o,Yw(Yw({},a),{configurable:!0,get:function(){return Nk(e,o)?n.localComputedValues.get(o).get():n.isPropertyDirty(o)?n.localValues.get(o):n.model[o]},set:Bt(function(s){s!==n.model[o]?n.localValues.set(o,s):n.localValues.delete(o)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Vg(this.localValues).forEach(function(n){var o=e.localValues.get(n),r=e.model[n];tf(r)?r.replace(o):Ys(r)?(r.clear(),r.merge(o)):FK(o)||(e.model[n]=o)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},Fy([Ai],t.prototype,"isDirty",null),Fy([Ai],t.prototype,"changedValues",null),Fy([Bt.bound],t.prototype,"submit",null),Fy([Bt.bound],t.prototype,"reset",null),Fy([Bt.bound],t.prototype,"resetProperty",null),t})();function uS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function cS(t){return rd(t)||tf(t)||Ys(t)}function ate(t,e){var n=new WeakMap;function o(s){var l=n.get(s.object);r(s,l),e(s,uS(l),t)}function r(s,l){switch(s.type){case"add":i(s.newValue,l,s.name);break;case"update":a(s.oldValue),i(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(v,b){return i(v,l,""+(s.index+b))});for(var f=s.index+s.addedCount;f<s.object.length;f++)if(cS(s.object[f])){var h=n.get(s.object[f]);h&&(h.path=""+f)}break}}function i(s,l,f){if(cS(s)){var h=n.get(s);if(h){if(h.parent!==l||h.path!==f)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+uS(l)+"/"+f+"',")+(" but it already exists at '"+uS(h.parent)+"/"+h.path+"'"))}else{var v={parent:l,path:f,dispose:Q3(s,o)};n.set(s,v),UK(s).forEach(function(b){var E=b[0],O=b[1];return i(O,v,E)})}}}function a(s){if(cS(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),$K(s).forEach(a)}}return i(t,void 0,""),function(){a(t)}}var lte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i])},t(e,n)};return function(e,n){t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){lte(e,t);function e(n,o,r){var i=r===void 0?{}:r,a=i.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=i.keyToName,f=l===void 0?function(b){return""+b}:l,h=t.call(this)||this;h._keyToName=f,h._groupBy=o,h._ogmInfoKey=Symbol("ogmInfo"+s),h._base=n;for(var v=0;v<n.length;v++)h._addItem(n[v]);return h._disposeBaseObserver=Q3(h._base,function(b){if(b.type==="splice")Yc(function(){for(var E=0,O=b.removed;E<O.length;E++){var w=O[E];h._removeItem(w)}for(var S=0,M=b.added;S<M.length;S++){var T=M[S];h._addItem(T)}});else if(b.type==="update")Yc(function(){h._removeItem(b.oldValue),h._addItem(b.newValue)});else throw new Error("illegal state")}),h}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(n){throw new Error("not supported")},e.prototype.set=function(n,o){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var o=this._base[n],r=o[this._ogmInfoKey];r.reaction(),delete o[this._ogmInfoKey]}},e.prototype._getGroupArr=function(n){var o=t.prototype.get.call(this,n);return o===void 0&&(o=Ut([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),t.prototype.set.call(this,n,o)),o},e.prototype._removeFromGroupArr=function(n,o){var r=t.prototype.get.call(this,n);r.length===1?t.prototype.delete.call(this,n):(o===r.length-1||(r[o]=r[r.length-1],r[o][this._ogmInfoKey].groupArrIndex=o),r.length--)},e.prototype._addItem=function(n){var o=this,r=this._groupBy(n),i=this._getGroupArr(r),a={groupByValue:r,groupArrIndex:i.length,reaction:H3(function(){return o._groupBy(n)},function(s,l){var f=n[o._ogmInfoKey];o._removeFromGroupArr(f.groupByValue,f.groupArrIndex);var h=o._getGroupArr(s),v=h.length;h.push(n),f.groupByValue=s,f.groupArrIndex=v})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),i.push(n)},e.prototype._removeItem=function(n){var o=n[this._ogmInfoKey];this._removeFromGroupArr(o.groupByValue,o.groupArrIndex),o.reaction(),delete n[this._ogmInfoKey]},e})(AM);Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var c2=function(){return c2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c2.apply(this,arguments)},ste=(function(){function t(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return t.prototype.add=function(e){uA(ec(this.undos),e)||(this.undos.push(e),uA(this.curData,e)||(this.redos=[]),this.eventCenter.emit(pr.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=to(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=to(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=ate(e,D2(function(){var o=e.modelToHistoryData();o&&n.add(c2({},o))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t})(),dS={exports:{}},WP;function ute(){return WP||(WP=1,(function(t){(function(e,n,o){if(!e)return;for(var r={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"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,f=1;f<20;++f)r[111+f]="f"+f;for(f=0;f<=9;++f)r[f+96]=f.toString();function h(F,I,V){if(F.addEventListener){F.addEventListener(I,V,!1);return}F.attachEvent("on"+I,V)}function v(F){if(F.type=="keypress"){var I=String.fromCharCode(F.which);return F.shiftKey||(I=I.toLowerCase()),I}return r[F.which]?r[F.which]:i[F.which]?i[F.which]:String.fromCharCode(F.which).toLowerCase()}function b(F,I){return F.sort().join(",")===I.sort().join(",")}function E(F){var I=[];return F.shiftKey&&I.push("shift"),F.altKey&&I.push("alt"),F.ctrlKey&&I.push("ctrl"),F.metaKey&&I.push("meta"),I}function O(F){if(F.preventDefault){F.preventDefault();return}F.returnValue=!1}function w(F){if(F.stopPropagation){F.stopPropagation();return}F.cancelBubble=!0}function S(F){return F=="shift"||F=="ctrl"||F=="alt"||F=="meta"}function M(){if(!l){l={};for(var F in r)F>95&&F<112||r.hasOwnProperty(F)&&(l[r[F]]=F)}return l}function T(F,I,V){return V||(V=M()[F]?"keydown":"keypress"),V=="keypress"&&I.length&&(V="keydown"),V}function $(F){return F==="+"?["+"]:(F=F.replace(/\+{2}/g,"+plus"),F.split("+"))}function D(F,I){var V,z,X,Y=[];for(V=$(F),X=0;X<V.length;++X)z=V[X],s[z]&&(z=s[z]),I&&I!="keypress"&&a[z]&&(z=a[z],Y.push("shift")),S(z)&&Y.push(z);return I=T(z,Y,I),{key:z,modifiers:Y,action:I}}function P(F,I){return F===null||F===n?!1:F===I?!0:P(F.parentNode,I)}function B(F){var I=this;if(F=F||n,!(I instanceof B))return new B(F);I.target=F,I._callbacks={},I._directMap={};var V={},z,X=!1,Y=!1,W=!1;function Q(ze){ze=ze||{};var Ye=!1,Be;for(Be in V){if(ze[Be]){Ye=!0;continue}V[Be]=0}Ye||(W=!1)}function J(ze,Ye,Be,Je,gt,le){var Ze,pe,se=[],we=Be.type;if(!I._callbacks[ze])return[];for(we=="keyup"&&S(ze)&&(Ye=[ze]),Ze=0;Ze<I._callbacks[ze].length;++Ze)if(pe=I._callbacks[ze][Ze],!(!Je&&pe.seq&&V[pe.seq]!=pe.level)&&we==pe.action&&(we=="keypress"&&!Be.metaKey&&!Be.ctrlKey||b(Ye,pe.modifiers))){var $e=!Je&&pe.combo==gt,rt=Je&&pe.seq==Je&&pe.level==le;($e||rt)&&I._callbacks[ze].splice(Ze,1),se.push(pe)}return se}function ie(ze,Ye,Be,Je){I.stopCallback(Ye,Ye.target||Ye.srcElement,Be,Je)||ze(Ye,Be)===!1&&(O(Ye),w(Ye))}I._handleKey=function(ze,Ye,Be){var Je=J(ze,Ye,Be),gt,le={},Ze=0,pe=!1;for(gt=0;gt<Je.length;++gt)Je[gt].seq&&(Ze=Math.max(Ze,Je[gt].level));for(gt=0;gt<Je.length;++gt){if(Je[gt].seq){if(Je[gt].level!=Ze)continue;pe=!0,le[Je[gt].seq]=1,ie(Je[gt].callback,Be,Je[gt].combo,Je[gt].seq);continue}pe||ie(Je[gt].callback,Be,Je[gt].combo)}var se=Be.type=="keypress"&&Y;Be.type==W&&!S(ze)&&!se&&Q(le),Y=pe&&Be.type=="keydown"};function Se(ze){typeof ze.which!="number"&&(ze.which=ze.keyCode);var Ye=v(ze);if(Ye){if(ze.type=="keyup"&&X===Ye){X=!1;return}I.handleKey(Ye,E(ze),ze)}}function Ae(){clearTimeout(z),z=setTimeout(Q,1e3)}function Pe(ze,Ye,Be,Je){V[ze]=0;function gt(we){return function(){W=we,++V[ze],Ae()}}function le(we){ie(Be,we,ze),Je!=="keyup"&&(X=v(we)),setTimeout(Q,10)}for(var Ze=0;Ze<Ye.length;++Ze){var pe=Ze+1===Ye.length,se=pe?le:gt(Je||D(Ye[Ze+1]).action);De(Ye[Ze],se,Je,ze,Ze)}}function De(ze,Ye,Be,Je,gt){I._directMap[ze+":"+Be]=Ye,ze=ze.replace(/\s+/g," ");var le=ze.split(" "),Ze;if(le.length>1){Pe(ze,le,Ye,Be);return}Ze=D(ze,Be),I._callbacks[Ze.key]=I._callbacks[Ze.key]||[],J(Ze.key,Ze.modifiers,{type:Ze.action},Je,ze,gt),I._callbacks[Ze.key][Je?"unshift":"push"]({callback:Ye,modifiers:Ze.modifiers,action:Ze.action,seq:Je,level:gt,combo:ze})}I._bindMultiple=function(ze,Ye,Be){for(var Je=0;Je<ze.length;++Je)De(ze[Je],Ye,Be)},h(F,"keypress",Se),h(F,"keydown",Se),h(F,"keyup",Se)}B.prototype.bind=function(F,I,V){var z=this;return F=F instanceof Array?F:[F],z._bindMultiple.call(z,F,I,V),z},B.prototype.unbind=function(F,I){var V=this;return V.bind.call(V,F,function(){},I)},B.prototype.trigger=function(F,I){var V=this;return V._directMap[F+":"+I]&&V._directMap[F+":"+I]({},F),V},B.prototype.reset=function(){var F=this;return F._callbacks={},F._directMap={},F},B.prototype.stopCallback=function(F,I){var V=this;if((" "+I.className+" ").indexOf(" mousetrap ")>-1||P(I,V.target))return!1;if("composedPath"in F&&typeof F.composedPath=="function"){var z=F.composedPath()[0];z!==F.target&&(I=z)}return I.tagName=="INPUT"||I.tagName=="SELECT"||I.tagName=="TEXTAREA"||I.isContentEditable},B.prototype.handleKey=function(){var F=this;return F._handleKey.apply(F,arguments)},B.addKeycodes=function(F){for(var I in F)F.hasOwnProperty(I)&&(r[I]=F[I]);l=null},B.init=function(){var F=B(n);for(var I in F)I.charAt(0)!=="_"&&(B[I]=(function(V){return function(){return F[V].apply(F,arguments)}})(I))},B.init(),e.Mousetrap=B,t.exports&&(t.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var cte=ute();const dte=Z_(cte);var Rd=null;function GP(t,e){var n,o;return t.x+=e,t.y+=e,dw(t.text)||(t.text.x+=e,t.text.y+=e),dw((n=t.properties)===null||n===void 0?void 0:n._label)||(o=t.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=e,r.y+=e}),t}function zP(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),dw(t.text)||(t.text.x+=e,t.text.y+=e),t}var ag=40,P0=40;function fte(t,e){var n=t.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(P0=ag,!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=t.options.guards,i=e.getSelectElements(!1),a=r&&r.beforeClone?r.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(Rd=null,!0):(Rd=i,Rd.nodes.forEach(function(s){return GP(s,ag)}),Rd.edges.forEach(function(s){return zP(s,ag)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Rd&&(Rd.nodes||Rd.edges)){t.clearSelectElements();var r=t.addElements(Rd,P0);if(!r)return!0;r.nodes.forEach(function(i){return t.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return t.selectElementById(i.id,!0)}),Rd.nodes.forEach(function(i){return GP(i,ag)}),Rd.edges.forEach(function(i){return zP(i,ag)}),P0=P0+ag}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=e.getSelectElements(!0);return t.clearSelectElements(),r.edges.forEach(function(i){return i.id&&t.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&t.deleteNode(i.id)}),!1})}var pte=(function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new dte(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,o=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(o)if(qa(o))o.forEach(function(s){var l=s.keys,f=s.callback,h=s.action;return e.on(l,f,h)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},t.prototype.on=function(e,n,o){this.mousetrap.bind(this.getKeys(e),n,o)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(o){return n.formatKey(o)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t})(),ph=function(){return ph=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},ph.apply(this,arguments)},R0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},pS=Symbol("plugin registered by Logicflow.use"),HP=(function(){function t(e){var n=this,o;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(f,h){return n.viewMap.set(f,h)},this.getView=function(f){return n.viewMap.get(f)};var r=M_.get(e),i=r.container,a=r.width,s=r.height;this.options=r,this.container=this.initContainer(i,a,s),this.graphModel=new ree(ph(ph({},r),{container:this.container})),this.plugins=(o=r.plugins)!==null&&o!==void 0?o:[];var l=this.graphModel.eventCenter;this.tool=new ete(this),this.dnd=new Wee({lf:this}),this.history=new ste(l),this.keyboard=new pte({lf:this,keyboard:r.keyboard}),r.snapline!==!1&&(this.snaplineModel=new oee(this.graphModel,r.snaplineEpsilon),Gee(l,this.snaplineModel)),r.isSilentMode||(fte(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(r.disabledPlugins)}return t.prototype.initContainer=function(e,n,o){var r=document.createElement("div");return r.style.position="relative",r.style.width=n?"".concat(n,"px"):"100%",r.style.height=o?"".concat(o,"px"):"100%",e.innerHTML="",e.appendChild(r),r},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(e,n,o){if(o===void 0&&(o=!0),typeof e!="string"){this.registerElement(e);return}var r={BaseEdge:Z1,BaseEdgeModel:K1,BaseNode:Ih,BaseNodeModel:Lh,RectNode:Zv,RectNodeModel:Hg,CircleNode:Ww,CircleNodeModel:$w,PolygonNode:zw,PolygonNodeModel:Uw,TextNode:FP,TextNodeModel:jP,LineEdge:UP,LineEdgeModel:kP,DiamondNode:n2,DiamondNodeModel:HA,PolylineEdge:$_,PolylineEdgeModel:F_,BezierEdge:$P,BezierEdgeModel:CP,EllipseNode:o2,EllipseNodeModel:XA,HtmlNode:a2,HtmlNodeModel:YA,h:Lr,type:e};if(this.viewMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),this.graphModel.modelMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),n){var i=n(r),a=i.view,s=i.model,l=a;o&&!l.isObserved&&(l.isObserved=!0,l=xs(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=xs(n)),this.setView(e.type,n),this.graphModel.setModel(e.type,e.model)},t.prototype.batchRegister=function(e){var n=this;e===void 0&&(e=[]),ri(e,function(o){n.registerElement(o)})},t.prototype.defaultRegister=function(){var e=[{type:"rect",view:Zv,model:Hg},{type:"circle",view:Ww,model:$w},{type:"polygon",view:zw,model:Uw},{type:"text",view:FP,model:jP},{type:"ellipse",view:o2,model:XA},{type:"diamond",view:n2,model:HA},{type:"html",view:a2,model:YA},{type:"line",view:UP,model:kP},{type:"polyline",view:$_,model:F_},{type:"bezier",view:$P,model:CP}];this.batchRegister(e)},t.prototype.addNode=function(e,n,o){return n===void 0&&(n=pr.NODE_ADD),this.graphModel.addNode(e,n,o)},t.prototype.deleteNode=function(e){var n=this.graphModel.getNodeModelById(e);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteNode(e),i},t.prototype.cloneNode=function(e){var n=this.graphModel.getNodeModelById(e),o=n==null?void 0:n.getData();if(o){var r=this.options.guards,i=r!=null&&r.beforeClone?r.beforeClone(o):!0;if(i)return this.graphModel.cloneNode(e)}},t.prototype.changeNodeId=function(e,n){return this.graphModel.changeNodeId(e,n)},t.prototype.changeNodeType=function(e,n){this.graphModel.changeNodeType(e,n)},t.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},t.prototype.getNodeDataById=function(e){var n=this.getNodeModelById(e);return n==null?void 0:n.getData()},t.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},t.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},t.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},t.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},t.prototype.createFakeNode=function(e){var n=this.graphModel.modelMap.get(e.type);if(!n)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var o=new n(ph(ph({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(o),o},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(e){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(e)},t.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},t.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},t.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},t.prototype.getEdgeDataById=function(e){var n=this.getEdgeModelById(e);return n==null?void 0:n.getData()},t.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},t.prototype.getEdgeModels=function(e){var n=e.sourceNodeId,o=e.targetNodeId,r=[],i=this.graphModel.edges;return n&&o?ri(i,function(a){a.sourceNodeId===n&&a.targetNodeId===o&&r.push(a)}):n?ri(i,function(a){a.sourceNodeId===n&&r.push(a)}):o&&ri(i,function(a){a.targetNodeId===o&&r.push(a)}),r},t.prototype.changeEdgeId=function(e,n){return this.graphModel.changeEdgeId(e,n)},t.prototype.changeEdgeType=function(e,n){this.graphModel.changeEdgeType(e,n)},t.prototype.deleteEdge=function(e){var n=this.graphModel.getEdgeModelById(e);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteEdgeById(e),i},t.prototype.deleteEdgeByNodeId=function(e){var n=e.sourceNodeId,o=e.targetNodeId;n&&o?this.graphModel.deleteEdgeBySourceAndTarget(n,o):n?this.graphModel.deleteEdgeBySource(n):o&&this.graphModel.deleteEdgeByTarget(o)},t.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},t.prototype.addElements=function(e,n){var o=this,r=e.nodes,i=e.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return ri(r,function(l){var f=l.id,h=o.addNode(l);f&&(a[f]=h.id),s.nodes.push(h)}),ri(i,function(l){var f=l.sourceNodeId,h=l.targetNodeId;a[f]&&(f=a[f]),a[h]&&(h=a[h]);var v=o.graphModel.addEdge(ph(ph({},l),{sourceNodeId:f,targetNodeId:h}));s.edges.push(v)}),s},t.prototype.selectElementById=function(e,n,o){n===void 0&&(n=!1),o===void 0&&(o=!0),this.graphModel.selectElementById(e,n),!n&&o&&this.graphModel.toFront(e)},t.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},t.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(e){return this.graphModel.getElement(e)},t.prototype.getDataById=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getData()},t.prototype.deleteElement=function(e){var n,o,r,i=this.getModelById(e);if(!i)return!1;var a=(n={},n[da.NODE]=this.deleteNode,n[da.EDGE]=this.deleteEdge,n);return(r=(o=a[i.BaseType])===null||o===void 0?void 0:o.call(this,e))!==null&&r!==void 0?r:!1},t.prototype.setElementZIndex=function(e,n){return this.graphModel.setElementZIndex(e,n)},t.prototype.getAreaElement=function(e,n,o,r,i){return o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1),this.graphModel.getAreaElement(e,n,o,r,i).map(function(a){return a.getData()})},t.prototype.setProperties=function(e,n){var o;(o=this.graphModel.getElement(e))===null||o===void 0||o.setProperties(Jl(n))},t.prototype.getProperties=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getProperties()},t.prototype.deleteProperty=function(e,n){var o;(o=this.graphModel.getElement(e))===null||o===void 0||o.deleteProperty(n)},t.prototype.updateAttributes=function(e,n){this.graphModel.updateAttributes(e,n)},t.prototype.editText=function(e){this.graphModel.editText(e)},t.prototype.updateText=function(e,n){this.graphModel.updateText(e,n)},t.prototype.updateEditConfig=function(e){var n=this.graphModel,o=n.editConfigModel,r=n.transformModel,i=o.snapGrid;if(o.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&r.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!ws(e==null?void 0:e.snapGrid)&&e.snapGrid!==i){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(pr.EDIT_CONFIG_CHANGED,{data:o.getConfig()})},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(e,n){this.graphModel.setTheme(e,n)},t.prototype.getTheme=function(){return this.graphModel.getTheme()},t.prototype.focusByElement=function(e){var n=void 0,o=this.getNodeModelById(e);if(o){var r=o.getData(),i=r.x,a=r.y;n={x:i,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,i=l.x,a=l.y;n={x:i,y:a}}n&&this.focusByCoordinate(n)},t.prototype.focusByCoordinate=function(e){var n=this.graphModel,o=n.transformModel,r=n.width,i=n.height,a=e.x,s=e.y;o.focusOn(a,s,r,i)},t.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var n=e.id,o=e.coordinate;n&&this.focusByElement(n),o&&this.focusByCoordinate(o)}},t.prototype.resize=function(e,n){this.graphModel.resize(e,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(e){this.graphModel.toFront(e)},t.prototype.getPointByClient=function(e,n){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof n=="number")return this.graphModel.getPointByClient({x:e,y:n})},t.prototype.getGraphData=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,fS([o],R0(e),!1)):o},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},t.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},t.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(Jl(e)),this.options.history!==!1&&this.history.watch(this.graphModel),rP($t(uee,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(pr.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(e){var n=to(e);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},t.prototype.undo=function(){if(this.history.undoAble()){var e=Jl(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=Jl(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.zoom=function(e,n){var o=this.graphModel.transformModel;return o.zoom(e,n)},t.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},t.prototype.setZoomMiniSize=function(e){var n=this.graphModel.transformModel;n.setZoomMiniSize(e)},t.prototype.setZoomMaxSize=function(e){var n=this.graphModel.transformModel;n.setZoomMaxSize(e)},t.prototype.getTransform=function(){var e=this.graphModel.transformModel,n=e.SCALE_X,o=e.SCALE_Y,r=e.TRANSLATE_X,i=e.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:o,TRANSLATE_X:r,TRANSLATE_Y:i}},t.prototype.translate=function(e,n){var o=this.graphModel.transformModel;o.translate(e,n)},t.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,n=e.TRANSLATE_X,o=e.TRANSLATE_Y;this.translate(-n,-o)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(e,n){n===void 0&&(n=e),this.graphModel.fitView(e,n)},t.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},t.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},t.prototype.on=function(e,n){this.graphModel.eventCenter.on(e,n)},t.prototype.off=function(e,n){this.graphModel.eventCenter.off(e,n)},t.prototype.once=function(e,n){this.graphModel.eventCenter.once(e,n)},t.prototype.emit=function(e,n){this.graphModel.eventCenter.emit(e,n)},t.use=function(e,n){var o,r=e.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,(o={},o[pS]=pS,o.extension=e,o.props=n,o))},t.addThemeMode=function(e,n){nQ(e,n)},t.removeThemeMode=function(e){rQ(e)},t.clearThemeMode=function(){oQ()},t.prototype.installPlugins=function(e){var n=this;e===void 0&&(e=[]);var o=Array.from(t.extensions,function(i){var a=R0(i,2),s=a[1];return s}),r=fS(fS([],R0(this.plugins),!1),R0(o),!1);ri(r,function(i){var a,s;pS in i?(a=i.extension,s=i.props):a=i;var l=a==null?void 0:a.pluginName;zj(e,l)===-1&&n.installPlugin(a,s)})},t.prototype.installPlugin=function(e,n){var o,r;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,s=e.render;i&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[i]=e);return}var l=e,f=l.pluginName,h=new l({lf:this,LogicFlow:t,props:n,options:(r=(o=this.options.pluginsOptions)===null||o===void 0?void 0:o[f])!==null&&r!==void 0?r:{}});h.render&&this.components.push(h.render.bind(h)),this.extension[f]=h},t.prototype.destroy=function(){var e;this.clearData(),rP(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var o=this.extension[n];"destroy"in o&&((e=o.destroy)===null||e===void 0||e.call(o))}},t.extensions=new Map,t})();(function(t){t.toStringTag="LF.".concat(t.name)})(HP||(HP={}));function xs(t){return TM(t)}var hte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,o=e==="x"?n:n&3|8;return o.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),vte=(globalThis==null?void 0:globalThis._ids)||new hte;function sy(){return vte.next()}var kI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){kI(e,t);function e(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,o)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(o),n},e.extendKey="StartEventModel",e})($w);(function(t){kI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(Ww);var PI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qw=function(){return qw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},qw.apply(this,arguments)};(function(t){PI(e,t);function e(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,o)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(o),n},e.extendKey="EndEventModel",e})($w);(function(t){PI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=t.prototype.getShape.call(this);return Lr("g",{},l,Lr("circle",qw(qw({},o),{cx:i,cy:a,r:s-5})))},e.extendKey="EndEventView",e})(Ww);var RI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){RI(e,t);function e(n,o){return n.id||(n.id="Flow_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="SequenceFlowModel",e})(F_);(function(t){RI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e})($_);var DI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f_=function(){return f_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},f_.apply(this,arguments)};(function(t){DI(e,t);function e(n,o){var r=this;return n.id||(n.id="Gateway_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=t.call(this,n,o)||this,r.points=[[25,0],[50,25],[25,50],[0,25]],r}return e.extendKey="ExclusiveGatewayModel",e})(Uw);(function(t){DI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle();return Lr("g",{transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")},Lr("polygon",f_(f_({},f),{x:r,y:i,points:l})),Lr("path",f_({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},f)))},e.extendKey="ExclusiveGatewayNode",e})(zw);var jI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),d2=function(){return d2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},d2.apply(this,arguments)};(function(t){jI(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="ServiceTaskModel",e})(Hg);(function(t){jI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",d2({x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e})(Zv);var LI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kw=function(){return Kw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Kw.apply(this,arguments)};(function(t){LI(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="UserTaskModel",e})(Hg);(function(t){LI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",Kw(Kw({},l),{x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e})(Zv);var mte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,o=e==="x"?n:n&3|8;return o.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),gte=(globalThis==null?void 0:globalThis._ids)||new mte;function XP(){return gte.next()}function II(t){return Object.prototype.toString.call(t)}function yte(t){return" ".repeat(t)}function Zw(t){var e=t;return II(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var o=n;n.charAt(0)==="-"&&(o=n.substring(1)),e[o]=Zw(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,o){e[o]=Zw(n)})),e}function Jw(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _te(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Zw(t)).replace(/"/g,"'")}return Jw(String(e))}var Tv=`
|
||
`;function Z0(t,e,n){var o=yte(n);if(t!==0&&t!==!1&&!t)return Tv+o+"<".concat(e," />");var r="";if(e==="#text")return Tv+o+Jw(String(t));if(e==="#cdata-section")return Tv+o+"<![CDATA["+t+"]]>";if(e==="#comment")return Tv+o+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+_te(t)+'"';if(Array.isArray(t))t.forEach(function(l){r+=Z0(l,e,n+1)});else if(II(t)==="[object Object]"){var i=Object.keys(t),a="",s="";r+=(n===0?"":Tv+o)+"<"+e,i.forEach(function(l){l.charAt(0)==="-"?a+=Z0(t[l],l,n+1):s+=Z0(t[l],l,n+1)}),r+=a+(s!==""?">".concat(s).concat(Tv+o,"</").concat(e,">"):" />")}else r+=Tv+o+"<".concat(e,">").concat(Jw(String(t)),"</").concat(e,">");return r}function bte(t){var e="";for(var n in t)e+=Z0(t[n],n,0);return e}var As=function(){};As.ObjTree=function(){return this};As.ObjTree.VERSION="0.23";As.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;As.ObjTree.prototype.attr_prefix="-";As.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};As.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};As.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!=11){var o={};o[t.nodeName]=n,n=o}return n}};As.ObjTree.prototype.parseElement=function(t){if(t.nodeType!=7){if(t.nodeType==3||t.nodeType==4||t.nodeType==8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,o={};if(t.attributes&&t.attributes.length){n={};for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r].nodeName;if(typeof i=="string"){var a=t.attributes[r].nodeValue;try{a=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[r].nodeValue}a&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<t.childNodes.length&&s;r++){var l=t.childNodes[r].nodeType;l==3||l==4||l==8||(s=!1)}if(s){n||(n="");for(var r=0;r<t.childNodes.length;r++)n+=t.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<t.childNodes.length;r++){var i=t.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(t.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};As.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=o):n==1?t[e]=o:n==2?t[e]=[t[e],o]:t[e][t[e].length]=o};As.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};As.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<"+r+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<"+t+a+`>
|
||
`+s+"</"+t+`>
|
||
`:s="<"+t+a+">"+s+"</"+t+`>
|
||
`:s="<"+t+a+` />
|
||
`),s};As.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];typeof r>"u"||r==null?n[n.length]="<"+t+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};As.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
|
||
`};As.ObjTree.prototype.xml_escape=Jw;var wte=function(t){return new As.ObjTree().parseXML(t)},Ete=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f2=function(){return f2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},f2.apply(this,arguments)},J1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xd;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Xd||(Xd={}));var FI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],YP=["properties","startPoint","endPoint","pointsList"],BI=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function qP(t){var e=t?YP.concat(t):YP;return function(n){function o(r){var i={};return typeof r=="string"?r:Array.isArray(r)?r.map(function(a){return o(a)}):(Object.entries(r).forEach(function(a){var s=J1(a,2),l=s[0],f=s[1];typeof f!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?i[l]=f:i["-".concat(l)]=f:e.includes(l)?i["-".concat(l)]=o(f):i[l]=o(f)}),i)}return o(n)}}function Qw(t){var e={};return Object.entries(t).forEach(function(n){var o=J1(n,2),r=o[0],i=o[1];r.indexOf("-")===0?e[r.substring(1)]=Zw(i):typeof i=="string"?e[r]=i:Object.prototype.toString.call(i)==="[object Object]"?e[r]=Qw(i):Array.isArray(i)?e[r]=i.map(function(a){return Qw(a)}):e[r]=i}),e}function xte(t,e,n){var o=new Map;e.nodes.forEach(function(i){var a,s={"-id":i.id};if(!((a=i.text)===null||a===void 0)&&a.value&&(s["-name"]=i.text.value),i.properties){var l=qP(n)(i.properties);Object.assign(s,l)}o.set(i.id,s),t[i.type]?Array.isArray(t[i.type])?t[i.type].push(s):t[i.type]=[t[i.type],s]:t[i.type]=s});var r=e.edges.map(function(i){var a,s,l=o.get(i.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(i.id):l["bpmn:incoming"]=[l["bpmn:incoming"],i.id]:l["bpmn:incoming"]=i.id;var f={"-id":i.id,"-sourceRef":i.sourceNodeId,"-targetRef":i.targetNodeId};if(!((a=i.text)===null||a===void 0)&&a.value&&(f["-name"]=(s=i.text)===null||s===void 0?void 0:s.value),i.properties){var h=qP(n)(i.properties);Object.assign(f,h)}return f});e.edges.forEach(function(i){var a=o.get(i.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(i.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],i.id]:a["bpmn:outgoing"]=i.id}),t[Xd.FLOW]=r}function Ote(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(s){var l=s.x,f=s.y;return{"-x":l,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=Fh.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),s-=i/2,l-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":s,"-y":l,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}function Ste(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"],i=o["bpmndi:BPMNDiagram"],a=i==null?void 0:i["bpmndi:BPMNPlane"];if(!r||!a)return{nodes:e,edges:n};Object.keys(r).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=r[s];if(s===Xd.FLOW){var f=a["bpmndi:BPMNEdge"],h=(Array.isArray(f),f);n=Mte(l,h)}else{var v=a["bpmndi:BPMNShape"],b=(Array.isArray(v),v);e=e.concat(Ate(l,b,s))}}})}return{nodes:e,edges:n}}function Ate(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=KP(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=KP(r,n,t);o.push(i)}return o}function KP(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=BI(n["-name"]),a=Fh.shapeConfigMap.get(e);a&&(o+=a.width/2,r+=a.height/2);var s;Object.entries(n).forEach(function(v){var b=J1(v,2),E=b[0],O=b[1];FI.indexOf(E)===-1&&(s||(s={}),s[E]=O)}),s&&(s=Qw(s));var l;if(i&&(l={x:o,y:r,value:i},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(f["-x"])+Number(f["-width"])/2,l.y=Number(f["-y"])+Number(f["-height"])/2}var h={id:t["-bpmnElement"],type:e,x:o,y:r,properties:s};return l&&(h.text=l),h}function Mte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(ZP(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(ZP(o,t))}return n}function ZP(t,e){var n,o=e["-name"]?BI("".concat(e["-name"])):"";if(o){var r=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(r=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var i=0;if(o.split(`
|
||
`).forEach(function(E){i<E.length&&(i=E.length)}),r)n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7};else{var a=t["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,f=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,h=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:o,x:f,y:h}}}var v;Object.entries(e).forEach(function(E){var O=J1(E,2),w=O[0],S=O[1];FI.indexOf(w)===-1&&(v||(v={}),v[w]=S)}),v&&(v=Qw(v));var b={id:e["-id"],type:Xd.FLOW,pointsList:t["di:waypoint"].map(function(E){return{x:Number(E["-x"]),y:Number(E["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:v};return n&&(b.text=n),b}var Fh=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a=f2({},o.processAttributes);xte(a,r,i);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};Ote(s,r);var l=o.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var f={"bpmn:definitions":l};return f},this.adapterIn=function(r){if(r)return Ste(r)},n.adapterIn=function(r){return o.adapterIn(r)},n.adapterOut=function(r,i){return o.adapterOut(r,i)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(XP())},this.definitionAttributes={"-id":"Definitions_".concat(XP()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();Fh.shapeConfigMap.set(Xd.START,{width:gk.width,height:gk.height});Fh.shapeConfigMap.set(Xd.END,{width:yk.width,height:yk.height});Fh.shapeConfigMap.set(Xd.GATEWAY,{width:_k.width,height:_k.height});Fh.shapeConfigMap.set(Xd.SYSTEM,{width:bk.width,height:bk.height});Fh.shapeConfigMap.set(Xd.USER,{width:wk.width,height:wk.height});(function(t){Ete(e,t);function e(n){var o=t.call(this,n)||this;o.adapterXmlIn=function(i){var a=typeof i=="string"?o.sanitizeNameAttributes(i):i,s=wte(a);return o.adapterIn(s)},o.adapterXmlOut=function(i,a){var s=o.adapterOut(i,a);return bte(s)};var r=n.lf;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(o,r){var i=r.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(i,'"')})},e.pluginName="bpmnXmlAdapter",e})(Fh);var Tte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var o=Math.random()*16|0,r=n==="x"?o:o&3|8;return r.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),Cte=(globalThis==null?void 0:globalThis._ids)||new Tte;function Nte(){return Cte.next()}Lr("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Lr("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});Lr("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"});Lr("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var kte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uv=function(){return Uv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Uv.apply(this,arguments)},Pte=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rte=ac,Dte=(function(t){kte(e,t);function e(n){var o=t.call(this)||this;return o.updatePosition=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y;o.nodeModel.x=l+i/2,o.nodeModel.y=f+a/2,o.nodeModel.moveText(i/2,a/2)},o.getResize=function(r){var i=r.index,a=r.deltaX,s=r.deltaY,l=r.width,f=r.height,h=r.PCTResizeInfo,v=r.pct,b=v===void 0?1:v,E=r.freezeWidth,O=E===void 0?!1:E,w=r.freezeHeight,S=w===void 0?!1:w,M={width:l,height:f,deltaX:a,deltaY:s};if(h){var T=4,$=0,D=0;switch(i){case 0:D=(a*-1-s)/T;break;case 1:D=(a-s)/T;break;case 2:D=(a+s)/T;break;case 3:D=(a*-1+s)/T;break}D!==0&&($=Math.round(D/h.ResizeBasis.basisHeight*1e5)/1e3),h.ResizePCT.widthPCT=Math.max(Math.min(h.ResizePCT.widthPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit),h.ResizePCT.heightPCT=Math.max(Math.min(h.ResizePCT.heightPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit);var P=Math.round(h.ResizePCT.widthPCT*h.ResizeBasis.basisWidth/100),B=Math.round(h.ResizePCT.heightPCT*h.ResizeBasis.basisHeight/100);switch(i){case 0:a=l-P,s=f-B;break;case 1:a=P-l,s=f-B;break;case 2:a=P-l,s=B-f;break;case 3:a=l-P,s=B-f;break}return M.width=P,M.height=B,M.deltaX=a/b,M.deltaY=s/b,M}switch(i){case 0:M.width=O?l:l-a*b,M.height=S?f:f-s*b;break;case 1:M.width=O?l:l+a*b,M.height=S?f:f-s*b;break;case 2:M.width=O?l:l+a*b,M.height=S?f:f+s*b;break;case 3:M.width=O?l:l-a*b,M.height=S?f:f+s*b;break}return M},o.updateEdgePointByAnchors=function(){var r=o.nodeModel,i=r.id,a=r.anchors,s=o.getNodeEdges(i);s.sourceEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.sourceAnchorId});f&&l.updateStartPoint({x:f.x,y:f.y})}),s.targetEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.targetAnchorId});f&&l.updateEndPoint({x:f.x,y:f.y})})},o.updateRect=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y,h=s.width,v=s.height,b=s.radius,E=s.PCTResizeInfo,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=o.index,D=w===M,P=S===T,B=o.getResize({index:$,deltaX:i,deltaY:a,width:h,height:v,PCTResizeInfo:E,pct:1,freezeWidth:D,freezeHeight:P});if(B.width<w||B.width>M||B.height<S||B.height>T){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:D?0:B.deltaX,deltaY:P?0:B.deltaY}),o.nodeModel.width=B.width,o.nodeModel.height=B.height,o.nodeModel.setProperties({nodeSize:{width:B.width,height:B.height}});var F={x:l,y:f,width:h,height:v,radius:b},I={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:b};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:F,afterNode:I})},o.updateEllipse=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,b=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=w===M,D=S===T,P=l,B=f,F=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.width<w/2||F.width>M/2||F.height<S/2||F.height>T/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:Uv(Uv({},I),{rx:l,ry:f}),afterNode:V})},o.updateDiamond=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,b=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=w===M,D=S===T,P=l,B=f,F=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.width<w/2||F.width>M/2||F.height<S/2||F.height>T/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v,rx:l,ry:f},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:I,afterNode:V})},o.eventEmit=function(r){var i=r.deltaX,a=r.deltaY,s=r.beforeNode,l=r.afterNode,f=o.nodeModel,h=f.id,v=f.modelType,b=f.type,E=Uv({id:h,modelType:v,type:b},s),O=Uv({id:h,modelType:v,type:b},l);o.graphModel.eventCenter.emit("node:resize",{preData:E,data:O,deltaX:i,deltaY:a,index:o.index,model:o.nodeModel})},o.onDragging=function(r){var i,a=r.deltaX,s=r.deltaY,l=o.graphModel.transformModel,f=o.nodeModel.modelType;i=Pte(l.fixDeltaXY(a,s),2),a=i[0],s=i[1],f===_o.RECT_NODE||f===_o.HTML_NODE?o.updateRect({deltaX:a,deltaY:s}):f===_o.ELLIPSE_NODE?o.updateEllipse({deltaX:a,deltaY:s}):f===_o.DIAMOND_NODE&&o.updateDiamond({deltaX:a,deltaY:s})},o.onDragEnd=function(){var r=o.graphModel.gridSize,i=r===void 0?1:r,a=i*Math.round(o.nodeModel.x/i),s=i*Math.round(o.nodeModel.y/i);o.nodeModel.moveTo(a,s),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new Rte({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return e.prototype.getNodeEdges=function(n){for(var o=this.graphModel,r=o.edges,i=[],a=[],s=0;s<r.length;s++){var l=r[s];l.sourceNodeId===n?i.push(l):r[s].targetNodeId===n&&a.push(l)}return{sourceEdges:i,targetEdges:a}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.index,a=n.model,s=a.getControlPointStyle();return $t("g",{className:"lf-resize-control-".concat(i),children:$t(qu,Uv({className:"lf-node-control",x:o,y:r},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e})(ko),jte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e1=function(){return e1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e1.apply(this,arguments)},Q1=(function(t){jte(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=o.x,a=o.y,s=o.width,l=o.height,f={minX:i-s/2,minY:a-l/2,maxX:i+s/2,maxY:a+l/2},h=f.minX,v=f.minY,b=f.maxX,E=f.maxY,O=[{x:h,y:v},{x:b,y:v},{x:b,y:E},{x:h,y:E}];return O.map(function(w,S){return $t(Dte,e1({index:S},w,{model:o,graphModel:r}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,e1({},s,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e})(ko),$I=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){$I(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(XA);(function(t){$I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o.isSelected&&!r?this.getControlGroup():""]})},e})(o2);var UI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p2=function(){return p2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},p2.apply(this,arguments)};(function(t){UI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(HA);(function(t){UI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){var n=this.props.model,o=n.points,r=n.getNodeStyle();return $t("g",{children:$t(kM,p2({},r,{points:o}))})},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(n2);var VI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Lte=(function(t){VI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(YA),Ite=(function(t){VI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(a2),WI={view:Ite,model:Lte},GI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fte=(function(t){GI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(Hg),Bte=(function(t){GI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(Zv),zI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t1=function(){return t1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},t1.apply(this,arguments)},Cv=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nv=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},JP=500,QP=300,$te=-1e4;(function(t){zI(e,t);function e(){var n=t.apply(this,Nv([],Cv(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=JP,n.unfoldedHeight=QP,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var o=this;t.prototype.initNodeData.call(this,n);var r=[];qa(n.children)&&(r=n.children),this.children=new Set(r),this.width=JP,this.height=QP,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=$te,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){o.isFolded&&o.foldGroup(o.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var o=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var r=Nv(Nv([],Cv(this.incoming.edges),!1),Cv(this.outgoing.edges),!1);this.children.forEach(function(i){var a=o.graphModel.getElement(i);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=o.childrenLastFoldStatus[i];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}o.childrenLastFoldStatus[i]=!!s,a.visible=!n;var f=a.incoming.edges,h=a.outgoing.edges;r=Nv(Nv(Nv([],Cv(r),!1),Cv(f),!1),Cv(h),!1)}}),this.foldEdge(n,r)}},e.prototype.getAnchorStyle=function(n){var o=t.prototype.getAnchorStyle.call(this,n);return o.stroke="transparent",o.fill="transparent",o.hover.fill="transparent",o.hover.stroke="transparent",o},e.prototype.foldEdge=function(n,o){var r=this;o.forEach(function(i,a){var s=i.id,l=i.sourceNodeId,f=i.targetNodeId,h=i.startPoint,v=i.endPoint,b=i.type,E=i.text,O=i.getProperties(),w={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:f,startPoint:h,endPoint:v,type:b,properties:O,text:E==null?void 0:E.value};i.virtual&&r.graphModel.deleteEdgeById(i.id);var S=r.graphModel.group.getNodeGroup(f);S||(S=r.graphModel.getNodeModelById(f));var M=r.graphModel.group.getNodeGroup(l);M||(M=r.graphModel.getNodeModelById(l)),n&&i.visible!==!1&&(r.children.has(l)||r.id===l?(w.startPoint=void 0,w.sourceNodeId=r.id):(w.endPoint=void 0,w.targetNodeId=r.id),(S.id!==r.id||M.id!==r.id)&&r.createVirtualEdge(w),i.visible=!1),!n&&i.visible===!1&&(S&&S.isGroup&&S.isFolded?(w.targetNodeId=S.id,w.endPoint=void 0,r.createVirtualEdge(w)):M&&M.isGroup&&M.isFolded?(w.sourceNodeId=M.id,w.startPoint=void 0,r.createVirtualEdge(w)):i.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isFoldedEdge=!0},e.prototype.isInRange=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return o>=this.x-this.width/2&&i<=this.x+this.width/2&&r>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return{x:o>=this.x-this.width/2&&i<=this.x+this.width/2,y:r>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this);o.children=[],this.children.forEach(function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&o.children.push(i)});var r=o.properties;return r==null||delete r.groupAddable,r==null||delete r.isFolded,o},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=Nv([],Cv(this.children),!1),n.isGroup=!0;var o=n.properties;return o==null||delete o.groupAddable,o!=null&&o.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(Fte);(function(t){zI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,o=n.resizable,r=n.properties;return o&&!r.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.properties,f=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var h=this.props.model.getNodeStyle().strokeWidth,v=h===void 0?0:h,b=f(),E=o+v+8,O=r+v+8;return Lr("rect",t1(t1({},b),{width:E,height:O,x:i-E/2,y:a-O/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,o=n.x-n.width/2+5,r=n.y-n.height/2+5;if(!n.foldable)return null;var i=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," M").concat(o+7,",").concat(r+2," ").concat(o+7,",").concat(r+10):"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," ")});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),i])},e.prototype.getResizeShape=function(){return Lr("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Bte);var eR=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p_=function(){return p_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},p_.apply(this,arguments)};function Ute(t){var e=(function(o){eR(r,o);function r(i,a){i.id||(i.id="Flow_".concat(Nte()));var s=p_(p_(p_({},{}),i.properties),{isDefaultFlow:!1});return i.properties=s,o.call(this,i,a)||this}return r.extendKey="SequenceFlowModel",r})(F_),n=(function(o){eR(r,o);function r(){return o!==null&&o.apply(this,arguments)||this}return r.prototype.getStartArrow=function(){var i=this.props.model,a=i.properties.isDefaultFlow;return a?Lr("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Lr("path",{d:""})},r.extendKey="SequenceFlowEdge",r})($_);return{type:"bpmn:sequenceFlow",view:n,model:e}}Ute();var tR={width:40,height:40},nR={width:40,height:40},rR={width:100,height:80},n1={width:100,height:80},oR={width:100,height:80},iR={width:100,height:80},aR={width:100,height:80},lR={width:100,height:80},sR={width:100,height:80},uR={width:100,height:80};function HI(t){return Object.prototype.toString.call(t)}function cR(t){return" ".repeat(t)}function r1(t){return HI(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var o=n;return n.charAt(0)==="-"&&(o=n.substring(1)),e[o]=r1(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return r1(e)}):t}function o1(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vte(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(r1(t)).replace(/"/g,"'")}return o1(String(e))}var dR=`
|
||
`;function J0(t,e,n){var o=cR(n),r="",i=dR+o;if(e==="-json")return"";if(e==="#text")return i+o1(String(t));if(e==="#cdata-section")return"".concat(i,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(i,"<!--").concat(t,"-->");if(t!==0&&t!==!1&&!t)return"".concat(i,"<").concat(e," />");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Vte(t),'"');if(Array.isArray(t))r+=t.map(function(f){return J0(f,e,n+1)}).join("");else if(HI(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?dR+cR(n+1)+t["-json"]:"";r+="".concat(n===0?"":i,"<").concat(e),a.forEach(function(f){f.charAt(0)==="-"?s+=J0(t[f],f,n+1):l+=J0(t[f],f,n+1)}),r+=s+(l!==""?">".concat(l).concat(i,"</").concat(e,">"):" />")}else r+="".concat(i,"<").concat(e,">").concat(o1(String(t)),"</").concat(e,">");return r}function Wte(t){var e="";for(var n in t)e+=J0(t[n],n,0);return e}var Ms=function(){};Ms.ObjTree=function(){return this};Ms.ObjTree.VERSION="0.23";Ms.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;Ms.ObjTree.prototype.attr_prefix="-";Ms.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var r=this.parseDOM(e);return r}};Ms.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};Ms.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var o={};o[t.nodeName]=n,n=o}return n}};Ms.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,o={};if(t.attributes&&t.attributes.length){n={};for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r].nodeName;if(typeof i=="string"){var a=t.attributes[r].nodeValue;try{a=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[r].nodeValue}a!=null&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<t.childNodes.length&&s;r++){var l=t.childNodes[r].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var r=0;r<t.childNodes.length;r++)n+=t.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<t.childNodes.length;r++){var i=t.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(t.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Ms.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=o):n===1?t[e]=o:n===2?t[e]=[t[e],o]:t[e][t[e].length]=o};Ms.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Ms.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(hw(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<".concat(r," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`>
|
||
`).concat(s,"</").concat(t,`>
|
||
`):s="<".concat(t).concat(a,">").concat(s,"</").concat(t,`>
|
||
`):s="<".concat(t).concat(a,` />
|
||
`)),s};Ms.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];typeof r>"u"||r==null?n[n.length]="<".concat(t," />"):typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};Ms.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
|
||
`)};Ms.ObjTree.prototype.xml_escape=o1;var Gte=function(t){return new Ms.ObjTree().parseXML(t)},zte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h2=function(){return h2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},h2.apply(this,arguments)},fR=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},RM=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zl=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xc=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Os;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(Os||(Os={}));var XI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Hte=["properties","startPoint","endPoint","pointsList"],i1={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},YI=function(t,e){var n=Object.keys(e||{});return n.forEach(function(o){if(t[o]){var r=e[o],i=r.in,a=r.out;i&&(t[o].in=i),a&&(t[o].out=a)}else t[o]=e[o]}),t},Xu={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId,i=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(r,'"').concat(n&&o?">".concat(i(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,r,i,a=t,s=e["-id"],l="",f="";try{for(var h=RM(Object.keys(e)),v=h.next();!v.done;v=h.next()){var b=v.value;b.includes("bpmn:")&&(r=Zl(b.split(":"),2),l=r[1],f=(i=e[b])===null||i===void 0?void 0:i["#text"])}}catch(E){n={error:E}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":f}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function Xte(t){var e=t??{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(Xc(Xc([],Zl(Hte),!1),Zl(n||[]),!1)),a={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((o==null?void 0:o.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((o==null?void 0:o.out)||[]),!1))};return Xu=YI(Xu,r),function(s){var l=s.nodes,f=s.edges;function h(v,b){var E,O;if((v==null?void 0:v.flag)!==1){var w;if((w=Xu[v.type])&&w.out){var S=w.out(v),M=Object.keys(S);M.length>0&&M.forEach(function(V){v[V]=S[V]})}v!=null&&v.children&&(v.children=v.children.map(function(V){var z=l.find(function(X){return X.id===V})||f.find(function(X){return X.id===V});return z||{}}));var T={};if(typeof v=="string")return v;if(Array.isArray(v))return v.map(function(V){return h(V,"")}).filter(function(V){return V!=null});try{for(var $=RM(Object.entries(v)),D=$.next();!D.done;D=$.next()){var P=Zl(D.value,2),B=P[0],F=P[1];if((F==null?void 0:F.flag)===1)return;var I=[b,B].filter(function(V){return V}).join(".");a.out.has(I)||(typeof F!="object"?B.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(B)?T[B]=F:T["-".concat(B)]=F:i.has(I)?T["-".concat(B)]=h(F,I):T[B]=h(F,I))}}catch(V){E={error:V}}finally{try{D&&!D.done&&(O=$.return)&&O.call($)}finally{if(E)throw E.error}}return T}}return h(s,"")}}function a1(t){var e,n,o={};try{for(var r=RM(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=Zl(i.value,2),s=a[0],l=a[1];s.indexOf("-")===0?o[s.substring(1)]=r1(l):typeof l=="string"?o[s]=l:Object.prototype.toString.call(l)==="[object Object]"?o[s]=a1(l):Array.isArray(l)?o[s]=l.map(function(f){return a1(f)}):o[s]=l}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function Yte(t,e,n){var o,r=new Map,i=Xte(n)(e);i.nodes.forEach(function(s){var l=s["-id"],f=s["-type"],h=s.text,v=s.children,b=fR(s,["-id","-type","text","children"]),E={"-id":l};h!=null&&h["-value"]&&(E["-name"]=h["-value"]),b["-json"]&&(E["-json"]=b["-json"]),b["-properties"]&&Object.assign(E,b["-properties"]),v&&(E.children=v),t[f]||(t[f]=[]),t[f].push(E),r.set(l,E)});var a=i.edges.map(function(s){var l=s["-id"],f=s["-sourceNodeId"],h=s["-targetNodeId"],v=s.text,b=fR(s,["-id","-sourceNodeId","-targetNodeId","text"]),E=r.get(h);E["bpmn:incoming"]||(E["bpmn:incoming"]=[]),E["bpmn:incoming"].push(l);var O={"-id":l,"-sourceRef":f,"-targetRef":h};return v!=null&&v["-value"]&&(O["-name"]=v["-value"]),b["-json"]&&(O["-json"]=b["-json"]),b["-properties"]&&Object.assign(O,b["-properties"]),O});return e.edges.forEach(function(s){var l=s.sourceNodeId,f=s.id,h=r.get(l);h["bpmn:outgoing"]||(h["bpmn:outgoing"]=[]),h["bpmn:outgoing"].push(f)}),(o=t["bpmn:subProcess"])===null||o===void 0||o.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},f=[];s.children.forEach(function(w){var S,M=r.get(w["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function($){M[$]&&M[$].forEach(function(D){l[$].add(D)})});var T=(S=t[w["-type"]])===null||S===void 0?void 0:S.findIndex(function($){return $["-id"]===w["-id"]});T>=0&&t[w["-type"]].splice(T,1),r.delete(w["-id"]),s[w["-type"]]||(s[w["-type"]]=[]),s[w["-type"]].push(M)});var h=l["bpmn:incoming"],v=l["bpmn:outgoing"];v.forEach(function(w){h.has(w)&&f.push(w)});for(var b=function(w){var S=a.findIndex(function(M){return M["-id"]===f[w]});S>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[S]),a.splice(S,1)):w++,E=w},E,O=0;O<f.length;)b(O),O=E;delete s.children}),t[Os.FLOW]=a,t}function qte(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(s){var l=s.x,f=s.y;return{"-x":l,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=qs.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),s-=i/2,l-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":s,"-y":l,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}var Kte=["bpmn:incoming","bpmn:outgoing"];function Zte(t,e){var n=[],o=[],r=new Map,i=e??{},a=i.transformer,s=i.excludeFields,l={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((s==null?void 0:s.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((s==null?void 0:s.out)||[]),!1))};Xu=YI(Xu,a);var f=t["bpmn:definitions"];if(f){var h=f["bpmn:process"];(function(b,E){E.forEach(function(O){try{Object.keys(b).forEach(function(w){try{O(w)}catch(S){console.error(S)}})}catch(w){console.error(w)}})})(h,[function(b){function E(w){w["-children"]||(w["-children"]=[]),Object.keys(w).forEach(function(S){var M;S.indexOf("bpmn:")===0&&!Kte.includes(S)&&(h[S]||(h[S]=[]),!Array.isArray(h[S])&&(h[S]=[h[S]]),Array.isArray(w[S])?(M=h[S]).push.apply(M,Xc([],Zl(w[S]),!1)):h[S].push(w[S]),Array.isArray(w[S])?w[S].forEach(function(T){!S.includes("Flow")&&w["-children"].push(T["-id"])}):!S.includes("Flow")&&w["-children"].push(w[S]["-id"]),delete w[S])})}if(b==="bpmn:subProcess"){var O=h[b];Array.isArray(O)?O.forEach(function(w){b==="bpmn:subProcess"&&E(w)}):E(O)}},function(b){var E=function(w){Object.keys(w).forEach(function(S){var M,T;if(S.includes("bpmn:")){var $={};Xu[S]&&Xu[S].in?($=(T=(M=Xu[S]).in)===null||T===void 0?void 0:T.call(M,S,ge.cloneDeep(w[S])),delete w[S]):O(w[S]);var D=void 0;(D=Reflect.ownKeys($)).length>0&&D.forEach(function(P){Reflect.set(w,P,$[P])})}})};function O(w){r.set(w["-id"],w),Array.isArray(w)?w.forEach(function(S){O(S)}):typeof w=="object"&&E(w)}O(h[b])},function(b){if(b.indexOf("bpmn:")===0){var E=h[b];if(b==="bpmn:sequenceFlow"){var O=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=Qte(E,O)}else{var w=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(b==="bpmn:boundaryEvent"){var S=h[b],M=function(T){var $=T["-attachedToRef"],D=r.get($);D["-boundaryEvents"]||(D["-boundaryEvents"]=[]),D["-boundaryEvents"].push(T["-id"])};Array.isArray(S)?S.forEach(function(T){M(T)}):M(S)}n=n.concat(Jte(E,w,b))}}}])}var v=function(b,E,O){Object.keys(b).forEach(function(w){var S=O?"".concat(O,".").concat(w):w;E.has(S)?delete b[w]:typeof b[w]=="object"&&v(b[w],E,S)})};return n.forEach(function(b){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;w[S]&&(b.type=w[S])}v(b,l.in,"")}),o.forEach(function(b){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;w[S]&&(b.type=w[S])}v(b,l.in,"")}),{nodes:n,edges:o}}function Jte(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=pR(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=pR(r,n,t);o.push(i)}return o}function pR(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=qs.shapeConfigMap.get(e);s&&(o+=s.width/2,r+=s.height/2);var l={};Object.entries(n).forEach(function(b){var E=Zl(b,2),O=E[0],w=E[1];XI.includes(O)||(l[O]=w)}),l=a1(l);var f;if(a&&(f={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var h=t["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(h["-x"])+Number(h["-width"])/2,f.y=Number(h["-y"])+Number(h["-height"])/2}var v={id:t["-bpmnElement"],type:e,x:o,y:r,properties:l};return i&&(v.children=i),f&&(v.text=f),v}function Qte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(hR(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(hR(o,t))}return n}function hR(t,e){var n,o=e["-name"]?"".concat(e["-name"]):"";if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split(`
|
||
`).forEach(function(f){i<f.length&&(i=f.length)}),n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7}}var a={};Object.entries(e).forEach(function(f){var h=Zl(f,2),v=h[0],b=h[1];XI.includes(v)||(a[v]=b)}),a=a1(a);var s=t["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),l={id:e["-id"],type:Os.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var qs=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a,s,l=h2({},o.processAttributes);Yte(l,r,i);var f={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};qte(f,r);var h=o.definitionAttributes;h["bpmn:process"]=l,h["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":f};var v={"bpmn:definitions":h};if(!((a=i==null?void 0:i.mapping)===null||a===void 0)&&a.out){var b=(s=i==null?void 0:i.mapping)===null||s===void 0?void 0:s.out,E=function(O){Array.isArray(O)&&O.forEach(function(w){return E(w)}),typeof O=="object"&&Object.keys(O).forEach(function(w){var S;(S=b[w])?(O[S]=ge.cloneDeep(O[w]),delete O[w],E(O[S])):E(O[w])})};E(v)}return v},this.adapterIn=function(r,i){if(r)return Zte(r,i)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();qs.shapeConfigMap.set(Os.START,{width:tR.width,height:tR.height});qs.shapeConfigMap.set(Os.END,{width:nR.width,height:nR.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_CATCH,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_THROW,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.BOUNDARY,{width:rR.width,height:rR.height});qs.shapeConfigMap.set(Os.PARALLEL_GATEWAY,{width:oR.width,height:oR.height});qs.shapeConfigMap.set(Os.INCLUSIVE_GATEWAY,{width:iR.width,height:iR.height});qs.shapeConfigMap.set(Os.EXCLUSIVE_GATEWAY,{width:aR.width,height:aR.height});qs.shapeConfigMap.set(Os.SYSTEM,{width:lR.width,height:lR.height});qs.shapeConfigMap.set(Os.USER,{width:sR.width,height:sR.height});qs.shapeConfigMap.set(Os.SUBPROCESS,{width:uR.width,height:uR.height});(function(t){zte(e,t);function e(n){var o=t.call(this,n)||this;o.adapterXmlIn=function(a){var s=Gte(a);return o.adapterIn(s,o.props)},o.adapterXmlOut=function(a){var s=o.adapterOut(a,o.props);return Wte(s)};var r=n.lf,i=n.props;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o.props=i,o}return e.pluginName="BPMNAdapter",e})(qs);function ene(t,e,n){var o=e.x,r=e.y,i=t.x,a=t.y,s=i-o,l=a-r,f=s*Math.cos(n)-l*Math.sin(n),h=s*Math.sin(n)+l*Math.cos(n),v=f+o,b=h+r;return{x:v,y:b}}var tne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l1=function(){return l1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l1.apply(this,arguments)},nne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rne=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};(function(t){tne(e,t);function e(){var n=t.apply(this,rne([],nne(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(o){var r=o.model,i=n.props,a=i.model,s=i.graphModel,l=a.transformWithContainer,f=a.isRestrict,h=n.childrenPositionMap;if(!(!l||f)&&r.id===a.id){var v={x:a.x,y:a.y};ri(Array.from(a.children),function(b){var E=s.getNodeModelById(b);if(E){var O={x:E.x,y:E.y};h.has(E.id)?O=h.get(E.id):h.set(E.id,O);var w=r.rotate*(180/Math.PI);w<0&&(w+=360);var S=w*(Math.PI/180),M=ene(O,v,S);E.moveTo(M.x,M.y),E.rotate=r.rotate}})}},n.onNodeResize=function(o){var r=o.deltaX,i=o.deltaY,a=o.index,s=o.model,l=o.preData,f=n.props,h=f.model,v=f.graphModel,b=h.transformWithContainer,E=h.isRestrict;if(!(!b||E)&&s.id===h.id){var O=l.properties,w=O||{},S=w.width,M=w.height;ri(Array.from(h.children),function(T){var $=v.getNodeModelById(T);if($){var D=$.width/S*r,P=$.height/M*i;OI({deltaX:D,deltaY:P,index:a,nodeModel:$,graphModel:v,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var o=n.props.model;o.isCollapsed&&o.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,o){var r=this,i=[];return n.isGroup&&ri(Array.from(n.children),function(a){i.push(a);var s=o.getNodeModelById(a);s!=null&&s.isGroup&&(i=i.concat(r.getNodesInGroup(s,o)))}),i},e.prototype.getResizeControl=function(){var n=this.props.model,o=n.resizable,r=n.isCollapsed,i=o&&!r;return i?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var f=n.getNodeStyle().strokeWidth,h=f===void 0?0:f,v=n.getAddableOutlineStyle(),b=o+h+8,E=r+h+8;return Lr("rect",l1(l1({},v),{width:b,height:E,x:i-b/2,y:a-E/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," M").concat(n+7,",").concat(o+2," ").concat(n+7,",").concat(o+10)},e.prototype.getExpandIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=o-i/2+10,l=r-a/2+10;if(!n.collapsible)return null;var f=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),h=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:f});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),h])},e.prototype.getShape=function(){return Lr("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(Zv);var one=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s1=function(){return s1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s1.apply(this,arguments)},hS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},By=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ine=400,ane=230,lne=80,sne=60,une=-1e4;(function(t){one(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.isGroup=!0,r.isRestrict=!1,r.autoResize=!1,r.collapsible=!0,r.isCollapsed=!1,r.groupAddable=!1,r.transformWithContainer=!1,r.childrenLastCollapseStateDict=new Map,r.childrenLastCollapseStateDict=new Map,r.initNodeData(n),r.setAttributes(),r}return e.prototype.initNodeData=function(n){var o;t.prototype.initNodeData.call(this,n);var r=(o=n.properties)!==null&&o!==void 0?o:{},i=r.children,a=r.width,s=r.height,l=r.collapsedWidth,f=r.collapsedHeight,h=r.collapsible,v=r.isCollapsed,b=r.zIndex,E=r.isRestrict,O=r.autoResize,w=r.autoToFront,S=r.transformWithContainer;this.children=i?new Set(i):new Set,this.zIndex=b??une,this.isCollapsed=v??!1,this.setProperties({isCollapsed:v??!1});var M=a??ine,T=s??ane;this.width=M,this.height=T,this.expandWidth=M,this.expandHeight=T,this.collapsedWidth=l??lne,this.collapsedHeight=f??sne,this.isRestrict=E??!1,this.transformWithContainer=S??!1,this.autoResize=O??!1,this.collapsible=h??!0,this.autoToFront=w??!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this),r=[];return ri(Array.from(this.children),function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&r.push(i)}),o.children=r,o.properties&&(o.properties.children=r,o.properties.isCollapsed=this.isCollapsed),o},e.prototype.getNodesInGroup=function(n){var o=[];return n.isGroup&&ri(Array.from(n.children),function(r){o.push(r)}),o},e.prototype.getMoveDistance=function(n,o,r){r===void 0&&(r=!1);var i=lg(t.prototype.getMoveDistance.call(this,n,o,r),2),a=i[0],s=i[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,o,r),[a,s]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var o=this,r=o.x,i=o.y,a=o.collapsedWidth,s=o.collapsedHeight,l=o.expandWidth,f=o.expandHeight,h=o.isCollapsed;return h&&(n.x=r+l/2-a/2,n.y=i+f/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+f/2-s/2)),n},e.prototype.toggleCollapse=function(n){var o=this,r=this.graphModel,i=!!n;this.isCollapsed=i,this.setProperties({isCollapsed:i}),r.eventCenter.emit("dynamicGroup:collapse",{collapse:i,nodeModel:this}),i?this.collapse():this.expand();var a=By(By([],lg(this.incoming.edges),!1),lg(this.outgoing.edges),!1),s=Array.from(this.children);ri(s,function(l){var f,h,v=o.graphModel.elementsModelMap.get(l);if(v){var b=v.isCollapsed;if(v.isGroup){var E=v;if(E.isCollapsed||E.toggleCollapse(n),!n){var O=(f=o.childrenLastCollapseStateDict)===null||f===void 0?void 0:f.get(l);O!==void 0&&O!==v.isCollapsed&&E.toggleCollapse(O)}}if((h=o.childrenLastCollapseStateDict)===null||h===void 0||h.set(l,!!b),v.visible=!n,v.BaseType===da.NODE){var w=v.incoming.edges,S=v.outgoing.edges;a=By(By(By([],lg(a),!1),lg(w),!1),lg(S),!1)}}}),this.collapseEdge(i,a)},e.prototype.collapse=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.width,s=n.height,l=n.collapsedWidth,f=n.collapsedHeight;this.x=o-a/2+l/2,this.y=r-s/2+f/2,this.text.x=i.x-a/2+l/2,this.text.y=i.y-s/2+f/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=f},e.prototype.expand=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,f=n.collapsedHeight;this.width=a,this.height=s,this.x=o+this.width/2-l/2,this.y=r+this.height/2-f/2,this.text.x=i.x+this.width/2-l/2,this.text.y=i.y+this.height/2-f/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,o){var r=this,i=this.graphModel;ri(o,function(a,s){var l,f=a.getData(),h=f.targetNodeId,v=f.sourceNodeId,b=s1(s1({},f),{id:"".concat(f.id,"__").concat(s),text:(l=f.text)===null||l===void 0?void 0:l.value});a.virtual&&i.deleteEdgeById(a.id);var E=i.dynamicGroup.getGroupByNodeId(h);E||(E=i.getNodeModelById(h));var O=i.dynamicGroup.getGroupByNodeId(v);O||(O=i.getNodeModelById(v)),n&&a.visible&&(r.children.has(v)||r.id===v?(b.startPoint=void 0,b.sourceNodeId=r.id):(b.endPoint=void 0,b.targetNodeId=r.id),(E.id!==r.id||O.id!==r.id)&&r.createVirtualEdge(b),a.visible=!1),!n&&!a.visible&&(E&&E.isGroup&&E.isCollapsed?(b.targetNodeId=E.id,b.endPoint=void 0,r.createVirtualEdge(b)):O&&O.isGroup&&O.isCollapsed?(b.sourceNodeId=O.id,b.startPoint=void 0,r.createVirtualEdge(b)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var o=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:o,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var o=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:o})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},hS([Ut],e.prototype,"isCollapsed",void 0),hS([Ut],e.prototype,"groupAddable",void 0),hS([Ut],e.prototype,"transformWithContainer",void 0),e})(Hg);var vR;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(vR||(vR={}));var cne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h_=function(){return h_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},h_.apply(this,arguments)},dne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},fne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pne=(function(t){cne(e,t);function e(n){var o=t.call(this,n)||this;o.textRef=W1(),o.setHoverOn=function(){var l=o.props.element;l.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),l.setHovered(!0))},o.setHoverOff=function(){var l=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),l.setHovered(!1))},o.handleMouseDown=function(l){var f,h=o.props,v=h.label,b=h.graphModel,E=b.editConfigModel.nodeTextDraggable;((f=v.draggable)!==null&&f!==void 0?f:E)&&!o.state.isDragging&&!o.state.isEditing&&o.stepDrag.handleMouseDown(l)},o.handleMouseUp=function(l){o.state.isDragging&&o.stepDrag.handleMouseUp(l)},o.handleDragging=function(l){var f=l.deltaX,h=l.deltaY;o.state.isDragging||o.setState({isDragging:!0});var v=o.props,b=v.label,E=v.graphModel,O=E.transformModel,w=fne(O.fixDeltaXY(f,h),2),S=w[0],M=w[1];o.setElementModelLabelInfo({x:b.x+S,y:b.y+M}),E.eventCenter.emit("label:drag",{data:b.getData(),model:b})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleClick=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel;v.setSelected(!o.state.isSelected),o.setState({isSelected:!o.state.isSelected}),o.setElementModelLabelInfo({isSelected:!0}),b.eventCenter.emit("label:click",{data:h.getData(),e:l,model:v})},o.handleDbClick=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel;if(b.eventCenter.emit("label:dblclick",{data:h.getData(),e:l,model:v}),!h.editable){v.setSelected(!0);return}if(v.setSelected(),v.setElementState(Wo.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var E=document.createRange(),O=window.getSelection();E.selectNodeContents(o.textRef.current),E.collapse(!1),O==null||O.removeAllRanges(),O==null||O.addRange(E)}},o.handleBlur=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel.eventCenter;b.emit("label:blur",{e:l,model:v,data:h.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1,isSelected:!1})},o.handleInput=function(l){var f=o.props,h=f.label,v=f.graphModel;v.eventCenter.emit("label:input",{e:l,data:h.getData()})},o.reCalcLabelSize=function(){};var r=n.label,i=n.graphModel,a=i.gridSize,s=i.eventCenter;return o.stepDrag=new ac({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:r,eventCenter:s}),o.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},o}return e.prototype.setElementModelLabelInfo=function(n){var o=this.props,r=o.label,i=o.element,a=o.graphModel,s=i.properties._label,l=s,f=Wj(l,function(b){return b.id===r.id}),h=l[f];l[f]=h_(h_({},h),n);var v=a.getElement(i.id);v==null||v.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,o=this.props,r=o.label,i=o.element,a=o.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,f,h,v,b=s.data;if(((b==null?void 0:b.type)!=="label"||b.type==="label"&&b.id!==r.id||n.state.isSelected)&&n.setState({isSelected:!1}),((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.state.isEditing){n.setState({isEditing:!1});var E=(f=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&f!==void 0?f:"",O=(v=(h=n.textRef.current)===null||h===void 0?void 0:h.innerHTML)!==null&&v!==void 0?v:"";n.setElementModelLabelInfo({value:E,content:O,isSelected:!1}),i.setElementState(Wo.DEFAULT)}((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,o=this.props,r=o.label,i=o.element,a=o.graphModel,s=this.state,l=s.isDragging,f=s.isHovered,h=s.isSelected,v=s.isEditing,b=a.transformModel,E=b.getTransformStyle().transform,O=r.id,w=r.x,S=r.y,M=r.zIndex,T=r.vertical,$=r.style,D=r.rotate,P=r.content,B=r.labelWidth,F=r.textOverflowMode,I=B??(i.BaseType==="node"?i.width-20:80),V={left:"".concat(w-I/2,"px"),top:"".concat(S-10,"px"),width:"".concat(I,"px"),height:"20px",zIndex:M??1,transform:D?"".concat(E," rotate(").concat(D,"deg)"):"".concat(E," rotate(").concat(T?-.25:0,"turn)")};return $t("div",{id:"element-container-".concat(O),className:ZA("lf-label-editor-container"),style:V,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:$t("div",{ref:this.textRef,id:"editor-container-".concat(O),className:ZA("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":v,"lf-label-editor-hover":!v&&(f||h)},n["lf-label-editor-".concat(F)]=!v,n)),onInput:this.handleInput,style:h_({maxWidth:"".concat(I,"px"),boxSizing:"border-box",display:"inline-block",background:v||i.BaseType==="edge"?"#fff":"transparent"},$),dangerouslySetInnerHTML:{__html:P}})})},e=dne([xs],e),e})(ko),Vu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},hne=wh,vne=(function(){function t(e,n,o){var r;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=o,this.id=(r=e.id)!==null&&r!==void 0?r:hne(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xo(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:Hc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Vu([Ut],t.prototype,"x",void 0),Vu([Ut],t.prototype,"y",void 0),Vu([Ut],t.prototype,"content",void 0),Vu([Ut],t.prototype,"value",void 0),Vu([Ut],t.prototype,"rotate",void 0),Vu([Ut],t.prototype,"style",void 0),Vu([Ut],t.prototype,"zIndex",void 0),Vu([Ut],t.prototype,"vertical",void 0),Vu([Ut],t.prototype,"editable",void 0),Vu([Ut],t.prototype,"draggable",void 0),Vu([Ut],t.prototype,"labelWidth",void 0),Vu([Ut],t.prototype,"textOverflowMode",void 0),t})(),Q0={exports:{}},vS=Q0.exports,mR;function mne(){return mR||(mR=1,(function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var n="classList",o="prototype",r=e.Element[o],i=Object,a=String[o].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[o].indexOf||function(O){for(var w=0,S=this.length;w<S;w++)if(w in this&&this[w]===O)return w;return-1},l=function(O,w){this.name=O,this.code=DOMException[O],this.message=w},f=function(O,w){if(w==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(w))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(O,w)},h=function(O){for(var w=a.call(O.getAttribute("class")||""),S=w?w.split(/\s+/):[],M=0,T=S.length;M<T;M++)this.push(S[M]);this._updateClassName=function(){O.setAttribute("class",this.toString())}},v=h[o]=[],b=function(){return new h(this)};if(l[o]=Error[o],v.item=function(O){return this[O]||null},v.contains=function(O){return O+="",f(this,O)!==-1},v.add=function(){var O=arguments,w=0,S=O.length,M,T=!1;do M=O[w]+"",f(this,M)===-1&&(this.push(M),T=!0);while(++w<S);T&&this._updateClassName()},v.remove=function(){var O=arguments,w=0,S=O.length,M,T=!1,$;do for(M=O[w]+"",$=f(this,M);$!==-1;)this.splice($,1),T=!0,$=f(this,M);while(++w<S);T&&this._updateClassName()},v.toggle=function(O,w){O+="";var S=this.contains(O),M=S?w!==!0&&"remove":w!==!1&&"add";return M&&this[M](O),w===!0||w===!1?w:!S},v.toString=function(){return this.join(" ")},i.defineProperty){var E={get:b,enumerable:!0,configurable:!0};try{i.defineProperty(r,n,E)}catch(O){O.number===-2146823252&&(E.enumerable=!1,i.defineProperty(r,n,E))}}else i[o].__defineGetter__&&r.__defineGetter__(n,b)}})(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||(function(r){var i=function(F){return Object.prototype.toString.call(F).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(I,V,z){this.data=I,this.size=I.length,this.type=V,this.encoding=z},l=a.prototype,f=s.prototype,h=r.FileReaderSync,v=function(F){this.code=this[this.name=F]},b="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),E=b.length,O=r.URL||r.webkitURL||r,w=O.createObjectURL,S=O.revokeObjectURL,M=O,T=r.btoa,$=r.atob,D=r.ArrayBuffer,P=r.Uint8Array,B=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=f.fake=!0;E--;)v.prototype[b[E]]=E+1;return O.createObjectURL||(M=r.URL=function(F){var I=document.createElementNS("http://www.w3.org/1999/xhtml","a"),V;return I.href=F,"origin"in I||(I.protocol.toLowerCase()==="data:"?I.origin=null:(V=F.match(B),I.origin=V&&V[1])),I}),M.createObjectURL=function(F){var I=F.type,V;if(I===null&&(I="application/octet-stream"),F instanceof s)return V="data:"+I,F.encoding==="base64"?V+";base64,"+F.data:F.encoding==="URI"?V+","+decodeURIComponent(F.data):T?V+";base64,"+T(F.data):V+","+encodeURIComponent(F.data);if(w)return w.call(O,F)},M.revokeObjectURL=function(F){F.substring(0,5)!=="data:"&&S&&S.call(O,F)},l.append=function(F){var I=this.data;if(P&&(F instanceof D||F instanceof P)){for(var V="",z=new P(F),X=0,Y=z.length;X<Y;X++)V+=String.fromCharCode(z[X]);I.push(V)}else if(i(F)==="Blob"||i(F)==="File")if(h){var W=new h;I.push(W.readAsBinaryString(F))}else throw new v("NOT_READABLE_ERR");else F instanceof s?F.encoding==="base64"&&$?I.push($(F.data)):F.encoding==="URI"?I.push(decodeURIComponent(F.data)):F.encoding==="raw"&&I.push(F.data):(typeof F!="string"&&(F+=""),I.push(unescape(encodeURIComponent(F))))},l.getBlob=function(F){return arguments.length||(F=null),new s(this.data.join(""),F,"raw")},l.toString=function(){return"[object BlobBuilder]"},f.slice=function(F,I,V){var z=arguments.length;return z<3&&(V=null),new s(this.data.slice(F,z>1?I:this.data.length),V,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},a})(e);e.Blob=function(r,i){var a=i&&i.type||"",s=new n;if(r)for(var l=0,f=r.length;l<f;l++)Uint8Array&&r[l]instanceof Uint8Array?s.append(r[l].buffer):s.append(r[l]);var h=s.getBlob(a);return!h.slice&&h.webkitSlice&&(h.slice=h.webkitSlice),h};var o=Object.getPrototypeOf||function(r){return r.__proto__};e.Blob.prototype=o(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||vS.content||vS),(function(e,n){var o=typeof process<"u"&&process&&process.versions&&process.versions.electron;o?e.MediumEditor=n:t.exports=n})(vS,(function(){function e(n,o){return this.init(n,o)}return e.extensions={},(function(n){function o(l,f){var h,v=Array.prototype.slice.call(arguments,2);f=f||{};for(var b=0;b<v.length;b++){var E=v[b];if(E)for(h in E)E.hasOwnProperty(h)&&typeof E[h]<"u"&&(l||f.hasOwnProperty(h)===!1)&&(f[h]=E[h])}return f}var r=!1;try{var i=document.createElement("div"),a=document.createTextNode(" ");i.appendChild(a),r=i.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,f){var h=s.getKeyCode(l);return Array.isArray(f)===!1?h===f:f.indexOf(h)!==-1},getKeyCode:function(l){var f=l.which;return f===null&&(f=l.charCode!==null?l.charCode:l.keyCode),f},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var f=[!0].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},defaults:function(){var f=[!1].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},createLink:function(l,f,h,v){var b=l.createElement("a");return s.moveTextRangeIntoElement(f[0],f[f.length-1],b),b.setAttribute("href",h),v&&(v==="_blank"&&b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",v)),b},findOrCreateMatchingTextNodes:function(l,f,h){for(var v=l.createTreeWalker(f,NodeFilter.SHOW_ALL,null,!1),b=[],E=0,O=!1,w=null,S=null;(w=v.nextNode())!==null;)if(!(w.nodeType>3))if(w.nodeType===3){if(!O&&h.start<E+w.nodeValue.length&&(O=!0,S=s.splitStartNodeIfNeeded(w,h.start,E)),O&&s.splitEndNodeIfNeeded(w,S,h.end,E),O&&E===h.end)break;if(O&&E>h.end+1)throw new Error("PerformLinking overshot the target!");O&&b.push(S||w),E+=w.nodeValue.length,S!==null&&(E+=S.nodeValue.length,v.nextNode()),S=null}else w.tagName.toLowerCase()==="img"&&(!O&&h.start<=E&&(O=!0),O&&b.push(w));return b},splitStartNodeIfNeeded:function(l,f,h){return f!==h?l.splitText(f-h):null},splitEndNodeIfNeeded:function(l,f,h,v){var b,E;b=v+l.nodeValue.length+(f?f.nodeValue.length:0)-1,E=h-v-(f?l.nodeValue.length:0),b>=h&&v!==b&&E!==0&&(f||l).splitText(E)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var f=[],h=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(h).length===0)return[l];for(var v=0;v<l.childNodes.length;v++){var b=l.childNodes[v];if(b.nodeType===3)f.push(b);else if(b.nodeType===1){var E=b.querySelectorAll(h);E.length===0?f.push(b):f=f.concat(e.util.splitByBlockElements(b))}}return f},findAdjacentTextNodeWithContent:function(f,h,v){var b=!1,E,O=v.createNodeIterator(f,NodeFilter.SHOW_TEXT,null,!1);for(E=O.nextNode();E;){if(E===h)b=!0;else if(b&&E.nodeType===3&&E.nodeValue&&E.nodeValue.trim().length>0)break;E=O.nextNode()}return E},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var f=l.previousSibling;!f&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,f=l.previousSibling;return f},isDescendant:function(f,h,v){if(!f||!h)return!1;if(f===h)return!!v;if(f.nodeType!==1)return!1;if(r||h.nodeType!==3)return f.contains(h);for(var b=h.parentNode;b!==null;){if(b===f)return!0;b=b.parentNode}return!1},isElement:function(f){return!!(f&&f.nodeType===1)},throttle:function(l,f){var h=50,v,b,E,O=null,w=0,S=function(){w=Date.now(),O=null,E=l.apply(v,b),O||(v=b=null)};return!f&&f!==0&&(f=h),function(){var M=Date.now(),T=f-(M-w);return v=this,b=arguments,T<=0||T>f?(O&&(clearTimeout(O),O=null),w=M,E=l.apply(v,b),O||(v=b=null)):O||(O=setTimeout(S,T)),E}},traverseUp:function(l,f){if(!l)return!1;do{if(l.nodeType===1){if(f(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(l,f){var h,v,b,E,O,w,S,M=!1,T=["insertHTML",!1,f];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,T)}catch{}if(h=l.getSelection(),h.rangeCount){if(v=h.getRangeAt(0),S=v.commonAncestorContainer,s.isMediumEditorElement(S)&&!S.firstChild)v.selectNode(S.appendChild(l.createTextNode("")));else if(S.nodeType===3&&v.startOffset===0&&v.endOffset===S.nodeValue.length||S.nodeType!==3&&S.innerHTML===v.toString()){for(;!s.isMediumEditorElement(S)&&S.parentNode&&S.parentNode.childNodes.length===1&&!s.isMediumEditorElement(S.parentNode);)S=S.parentNode;v.selectNode(S)}for(v.deleteContents(),b=l.createElement("div"),b.innerHTML=f,E=l.createDocumentFragment();b.firstChild;)O=b.firstChild,w=E.appendChild(O);v.insertNode(E),w&&(v=v.cloneRange(),v.setStartAfter(w),v.collapse(!0),e.selection.selectRange(l,v)),M=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(T,M),M},execFormatBlock:function(l,f){var h=s.getTopBlockContainer(e.selection.getSelectionStart(l)),v;if(f==="blockquote"){if(h&&(v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return s.isBlockContainer(b)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,f)}if(h&&f===h.nodeName.toLowerCase()&&(f="p"),s.isIE&&(f="<"+f+">"),h&&h.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&f==="<p>")return l.execCommand("outdent",!1,f);if((s.isFF||s.isEdge)&&f==="p")return v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return!s.isBlockContainer(b)})&&l.execCommand("formatBlock",!1,f),l.execCommand("outdent",!1,f)}return l.execCommand("formatBlock",!1,f)},setTargetBlank:function(l,f){var h,v=f||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),h=0;h<l.length;h+=1)(v===!1||v===l[h].attributes.href.value)&&(l[h].target="_blank",l[h].rel="noopener noreferrer")},removeTargetBlank:function(l,f){var h;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),h=0;h<l.length;h+=1)f===l[h].attributes.href.value&&(l[h].removeAttribute("target"),l[h].removeAttribute("rel"))},addClassToAnchors:function(l,f){var h=f.split(" "),v,b;if(l.nodeName.toLowerCase()==="a")for(b=0;b<h.length;b+=1)l.classList.add(h[b]);else{var E=l.getElementsByTagName("a");if(E.length===0){var O=s.getClosestTag(l,"a");l=O?[O]:[]}else l=E;for(v=0;v<l.length;v+=1)for(b=0;b<h.length;b+=1)l[v].classList.add(h[b])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var f=l.parentNode,h=f.nodeName.toLowerCase();h==="li"||!s.isBlockContainer(f)&&h!=="div";){if(h==="li")return!0;if(f=f.parentNode,f)h=f.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,f){if(f.nodeName.toLowerCase()==="li"){var h=f.parentElement;h.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(h.parentElement,l),e.selection.moveCursor(l,f.firstChild,f.firstChild.textContent.length))}},splitOffDOMTree:function(l,f,h){for(var v=f,b=null,E=!h;v!==l;){var O=v.parentNode,w=O.cloneNode(!1),S=E?v:O.firstChild,M;for(b&&(E?w.appendChild(b):M=b),b=w;S;){var T=S.nextSibling;S===v?(S.hasChildNodes()?S=S.cloneNode(!1):S.parentNode.removeChild(S),S.textContent&&b.appendChild(S),S=E?T:null):(S.parentNode.removeChild(S),(S.hasChildNodes()||S.textContent)&&b.appendChild(S),S=T)}M&&b.appendChild(M),v=O}return b},moveTextRangeIntoElement:function(l,f,h){if(!l||!f)return!1;var v=s.findCommonRoot(l,f);if(!v)return!1;if(f===l){var b=l.parentNode,E=l.nextSibling;return b.removeChild(l),h.appendChild(l),E?b.insertBefore(h,E):b.appendChild(h),h.hasChildNodes()}for(var O=[],w,S,M,T=0;T<v.childNodes.length;T++)if(M=v.childNodes[T],!w)s.isDescendant(M,l,!0)&&(w=M);else if(s.isDescendant(M,f,!0)){S=M;break}else O.push(M);var $=S.nextSibling,D=v.ownerDocument.createDocumentFragment();return w===l?(w.parentNode.removeChild(w),D.appendChild(w)):D.appendChild(s.splitOffDOMTree(w,l)),O.forEach(function(P){P.parentNode.removeChild(P),D.appendChild(P)}),S===f?(S.parentNode.removeChild(S),D.appendChild(S)):D.appendChild(s.splitOffDOMTree(S,f,!0)),h.appendChild(D),S.parentNode===v?v.insertBefore(h,S):$?v.insertBefore(h,$):v.appendChild(h),h.hasChildNodes()},depthOfNode:function(l){for(var f=0,h=l;h.parentNode!==null;)h=h.parentNode,f++;return f},findCommonRoot:function(l,f){for(var h=s.depthOfNode(l),v=s.depthOfNode(f),b=l,E=f;h!==v;)h>v?(b=b.parentNode,h-=1):(E=E.parentNode,v-=1);for(;b!==E;)b=b.parentNode,E=E.parentNode;return b},isElementAtBeginningOfBlock:function(l){for(var f,h;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(h=l;h=h.previousSibling;)if(f=h.nodeType===3?h.nodeValue:h.textContent,f.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(f){return s.isMediumEditorElement(f)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(f){return s.isBlockContainer(f)||s.isMediumEditorElement(f)})},getTopBlockContainer:function(l){var f=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(h){return s.isBlockContainer(h)&&(f=h),!f&&s.isMediumEditorElement(h)?(f=h,!0):!1}),f},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(h){return s.emptyElementNames.indexOf(h.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var f=l.querySelector("th, td");f&&(l=f)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var f=0;f<l.childNodes.length;f++){var h=s._getFirstTextNode(l.childNodes[f]);if(h!==null)return h}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,f,h){var v=l+" is deprecated, please use "+f+" instead.";h&&(v+=" Will be removed in "+h),s.warn(v)},deprecatedMethod:function(l,f,h,v){s.deprecated(l,f,v),typeof this[f]=="function"&&this[f].apply(this,h)},cleanupAttrs:function(l,f){f.forEach(function(h){l.removeAttribute(h)})},cleanupTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,f){return s.traverseUp(l,function(h){return h.nodeName.toLowerCase()===f.toLowerCase()})},unwrap:function(l,f){for(var h=f.createDocumentFragment(),v=Array.prototype.slice.call(l.childNodes),b=0;b<v.length;b++)h.appendChild(v[b]);h.childNodes.length?l.parentNode.replaceChild(h,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s})(window),(function(){var n=function(o){e.util.extend(this,o)};n.extend=function(o){var r=this,i;o&&o.hasOwnProperty("constructor")?i=o.constructor:i=function(){return r.apply(this,arguments)},e.util.extend(i,r);var a=function(){this.constructor=i};return a.prototype=r.prototype,i.prototype=new a,o&&e.util.extend(i.prototype,o),i},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(o){return this.base.options[o]}},["execAction","on","off","subscribe","trigger"].forEach(function(o){n.prototype[o]=function(){return this.base[o].apply(this.base,arguments)}}),e.Extension=n})(),(function(){function n(r){return e.util.isBlockContainer(r)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var o={findMatchingSelectionParent:function(r,i){var a=i.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,r))},getSelectionElement:function(r){return this.findMatchingSelectionParent(function(i){return e.util.isMediumEditorElement(i)},r)},exportSelection:function(r,i){if(!r)return null;var a=null,s=i.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),f=l.cloneRange(),h;f.selectNodeContents(r),f.setEnd(l.startContainer,l.startOffset),h=f.toString().length,a={start:h,end:h+l.toString().length},this.doesRangeStartWithImages(l,i)&&(a.startsWithImage=!0);var v=this.getTrailingImageCount(r,a,l.endContainer,l.endOffset);if(v&&(a.trailingImageCount=v),h!==0){var b=this.getIndexRelativeToAdjacentEmptyBlocks(i,r,l.startContainer,l.startOffset);b!==-1&&(a.emptyBlocksIndex=b)}}return a},importSelection:function(r,i,a,s){if(!(!r||!i)){var l=a.createRange();l.setStart(i,0),l.collapse(!0);var f=i,h=[],v=0,b=!1,E=!1,O=0,w=!1,S,M=!1,T=null;for((s||r.startsWithImage||typeof r.emptyBlocksIndex<"u")&&(M=!0);!w&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=v+f.length,!b&&r.start>=v&&r.start<=S&&(M||r.start<S?(l.setStart(f,r.start-v),b=!0):T=f),b&&r.end>=v&&r.end<=S&&(r.trailingImageCount?E=!0:(l.setEnd(f,r.end-v),w=!0)),v=S;else{if(r.trailingImageCount&&E&&(f.nodeName.toLowerCase()==="img"&&O++,O===r.trailingImageCount)){for(var $=0;f.parentNode.childNodes[$]!==f;)$++;l.setEnd(f.parentNode,$+1),w=!0}if(!w&&f.nodeType===1)for(var D=f.childNodes.length-1;D>=0;)h.push(f.childNodes[D]),D-=1}w||(f=h.pop())}!b&&T&&(l.setStart(T,T.length),l.setEnd(T,T.length)),typeof r.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,i,r.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(r,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(r,i){var a=function(v){return v.nodeName.toLowerCase()==="a"};if(r.start===r.end&&i.startContainer.nodeType===3&&i.startOffset===i.startContainer.nodeValue.length&&e.util.traverseUp(i.startContainer,a)){for(var s=i.startContainer,l=i.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var f=null,h=0;f===null&&h<l.parentNode.childNodes.length;h++)l.parentNode.childNodes[h]===l&&(f=h);i.setStart(l.parentNode,f+1),i.collapse(!0)}}return i},importSelectionMoveCursorPastBlocks:function(r,i,a,s){var l=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),f=s.startContainer,h,v,b=0;for(a=a||1,f.nodeType===3&&e.util.isBlockContainer(f.previousSibling)?h=f.previousSibling:h=e.util.getClosestBlockContainer(f);l.nextNode();)if(!v)h===l.currentNode&&(v=l.currentNode);else if(v=l.currentNode,b++,b===a||v.textContent.length>0)break;return v||(v=h),s.setStart(e.util.getFirstSelectableLeafNode(v),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(r,i,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var f=e.util.findPreviousSibling(l);if(f){if(f.nodeValue)return-1}else return-1}for(var h=e.util.getClosestBlockContainer(a),v=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),b=0;v.nextNode();){var E=v.currentNode.textContent==="";if((E||b>0)&&(b+=1),v.currentNode===h)return b;E||(b=0)}return b},doesRangeStartWithImages:function(r,i){if(r.startOffset!==0||r.startContainer.nodeType!==1)return!1;if(r.startContainer.nodeName.toLowerCase()==="img")return!0;var a=r.startContainer.querySelector("img");if(!a)return!1;for(var s=i.createTreeWalker(r.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(r,i,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var f=r,h=[],v=0,b=!1,E=!1,O=!1,w,S=0;!O&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=0,w=v+f.length,!b&&i.start>=v&&i.start<=w&&(b=!0),b&&i.end>=v&&i.end<=w&&(E=!0),v=w;else if(f.nodeName.toLowerCase()==="img"&&S++,f===l)O=!0;else if(f.nodeType===1)for(var M=f.childNodes.length-1;M>=0;)h.push(f.childNodes[M]),M-=1;O||(f=h.pop())}return S},selectionContainsContent:function(r){var i=r.getSelection();if(!i||i.isCollapsed||!i.rangeCount)return!1;if(i.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(i.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(r){var i,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(i=!0),s.nodeName!=="#text"&&l==="false"},r);return!i&&a},getSelectionHtml:function(i){var a,s="",l=i.getSelection(),f,h;if(l.rangeCount){for(h=i.createElement("div"),a=0,f=l.rangeCount;a<f;a+=1)h.appendChild(l.getRangeAt(a).cloneContents());s=h.innerHTML}return s},getCaretOffsets:function(i,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(i),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(i),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(r){var i=r.startContainer;return i===r.endContainer&&i.hasChildNodes()&&r.endOffset===r.startOffset+1},getSelectedParentElement:function(r){return r?this.rangeSelectsSingleNode(r)&&r.startContainer.childNodes[r.startOffset].nodeType!==3?r.startContainer.childNodes[r.startOffset]:r.startContainer.nodeType===3?r.startContainer.parentNode:r.startContainer:null},getSelectedElements:function(r){var i=r.getSelection(),a,s,l;if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(a=i.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(f){return typeof i.containsNode=="function"?i.containsNode(f,!0):!0})},selectNode:function(r,i){var a=i.createRange();a.selectNodeContents(r),this.selectRange(i,a)},select:function(r,i,a,s,l){var f=r.createRange();return f.setStart(i,a),s?f.setEnd(s,l):f.collapse(!0),this.selectRange(r,f),f},clearSelection:function(r,i){i?r.getSelection().collapseToStart():r.getSelection().collapseToEnd()},moveCursor:function(r,i,a){this.select(r,i,a)},getSelectionRange:function(r){var i=r.getSelection();return i.rangeCount===0?null:i.getRangeAt(0)},selectRange:function(r,i){var a=r.getSelection();a.removeAllRanges(),a.addRange(i)},getSelectionStart:function(r){var i=r.getSelection().anchorNode,a=i&&i.nodeType===3?i.parentNode:i;return a}};e.selection=o})(),(function(){function n(r,i){return r?r.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,i,!0)})):!1}):!1}var o=function(r){this.base=r,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};o.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(r,i,a,s){var l=this.base.options.contentWindow,f=this.base.options.ownerDocument;r=e.util.isElement(r)||[l,f].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(h){h.addEventListener(i,a,s),this.events.push([h,i,a,s])}).bind(this))},detachDOMEvent:function(r,i,a,s){var l,f,h=this.base.options.contentWindow,v=this.base.options.ownerDocument;r&&(r=e.util.isElement(r)||[h,v].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(b){l=this.indexOfListener(b,i,a,s),l!==-1&&(f=this.events.splice(l,1)[0],f[0].removeEventListener(f[1],f[2],f[3]))}).bind(this)))},indexOfListener:function(r,i,a,s){var l,f,h;for(l=0,f=this.events.length;l<f;l=l+1)if(h=this.events[l],h[0]===r&&h[1]===i&&h[2]===a&&h[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var r=this.events.pop();r;)r[0].removeEventListener(r[1],r[2],r[3]),r=this.events.pop()},detachAllEventsFromElement:function(r){for(var i=this.events.filter(function(f){return f&&f[0].getAttribute&&f[0].getAttribute("medium-editor-index")===r.getAttribute("medium-editor-index")}),a=0,s=i.length;a<s;a++){var l=i[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(r){this.listeners.editableInput&&(this.contentCache[r.getAttribute("medium-editor-index")]=r.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(i){this.attachDOMEvent(r,i.name,i.handler.bind(this))},this)},enableCustomEvent:function(r){this.disabledEvents[r]!==void 0&&delete this.disabledEvents[r]},disableCustomEvent:function(r){this.disabledEvents[r]=!0},attachCustomEvent:function(r,i){this.setupListener(r),this.customEvents[r]||(this.customEvents[r]=[]),this.customEvents[r].push(i)},detachCustomEvent:function(r,i){var a=this.indexOfCustomListener(r,i);a!==-1&&this.customEvents[r].splice(a,1)},indexOfCustomListener:function(r,i){return!this.customEvents[r]||!this.customEvents[r].length?-1:this.customEvents[r].indexOf(i)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(r,i,a){this.customEvents[r]&&!this.disabledEvents[r]&&this.customEvents[r].forEach(function(s){s(i,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(r){r.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(r){this.handleDocumentExecCommand(r)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var r=this.options.ownerDocument;if(!(!this.execCommandListener||!r.execCommand.listeners)){var i=r.execCommand.listeners.indexOf(this.execCommandListener);i!==-1&&r.execCommand.listeners.splice(i,1),r.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var r=this.options.ownerDocument;if(!r.execCommand.listeners){var i=function(s,l){r.execCommand.listeners&&r.execCommand.listeners.forEach(function(f){f({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=r.execCommand.orig.apply(this,arguments);if(!r.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return i(l,s),s};a.orig=r.execCommand,a.listeners=[],a.callListeners=i,r.execCommand=a}},unwrapExecCommand:function(){var r=this.options.ownerDocument;r.execCommand.orig&&(r.execCommand=r.execCommand.orig)},setupListener:function(r){if(!this.listeners[r]){switch(r){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(i){this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[r]=!0}},attachToEachElement:function(r,i){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,r,i.bind(this))},this),this.eventsCache.push({name:r,handler:i})},cleanupElement:function(r){var i=r.getAttribute("medium-editor-index");i&&(this.detachAllEventsFromElement(r),this.contentCache&&delete this.contentCache[i])},focusElement:function(r){r.focus(),this.updateFocus(r,{target:r,type:"focus"})},updateFocus:function(r,i){var a=this.base.getFocusedElement(),s;a&&i.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(f){return!s&&e.util.isDescendant(f,r,!0)&&(s=f),!!s},this);var l=!e.util.isDescendant(a,r,!0)&&!n(this.base.extensions,r);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,s))),l&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(r,i){if(this.contentCache){var a=r.getAttribute("medium-editor-index"),s=r.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",i,r),this.contentCache[a]=s}},handleDocumentSelectionChange:function(r){if(r.currentTarget&&r.currentTarget.activeElement){var i=r.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,i,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:i,currentTarget:a})}},handleDocumentExecCommand:function(){var r=this.base.getFocusedElement();r&&this.updateInput(r,{target:r,currentTarget:r})},handleBodyClick:function(r){this.updateFocus(r.target,r)},handleBodyFocus:function(r){this.updateFocus(r.target,r)},handleBodyMousedown:function(r){this.lastMousedownTarget=r.target},handleInput:function(r){this.updateInput(r.currentTarget,r)},handleClick:function(r){this.triggerCustomEvent("editableClick",r,r.currentTarget)},handleBlur:function(r){this.triggerCustomEvent("editableBlur",r,r.currentTarget)},handleKeypress:function(r){if(this.triggerCustomEvent("editableKeypress",r,r.currentTarget),this.keypressUpdateInput){var i={target:r.target,currentTarget:r.currentTarget};setTimeout((function(){this.updateInput(i.currentTarget,i)}).bind(this),0)}},handleKeyup:function(r){this.triggerCustomEvent("editableKeyup",r,r.currentTarget)},handleMouseover:function(r){this.triggerCustomEvent("editableMouseover",r,r.currentTarget)},handleDragging:function(r){this.triggerCustomEvent("editableDrag",r,r.currentTarget)},handleDrop:function(r){this.triggerCustomEvent("editableDrop",r,r.currentTarget)},handlePaste:function(r){this.triggerCustomEvent("editablePaste",r,r.currentTarget)},handleKeydown:function(r){if(this.triggerCustomEvent("editableKeydown",r,r.currentTarget),e.util.isKey(r,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",r,r.currentTarget);if(e.util.isKey(r,e.util.keyCode.ENTER)||r.ctrlKey&&e.util.isKey(r,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",r,r.currentTarget);if(e.util.isKey(r,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",r,r.currentTarget);if(e.util.isKey(r,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",r,r.currentTarget)}},e.Events=o})(),(function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(o){n.isBuiltInButton(o)?e.Extension.call(this,this.defaults[o]):e.Extension.call(this,o)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var o=this.document.createElement("button"),r=this.contentDefault,i=this.getAria(),a=this.getEditorOption("buttonLabels");return o.classList.add("medium-editor-action"),o.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){o.classList.add(s)}),o.setAttribute("data-action",this.getAction()),i&&(o.setAttribute("title",i),o.setAttribute("aria-label",i)),this.attrs&&Object.keys(this.attrs).forEach(function(s){o.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(r=this.contentFA),o.innerHTML=r,o},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=this.getAction();r&&this.execAction(r)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var o=null;return this.useQueryState&&(o=this.base.queryCommandState(this.getAction())),o},isAlreadyApplied:function(o){var r=!1,i=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(i&&i.length>0&&(r=i.indexOf(o.nodeName.toLowerCase())!==-1),!r&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(o,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(r=s.indexOf(l)!==-1,(r||this.style.prop!=="text-decoration")&&(this.knownState=r))},this)),r)}});n.isBuiltInButton=function(o){return typeof o=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(o)},e.extensions.button=n})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.hideToolbarDefaultActions()},setToolbarPosition:function(){var o=this.base.getExtensionByName("toolbar");o&&o.setToolbarPosition()}});e.extensions.form=n})(),(function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=e.selection.getSelectionRange(this.document);return r.startContainer.nodeName.toLowerCase()==="a"||r.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(r),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(o){e.util.isKey(o,e.util.keyCode.K)&&e.util.isMetaCtrlKey(o)&&!o.shiftKey&&this.handleClick(o)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var o=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return o.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),o.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),o.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(o){var r=this.getInput(),i=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(o=o||{value:""},typeof o=="string"&&(o={value:o}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),r.value=o.value,r.focus(),i&&(i.checked=o.target==="_blank"),a){var s=o.buttonClass?o.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox(),i={value:this.getInput().value.trim()};return this.linkValidation&&(i.value=this.checkLinkFormat(i.value)),i.target="_self",o&&o.checked&&(i.target="_blank"),r&&r.checked&&(i.buttonClass=this.customClassOption),i},doFormSave:function(){var o=this.getFormOpts();this.completeFormSave(o)},completeFormSave:function(o){this.base.restoreSelection(),this.execAction(this.action,o),this.base.checkSelection()},ensureEncodedUri:function(o){return o===decodeURI(o)?encodeURI(o):o},ensureEncodedUriComponent:function(o){return o===decodeURIComponent(o)?encodeURIComponent(o):o},ensureEncodedParam:function(o){var r=o.split("="),i=r[0],a=r[1];return i+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(o){return o.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(o){var r=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,i=r.test(o),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=o.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),f=l[1],h=l[2],v=l[3];if(s.test(o))return"tel:"+o;if(!i){var b=f.split("/")[0];(b.match(/.+(\.|:).+/)||b==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(f)+(h===void 0?"":"?"+this.ensureEncodedQuery(h))+(v===void 0?"":"#"+v)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(o){var r=o.querySelector(".medium-editor-toolbar-close"),i=o.querySelector(".medium-editor-toolbar-save"),a=o.querySelector(".medium-editor-toolbar-input");this.on(o,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(r,"click",this.handleCloseClick.bind(this)),this.on(i,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var o=this.document,r=o.createElement("div");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),r.innerHTML=this.getTemplate(),this.attachFormEvents(r),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(o){if(o.keyCode===e.util.keyCode.ENTER){o.preventDefault(),this.doFormSave();return}o.keyCode===e.util.keyCode.ESCAPE&&(o.preventDefault(),this.doFormCancel())},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n})(),(function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var o=this.document.createElement("div");return o.id="medium-editor-anchor-preview-"+this.getEditorId(),o.className="medium-editor-anchor-preview",o.innerHTML=this.getTemplate(),this.on(o,"click",this.handleClick.bind(this)),o},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(o){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||o.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=o.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=o.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=o,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(o){o=o||this.activeAnchor;var r=this.window.innerWidth,i=this.anchorPreview.offsetHeight,a=o.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,f=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,v={},b,E,O,w,S;b=this.anchorPreview.offsetWidth/2;var M=this.base.getExtensionByName("toolbar");M&&(s=M.diffLeft,l=M.diffTop),E=s-b,h?(w=f.getBoundingClientRect(),["top","left"].forEach(function(T){v[T]=a[T]-w[T]}),v.width=a.width,v.height=a.height,a=v,r=w.width,S=f.scrollTop):S=this.window.pageYOffset,O=a.left+a.width/2,S+=i+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(S)+"px",this.anchorPreview.style.right="initial",O<b?(this.anchorPreview.style.left=E+b+"px",this.anchorPreview.style.right="initial"):r-O<b?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=E+O+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(o){var r=this.base.getExtensionByName("anchor"),i=this.activeAnchor;r&&i&&(o.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(i){var a={value:i.attributes.href.value,target:i.getAttribute("target"),buttonClass:i.getAttribute("class")};r.showForm(a),i=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(o){var r=e.util.getClosestTag(o.target,"a");if(r!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(r.outerHTML)||/href=["']#\S+["']/.test(r.outerHTML)))return!0;var i=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&i&&i.isDisplayed&&i.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==r&&this.detachPreviewHandlers(),this.anchorToPreview=r,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(o){(!o.relatedTarget||!/anchor-preview/.test(o.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var o=new Date().getTime()-this.lastOver;o>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n})(),(function(){var n,o,r,i,a;n=[" "," ",`
|
||
`,"\r"," "," "," "," "," ","\u2028","\u2029"],o="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",r="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+o+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+o+"))",i=new RegExp("^("+o+")$","i"),a=new RegExp(r,"gi");function s(f){return!e.util.getClosestTag(f,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var f=0,h=0;h<this.window._mediumEditors.length;h++){var v=this.window._mediumEditors[h];v!==null&&v.getExtensionByName("autoLink")!==void 0&&f++}return f===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(f,h){this.performLinking(h)},onKeypress:function(f){this.disableEventHandling||e.util.isKey(f,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var h=this.base.exportSelection();this.performLinking(f.target)&&this.base.importSelection(h,!0)}catch(v){window.console&&window.console.error("Failed to perform linking",v),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(f){var h=e.util.splitByBlockElements(f),v=!1;h.length===0&&(h=[f]);for(var b=0;b<h.length;b++)v=this.removeObsoleteAutoLinkSpans(h[b])||v,v=this.performLinkingWithinElement(h[b])||v;return this.base.events.updateInput(f,{target:f,currentTarget:f}),v},removeObsoleteAutoLinkSpans:function(f){if(!f||f.nodeType===3)return!1;for(var h=f.querySelectorAll('span[data-auto-link="true"]'),v=!1,b=0;b<h.length;b++){var E=h[b].textContent;if(E.indexOf("://")===-1&&(E=e.util.ensureUrlHasProtocol(E)),h[b].getAttribute("data-href")!==E&&s(h[b])){v=!0;var O=E.replace(/\s+$/,"");if(h[b].getAttribute("data-href")===O){var w=E.length-O.length,S=e.util.splitOffDOMTree(h[b],this.splitTextBeforeEnd(h[b],w));h[b].parentNode.insertBefore(S,h[b].nextSibling)}else e.util.unwrap(h[b],this.document)}}return v},splitTextBeforeEnd:function(f,h){for(var v=this.document.createTreeWalker(f,NodeFilter.SHOW_TEXT,null,!1),b=!0;b;)b=v.lastChild()!==null;for(var E,O,w;h>0&&w!==null;)E=v.currentNode,O=E.nodeValue,O.length>h?(w=E.splitText(O.length-h),h=0):(w=v.previousNode(),h-=O.length);return w},performLinkingWithinElement:function(f){for(var h=this.findLinkableText(f),v=!1,b=0;b<h.length;b++){var E=e.util.findOrCreateMatchingTextNodes(this.document,f,h[b]);this.shouldNotLink(E)||this.createAutoLink(E,h[b].href)}return v},shouldNotLink:function(f){for(var h=!1,v=0;v<f.length&&h===!1;v++)h=!!e.util.traverseUp(f[v],function(b){return b.nodeName.toLowerCase()==="a"||b.getAttribute&&b.getAttribute("data-auto-link")==="true"});return h},findLinkableText:function(f){for(var h=f.textContent,v=null,b=[];(v=a.exec(h))!==null;){var E=!0,O=v.index+v[0].length;E=(v.index===0||n.indexOf(h[v.index-1])!==-1)&&(O===h.length||n.indexOf(h[O])!==-1),E=E&&(v[0].indexOf("/")!==-1||i.test(v[0].split(".").pop().split("?").shift())),E&&b.push({href:v[0],start:v.index,end:O})}return b},createAutoLink:function(f,h){h=e.util.ensureUrlHasProtocol(h);var v=e.util.createLink(this.document,f,h,this.getEditorOption("targetBlank")?"_blank":null),b=this.document.createElement("span");for(b.setAttribute("data-auto-link","true"),b.setAttribute("data-href",h),v.insertBefore(b,v.firstChild);v.childNodes.length>1;)b.appendChild(v.childNodes[1])}});e.extensions.autoLink=l})(),(function(){var n="medium-editor-dragover";function o(i){var a=e.util.getContainerEditorElement(i),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(i){i.preventDefault(),i.dataTransfer.dropEffect="copy";var a=i.target.classList?i.target:i.target.parentElement;o(a),i.type==="dragover"&&a.classList.add(n)},handleDrop:function(i){i.preventDefault(),i.stopPropagation(),this.base.selectElement(i.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),i.dataTransfer.files&&Array.prototype.slice.call(i.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),o(i.target)},isAllowedFile:function(i){return this.allowedTypes.some(function(a){return!!i.type.match(a)})},insertImageFile:function(i){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(i),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=r})(),(function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(o){var r=o.key.charCodeAt(0);this.keys[r]||(this.keys[r]=[]),this.keys[r].push(o)},this)},handleKeydown:function(o){var r=e.util.getKeyCode(o);if(this.keys[r]){var i=e.util.isMetaCtrlKey(o),a=!!o.shiftKey,s=!!o.altKey;this.keys[r].forEach(function(l){l.meta===i&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(o.preventDefault(),o.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontName")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(o){var r=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("select"),a=o.createElement("a"),s=o.createElement("a"),l;r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this));for(var f=0;f<this.fonts.length;f++)l=o.createElement("option"),l.innerHTML=this.fonts[f],l.value=this.fonts[f],i.appendChild(l);return i.className="medium-editor-toolbar-select",r.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("face")&&o.removeAttribute("face")})},handleFontChange:function(){var o=this.getSelect().value;o===""?this.clearFontName():this.execAction("fontName",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontSize")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(o){var r=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("input"),a=o.createElement("a"),s=o.createElement("a");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this)),i.setAttribute("type","range"),i.setAttribute("min","1"),i.setAttribute("max","7"),i.className="medium-editor-toolbar-input",r.appendChild(i),this.on(i,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("size")&&o.removeAttribute("size")})},handleSliderChange:function(){var o=this.getInput().value;o==="4"?this.clearFontSize():this.execAction("fontSize",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",o=null,r=null,i=function(f){f.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(f,h,v){var b=f.clipboardData||h.clipboardData||v.dataTransfer,E={};if(!b)return E;if(b.getData){var O=b.getData("Text");O&&O.length>0&&(E["text/plain"]=O)}if(b.types)for(var w=0;w<b.types.length;w++){var S=b.types[w];E[S]=b.getData(S)}return E}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(f){this.on(f,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(f,h){this.on(h,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(f,h){if(!f.defaultPrevented){var v=s(f,this.window,this.document),b=v["text/html"],E=v["text/plain"];this.window.clipboardData&&f.clipboardData===void 0&&!b&&(b=E),(b||E)&&(f.preventDefault(),this.doPaste(b,E,h))}},doPaste:function(f,h,v){var b,E="",O;if(this.cleanPastedHTML&&f)return this.cleanPaste(f);if(h){if(this.getEditorOption("disableReturn")||v&&v.getAttribute("data-disable-return"))E=e.util.htmlEntities(h);else if(b=h.split(/[\r\n]+/g),b.length>1)for(O=0;O<b.length;O+=1)b[O]!==""&&(E+="<p>"+e.util.htmlEntities(b[O])+"</p>");else E=e.util.htmlEntities(b[0]);e.util.insertHTMLCommand(this.document,E)}},handlePasteBinPaste:function(f){if(f.defaultPrevented){this.removePasteBin();return}var h=s(f,this.window,this.document),v=h["text/html"],b=h["text/plain"],E=r;if(!this.cleanPastedHTML||v){f.preventDefault(),this.removePasteBin(),this.doPaste(v,b,E),this.trigger("editablePaste",{currentTarget:E,target:E},E);return}setTimeout((function(){this.cleanPastedHTML&&(v=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(v,b,E),this.trigger("editablePaste",{currentTarget:E,target:E},E)}).bind(this),0)},handleKeydown:function(f,h){e.util.isKey(f,e.util.keyCode.V)&&e.util.isMetaCtrlKey(f)&&(f.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(h))},createPasteBin:function(f){var h,v=e.selection.getSelectionRange(this.document),b=this.window.pageYOffset;r=f,v&&(h=v.getClientRects(),h.length?b+=h[0].top:v.startContainer.getBoundingClientRect!==void 0?b+=v.startContainer.getBoundingClientRect().top:b+=v.getBoundingClientRect().top),o=v;var E=this.document.createElement("div");E.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),E.setAttribute("style","border: 1px red solid; position: absolute; top: "+b+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),E.setAttribute("contentEditable",!0),E.innerHTML=n,this.document.body.appendChild(E),this.on(E,"focus",i),this.on(E,"focusin",i),this.on(E,"focusout",i),E.focus(),e.selection.selectNode(E,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(E,"paste",this.boundHandlePaste)},removePasteBin:function(){o!==null&&(e.selection.selectRange(this.document,o),o=null),r!==null&&(r=null);var f=this.getPasteBin();f&&f&&(this.off(f,"focus",i),this.off(f,"focusin",i),this.off(f,"focusout",i),this.off(f,"paste",this.boundHandlePaste),f.parentElement.removeChild(f))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var f=this.getPasteBin();if(!f||f.firstChild&&f.firstChild.id==="mcepastebin")return!1;var h=f.innerHTML;return!h||h===n?!1:h},cleanPaste:function(f){var h,v,b,E,O=/<p|<br|<div/.test(f),w=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(h=0;h<w.length;h+=1)f=f.replace(w[h][0],w[h][1]);if(!O)return this.pasteHTML(f);for(b=this.document.createElement("div"),b.innerHTML="<p>"+f.split("<br><br>").join("</p><p>")+"</p>",v=b.querySelectorAll("a,p,div,br"),h=0;h<v.length;h+=1)switch(E=v[h],E.innerHTML=E.innerHTML.replace(/\n/gi," "),E.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(E);break;case"br":this.filterLineBreak(E);break}this.pasteHTML(b.innerHTML)},pasteHTML:function(f,h){h=e.util.defaults({},h,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var v,b,E,O,w=this.document.createDocumentFragment();for(w.appendChild(this.document.createElement("body")),O=w.querySelector("body"),O.innerHTML=f,this.cleanupSpans(O),v=O.querySelectorAll("*"),E=0;E<v.length;E+=1)b=v[E],b.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(b),e.util.cleanupAttrs(b,h.cleanAttrs),e.util.cleanupTags(b,h.cleanTags),e.util.unwrapTags(b,h.unwrapTags);e.util.insertHTMLCommand(this.document,O.innerHTML.replace(/ /g," "))},isCommonBlock:function(f){return f&&(f.nodeName.toLowerCase()==="p"||f.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(f){/^\s*$/.test(f.textContent)&&f.parentNode&&f.parentNode.removeChild(f)},filterLineBreak:function(f){this.isCommonBlock(f.previousElementSibling)?this.removeWithParent(f):this.isCommonBlock(f.parentNode)&&(f.parentNode.firstChild===f||f.parentNode.lastChild===f)?this.removeWithParent(f):f.parentNode&&f.parentNode.childElementCount===1&&f.parentNode.textContent===""&&this.removeWithParent(f)},removeWithParent:function(f){f&&f.parentNode&&(f.parentNode.parentNode&&f.parentNode.childElementCount===1?f.parentNode.parentNode.removeChild(f.parentNode):f.parentNode.removeChild(f))},cleanupSpans:function(f){var h,v,b,E=f.querySelectorAll(".replace-with"),O=function(w){return w&&w.nodeName!=="#text"&&w.getAttribute("contenteditable")==="false"};for(h=0;h<E.length;h+=1)v=E[h],b=this.document.createElement(v.classList.contains("bold")?"b":"i"),v.classList.contains("bold")&&v.classList.contains("italic")?b.innerHTML="<i>"+v.innerHTML+"</i>":b.innerHTML=v.innerHTML,v.parentNode.replaceChild(b,v);for(E=f.querySelectorAll("span"),h=0;h<E.length;h+=1){if(v=E[h],e.util.traverseUp(v,O))return!1;e.util.unwrap(v,this.document)}}});e.extensions.paste=l})(),(function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(o,r){this.initElement(r)},initElement:function(o){o.getAttribute("data-placeholder")||o.setAttribute("data-placeholder",this.text),this.updatePlaceholder(o)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(o,r){this.cleanupElement(r)},cleanupElement:function(o){o.getAttribute("data-placeholder")===this.text&&o.removeAttribute("data-placeholder")},showPlaceholder:function(o){o&&(e.util.isFF&&o.childNodes.length===0?(o.classList.add("medium-editor-placeholder-relative"),o.classList.remove("medium-editor-placeholder")):(o.classList.add("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(o){o&&(o.classList.remove("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(o,r){if(o.querySelector("img, blockquote, ul, ol, table")||o.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(o);r||this.showPlaceholder(o)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(o,r){var i=this.hideOnClick&&r===this.base.getFocusedElement();this.updatePlaceholder(r,i)},handleFocus:function(o,r){this.hidePlaceholder(r)},handleBlur:function(o,r){this.updatePlaceholder(r)}});e.extensions.placeholder=n})(),(function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(o,r){return this.base.extensions.forEach(function(i){if(i!==this)return o.apply(r||this,arguments)},this)},createToolbar:function(){var o=this.document.createElement("div");return o.id="medium-editor-toolbar-"+this.getEditorId(),o.className="medium-editor-toolbar",this.static?o.className+=" static-toolbar":this.relativeContainer?o.className+=" medium-editor-relative-toolbar":o.className+=" medium-editor-stalker-toolbar",o.appendChild(this.createToolbarButtons()),this.forEachExtension(function(r){r.hasForm&&o.appendChild(r.getForm())}),this.attachEventHandlers(),o},createToolbarButtons:function(){var o=this.document.createElement("ul"),r,i,a,s,l,f;return o.id="medium-editor-toolbar-actions"+this.getEditorId(),o.className="medium-editor-toolbar-actions",o.style.display="block",this.buttons.forEach(function(h){typeof h=="string"?(l=h,f=null):(l=h.name,f=h),s=this.base.addBuiltInExtension(l,f),s&&typeof s.getButton=="function"&&(i=s.getButton(this.base),r=this.document.createElement("li"),e.util.isElement(i)?r.appendChild(i):r.innerHTML=i,o.appendChild(r))},this),a=o.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),o},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(o){if(o&&o.target&&e.util.isDescendant(this.getToolbarElement(),o.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(o){o.hasForm&&o.isDisplayed()&&o.hideForm()})},multipleBlockElementsSelected:function(){var o=/<[^\/>][^>]*><\/[^>]+>/gim,r=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=e.selection.getSelectionHtml(this.document).replace(o,""),a=i.match(r);return!!a&&a.length>1},modifySelection:function(){var o=this.window.getSelection(),r=o.getRangeAt(0);if(this.standardizeSelectionStart&&r.startContainer.nodeValue&&r.startOffset===r.startContainer.nodeValue.length){var i=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),r.startContainer,this.document);if(i){for(var a=0;i.nodeValue.substr(a,1).trim().length===0;)a=a+1;r=e.selection.select(this.document,i,a,r.endContainer,r.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var o=e.selection.getSelectionElement(this.window);if(!o||this.getEditorElements().indexOf(o)===-1||o.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(o){typeof o.isActive=="function"&&typeof o.setInactive=="function"&&o.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var o=[],r=null,i=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(i&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(r=l.queryCommandState(),r!==null)){r&&typeof l.setActive=="function"&&l.setActive();return}o.push(l)}),a=e.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(o.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var o=this.base.getFocusedElement(),r=this.window.getSelection();if(!o)return this;(this.static||!r.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(o):this.positionToolbar(r)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(o){this.getToolbarElement().style.left="0";var r=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,a=this.getToolbarElement(),s=o.getBoundingClientRect(),l=s.top+r,f=s.left+s.width/2,h=a.offsetHeight,v=a.offsetWidth,b=v/2,E;switch(this.sticky?r>l+o.offsetHeight-h-this.stickyTopOffset?(a.style.top=l+o.offsetHeight-h+"px",a.classList.remove("medium-editor-sticky-toolbar")):r>l-h-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-h+"px"):a.style.top=l-h+"px",this.align){case"left":E=s.left;break;case"right":E=s.right-v;break;case"center":E=f-b;break}E<0?E=0:E+v>i&&(E=i-Math.ceil(v)-1),a.style.left=E+"px"},positionToolbar:function(o){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var r=o.getRangeAt(0),i=r.getBoundingClientRect();(!i||i.height===0&&i.width===0&&r.startContainer===r.endContainer)&&(r.startContainer.nodeType===1&&r.startContainer.querySelector("img")?i=r.startContainer.querySelector("img").getBoundingClientRect():i=r.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,f=s.offsetWidth,h=f/2,v=50,b=this.diffLeft-h,E=this.getEditorOption("elementsContainer"),O=["absolute","fixed"].indexOf(window.getComputedStyle(E).getPropertyValue("position"))>-1,w={},S={},M,T;O?(T=E.getBoundingClientRect(),["top","left"].forEach(function($){S[$]=i[$]-T[$]}),S.width=i.width,S.height=i.height,i=S,a=T.width,w.top=E.scrollTop):w.top=this.window.pageYOffset,M=i.left+i.width/2,w.top+=i.top-l,i.top<v?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),w.top+=v+i.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),w.top+=this.diffTop),M<h?(w.left=b+h,w.right="initial"):a-M<h?(w.left="auto",w.right=0):(w.left=b+M,w.right="initial"),["top","left","right"].forEach(function($){s.style[$]=w[$]+(isNaN(w[$])?"":"px")})}});e.extensions.toolbar=n})(),(function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){var r="medium-editor-dragover";o.preventDefault(),o.dataTransfer.dropEffect="copy",o.type==="dragover"?o.target.classList.add(r):o.type==="dragleave"&&o.target.classList.remove(r)},handleDrop:function(o){var r="medium-editor-dragover",i;o.preventDefault(),o.stopPropagation(),o.dataTransfer.files&&(i=Array.prototype.slice.call(o.dataTransfer.files,0),i.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var f=this.document.getElementById(l);f&&(f.removeAttribute("id"),f.removeAttribute("class"),f.src=s.result)}).bind(this)}}).bind(this))),o.target.classList.remove(r)}});e.extensions.imageDragging=n})(),(function(){function n(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q.textContent,ie=e.selection.getCaretOffsets(Q);(J[ie.left-1]===void 0||J[ie.left-1].trim()===""||J[ie.left]!==void 0&&J[ie.left].trim()==="")&&W.preventDefault()}function o(W,Q){if(this.options.disableReturn||Q.getAttribute("data-disable-return"))W.preventDefault();else if(this.options.disableDoubleReturn||Q.getAttribute("data-disable-double-return")){var J=e.selection.getSelectionStart(this.options.ownerDocument);(J&&J.textContent.trim()===""&&J.nodeName.toLowerCase()!=="li"||J.previousElementSibling&&J.previousElementSibling.nodeName.toLowerCase()!=="br"&&J.previousElementSibling.textContent.trim()==="")&&W.preventDefault()}}function r(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q&&Q.nodeName.toLowerCase();J==="pre"&&(W.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(Q)&&(W.preventDefault(),W.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(W){var Q,J=e.selection.getSelectionStart(this.options.ownerDocument),ie=J.nodeName.toLowerCase(),Se=/^(\s+|<br\/?>)?$/i,Ae=/h\d/i;e.util.isKey(W,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&J.previousElementSibling&&Ae.test(ie)&&e.selection.getCaretOffsets(J).left===0?e.util.isKey(W,e.util.keyCode.BACKSPACE)&&Se.test(J.previousElementSibling.innerHTML)?(J.previousElementSibling.parentNode.removeChild(J.previousElementSibling),W.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(W,e.util.keyCode.ENTER)&&(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.previousElementSibling.parentNode.insertBefore(Q,J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.DELETE)&&J.nextElementSibling&&J.previousElementSibling&&!Ae.test(ie)&&Se.test(J.innerHTML)&&Ae.test(J.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,J.nextElementSibling),J.previousElementSibling.parentNode.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&ie==="li"&&Se.test(J.innerHTML)&&!J.previousElementSibling&&!J.parentElement.previousElementSibling&&J.nextElementSibling&&J.nextElementSibling.nodeName.toLowerCase()==="li"?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.parentElement.parentElement.insertBefore(Q,J.parentElement),e.selection.moveCursor(this.options.ownerDocument,Q),J.parentElement.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).left===0?(W.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(W,e.util.keyCode.ENTER)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).right===0?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.parentElement.insertBefore(Q,J.nextSibling),e.selection.moveCursor(this.options.ownerDocument,Q),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(J.parentElement)&&!J.previousElementSibling&&J.nextElementSibling&&Se.test(J.innerHTML)&&(W.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,J.nextSibling),J.parentElement.removeChild(J))}function a(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J;Q&&(e.util.isMediumEditorElement(Q)&&Q.children.length===0&&!e.util.isBlockContainer(Q)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(W,e.util.keyCode.ENTER)&&!e.util.isListItem(Q)&&!e.util.isBlockContainer(Q)&&(J=Q.nodeName.toLowerCase(),J==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!W.shiftKey&&!W.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(W,Q){var J=Q.parentNode.querySelector('textarea[medium-editor-textarea-id="'+Q.getAttribute("medium-editor-textarea-id")+'"]');J&&(J.value=Q.innerHTML.trim())}function l(W){W._mediumEditors||(W._mediumEditors=[null]),this.id||(this.id=W._mediumEditors.length),W._mediumEditors[this.id]=this}function f(W){!W._mediumEditors||!W._mediumEditors[this.id]||(W._mediumEditors[this.id]=null)}function h(W,Q,J){var ie=[];if(W||(W=[]),typeof W=="string"&&(W=Q.querySelectorAll(W)),e.util.isElement(W)&&(W=[W]),J)for(var Se=0;Se<W.length;Se++){var Ae=W[Se];e.util.isElement(Ae)&&!Ae.getAttribute("data-medium-editor-element")&&!Ae.getAttribute("medium-editor-textarea-id")&&ie.push(Ae)}else ie=Array.prototype.slice.apply(W);return ie}function v(W){var Q=W.parentNode.querySelector('textarea[medium-editor-textarea-id="'+W.getAttribute("medium-editor-textarea-id")+'"]');Q&&(Q.classList.remove("medium-editor-hidden"),Q.removeAttribute("medium-editor-textarea-id")),W.parentNode&&W.parentNode.removeChild(W)}function b(W,Q){return Object.keys(Q).forEach(function(J){W[J]===void 0&&(W[J]=Q[J])}),W}function E(W,Q,J){var ie={window:J.options.contentWindow,document:J.options.ownerDocument,base:J};return W=b(W,ie),typeof W.init=="function"&&W.init(),W.name||(W.name=Q),W}function O(){return this.elements.every(function(W){return!!W.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function w(){return O.call(this)?this.options.anchorPreview!==!1:!1}function S(){return this.options.placeholder!==!1}function M(){return this.options.autoLink!==!1}function T(){return this.options.imageDragging!==!1}function $(){return this.options.keyboardCommands!==!1}function D(){return!this.options.extensions.imageDragging}function P(W){for(var Q=this.options.ownerDocument.createElement("div"),J=Date.now(),ie="medium-editor-"+J,Se=W.attributes;this.options.ownerDocument.getElementById(ie);)J++,ie="medium-editor-"+J;Q.className=W.className,Q.id=ie,Q.innerHTML=W.value,W.setAttribute("medium-editor-textarea-id",ie);for(var Ae=0,Pe=Se.length;Ae<Pe;Ae++)Q.hasAttribute(Se[Ae].nodeName)||Q.setAttribute(Se[Ae].nodeName,Se[Ae].value);return W.form&&this.on(W.form,"reset",(function(De){De.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(ie))}).bind(this)),W.classList.add("medium-editor-hidden"),W.parentNode.insertBefore(Q,W),Q}function B(W,Q){if(!W.getAttribute("data-medium-editor-element")){W.nodeName.toLowerCase()==="textarea"&&(W=P.call(this,W),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!W.getAttribute("data-disable-editing")&&(W.setAttribute("contentEditable",!0),W.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(W.getAttribute("data-disable-return")||W.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!W.getAttribute("data-disable-return")&&this.on(W,"keyup",a.bind(this));var J=e.util.guid();W.setAttribute("data-medium-editor-element",!0),W.classList.add("medium-editor-element"),W.setAttribute("role","textbox"),W.setAttribute("aria-multiline",!0),W.setAttribute("data-medium-editor-editor-index",Q),W.setAttribute("medium-editor-index",J),Y[J]=W.innerHTML,this.events.attachAllEventsToElement(W)}return W}function F(){this.subscribe("editableKeydownTab",r.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function I(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(Se){Se!=="toolbar"&&this.options.extensions[Se]&&this.extensions.push(E(this.options.extensions[Se],Se,this))},this),D.call(this)){var W=this.options.fileDragging;W||(W={},T.call(this)||(W.allowedTypes=[])),this.addBuiltInExtension("fileDragging",W)}var Q={paste:!0,"anchor-preview":w.call(this),autoLink:M.call(this),keyboardCommands:$.call(this),placeholder:S.call(this)};Object.keys(Q).forEach(function(Se){Q[Se]&&this.addBuiltInExtension(Se)},this);var J=this.options.extensions.toolbar;if(!J&&O.call(this)){var ie=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});J=new e.extensions.toolbar(ie)}J&&this.extensions.push(E(J,"toolbar",this))}function V(W,Q){var J=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return Q&&J.forEach(function(ie){Q.hasOwnProperty(ie[0])&&Q[ie[0]]!==void 0&&e.util.deprecated(ie[0],ie[1],"v6.0.0")}),e.util.defaults({},Q,W)}function z(W,Q){var J=/^append-(.+)$/gi,ie=/justify([A-Za-z]*)$/g,Se,Ae;if(Se=J.exec(W),Se)return e.util.execFormatBlock(this.options.ownerDocument,Se[1]);if(W==="fontSize")return Q.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),Ae=Q.value||Q.size,this.options.ownerDocument.execCommand("fontSize",!1,Ae);if(W==="fontName")return Q.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),Ae=Q.value||Q.name,this.options.ownerDocument.execCommand("fontName",!1,Ae);if(W==="createLink")return this.createLink(Q);if(W==="image"){var Pe=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Pe)}if(W==="html"){var De=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,De)}if(ie.exec(W)){var ze=this.options.ownerDocument.execCommand(W,!1,null),Ye=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Ye&&X.call(this,e.util.getTopBlockContainer(Ye)),ze}return Ae=Q&&Q.value,this.options.ownerDocument.execCommand(W,!1,Ae)}function X(W){if(W){var Q,J=Array.prototype.slice.call(W.childNodes).filter(function(ie){var Se=ie.nodeName.toLowerCase()==="div";return Se&&!Q&&(Q=ie.style.textAlign),Se});J.length&&(this.saveSelection(),J.forEach(function(ie){if(ie.style.textAlign===Q){var Se=ie.lastChild;if(Se){e.util.unwrap(ie,this.options.ownerDocument);var Ae=this.options.ownerDocument.createElement("BR");Se.parentNode.insertBefore(Ae,Se.nextSibling)}}},this),W.style.textAlign=Q,this.restoreSelection())}}var Y={};e.prototype={init:function(W,Q){return this.options=V.call(this,this.defaults,Q),this.origElements=W,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,I.call(this),F.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(W){typeof W.destroy=="function"&&W.destroy()},this),this.events.destroy(),this.elements.forEach(function(W){this.options.spellcheck&&(W.innerHTML=W.innerHTML),W.removeAttribute("contentEditable"),W.removeAttribute("spellcheck"),W.removeAttribute("data-medium-editor-element"),W.classList.remove("medium-editor-element"),W.removeAttribute("role"),W.removeAttribute("aria-multiline"),W.removeAttribute("medium-editor-index"),W.removeAttribute("data-medium-editor-editor-index"),W.getAttribute("medium-editor-textarea-id")&&v(W)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,f.call(this,this.options.contentWindow))},on:function(W,Q,J,ie){return this.events.attachDOMEvent(W,Q,J,ie),this},off:function(W,Q,J,ie){return this.events.detachDOMEvent(W,Q,J,ie),this},subscribe:function(W,Q){return this.events.attachCustomEvent(W,Q),this},unsubscribe:function(W,Q){return this.events.detachCustomEvent(W,Q),this},trigger:function(W,Q,J){return this.events.triggerCustomEvent(W,Q,J),this},delay:function(W){var Q=this;return setTimeout(function(){Q.isActive&&W()},this.options.delay)},serialize:function(){var W,Q,J={},ie=this.elements.length;for(W=0;W<ie;W+=1)Q=this.elements[W].id!==""?this.elements[W].id:"element-"+W,J[Q]={value:this.elements[W].innerHTML.trim()};return J},getExtensionByName:function(W){var Q;return this.extensions&&this.extensions.length&&this.extensions.some(function(J){return J.name===W?(Q=J,!0):!1}),Q},addBuiltInExtension:function(W,Q){var J=this.getExtensionByName(W),ie;if(J)return J;switch(W){case"anchor":ie=e.util.extend({},this.options.anchor,Q),J=new e.extensions.anchor(ie);break;case"anchor-preview":J=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":J=new e.extensions.autoLink;break;case"fileDragging":J=new e.extensions.fileDragging(Q);break;case"fontname":J=new e.extensions.fontName(this.options.fontName);break;case"fontsize":J=new e.extensions.fontSize(Q);break;case"keyboardCommands":J=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":J=new e.extensions.paste(this.options.paste);break;case"placeholder":J=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(W)&&(Q?(ie=e.util.defaults({},Q,e.extensions.button.prototype.defaults[W]),J=new e.extensions.button(ie)):J=new e.extensions.button(W))}return J&&this.extensions.push(E(J,W,this)),J},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var W=this.getExtensionByName("toolbar");return W&&W.checkState(),this},queryCommandState:function(W){var Q=/^full-(.+)$/gi,J,ie=null;J=Q.exec(W),J&&(W=J[1]);try{ie=this.options.ownerDocument.queryCommandState(W)}catch{ie=null}return ie},execAction:function(W,Q){var J=/^full-(.+)$/gi,ie,Se;return ie=J.exec(W),ie?(this.saveSelection(),this.selectAllContents(),Se=z.call(this,ie[1],Q),this.restoreSelection()):Se=z.call(this,W,Q),(W==="insertunorderedlist"||W==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),Se},getSelectedParentElement:function(W){return W===void 0&&(W=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(W)},selectAllContents:function(){var W=e.selection.getSelectionElement(this.options.contentWindow);if(W){for(;W.children.length===1;)W=W.children[0];this.selectElement(W)}},selectElement:function(W){e.selection.selectNode(W,this.options.ownerDocument);var Q=e.selection.getSelectionElement(this.options.contentWindow);Q&&this.events.focusElement(Q)},getFocusedElement:function(){var W;return this.elements.some(function(Q){return!W&&Q.getAttribute("data-medium-focused")&&(W=Q),!!W},this),W},exportSelection:function(){var W=e.selection.getSelectionElement(this.options.contentWindow),Q=this.elements.indexOf(W),J=null;return Q>=0&&(J=e.selection.exportSelection(W,this.options.ownerDocument)),J!==null&&Q!==0&&(J.editableElementIndex=Q),J},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(W,Q){if(W){var J=this.elements[W.editableElementIndex||0];e.selection.importSelection(W,J,this.options.ownerDocument,Q)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(W){var Q=e.selection.getSelectionElement(this.options.contentWindow),J={},ie;if(this.elements.indexOf(Q)!==-1){try{if(this.events.disableCustomEvent("editableInput"),W.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),ie=W.url||W.value,ie&&ie.trim().length>0){var Se=this.options.contentWindow.getSelection();if(Se){var Ae=Se.getRangeAt(0),Pe=Ae.commonAncestorContainer,De,ze,Ye,Be;if(Ae.endContainer.nodeType===3&&Ae.startContainer.nodeType!==3&&Ae.startOffset===0&&Ae.startContainer.firstChild===Ae.endContainer&&(Pe=Ae.endContainer),ze=e.util.getClosestBlockContainer(Ae.startContainer),Ye=e.util.getClosestBlockContainer(Ae.endContainer),Pe.nodeType!==3&&Pe.textContent.length!==0&&ze===Ye){var Je=ze||Q,gt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),De=this.exportSelection(),gt.appendChild(Je.cloneNode(!0)),Q===Je?e.selection.select(this.options.ownerDocument,Je.firstChild,0,Je.lastChild,Je.lastChild.nodeType===3?Je.lastChild.nodeValue.length:Je.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,Je,0,Je,Je.childNodes.length);var le=this.exportSelection();Be=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,gt,{start:De.start-le.start,end:De.end-le.start,editableElementIndex:De.editableElementIndex}),Be.length===0&&(gt=this.options.ownerDocument.createDocumentFragment(),gt.appendChild(Pe.cloneNode(!0)),Be=[gt.firstChild.firstChild,gt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(gt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,gt.firstChild.innerHTML.replace(/^\s+/,"")),De.start-=Ze,De.end-=Ze,this.importSelection(De)}else this.options.ownerDocument.execCommand("createLink",!1,ie);this.options.targetBlank||W.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie),W.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),W.buttonClass)}}if(this.options.targetBlank||W.target==="_blank"||W.buttonClass){J=this.options.ownerDocument.createEvent("HTMLEvents"),J.initEvent("input",!0,!0,this.options.contentWindow);for(var pe=0,se=this.elements.length;pe<se;pe+=1)this.elements[pe].dispatchEvent(J)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",J,Q)}},cleanPaste:function(W){this.getExtensionByName("paste").cleanPaste(W)},pasteHTML:function(W,Q){this.getExtensionByName("paste").pasteHTML(W,Q)},setContent:function(W,Q){if(Q=Q||0,this.elements[Q]){var J=this.elements[Q];J.innerHTML=W,this.checkContentChanged(J)}},getContent:function(W){return W=W||0,this.elements[W]?this.elements[W].innerHTML.trim():null},checkContentChanged:function(W){W=W||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(W,{target:W,currentTarget:W})},resetContent:function(W){if(W){var Q=this.elements.indexOf(W);Q!==-1&&this.setContent(Y[W.getAttribute("medium-editor-index")],Q);return}this.elements.forEach(function(J,ie){this.setContent(Y[J.getAttribute("medium-editor-index")],ie)},this)},addElements:function(W){var Q=h(W,this.options.ownerDocument,!0);if(Q.length===0)return!1;Q.forEach(function(J){J=B.call(this,J,this.id),this.elements.push(J),this.trigger("addElement",{target:J,currentTarget:J},J)},this)},removeElements:function(W){var Q=h(W,this.options.ownerDocument),J=Q.map(function(ie){return ie.getAttribute("medium-editor-textarea-id")&&ie.parentNode?ie.parentNode.querySelector('div[medium-editor-textarea-id="'+ie.getAttribute("medium-editor-textarea-id")+'"]'):ie});this.elements=this.elements.filter(function(ie){return J.indexOf(ie)!==-1?(this.events.cleanupElement(ie),ie.getAttribute("medium-editor-textarea-id")&&v(ie),this.trigger("removeElement",{target:ie,currentTarget:ie},ie),!1):!0},this)}},e.getEditorFromElement=function(W){var Q=W.getAttribute("data-medium-editor-editor-index"),J=W&&W.ownerDocument&&(W.ownerDocument.defaultView||W.ownerDocument.parentWindow);return J&&J._mediumEditors&&J._mediumEditors[Q]?J._mediumEditors[Q]:null}})(),(function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}})(),e.parseVersionString=function(n){var o=n.split("-"),r=o[0].split("."),i=o.length>1?o[1]:"";return{major:parseInt(r[0],10),minor:parseInt(r[1],10),revision:parseInt(r[2],10),preRelease:i,toString:function(){return[r[0],r[1],r[2]].join(".")+(i?"-"+i:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Q0)),Q0.exports}var gne=mne();const D0=Z_(gne);/*!
|
||
* vanilla-picker v2.12.3
|
||
* https://vanilla-picker.js.org
|
||
*
|
||
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
||
* Released under the ISC license.
|
||
*/var DM=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jM=(function(){function t(e,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}})(),j0=(function(){function t(e,n){var o=[],r=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(f){i=!0,a=f}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return o}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0};String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var yne={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function gR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var _ne=(function(){function t(e,n,o,r){DM(this,t);var i=this;function a(l){if(l.startsWith("hsl")){var f=l.match(/([\-\d\.e]+)/g).map(Number),h=j0(f,4),v=h[0],b=h[1],E=h[2],O=h[3];O===void 0&&(O=1),v/=360,b/=100,E/=100,i.hsla=[v,b,E,O]}else if(l.startsWith("rgb")){var w=l.match(/([\-\d\.e]+)/g).map(Number),S=j0(w,4),M=S[0],T=S[1],$=S[2],D=S[3];D===void 0&&(D=1),i.rgba=[M,T,$,D]}else l.startsWith("#")?i.rgba=t.hexToRgb(l):i.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(o===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,o,r===void 0?1:r]}return jM(t,[{key:"printRGB",value:function(n){var o=n?this.rgba:this.rgba.slice(0,3),r=o.map(function(i,a){return gR(i,a===3?3:0)});return n?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(n){var o=[360,100,100,1],r=["","%","%",""],i=n?this.hsla:this.hsla.slice(0,3),a=i.map(function(s,l){return gR(s*o[l],l===3?3:1)+r[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var o=this.hex;return n?o:o.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,o=n.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+o.map(function(r){return r.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var o=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!o.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var r=o.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(i){return parseInt(i,16)});return r[3]=r[3]/255,r}},{key:"nameToRgb",value:function(n){var o=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=yne[o];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3];r/=255,i/=255,a/=255;var l=Math.max(r,i,a),f=Math.min(r,i,a),h=void 0,v=void 0,b=(l+f)/2;if(l===f)h=v=0;else{var E=l-f;switch(v=b>.5?E/(2-l-f):E/(l+f),l){case r:h=(i-a)/E+(i<a?6:0);break;case i:h=(a-r)/E+2;break;case a:h=(r-i)/E+4;break}h/=6}return[h,v,b,s]}},{key:"hslToRgb",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3],l=void 0,f=void 0,h=void 0;if(i===0)l=f=h=a;else{var v=function(S,M,T){return T<0&&(T+=1),T>1&&(T-=1),T<.16666666666666666?S+(M-S)*6*T:T<.5?M:T<.6666666666666666?S+(M-S)*(.6666666666666666-T)*6:S},b=a<.5?a*(1+i):a+i-a*i,E=2*a-b;l=v(E,b,r+1/3),f=v(E,b,r),h=v(E,b,r-1/3)}var O=[l*255,f*255,h*255].map(Math.round);return O[3]=s,O}}]),t})(),bne=(function(){function t(){DM(this,t),this._events=[]}return jM(t,[{key:"add",value:function(n,o,r){n.addEventListener(o,r,!1),this._events.push({target:n,type:o,handler:r})}},{key:"remove",value:function(n,o,r){this._events=this._events.filter(function(i){var a=!0;return n&&n!==i.target&&(a=!1),o&&o!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&t._doRemove(i.target,i.type,i.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,o,r){n.removeEventListener(o,r,!1)}}]),t})();function wne(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function mS(t,e,n){var o=!1;function r(l,f,h){return Math.max(f,Math.min(l,h))}function i(l,f,h){if(h&&(o=!0),!!o){l.preventDefault();var v=e.getBoundingClientRect(),b=v.width,E=v.height,O=f.clientX,w=f.clientY,S=r(O-v.left,0,b),M=r(w-v.top,0,E);n(S/b,M/E)}}function a(l,f){var h=l.buttons===void 0?l.which:l.buttons;h===1?i(l,l,f):o=!1}function s(l,f){l.touches.length===1?i(l,l.touches[0],f):o=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){o=!1}),t.add(e,"touchend",function(l){o=!1}),t.add(e,"touchcancel",function(l){o=!1})}var Ene=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
||
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,xne=360,qI="keydown",L0="mousedown",gS="focusin";function Dd(t,e){return(e||document).querySelector(t)}function One(t){t.preventDefault(),t.stopPropagation()}function yS(t,e,n,o,r){t.add(e,qI,function(i){n.indexOf(i.key)>=0&&o(i)})}var KI=(function(){function t(e){DM(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new bne,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return jM(t,[{key:"setOptions",value:function(n){var o=this;if(!n)return;var r=this.settings;function i(f,h,v){for(var b in f)h[b]=f[b]}if(n instanceof HTMLElement)r.parent=n;else{r.parent&&n.parent&&r.parent!==n.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(n,r),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=r.parent;if(s&&r.popup&&!this._popupInited){var l=function(h){return o.openHandler(h)};this._events.add(s,"click",l),yS(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var o=n&&n.type===qI?this._domEdit:this.domElement;setTimeout(function(){return o.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var o=n&&n.type,r=!1;if(!n)r=!0;else if(o===L0||o===gS){var i=(this.__containedEvent||0)+100;n.timeStamp>i&&(r=!0)}else One(n),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",o!==L0&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,o){this.closeHandler(),this.setOptions(n),o&&this.openHandler()}},{key:"setColor",value:function(n,o){this._setColor(n,{silent:o})}},{key:"_setColor",value:function(n,o){if(typeof n=="string"&&(n=n.trim()),!!n){o=o||{};var r=void 0;try{r=new _ne(n)}catch(a){if(o.failSilently)return;throw a}if(!this.settings.alpha){var i=r.hsla;i[3]=1,r.hsla=i}this.colour=this.color=r,this._setHSLA(null,null,null,null,o)}}},{key:"setColour",value:function(n,o){this.setColor(n,o)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var o=this._toggleDOM(!0);return this._setPosition(),o}var r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=wne(r);return this.domElement=i,this._domH=Dd(".picker_hue",i),this._domSL=Dd(".picker_sl",i),this._domA=Dd(".picker_alpha",i),this._domEdit=Dd(".picker_editor input",i),this._domSample=Dd(".picker_sample",i),this._domOkay=Dd(".picker_done button",i),this._domCancel=Dd(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,o=this,r=this.domElement,i=this._events;function a(f,h,v){i.add(f,h,v)}a(r,"click",function(f){return f.preventDefault()}),mS(i,this._domH,function(f,h){return o._setHSLA(f)}),mS(i,this._domSL,function(f,h){return o._setHSLA(null,f,1-h)}),this.settings.alpha&&mS(i,this._domA,function(f,h){return o._setHSLA(null,null,null,1-h)});var s=this._domEdit;a(s,"input",function(f){o._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(f){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var f=function(b){return n.closeHandler(b)};a(window,L0,f),a(window,gS,f),yS(i,r,["Esc","Escape"],f);var h=function(b){n.__containedEvent=b.timeStamp};a(r,L0,h),a(r,gS,h),a(n._domCancel,"click",f)});var l=function(h){n._ifPopup(function(){return n.closeHandler(h)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),yS(i,r,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,o=this.domElement;n!==o.parentNode&&n.appendChild(o),this._ifPopup(function(r){getComputedStyle(n).position==="static"&&(n.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===i?o.classList.add(a):o.classList.remove(a)}),o.classList.add(i)})}},{key:"_setHSLA",value:function(n,o,r,i,a){a=a||{};var s=this.colour,l=s.hsla;[n,o,r,i].forEach(function(f,h){(f||f===0)&&(l[h]=f)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var o=this.colour,r=o.hsla,i="hsl("+r[0]*xne+", 100%, 50%)",a=o.hslString,s=o.hslaString,l=this._domH,f=this._domSL,h=this._domA,v=Dd(".picker_selector",l),b=Dd(".picker_selector",f),E=Dd(".picker_selector",h);function O(B,F,I){F.style.left=I*100+"%"}function w(B,F,I){F.style.top=I*100+"%"}O(l,v,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,O(f,b,r[1]),w(f,b,1-r[2]),f.style.color=a,w(h,E,1-r[3]);var S=a,M=S.replace("hsl","hsla").replace(")",", 0)"),T="linear-gradient("+[S,M]+")";if(this._domA.style.background=T+", "+Ene,!n.fromEditor){var $=this.settings.editorFormat,D=this.settings.alpha,P=void 0;switch($){case"rgb":P=o.printRGB(D);break;case"hsl":P=o.printHSL(D);break;default:P=o.printHex(D)}this._domEdit.value=P}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,o){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):o&&o()}},{key:"_toggleDOM",value:function(n){var o=this.domElement;if(!o)return!1;var r=n?"":"none",i=o.style.display!==r;return i&&(o.style.display=r),i}}]),t})();{var _S=document.createElement("style");_S.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(_S),KI.StyleElement=_S}var bS={exports:{}},yR;function ZI(){return yR||(yR=1,(function(t,e){(function(n,o){t.exports=n()})(function(){var n="object",o="function",r="undefined",i=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function f(le,Ze){var pe=typeof le[Ze];return pe==o||!!(pe==n&&le[Ze])||pe=="unknown"}function h(le,Ze){return!!(typeof le[Ze]==n&&le[Ze])}function v(le,Ze){return typeof le[Ze]!=r}function b(le){return function(Ze,pe){for(var se=pe.length;se--;)if(!le(Ze,pe[se]))return!1;return!0}}var E=b(f),O=b(h),w=b(v);function S(le){return le&&E(le,l)&&w(le,s)}function M(le){return h(le,"body")?le.body:le.getElementsByTagName("body")[0]}var T=[].forEach?function(le,Ze){le.forEach(Ze)}:function(le,Ze){for(var pe=0,se=le.length;pe<se;++pe)Ze(le[pe],pe)},$={},D=typeof window!=r&&typeof document!=r,P={isHostMethod:f,isHostObject:h,isHostProperty:v,areHostMethods:E,areHostObjects:O,areHostProperties:w,isTextRange:S,getBody:M,forEach:T},B={version:"1.3.2",initialized:!1,isBrowser:D,supported:!0,util:P,features:{},modules:$,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==r?!0:rangyAutoInitialize}};function F(le){typeof console!=r&&f(console,"log")&&console.log(le)}function I(le,Ze){D&&Ze?alert(le):F(le)}function V(le){B.initialized=!0,B.supported=!1,I("Rangy is not supported in this environment. Reason: "+le,B.config.alertOnFail)}B.fail=V;function z(le){I("Rangy warning: "+le,B.config.alertOnWarn)}B.warn=z;var X;({}).hasOwnProperty?(P.extend=X=function(le,Ze,pe){var se,we;for(var $e in Ze)$e==="__proto__"||$e==="constructor"||$e==="prototype"||Ze.hasOwnProperty($e)&&(se=le[$e],we=Ze[$e],pe&&se!==null&&typeof se=="object"&&we!==null&&typeof we=="object"&&X(se,we,!0),le[$e]=we);return Ze.hasOwnProperty("toString")&&(le.toString=Ze.toString),le},P.createOptions=function(le,Ze){var pe={};return X(pe,Ze),le&&X(pe,le),pe}):V("hasOwnProperty not supported"),D||V("Rangy can only run in a browser"),(function(){var le;if(D){var Ze=document.createElement("div");Ze.appendChild(document.createElement("span"));var pe=[].slice;try{pe.call(Ze.childNodes,0)[0].nodeType==1&&(le=function(se){return pe.call(se,0)})}catch{}}le||(le=function(se){for(var we=[],$e=0,rt=se.length;$e<rt;++$e)we[$e]=se[$e];return we}),P.toArray=le})();var Y;D&&(f(document,"addEventListener")?Y=function(le,Ze,pe){le.addEventListener(Ze,pe,!1)}:f(document,"attachEvent")?Y=function(le,Ze,pe){le.attachEvent("on"+Ze,pe)}:V("Document does not have required addEventListener or attachEvent method"),P.addListener=Y);var W=[];function Q(le){return le.message||le.description||String(le)}function J(){if(!(!D||B.initialized)){var le,Ze=!1,pe=!1;f(document,"createRange")&&(le=document.createRange(),E(le,a)&&w(le,i)&&(Ze=!0));var se=M(document);if(!se||se.nodeName.toLowerCase()!="body"){V("No body element found");return}if(se&&f(se,"createTextRange")&&(le=se.createTextRange(),S(le)&&(pe=!0)),!Ze&&!pe){V("Neither Range nor TextRange are available");return}B.initialized=!0,B.features={implementsDomRange:Ze,implementsTextRange:pe};var we,$e;for(var rt in $)(we=$[rt])instanceof De&&we.init(we,B);for(var pt=0,Lt=W.length;pt<Lt;++pt)try{W[pt](B)}catch(Jt){$e="Rangy init listener threw an exception. Continuing. Detail: "+Q(Jt),F($e)}}}function ie(le,Ze,pe){pe&&(le+=" in module "+pe.name),B.warn("DEPRECATED: "+le+" is deprecated. Please use "+Ze+" instead.")}function Se(le,Ze,pe,se){le[Ze]=function(){return ie(Ze,pe,se),le[pe].apply(le,P.toArray(arguments))}}P.deprecationNotice=ie,P.createAliasForDeprecatedMethod=Se,B.init=J,B.addInitListener=function(le){B.initialized?le(B):W.push(le)};var Ae=[];B.addShimListener=function(le){Ae.push(le)};function Pe(le){le=le||window,J();for(var Ze=0,pe=Ae.length;Ze<pe;++Ze)Ae[Ze](le)}D&&(B.shim=B.createMissingNativeApi=Pe,Se(B,"createMissingNativeApi","shim"));function De(le,Ze,pe){this.name=le,this.dependencies=Ze,this.initialized=!1,this.supported=!1,this.initializer=pe}De.prototype={init:function(){for(var le=this.dependencies||[],Ze=0,pe=le.length,se,we;Ze<pe;++Ze){if(we=le[Ze],se=$[we],!se||!(se instanceof De))throw new Error("required module '"+we+"' not found");if(se.init(),!se.supported)throw new Error("required module '"+we+"' not supported")}this.initializer(this)},fail:function(le){throw this.initialized=!0,this.supported=!1,new Error(le)},warn:function(le){B.warn("Module "+this.name+": "+le)},deprecationNotice:function(le,Ze){B.warn("DEPRECATED: "+le+" in module "+this.name+" is deprecated. Please use "+Ze+" instead")},createError:function(le){return new Error("Error in Rangy "+this.name+" module: "+le)}};function ze(le,Ze,pe){var se=new De(le,Ze,function(we){if(!we.initialized){we.initialized=!0;try{pe(B,we),we.supported=!0}catch(rt){var $e="Module '"+le+"' failed to load: "+Q(rt);F($e),rt.stack&&F(rt.stack)}}});return $[le]=se,se}B.createModule=function(le){var Ze,pe;arguments.length==2?(Ze=arguments[1],pe=[]):(Ze=arguments[2],pe=arguments[1]);var se=ze(le,pe,Ze);B.initialized&&B.supported&&se.init()},B.createCoreModule=function(le,Ze,pe){ze(le,Ze,pe)};function Ye(){}B.RangePrototype=Ye,B.rangePrototype=new Ye;function Be(){}B.selectionPrototype=new Be,B.createCoreModule("DomUtil",[],function(le,Ze){var pe="undefined",se=le.util,we=se.getBody;se.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||Ze.fail("document missing a Node creation method"),se.isHostMethod(document,"getElementsByTagName")||Ze.fail("document missing getElementsByTagName method");var $e=document.createElement("div");se.areHostMethods($e,["insertBefore","appendChild","cloneNode"])||Ze.fail("Incomplete Element implementation"),se.isHostProperty($e,"innerHTML")||Ze.fail("Element is missing innerHTML property");var rt=document.createTextNode("test");se.areHostMethods(rt,["splitText","deleteData","insertData","appendData","cloneNode"])||Ze.fail("Incomplete Text Node implementation");var pt=function(ut,vn){for(var In=ut.length;In--;)if(ut[In]===vn)return!0;return!1};function Lt(ut){var vn;return typeof ut.namespaceURI==pe||(vn=ut.namespaceURI)===null||vn=="http://www.w3.org/1999/xhtml"}function Jt(ut){var vn=ut.parentNode;return vn.nodeType==1?vn:null}function en(ut){for(var vn=0;ut=ut.previousSibling;)++vn;return vn}function zt(ut){switch(ut.nodeType){case 7:case 10:return 0;case 3:case 8:return ut.length;default:return ut.childNodes.length}}function it(ut,vn){var In=[],sr;for(sr=ut;sr;sr=sr.parentNode)In.push(sr);for(sr=vn;sr;sr=sr.parentNode)if(pt(In,sr))return sr;return null}function ae(ut,vn,In){for(var sr=In?vn:vn.parentNode;sr;){if(sr===ut)return!0;sr=sr.parentNode}return!1}function re(ut,vn){return ae(ut,vn,!0)}function je(ut,vn,In){for(var sr,wo=In?ut:ut.parentNode;wo;){if(sr=wo.parentNode,sr===vn)return wo;wo=sr}return null}function vt(ut){var vn=ut.nodeType;return vn==3||vn==4||vn==8}function q(ut){if(!ut)return!1;var vn=ut.nodeType;return vn==3||vn==8}function kt(ut,vn){var In=vn.nextSibling,sr=vn.parentNode;return In?sr.insertBefore(ut,In):sr.appendChild(ut),ut}function Rt(ut,vn,In){var sr=ut.cloneNode(!1);if(sr.deleteData(0,vn),ut.deleteData(vn,ut.length-vn),kt(sr,ut),In)for(var wo=0,oo;oo=In[wo++];)oo.node==ut&&oo.offset>vn?(oo.node=sr,oo.offset-=vn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return sr}function Gt(ut){if(ut.nodeType==9)return ut;if(typeof ut.ownerDocument!=pe)return ut.ownerDocument;if(typeof ut.document!=pe)return ut.document;if(ut.parentNode)return Gt(ut.parentNode);throw Ze.createError("getDocument: no document found for node")}function Pn(ut){var vn=Gt(ut);if(typeof vn.defaultView!=pe)return vn.defaultView;if(typeof vn.parentWindow!=pe)return vn.parentWindow;throw Ze.createError("Cannot get a window object for node")}function qt(ut){if(typeof ut.contentDocument!=pe)return ut.contentDocument;if(typeof ut.contentWindow!=pe)return ut.contentWindow.document;throw Ze.createError("getIframeDocument: No Document object found for iframe element")}function On(ut){if(typeof ut.contentWindow!=pe)return ut.contentWindow;if(typeof ut.contentDocument!=pe)return ut.contentDocument.defaultView;throw Ze.createError("getIframeWindow: No Window object found for iframe element")}function ke(ut){return ut&&se.isHostMethod(ut,"setTimeout")&&se.isHostObject(ut,"document")}function Ke(ut,vn,In){var sr;if(ut?se.isHostProperty(ut,"nodeType")?sr=ut.nodeType==1&&ut.tagName.toLowerCase()=="iframe"?qt(ut):Gt(ut):ke(ut)&&(sr=ut.document):sr=document,!sr)throw vn.createError(In+"(): Parameter must be a Window object or DOM node");return sr}function Le(ut){for(var vn;vn=ut.parentNode;)ut=vn;return ut}function dt(ut,vn,In,sr){var wo,oo,ta,Ca,Yi;if(ut==In)return vn===sr?0:vn<sr?-1:1;if(wo=je(In,ut,!0))return vn<=en(wo)?-1:1;if(wo=je(ut,In,!0))return en(wo)<sr?-1:1;if(oo=it(ut,In),!oo)throw new Error("comparePoints error: nodes have no common ancestor");if(ta=ut===oo?oo:je(ut,oo,!0),Ca=In===oo?oo:je(In,oo,!0),ta===Ca)throw Ze.createError("comparePoints got to case 4 and childA and childB are the same!");for(Yi=oo.firstChild;Yi;){if(Yi===ta)return-1;if(Yi===Ca)return 1;Yi=Yi.nextSibling}}var At=!1;function Tt(ut){var vn;try{return vn=ut.parentNode,!1}catch{return!0}}(function(){var ut=document.createElement("b");ut.innerHTML="1";var vn=ut.firstChild;ut.innerHTML="<br />",At=Tt(vn),le.features.crashyTextNodes=At})();function En(ut){if(!ut)return"[No node]";if(At&&Tt(ut))return"[Broken node]";if(vt(ut))return'"'+ut.data+'"';if(ut.nodeType==1){var vn=ut.id?' id="'+ut.id+'"':"";return"<"+ut.nodeName+vn+">[index:"+en(ut)+",length:"+ut.childNodes.length+"]["+(ut.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return ut.nodeName}function Zn(ut){for(var vn=Gt(ut).createDocumentFragment(),In;In=ut.firstChild;)vn.appendChild(In);return vn}var ao;typeof window.getComputedStyle!=pe?ao=function(ut,vn){return Pn(ut).getComputedStyle(ut,null)[vn]}:typeof document.documentElement.currentStyle!=pe?ao=function(ut,vn){return ut.currentStyle?ut.currentStyle[vn]:""}:Ze.fail("No means of obtaining computed style properties found");function Lo(ut,vn,In){var sr=we(ut),wo=ut.createElement("div");wo.contentEditable=""+!!In,vn&&(wo.innerHTML=vn);var oo=sr.firstChild;return oo?sr.insertBefore(wo,oo):sr.appendChild(wo),wo}function yo(ut){return ut.parentNode.removeChild(ut)}function ho(ut){this.root=ut,this._next=ut}ho.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var ut=this._current=this._next,vn,In;if(this._current)if(vn=ut.firstChild,vn)this._next=vn;else{for(In=null;ut!==this.root&&!(In=ut.nextSibling);)ut=ut.parentNode;this._next=In}return this._current},detach:function(){this._current=this._next=this.root=null}};function Nn(ut){return new ho(ut)}function qn(ut,vn){this.node=ut,this.offset=vn}qn.prototype={equals:function(ut){return!!ut&&this.node===ut.node&&this.offset==ut.offset},inspect:function(){return"[DomPosition("+En(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function rr(ut){this.code=this[ut],this.codeName=ut,this.message="DOMException: "+this.codeName}rr.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},rr.prototype.toString=function(){return this.message},le.dom={arrayContains:pt,isHtmlNamespace:Lt,parentElement:Jt,getNodeIndex:en,getNodeLength:zt,getCommonAncestor:it,isAncestorOf:ae,isOrIsAncestorOf:re,getClosestAncestorIn:je,isCharacterDataNode:vt,isTextOrCommentNode:q,insertAfter:kt,splitDataNode:Rt,getDocument:Gt,getWindow:Pn,getIframeWindow:On,getIframeDocument:qt,getBody:we,isWindow:ke,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:En,getComputedStyleProperty:ao,createTestElement:Lo,removeNode:yo,fragmentFromNodeChildren:Zn,createIterator:Nn,DomPosition:qn},le.DOMException=rr}),B.createCoreModule("DomRange",["DomUtil"],function(le,Ze){var pe=le.dom,se=le.util,we=pe.DomPosition,$e=le.DOMException,rt=pe.isCharacterDataNode,pt=pe.getNodeIndex,Lt=pe.isOrIsAncestorOf,Jt=pe.getDocument,en=pe.comparePoints,zt=pe.splitDataNode,it=pe.getClosestAncestorIn,ae=pe.getNodeLength,re=pe.arrayContains,je=pe.getRootContainer,vt=le.features.crashyTextNodes,q=pe.removeNode;function kt(ye,ht){return ye.nodeType!=3&&(Lt(ye,ht.startContainer)||Lt(ye,ht.endContainer))}function Rt(ye){return ye.document||Jt(ye.startContainer)}function Gt(ye){return je(ye.startContainer)}function Pn(ye){return new we(ye.parentNode,pt(ye))}function qt(ye){return new we(ye.parentNode,pt(ye)+1)}function On(ye,ht,fn){var Rn=ye.nodeType==11?ye.firstChild:ye;return rt(ht)?fn==ht.length?pe.insertAfter(ye,ht):ht.parentNode.insertBefore(ye,fn==0?ht:zt(ht,fn)):fn>=ht.childNodes.length?ht.appendChild(ye):ht.insertBefore(ye,ht.childNodes[fn]),Rn}function ke(ye,ht,fn){if(Sn(ye),Sn(ht),Rt(ht)!=Rt(ye))throw new $e("WRONG_DOCUMENT_ERR");var Rn=en(ye.startContainer,ye.startOffset,ht.endContainer,ht.endOffset),Cn=en(ye.endContainer,ye.endOffset,ht.startContainer,ht.startOffset);return fn?Rn<=0&&Cn>=0:Rn<0&&Cn>0}function Ke(ye){for(var ht,fn,Rn=Rt(ye.range).createDocumentFragment(),Cn;fn=ye.next();){if(ht=ye.isPartiallySelectedSubtree(),fn=fn.cloneNode(!ht),ht&&(Cn=ye.getSubtreeIterator(),fn.appendChild(Ke(Cn)),Cn.detach()),fn.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");Rn.appendChild(fn)}return Rn}function Le(ye,ht,fn){var Rn,Cn;fn=fn||{stop:!1};for(var nr,Mn;nr=ye.next();)if(ye.isPartiallySelectedSubtree()){if(ht(nr)===!1){fn.stop=!0;return}else if(Mn=ye.getSubtreeIterator(),Le(Mn,ht,fn),Mn.detach(),fn.stop)return}else for(Rn=pe.createIterator(nr);Cn=Rn.next();)if(ht(Cn)===!1){fn.stop=!0;return}}function dt(ye){for(var ht;ye.next();)ye.isPartiallySelectedSubtree()?(ht=ye.getSubtreeIterator(),dt(ht),ht.detach()):ye.remove()}function At(ye){for(var ht,fn=Rt(ye.range).createDocumentFragment(),Rn;ht=ye.next();){if(ye.isPartiallySelectedSubtree()?(ht=ht.cloneNode(!1),Rn=ye.getSubtreeIterator(),ht.appendChild(At(Rn)),Rn.detach()):ye.remove(),ht.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");fn.appendChild(ht)}return fn}function Tt(ye,ht,fn){var Rn=!!(ht&&ht.length),Cn,nr=!!fn;Rn&&(Cn=new RegExp("^("+ht.join("|")+")$"));var Mn=[];return Le(new Zn(ye,!1),function(or){if(!(Rn&&!Cn.test(or.nodeType))&&!(nr&&!fn(or))){var lr=ye.startContainer;if(!(or==lr&&rt(lr)&&ye.startOffset==lr.length)){var qr=ye.endContainer;or==qr&&rt(qr)&&ye.endOffset==0||Mn.push(or)}}}),Mn}function En(ye){var ht=typeof ye.getName>"u"?"Range":ye.getName();return"["+ht+"("+pe.inspectNode(ye.startContainer)+":"+ye.startOffset+", "+pe.inspectNode(ye.endContainer)+":"+ye.endOffset+")]"}function Zn(ye,ht){if(this.range=ye,this.clonePartiallySelectedTextNodes=ht,!ye.collapsed){this.sc=ye.startContainer,this.so=ye.startOffset,this.ec=ye.endContainer,this.eo=ye.endOffset;var fn=ye.commonAncestorContainer;this.sc===this.ec&&rt(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===fn&&!rt(this.sc)?this.sc.childNodes[this.so]:it(this.sc,fn,!0),this._last=this.ec===fn&&!rt(this.ec)?this.ec.childNodes[this.eo-1]:it(this.ec,fn,!0))}}Zn.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var ye=this._current=this._next;return ye&&(this._next=ye!==this._last?ye.nextSibling:null,rt(ye)&&this.clonePartiallySelectedTextNodes&&(ye===this.ec&&(ye=ye.cloneNode(!0)).deleteData(this.eo,ye.length-this.eo),this._current===this.sc&&(ye=ye.cloneNode(!0)).deleteData(0,this.so))),ye},remove:function(){var ye=this._current,ht,fn;rt(ye)&&(ye===this.sc||ye===this.ec)?(ht=ye===this.sc?this.so:0,fn=ye===this.ec?this.eo:ye.length,ht!=fn&&ye.deleteData(ht,fn-ht)):ye.parentNode&&q(ye)},isPartiallySelectedSubtree:function(){var ye=this._current;return kt(ye,this.range)},getSubtreeIterator:function(){var ye;if(this.isSingleCharacterDataNode)ye=this.range.cloneRange(),ye.collapse(!1);else{ye=new si(Rt(this.range));var ht=this._current,fn=ht,Rn=0,Cn=ht,nr=ae(ht);Lt(ht,this.sc)&&(fn=this.sc,Rn=this.so),Lt(ht,this.ec)&&(Cn=this.ec,nr=this.eo),so(ye,fn,Rn,Cn,nr)}return new Zn(ye,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var ao=[1,3,4,5,7,8,10],Lo=[2,9,11],yo=[5,6,10,12],ho=[1,3,4,5,7,8,10,11],Nn=[1,3,4,5,7,8];function qn(ye){return function(ht,fn){for(var Rn,Cn=fn?ht:ht.parentNode;Cn;){if(Rn=Cn.nodeType,re(ye,Rn))return Cn;Cn=Cn.parentNode}return null}}var rr=qn([9,11]),ut=qn(yo),vn=qn([6,10,12]),In=qn([1]);function sr(ye,ht){if(vn(ye,ht))throw new $e("INVALID_NODE_TYPE_ERR")}function wo(ye,ht){if(!re(ht,ye.nodeType))throw new $e("INVALID_NODE_TYPE_ERR")}function oo(ye,ht){if(ht<0||ht>(rt(ye)?ye.length:ye.childNodes.length))throw new $e("INDEX_SIZE_ERR")}function ta(ye,ht){if(rr(ye,!0)!==rr(ht,!0))throw new $e("WRONG_DOCUMENT_ERR")}function Ca(ye){if(ut(ye,!0))throw new $e("NO_MODIFICATION_ALLOWED_ERR")}function Yi(ye,ht){if(!ye)throw new $e(ht)}function fa(ye,ht){return ht<=(rt(ye)?ye.length:ye.childNodes.length)}function Ka(ye){return!!ye.startContainer&&!!ye.endContainer&&!(vt&&(pe.isBrokenNode(ye.startContainer)||pe.isBrokenNode(ye.endContainer)))&&je(ye.startContainer)==je(ye.endContainer)&&fa(ye.startContainer,ye.startOffset)&&fa(ye.endContainer,ye.endOffset)}function Sn(ye){if(!Ka(ye))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+ye.inspect()+")")}var Ts=document.createElement("style"),Oo=!1;try{Ts.innerHTML="<b>x</b>",Oo=Ts.firstChild.nodeType==3}catch{}le.features.htmlParsingConforms=Oo;var es=Oo?function(ye){var ht=this.startContainer,fn=Jt(ht);if(!ht)throw new $e("INVALID_STATE_ERR");var Rn=null;return ht.nodeType==1?Rn=ht:rt(ht)&&(Rn=pe.parentElement(ht)),Rn===null||Rn.nodeName=="HTML"&&pe.isHtmlNamespace(Jt(Rn).documentElement)&&pe.isHtmlNamespace(Rn)?Rn=fn.createElement("body"):Rn=Rn.cloneNode(!1),Rn.innerHTML=ye,pe.fragmentFromNodeChildren(Rn)}:function(ye){var ht=Rt(this),fn=ht.createElement("body");return fn.innerHTML=ye,pe.fragmentFromNodeChildren(fn)};function Ui(ye,ht){Sn(ye);var fn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=fn===Cn;rt(Cn)&&nr>0&&nr<Cn.length&&zt(Cn,nr,ht),rt(fn)&&Rn>0&&Rn<fn.length&&(fn=zt(fn,Rn,ht),Mn?(nr-=Rn,Cn=fn):Cn==fn.parentNode&&nr>=pt(fn)&&nr++,Rn=0),ye.setStartAndEnd(fn,Rn,Cn,nr)}function gr(ye){Sn(ye);var ht=ye.commonAncestorContainer.parentNode.cloneNode(!1);return ht.appendChild(ye.cloneContents()),ht.innerHTML}var gl=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],pa=0,qi=1,Na=2,al=3,yl=0,Cs=1,_l=2,ts=3;se.extend(le.rangePrototype,{compareBoundaryPoints:function(ye,ht){Sn(this),ta(this.startContainer,ht.startContainer);var fn,Rn,Cn,nr,Mn=ye==al||ye==pa?"start":"end",or=ye==qi||ye==pa?"start":"end";return fn=this[Mn+"Container"],Rn=this[Mn+"Offset"],Cn=ht[or+"Container"],nr=ht[or+"Offset"],en(fn,Rn,Cn,nr)},insertNode:function(ye){if(Sn(this),wo(ye,ho),Ca(this.startContainer),Lt(ye,this.startContainer))throw new $e("HIERARCHY_REQUEST_ERR");var ht=On(ye,this.startContainer,this.startOffset);this.setStartBefore(ht)},cloneContents:function(){Sn(this);var ye,ht;if(this.collapsed)return Rt(this).createDocumentFragment();if(this.startContainer===this.endContainer&&rt(this.startContainer))return ye=this.startContainer.cloneNode(!0),ye.data=ye.data.slice(this.startOffset,this.endOffset),ht=Rt(this).createDocumentFragment(),ht.appendChild(ye),ht;var fn=new Zn(this,!0);return ye=Ke(fn),fn.detach(),ye},canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var ye=new Zn(this,!0),ht=ye._first&&kt(ye._first,this)||ye._last&&kt(ye._last,this);return ye.detach(),!ht},surroundContents:function(ye){if(wo(ye,Nn),!this.canSurroundContents())throw new $e("INVALID_STATE_ERR");var ht=this.extractContents();if(ye.hasChildNodes())for(;ye.lastChild;)ye.removeChild(ye.lastChild);On(ye,this.startContainer,this.startOffset),ye.appendChild(ht),this.selectNode(ye)},cloneRange:function(){Sn(this);for(var ye=new si(Rt(this)),ht=gl.length,fn;ht--;)fn=gl[ht],ye[fn]=this[fn];return ye},toString:function(){Sn(this);var ye=this.startContainer;if(ye===this.endContainer&&rt(ye))return ye.nodeType==3||ye.nodeType==4?ye.data.slice(this.startOffset,this.endOffset):"";var ht=[],fn=new Zn(this,!0);return Le(fn,function(Rn){(Rn.nodeType==3||Rn.nodeType==4)&&ht.push(Rn.data)}),fn.detach(),ht.join("")},compareNode:function(ye){Sn(this);var ht=ye.parentNode,fn=pt(ye);if(!ht)throw new $e("NOT_FOUND_ERR");var Rn=this.comparePoint(ht,fn),Cn=this.comparePoint(ht,fn+1);return Rn<0?Cn>0?_l:yl:Cn>0?Cs:ts},comparePoint:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)<0?-1:en(ye,ht,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:es,toHtml:function(){return gr(this)},intersectsNode:function(ye,ht){if(Sn(this),je(ye)!=Gt(this))return!1;var fn=ye.parentNode,Rn=pt(ye);if(!fn)return!0;var Cn=en(fn,Rn,this.endContainer,this.endOffset),nr=en(fn,Rn+1,this.startContainer,this.startOffset);return ht?Cn<=0&&nr>=0:Cn<0&&nr>0},isPointInRange:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)>=0&&en(ye,ht,this.endContainer,this.endOffset)<=0},intersectsRange:function(ye){return ke(this,ye,!1)},intersectsOrTouchesRange:function(ye){return ke(this,ye,!0)},intersection:function(ye){if(this.intersectsRange(ye)){var ht=en(this.startContainer,this.startOffset,ye.startContainer,ye.startOffset),fn=en(this.endContainer,this.endOffset,ye.endContainer,ye.endOffset),Rn=this.cloneRange();return ht==-1&&Rn.setStart(ye.startContainer,ye.startOffset),fn==1&&Rn.setEnd(ye.endContainer,ye.endOffset),Rn}return null},union:function(ye){if(this.intersectsOrTouchesRange(ye)){var ht=this.cloneRange();return en(ye.startContainer,ye.startOffset,this.startContainer,this.startOffset)==-1&&ht.setStart(ye.startContainer,ye.startOffset),en(ye.endContainer,ye.endOffset,this.endContainer,this.endOffset)==1&&ht.setEnd(ye.endContainer,ye.endOffset),ht}else throw new $e("Ranges do not intersect")},containsNode:function(ye,ht){return ht?this.intersectsNode(ye,!1):this.compareNode(ye)==ts},containsNodeContents:function(ye){return this.comparePoint(ye,0)>=0&&this.comparePoint(ye,ae(ye))<=0},containsRange:function(ye){var ht=this.intersection(ye);return ht!==null&&ye.equals(ht)},containsNodeText:function(ye){var ht=this.cloneRange();ht.selectNode(ye);var fn=ht.getNodes([3]);if(fn.length>0){ht.setStart(fn[0],0);var Rn=fn.pop();return ht.setEnd(Rn,Rn.length),this.containsRange(ht)}else return this.containsNodeContents(ye)},getNodes:function(ye,ht){return Sn(this),Tt(this,ye,ht)},getDocument:function(){return Rt(this)},collapseBefore:function(ye){this.setEndBefore(ye),this.collapse(!1)},collapseAfter:function(ye){this.setStartAfter(ye),this.collapse(!0)},getBookmark:function(ye){var ht=Rt(this),fn=le.createRange(ht);ye=ye||pe.getBody(ht),fn.selectNodeContents(ye);var Rn=this.intersection(fn),Cn=0,nr=0;return Rn&&(fn.setEnd(Rn.startContainer,Rn.startOffset),Cn=fn.toString().length,nr=Cn+Rn.toString().length),{start:Cn,end:nr,containerNode:ye}},moveToBookmark:function(ye){var ht=ye.containerNode,fn=0;this.setStart(ht,0),this.collapse(!0);for(var Rn=[ht],Cn,nr=!1,Mn=!1,or,lr,qr;!Mn&&(Cn=Rn.pop());)if(Cn.nodeType==3)or=fn+Cn.length,!nr&&ye.start>=fn&&ye.start<=or&&(this.setStart(Cn,ye.start-fn),nr=!0),nr&&ye.end>=fn&&ye.end<=or&&(this.setEnd(Cn,ye.end-fn),Mn=!0),fn=or;else for(qr=Cn.childNodes,lr=qr.length;lr--;)Rn.push(qr[lr])},getName:function(){return"DomRange"},equals:function(ye){return si.rangesEqual(this,ye)},isValid:function(){return Ka(this)},inspect:function(){return En(this)},detach:function(){}});function ve(ye){ye.START_TO_START=pa,ye.START_TO_END=qi,ye.END_TO_END=Na,ye.END_TO_START=al,ye.NODE_BEFORE=yl,ye.NODE_AFTER=Cs,ye.NODE_BEFORE_AND_AFTER=_l,ye.NODE_INSIDE=ts}function mt(ye){ve(ye),ve(ye.prototype)}function cn(ye,ht){return function(){Sn(this);var fn=this.startContainer,Rn=this.startOffset,Cn=this.commonAncestorContainer,nr=new Zn(this,!0),Mn,or;fn!==Cn&&(Mn=it(fn,Cn,!0),or=qt(Mn),fn=or.node,Rn=or.offset),Le(nr,Ca),nr.reset();var lr=ye(nr);return nr.detach(),ht(this,fn,Rn,fn,Rn),lr}}function Kn(ye,ht){function fn(Mn,or){return function(lr){wo(lr,ao),wo(je(lr),Lo);var qr=(Mn?Pn:qt)(lr);(or?Rn:Cn)(this,qr.node,qr.offset)}}function Rn(Mn,or,lr){var qr=Mn.endContainer,na=Mn.endOffset;(or!==Mn.startContainer||lr!==Mn.startOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==1)&&(qr=or,na=lr),ht(Mn,or,lr,qr,na))}function Cn(Mn,or,lr){var qr=Mn.startContainer,na=Mn.startOffset;(or!==Mn.endContainer||lr!==Mn.endOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==-1)&&(qr=or,na=lr),ht(Mn,qr,na,or,lr))}var nr=function(){};nr.prototype=le.rangePrototype,ye.prototype=new nr,se.extend(ye.prototype,{setStart:function(Mn,or){sr(Mn,!0),oo(Mn,or),Rn(this,Mn,or)},setEnd:function(Mn,or){sr(Mn,!0),oo(Mn,or),Cn(this,Mn,or)},setStartAndEnd:function(){var Mn=arguments,or=Mn[0],lr=Mn[1],qr=or,na=lr;switch(Mn.length){case 3:na=Mn[2];break;case 4:qr=Mn[2],na=Mn[3];break}sr(or,!0),oo(or,lr),sr(qr,!0),oo(qr,na),ht(this,or,lr,qr,na)},setBoundary:function(Mn,or,lr){this["set"+(lr?"Start":"End")](Mn,or)},setStartBefore:fn(!0,!0),setStartAfter:fn(!1,!0),setEndBefore:fn(!0,!1),setEndAfter:fn(!1,!1),collapse:function(Mn){Sn(this),Mn?ht(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):ht(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(Mn){sr(Mn,!0),ht(this,Mn,0,Mn,ae(Mn))},selectNode:function(Mn){sr(Mn,!1),wo(Mn,ao);var or=Pn(Mn),lr=qt(Mn);ht(this,or.node,or.offset,lr.node,lr.offset)},extractContents:cn(At,ht),deleteContents:cn(dt,ht),canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var Mn=new Zn(this,!0),or=Mn._first&&kt(Mn._first,this)||Mn._last&&kt(Mn._last,this);return Mn.detach(),!or},splitBoundaries:function(){Ui(this)},splitBoundariesPreservingPositions:function(Mn){Ui(this,Mn)},normalizeBoundaries:function(){Sn(this);var Mn=this.startContainer,or=this.startOffset,lr=this.endContainer,qr=this.endOffset,na=function(Ro){var La=Ro.nextSibling;La&&La.nodeType==Ro.nodeType&&(lr=Ro,qr=Ro.length,Ro.appendData(La.data),q(La))},vi=function(Ro){var La=Ro.previousSibling;if(La&&La.nodeType==Ro.nodeType){Mn=Ro;var id=Ro.length;if(or=La.length,Ro.insertData(0,La.data),q(La),Mn==lr)qr+=or,lr=Mn;else if(lr==Ro.parentNode){var _u=pt(Ro);qr==_u?(lr=Ro,qr=id):qr>_u&&qr--}}},bl=!0,Vi;if(rt(lr))qr==lr.length?na(lr):qr==0&&(Vi=lr.previousSibling,Vi&&Vi.nodeType==lr.nodeType&&(qr=Vi.length,Mn==lr&&(bl=!1),Vi.appendData(lr.data),q(lr),lr=Vi));else{if(qr>0){var Ns=lr.childNodes[qr-1];Ns&&rt(Ns)&&na(Ns)}bl=!this.collapsed}if(bl){if(rt(Mn))or==0?vi(Mn):or==Mn.length&&(Vi=Mn.nextSibling,Vi&&Vi.nodeType==Mn.nodeType&&(lr==Vi&&(lr=Mn,qr+=Mn.length),Mn.appendData(Vi.data),q(Vi)));else if(or<Mn.childNodes.length){var Fl=Mn.childNodes[or];Fl&&rt(Fl)&&vi(Fl)}}else Mn=lr,or=qr;ht(this,Mn,or,lr,qr)},collapseToPoint:function(Mn,or){sr(Mn,!0),oo(Mn,or),this.setStartAndEnd(Mn,or)},parentElement:function(){Sn(this);var Mn=this.commonAncestorContainer;return Mn?In(this.commonAncestorContainer,!0):null}}),mt(ye)}function br(ye){ye.collapsed=ye.startContainer===ye.endContainer&&ye.startOffset===ye.endOffset,ye.commonAncestorContainer=ye.collapsed?ye.startContainer:pe.getCommonAncestor(ye.startContainer,ye.endContainer)}function so(ye,ht,fn,Rn,Cn){ye.startContainer=ht,ye.startOffset=fn,ye.endContainer=Rn,ye.endOffset=Cn,ye.document=pe.getDocument(ht),br(ye)}function si(ye){so(this,ye,0,ye,0)}Kn(si,so),se.extend(si,{rangeProperties:gl,RangeIterator:Zn,copyComparisonConstants:mt,createPrototypeRange:Kn,inspect:En,toHtml:gr,getRangeDocument:Rt,rangesEqual:function(ye,ht){return ye.startContainer===ht.startContainer&&ye.startOffset===ht.startOffset&&ye.endContainer===ht.endContainer&&ye.endOffset===ht.endOffset}}),le.DomRange=si}),B.createCoreModule("WrappedRange",["DomRange"],function(le,Ze){var pe,se,we=le.dom,$e=le.util,rt=we.DomPosition,pt=le.DomRange,Lt=we.getBody,Jt=we.getContentDocument,en=we.isCharacterDataNode;if(le.features.implementsDomRange&&(function(){var q,kt=pt.rangeProperties;function Rt(At){for(var Tt=kt.length,En;Tt--;)En=kt[Tt],At[En]=At.nativeRange[En];At.collapsed=At.startContainer===At.endContainer&&At.startOffset===At.endOffset}function Gt(At,Tt,En,Zn,ao){var Lo=At.startContainer!==Tt||At.startOffset!=En,yo=At.endContainer!==Zn||At.endOffset!=ao,ho=!At.equals(At.nativeRange);(Lo||yo||ho)&&(At.setEnd(Zn,ao),At.setStart(Tt,En))}var Pn;pe=function(At){if(!At)throw Ze.createError("WrappedRange: Range must be specified");this.nativeRange=At,Rt(this)},pt.createPrototypeRange(pe,Gt),q=pe.prototype,q.selectNode=function(At){this.nativeRange.selectNode(At),Rt(this)},q.cloneContents=function(){return this.nativeRange.cloneContents()},q.surroundContents=function(At){this.nativeRange.surroundContents(At),Rt(this)},q.collapse=function(At){this.nativeRange.collapse(At),Rt(this)},q.cloneRange=function(){return new pe(this.nativeRange.cloneRange())},q.refresh=function(){Rt(this)},q.toString=function(){return this.nativeRange.toString()};var qt=document.createTextNode("test");Lt(document).appendChild(qt);var On=document.createRange();On.setStart(qt,0),On.setEnd(qt,0);try{On.setStart(qt,1),q.setStart=function(At,Tt){this.nativeRange.setStart(At,Tt),Rt(this)},q.setEnd=function(At,Tt){this.nativeRange.setEnd(At,Tt),Rt(this)},Pn=function(At){return function(Tt){this.nativeRange[At](Tt),Rt(this)}}}catch{q.setStart=function(Tt,En){try{this.nativeRange.setStart(Tt,En)}catch{this.nativeRange.setEnd(Tt,En),this.nativeRange.setStart(Tt,En)}Rt(this)},q.setEnd=function(Tt,En){try{this.nativeRange.setEnd(Tt,En)}catch{this.nativeRange.setStart(Tt,En),this.nativeRange.setEnd(Tt,En)}Rt(this)},Pn=function(Tt,En){return function(Zn){try{this.nativeRange[Tt](Zn)}catch{this.nativeRange[En](Zn),this.nativeRange[Tt](Zn)}Rt(this)}}}q.setStartBefore=Pn("setStartBefore","setEndBefore"),q.setStartAfter=Pn("setStartAfter","setEndAfter"),q.setEndBefore=Pn("setEndBefore","setStartBefore"),q.setEndAfter=Pn("setEndAfter","setStartAfter"),q.selectNodeContents=function(At){this.setStartAndEnd(At,0,we.getNodeLength(At))},On.selectNodeContents(qt),On.setEnd(qt,3);var ke=document.createRange();ke.selectNodeContents(qt),ke.setEnd(qt,4),ke.setStart(qt,2),On.compareBoundaryPoints(On.START_TO_END,ke)==-1&&On.compareBoundaryPoints(On.END_TO_START,ke)==1?q.compareBoundaryPoints=function(At,Tt){return Tt=Tt.nativeRange||Tt,At==Tt.START_TO_END?At=Tt.END_TO_START:At==Tt.END_TO_START&&(At=Tt.START_TO_END),this.nativeRange.compareBoundaryPoints(At,Tt)}:q.compareBoundaryPoints=function(At,Tt){return this.nativeRange.compareBoundaryPoints(At,Tt.nativeRange||Tt)};var Ke=document.createElement("div");Ke.innerHTML="123";var Le=Ke.firstChild,dt=Lt(document);dt.appendChild(Ke),On.setStart(Le,1),On.setEnd(Le,2),On.deleteContents(),Le.data=="13"&&(q.deleteContents=function(){this.nativeRange.deleteContents(),Rt(this)},q.extractContents=function(){var At=this.nativeRange.extractContents();return Rt(this),At}),dt.removeChild(Ke),dt=null,$e.isHostMethod(On,"createContextualFragment")&&(q.createContextualFragment=function(At){return this.nativeRange.createContextualFragment(At)}),Lt(document).removeChild(qt),q.getName=function(){return"WrappedRange"},le.WrappedRange=pe,le.createNativeRange=function(At){return At=Jt(At,Ze,"createNativeRange"),At.createRange()}})(),le.features.implementsTextRange){var zt=function(q){var kt=q.parentElement(),Rt=q.duplicate();Rt.collapse(!0);var Gt=Rt.parentElement();Rt=q.duplicate(),Rt.collapse(!1);var Pn=Rt.parentElement(),qt=Gt==Pn?Gt:we.getCommonAncestor(Gt,Pn);return qt==kt?qt:we.getCommonAncestor(kt,qt)},it=function(q){return q.compareEndPoints("StartToEnd",q)==0},ae=function(q,kt,Rt,Gt,Pn){var qt=q.duplicate();qt.collapse(Rt);var On=qt.parentElement();if(we.isOrIsAncestorOf(kt,On)||(On=kt),!On.canHaveHTML){var ke=new rt(On.parentNode,we.getNodeIndex(On));return{boundaryPosition:ke,nodeInfo:{nodeIndex:ke.offset,containerElement:ke.node}}}var Ke=we.getDocument(On).createElement("span");Ke.parentNode&&we.removeNode(Ke);for(var Le,dt=Rt?"StartToStart":"StartToEnd",At,Tt,En,Zn,ao=Pn&&Pn.containerElement==On?Pn.nodeIndex:0,Lo=On.childNodes.length,yo=Lo,ho=yo;ho==Lo?On.appendChild(Ke):On.insertBefore(Ke,On.childNodes[ho]),qt.moveToElementText(Ke),Le=qt.compareEndPoints(dt,q),!(Le==0||ao==yo);){if(Le==-1){if(yo==ao+1)break;ao=ho}else yo=yo==ao+1?ao:ho;ho=Math.floor((ao+yo)/2),On.removeChild(Ke)}if(Zn=Ke.nextSibling,Le==-1&&Zn&&en(Zn)){qt.setEndPoint(Rt?"EndToStart":"EndToEnd",q);var Nn;if(/[\r\n]/.test(Zn.data)){var qn=qt.duplicate(),rr=qn.text.replace(/\r\n/g,"\r").length;for(Nn=qn.moveStart("character",rr);(Le=qn.compareEndPoints("StartToEnd",qn))==-1;)Nn++,qn.moveStart("character",1)}else Nn=qt.text.length;En=new rt(Zn,Nn)}else At=(Gt||!Rt)&&Ke.previousSibling,Tt=(Gt||Rt)&&Ke.nextSibling,Tt&&en(Tt)?En=new rt(Tt,0):At&&en(At)?En=new rt(At,At.data.length):En=new rt(On,we.getNodeIndex(Ke));return we.removeNode(Ke),{boundaryPosition:En,nodeInfo:{nodeIndex:ho,containerElement:On}}},re=function(q,kt){var Rt,Gt,Pn=q.offset,qt=we.getDocument(q.node),On,ke,Ke=Lt(qt).createTextRange(),Le=en(q.node);return Le?(Rt=q.node,Gt=Rt.parentNode):(ke=q.node.childNodes,Rt=Pn<ke.length?ke[Pn]:null,Gt=q.node),On=qt.createElement("span"),On.innerHTML="&#feff;",Rt?Gt.insertBefore(On,Rt):Gt.appendChild(On),Ke.moveToElementText(On),Ke.collapse(!kt),Gt.removeChild(On),Le&&Ke[kt?"moveStart":"moveEnd"]("character",Pn),Ke};se=function(q){this.textRange=q,this.refresh()},se.prototype=new pt(document),se.prototype.refresh=function(){var q,kt,Rt,Gt=zt(this.textRange);it(this.textRange)?kt=q=ae(this.textRange,Gt,!0,!0).boundaryPosition:(Rt=ae(this.textRange,Gt,!0,!1),q=Rt.boundaryPosition,kt=ae(this.textRange,Gt,!1,!1,Rt.nodeInfo).boundaryPosition),this.setStart(q.node,q.offset),this.setEnd(kt.node,kt.offset)},se.prototype.getName=function(){return"WrappedTextRange"},pt.copyComparisonConstants(se);var je=function(q){if(q.collapsed)return re(new rt(q.startContainer,q.startOffset),!0);var kt=re(new rt(q.startContainer,q.startOffset),!0),Rt=re(new rt(q.endContainer,q.endOffset),!1),Gt=Lt(pt.getRangeDocument(q)).createTextRange();return Gt.setEndPoint("StartToStart",kt),Gt.setEndPoint("EndToEnd",Rt),Gt};if(se.rangeToTextRange=je,se.prototype.toTextRange=function(){return je(this)},le.WrappedTextRange=se,!le.features.implementsDomRange||le.config.preferTextRange){var vt=(function(q){return q("return this;")()})(Function);typeof vt.Range>"u"&&(vt.Range=se),le.createNativeRange=function(q){return q=Jt(q,Ze,"createNativeRange"),Lt(q).createTextRange()},le.WrappedRange=se}}le.createRange=function(q){return q=Jt(q,Ze,"createRange"),new le.WrappedRange(le.createNativeRange(q))},le.createRangyRange=function(q){return q=Jt(q,Ze,"createRangyRange"),new pt(q)},$e.createAliasForDeprecatedMethod(le,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(le,"createIframeRangyRange","createRangyRange"),le.addShimListener(function(q){var kt=q.document;typeof kt.createRange>"u"&&(kt.createRange=function(){return le.createRange(kt)}),kt=q=null})}),B.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(le,Ze){le.config.checkSelectionRanges=!0;var pe="boolean",se="number",we=le.dom,$e=le.util,rt=$e.isHostMethod,pt=le.DomRange,Lt=le.WrappedRange,Jt=le.DOMException,en=we.DomPosition,zt,it,ae=le.features,re="Control",je=we.getDocument,vt=we.getBody,q=pt.rangesEqual;function kt(ve){return typeof ve=="string"?/^backward(s)?$/i.test(ve):!!ve}function Rt(ve,mt){if(ve){if(we.isWindow(ve))return ve;if(ve instanceof Sn)return ve.win;var cn=we.getContentDocument(ve,Ze,mt);return we.getWindow(cn)}else return window}function Gt(ve){return Rt(ve,"getWinSelection").getSelection()}function Pn(ve){return Rt(ve,"getDocSelection").document.selection}function qt(ve){var mt=!1;return ve.anchorNode&&(mt=we.comparePoints(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset)==1),mt}var On=rt(window,"getSelection"),ke=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=On,ae.implementsDocSelection=ke;var Ke=ke&&(!On||le.config.preferTextRange);if(Ke)zt=Pn,le.isSelectionValid=function(ve){var mt=Rt(ve,"isSelectionValid").document,cn=mt.selection;return cn.type!="None"||je(cn.createRange().parentElement())==mt};else if(On)zt=Gt,le.isSelectionValid=function(){return!0};else return Ze.fail("Neither document.selection or window.getSelection() detected."),!1;le.getNativeSelection=zt;var Le=zt();if(!Le)return Ze.fail("Native selection was null (possibly issue 138?)"),!1;var dt=le.createNativeRange(document),At=vt(document),Tt=$e.areHostProperties(Le,["anchorNode","focusNode","anchorOffset","focusOffset"]);ae.selectionHasAnchorAndFocus=Tt;var En=rt(Le,"extend");ae.selectionHasExtend=En;var Zn=rt(Le,"setBaseAndExtent");ae.selectionHasSetBaseAndExtent=Zn;var ao=typeof Le.rangeCount==se;ae.selectionHasRangeCount=ao;var Lo=!1,yo=!0,ho=En?function(ve,mt){var cn=pt.getRangeDocument(mt),Kn=le.createRange(cn);Kn.collapseToPoint(mt.endContainer,mt.endOffset),ve.addRange(sr(Kn)),ve.extend(mt.startContainer,mt.startOffset)}:null;$e.areHostMethods(Le,["addRange","getRangeAt","removeAllRanges"])&&typeof Le.rangeCount==se&&ae.implementsDomRange&&(function(){var ve=window.getSelection();if(ve){for(var mt=ve.rangeCount,cn=mt>1,Kn=[],br=qt(ve),so=0;so<mt;++so)Kn[so]=ve.getRangeAt(so);var si=we.createTestElement(document,"",!1),ye=si.appendChild(document.createTextNode(" ")),ht=document.createRange();if(ht.setStart(ye,1),ht.collapse(!0),ve.removeAllRanges(),ve.addRange(ht),yo=ve.rangeCount==1,ve.removeAllRanges(),!cn){var fn=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(fn&&parseInt(fn[1])>=36)Lo=!1;else{var Rn=ht.cloneRange();ht.setStart(ye,0),Rn.setEnd(ye,3),Rn.setStart(ye,2),ve.addRange(ht),ve.addRange(Rn),Lo=ve.rangeCount==2}}for(we.removeNode(si),ve.removeAllRanges(),so=0;so<mt;++so)so==0&&br?ho?ho(ve,Kn[so]):(le.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),ve.addRange(Kn[so])):ve.addRange(Kn[so])}})(),ae.selectionSupportsMultipleRanges=Lo,ae.collapsedNonEditableSelectionsSupported=yo;var Nn=!1,qn;At&&rt(At,"createControlRange")&&(qn=At.createControlRange(),$e.areHostProperties(qn,["item","add"])&&(Nn=!0)),ae.implementsControlRange=Nn,Tt?it=function(ve){return ve.anchorNode===ve.focusNode&&ve.anchorOffset===ve.focusOffset}:it=function(ve){return ve.rangeCount?ve.getRangeAt(ve.rangeCount-1).collapsed:!1};function rr(ve,mt,cn){var Kn=cn?"end":"start",br=cn?"start":"end";ve.anchorNode=mt[Kn+"Container"],ve.anchorOffset=mt[Kn+"Offset"],ve.focusNode=mt[br+"Container"],ve.focusOffset=mt[br+"Offset"]}function ut(ve){var mt=ve.nativeSelection;ve.anchorNode=mt.anchorNode,ve.anchorOffset=mt.anchorOffset,ve.focusNode=mt.focusNode,ve.focusOffset=mt.focusOffset}function vn(ve){ve.anchorNode=ve.focusNode=null,ve.anchorOffset=ve.focusOffset=0,ve.rangeCount=0,ve.isCollapsed=!0,ve._ranges.length=0,In(ve)}function In(ve){ve.type=ve.rangeCount==0?"None":it(ve)?"Caret":"Range"}function sr(ve){var mt;return ve instanceof pt?(mt=le.createNativeRange(ve.getDocument()),mt.setEnd(ve.endContainer,ve.endOffset),mt.setStart(ve.startContainer,ve.startOffset)):ve instanceof Lt?mt=ve.nativeRange:ae.implementsDomRange&&ve instanceof we.getWindow(ve.startContainer).Range&&(mt=ve),mt}function wo(ve){if(!ve.length||ve[0].nodeType!=1)return!1;for(var mt=1,cn=ve.length;mt<cn;++mt)if(!we.isAncestorOf(ve[0],ve[mt]))return!1;return!0}function oo(ve){var mt=ve.getNodes();if(!wo(mt))throw Ze.createError("getSingleElementFromRange: range "+ve.inspect()+" did not consist of a single element");return mt[0]}function ta(ve){return!!ve&&typeof ve.text<"u"}function Ca(ve,mt){var cn=new Lt(mt);ve._ranges=[cn],rr(ve,cn,!1),ve.rangeCount=1,ve.isCollapsed=cn.collapsed,In(ve)}function Yi(ve){if(ve._ranges.length=0,ve.docSelection.type=="None")vn(ve);else{var mt=ve.docSelection.createRange();if(ta(mt))Ca(ve,mt);else{ve.rangeCount=mt.length;for(var cn,Kn=je(mt.item(0)),br=0;br<ve.rangeCount;++br)cn=le.createRange(Kn),cn.selectNode(mt.item(br)),ve._ranges.push(cn);ve.isCollapsed=ve.rangeCount==1&&ve._ranges[0].collapsed,rr(ve,ve._ranges[ve.rangeCount-1],!1),In(ve)}}}function fa(ve,mt){for(var cn=ve.docSelection.createRange(),Kn=oo(mt),br=je(cn.item(0)),so=vt(br).createControlRange(),si=0,ye=cn.length;si<ye;++si)so.add(cn.item(si));try{so.add(Kn)}catch{throw Ze.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}so.select(),Yi(ve)}var Ka;rt(Le,"getRangeAt")?Ka=function(ve,mt){try{return ve.getRangeAt(mt)}catch{return null}}:Tt&&(Ka=function(ve){var mt=je(ve.anchorNode),cn=le.createRange(mt);return cn.setStartAndEnd(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset),cn.collapsed!==this.isCollapsed&&cn.setStartAndEnd(ve.focusNode,ve.focusOffset,ve.anchorNode,ve.anchorOffset),cn});function Sn(ve,mt,cn){this.nativeSelection=ve,this.docSelection=mt,this._ranges=[],this.win=cn,this.refresh()}Sn.prototype=le.selectionPrototype;function Ts(ve){ve.win=ve.anchorNode=ve.focusNode=ve._ranges=null,ve.rangeCount=ve.anchorOffset=ve.focusOffset=0,ve.detached=!0,In(ve)}var Oo=[];function es(ve,mt){for(var cn=Oo.length,Kn,br;cn--;)if(Kn=Oo[cn],br=Kn.selection,mt=="deleteAll")Ts(br);else if(Kn.win==ve)return mt=="delete"?(Oo.splice(cn,1),!0):br;return mt=="deleteAll"&&(Oo.length=0),null}var Ui=function(ve){if(ve&&ve instanceof Sn)return ve.refresh(),ve;ve=Rt(ve,"getNativeSelection");var mt=es(ve),cn=zt(ve),Kn=ke?Pn(ve):null;return mt?(mt.nativeSelection=cn,mt.docSelection=Kn,mt.refresh()):(mt=new Sn(cn,Kn,ve),Oo.push({win:ve,selection:mt})),mt};le.getSelection=Ui,$e.createAliasForDeprecatedMethod(le,"getIframeSelection","getSelection");var gr=Sn.prototype;function gl(ve,mt){for(var cn=je(mt[0].startContainer),Kn=vt(cn).createControlRange(),br=0,so,si=mt.length;br<si;++br){so=oo(mt[br]);try{Kn.add(so)}catch{throw Ze.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}Kn.select(),Yi(ve)}if(!Ke&&Tt&&$e.areHostMethods(Le,["removeAllRanges","addRange"])){gr.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),vn(this)};var pa=function(ve,mt){ho(ve.nativeSelection,mt),ve.refresh()};ao?gr.addRange=function(ve,mt){if(Nn&&ke&&this.docSelection.type==re)fa(this,ve);else if(kt(mt)&&En)pa(this,ve);else{var cn;Lo?cn=this.rangeCount:(this.removeAllRanges(),cn=0);var Kn=sr(ve).cloneRange();try{this.nativeSelection.addRange(Kn)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==cn+1){if(le.config.checkSelectionRanges){var br=Ka(this.nativeSelection,this.rangeCount-1);br&&!q(br,ve)&&(ve=new Lt(br))}this._ranges[this.rangeCount-1]=ve,rr(this,ve,al(this.nativeSelection)),this.isCollapsed=it(this),In(this)}else this.refresh()}}:gr.addRange=function(ve,mt){kt(mt)&&En?pa(this,ve):(this.nativeSelection.addRange(sr(ve)),this.refresh())},gr.setRanges=function(ve){if(Nn&&ke&&ve.length>1)gl(this,ve);else{this.removeAllRanges();for(var mt=0,cn=ve.length;mt<cn;++mt)this.addRange(ve[mt])}}}else if(rt(Le,"empty")&&rt(dt,"select")&&Nn&&Ke)gr.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var ve;if(this.anchorNode)ve=je(this.anchorNode);else if(this.docSelection.type==re){var mt=this.docSelection.createRange();mt.length&&(ve=je(mt.item(0)))}if(ve){var cn=vt(ve).createTextRange();cn.select(),this.docSelection.empty()}}}catch{}vn(this)},gr.addRange=function(ve){this.docSelection.type==re?fa(this,ve):(le.WrappedTextRange.rangeToTextRange(ve).select(),this._ranges[0]=ve,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,rr(this,ve,!1),In(this))},gr.setRanges=function(ve){this.removeAllRanges();var mt=ve.length;mt>1?gl(this,ve):mt&&this.addRange(ve[0])};else return Ze.fail("No means of selecting a Range or TextRange was found"),!1;gr.getRangeAt=function(ve){if(ve<0||ve>=this.rangeCount)throw new Jt("INDEX_SIZE_ERR");return this._ranges[ve].cloneRange()};var qi;if(Ke)qi=function(ve){var mt;le.isSelectionValid(ve.win)?mt=ve.docSelection.createRange():(mt=vt(ve.win.document).createTextRange(),mt.collapse(!0)),ve.docSelection.type==re?Yi(ve):ta(mt)?Ca(ve,mt):vn(ve)};else if(rt(Le,"getRangeAt")&&typeof Le.rangeCount==se)qi=function(ve){if(Nn&&ke&&ve.docSelection.type==re)Yi(ve);else if(ve._ranges.length=ve.rangeCount=ve.nativeSelection.rangeCount,ve.rangeCount){for(var mt=0,cn=ve.rangeCount;mt<cn;++mt)ve._ranges[mt]=new le.WrappedRange(ve.nativeSelection.getRangeAt(mt));rr(ve,ve._ranges[ve.rangeCount-1],al(ve.nativeSelection)),ve.isCollapsed=it(ve),In(ve)}else vn(ve)};else if(Tt&&typeof Le.isCollapsed==pe&&typeof dt.collapsed==pe&&ae.implementsDomRange)qi=function(ve){var mt,cn=ve.nativeSelection;cn.anchorNode?(mt=Ka(cn,0),ve._ranges=[mt],ve.rangeCount=1,ut(ve),ve.isCollapsed=it(ve),In(ve)):vn(ve)};else return Ze.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;gr.refresh=function(ve){var mt=ve?this._ranges.slice(0):null,cn=this.anchorNode,Kn=this.anchorOffset;if(qi(this),ve){var br=mt.length;if(br!=this._ranges.length||this.anchorNode!=cn||this.anchorOffset!=Kn)return!0;for(;br--;)if(!q(mt[br],this._ranges[br]))return!0;return!1}};var Na=function(ve,mt){var cn=ve.getAllRanges();ve.removeAllRanges();for(var Kn=0,br=cn.length;Kn<br;++Kn)q(mt,cn[Kn])||ve.addRange(cn[Kn]);ve.rangeCount||vn(ve)};Nn&&ke?gr.removeRange=function(ve){if(this.docSelection.type==re){for(var mt=this.docSelection.createRange(),cn=oo(ve),Kn=je(mt.item(0)),br=vt(Kn).createControlRange(),so,si=!1,ye=0,ht=mt.length;ye<ht;++ye)so=mt.item(ye),so!==cn||si?br.add(mt.item(ye)):si=!0;br.select(),Yi(this)}else Na(this,ve)}:gr.removeRange=function(ve){Na(this,ve)};var al;!Ke&&Tt&&ae.implementsDomRange?(al=qt,gr.isBackward=function(){return al(this)}):al=gr.isBackward=function(){return!1},gr.isBackwards=gr.isBackward,gr.toString=function(){for(var ve=[],mt=0,cn=this.rangeCount;mt<cn;++mt)ve[mt]=""+this._ranges[mt];return ve.join("")};function yl(ve,mt){if(ve.win.document!=je(mt))throw new Jt("WRONG_DOCUMENT_ERR")}function Cs(ve,mt){if(mt<0||mt>(we.isCharacterDataNode(ve)?ve.length:ve.childNodes.length))throw new Jt("INDEX_SIZE_ERR")}gr.collapse=function(ve,mt){yl(this,ve);var cn=le.createRange(ve);cn.collapseToPoint(ve,mt),this.setSingleRange(cn),this.isCollapsed=!0},gr.collapseToStart=function(){if(this.rangeCount){var ve=this._ranges[0];this.collapse(ve.startContainer,ve.startOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.collapseToEnd=function(){if(this.rangeCount){var ve=this._ranges[this.rangeCount-1];this.collapse(ve.endContainer,ve.endOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.selectAllChildren=function(ve){yl(this,ve);var mt=le.createRange(ve);mt.selectNodeContents(ve),this.setSingleRange(mt)},Zn?gr.setBaseAndExtent=function(ve,mt,cn,Kn){this.nativeSelection.setBaseAndExtent(ve,mt,cn,Kn),this.refresh()}:En&&(gr.setBaseAndExtent=function(ve,mt,cn,Kn){Cs(ve,mt),Cs(cn,Kn),yl(this,ve),yl(this,cn);var br=le.createRange(node),so=we.comparePoints(ve,mt,cn,Kn)==-1;so?br.setStartAndEnd(cn,Kn,ve,mt):br.setStartAndEnd(ve,mt,cn,Kn),this.setSingleRange(br,so)}),gr.deleteFromDocument=function(){if(Nn&&ke&&this.docSelection.type==re){for(var ve=this.docSelection.createRange(),mt;ve.length;)mt=ve.item(0),ve.remove(mt),we.removeNode(mt);this.refresh()}else if(this.rangeCount){var cn=this.getAllRanges();if(cn.length){this.removeAllRanges();for(var Kn=0,br=cn.length;Kn<br;++Kn)cn[Kn].deleteContents();this.addRange(cn[br-1])}}},gr.eachRange=function(ve,mt){for(var cn=0,Kn=this._ranges.length;cn<Kn;++cn)if(ve(this.getRangeAt(cn)))return mt},gr.getAllRanges=function(){var ve=[];return this.eachRange(function(mt){ve.push(mt)}),ve},gr.setSingleRange=function(ve,mt){this.removeAllRanges(),this.addRange(ve,mt)},gr.callMethodOnEachRange=function(ve,mt){var cn=[];return this.eachRange(function(Kn){cn.push(Kn[ve].apply(Kn,mt||[]))}),cn};function _l(ve){return function(mt,cn){var Kn;this.rangeCount?(Kn=this.getRangeAt(0),Kn["set"+(ve?"Start":"End")](mt,cn)):(Kn=le.createRange(this.win.document),Kn.setStartAndEnd(mt,cn)),this.setSingleRange(Kn,this.isBackward())}}gr.setStart=_l(!0),gr.setEnd=_l(!1),le.rangePrototype.select=function(ve){Ui(this.getDocument()).setSingleRange(this,ve)},gr.changeEachRange=function(ve){var mt=[],cn=this.isBackward();this.eachRange(function(Kn){ve(Kn),mt.push(Kn)}),this.removeAllRanges(),cn&&mt.length==1?this.addRange(mt[0],"backward"):this.setRanges(mt)},gr.containsNode=function(ve,mt){return this.eachRange(function(cn){return cn.containsNode(ve,mt)},!0)||!1},gr.getBookmark=function(ve){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[ve])}},gr.moveToBookmark=function(ve){for(var mt=[],cn=0,Kn,br;Kn=ve.rangeBookmarks[cn++];)br=le.createRange(this.win),br.moveToBookmark(Kn),mt.push(br);ve.backward?this.setSingleRange(mt[0],"backward"):this.setRanges(mt)},gr.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},gr.restoreRanges=function(ve){this.removeAllRanges();for(var mt=0,cn;cn=ve.ranges[mt];++mt)this.addRange(cn,ve.backward&&mt==0)},gr.toHtml=function(){var ve=[];return this.eachRange(function(mt){ve.push(pt.toHtml(mt))}),ve.join("")},ae.implementsTextRange&&(gr.getNativeTextRange=function(){var ve;if(ve=this.docSelection){var mt=ve.createRange();if(ta(mt))return mt;throw Ze.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return le.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw Ze.createError("getNativeTextRange: selection contains no range")}});function ts(ve){var mt=[],cn=new en(ve.anchorNode,ve.anchorOffset),Kn=new en(ve.focusNode,ve.focusOffset),br=typeof ve.getName=="function"?ve.getName():"Selection";if(typeof ve.rangeCount<"u")for(var so=0,si=ve.rangeCount;so<si;++so)mt[so]=pt.inspect(ve.getRangeAt(so));return"["+br+"(Ranges: "+mt.join(", ")+")(anchor: "+cn.inspect()+", focus: "+Kn.inspect()+"]"}gr.getName=function(){return"WrappedSelection"},gr.inspect=function(){return ts(this)},gr.detach=function(){es(this.win,"delete"),Ts(this)},Sn.detachAll=function(){es(null,"deleteAll")},Sn.inspect=ts,Sn.isDirectionBackward=kt,le.Selection=Sn,le.selectionPrototype=gr,le.addShimListener(function(ve){typeof ve.getSelection>"u"&&(ve.getSelection=function(){return Ui(ve)}),ve=null})});var Je=!1,gt=function(le){Je||(Je=!0,!B.initialized&&B.config.autoInitialize&&J())};return D&&(document.readyState=="complete"?gt():(f(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",gt,!1),Y(window,"load",gt))),B})})(bS)),bS.exports}var Sne=ZI();const _R=Z_(Sne);var wS={exports:{}},bR;function Ane(){return bR||(bR=1,(function(t,e){(function(n,o){t.exports=n(ZI())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(o,r){var i=o.dom,a=i.DomPosition,s=i.arrayContains,l=o.util,f=l.forEach,h="span",v=l.isHostMethod(document,"createElementNS");function b(ae,re){for(var je in ae)if(ae.hasOwnProperty(je)&&re(je,ae[je])===!1)return!1;return!0}function E(ae){return ae.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function O(ae,re){return!!ae&&new RegExp("(?:^|\\s)"+re+"(?:\\s|$)").test(ae)}function w(ae,re){if(typeof ae.classList=="object")return ae.classList.contains(re);var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");return O(vt,re)}function S(ae,re){if(typeof ae.classList=="object")ae.classList.add(re);else{var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");vt?O(vt,re)||(vt+=" "+re):vt=re,je?ae.className=vt:ae.setAttribute("class",vt)}}var M=(function(){function ae(re,je,vt){return je&&vt?" ":""}return function(re,je){if(typeof re.classList=="object")re.classList.remove(je);else{var vt=typeof re.className=="string",q=vt?re.className:re.getAttribute("class");q=q.replace(new RegExp("(^|\\s)"+je+"(\\s|$)"),ae),vt?re.className=q:re.setAttribute("class",q)}}})();function T(ae){var re=typeof ae.className=="string";return re?ae.className:ae.getAttribute("class")}function $(ae){return ae&&ae.split(/\s+/).sort().join(" ")}function D(ae){return $(T(ae))}function P(ae,re){return D(ae)==D(re)}function B(ae,re){for(var je=re.split(/\s+/),vt=0,q=je.length;vt<q;++vt)if(!w(ae,E(je[vt])))return!1;return!0}function F(ae){var re=ae.parentNode;return re&&re.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(re.nodeName)}function I(ae,re,je,vt,q){var kt=ae.node,Rt=ae.offset,Gt=kt,Pn=Rt;kt==vt&&Rt>q&&++Pn,kt==re&&(Rt==je||Rt==je+1)&&(Gt=vt,Pn+=q-je),kt==re&&Rt>je+1&&--Pn,ae.node=Gt,ae.offset=Pn}function V(ae,re,je){ae.node==re&&ae.offset>je&&--ae.offset}function z(ae,re,je,vt){je==-1&&(je=re.childNodes.length);var q=ae.parentNode,kt=i.getNodeIndex(ae);f(vt,function(Rt){I(Rt,q,kt,re,je)}),re.childNodes.length==je?re.appendChild(ae):re.insertBefore(ae,re.childNodes[je])}function X(ae,re){var je=ae.parentNode,vt=i.getNodeIndex(ae);f(re,function(q){V(q,je,vt)}),i.removeNode(ae)}function Y(ae,re,je,vt,q){for(var kt,Rt=[];kt=ae.firstChild;)z(kt,re,je++,q),Rt.push(kt);return X(ae,q),Rt}function W(ae,re){return Y(ae,ae.parentNode,i.getNodeIndex(ae),!0,re)}function Q(ae,re){var je=ae.cloneRange();je.selectNodeContents(re);var vt=je.intersection(ae),q=vt?vt.toString():"";return q!=""}function J(ae){for(var re=ae.getNodes([3]),je=0,vt;(vt=re[je])&&!Q(ae,vt);)++je;for(var q=re.length-1;(vt=re[q])&&!Q(ae,vt);)--q;return re.slice(je,q+1)}function ie(ae,re){if(ae.attributes.length!=re.attributes.length)return!1;for(var je=0,vt=ae.attributes.length,q,kt,Rt;je<vt;++je)if(q=ae.attributes[je],Rt=q.name,Rt!="class"&&(kt=re.attributes.getNamedItem(Rt),q===null!=(kt===null)||q.specified!=kt.specified||q.specified&&q.nodeValue!==kt.nodeValue))return!1;return!0}function Se(ae,re){for(var je=0,vt=ae.attributes.length,q;je<vt;++je)if(q=ae.attributes[je].name,!(re&&s(re,q))&&ae.attributes[je].specified&&q!="class")return!0;return!1}var Ae=i.getComputedStyleProperty,Pe=(function(){var ae=document.createElement("div");return typeof ae.isContentEditable=="boolean"?function(re){return re&&re.nodeType==1&&re.isContentEditable}:function(re){return!re||re.nodeType!=1||re.contentEditable=="false"?!1:re.contentEditable=="true"||Pe(re.parentNode)}})();function De(ae){var re;return ae&&ae.nodeType==1&&((re=ae.parentNode)&&re.nodeType==9&&re.designMode=="on"||Pe(ae)&&!Pe(ae.parentNode))}function ze(ae){return(Pe(ae)||ae.nodeType!=1&&Pe(ae.parentNode))&&!De(ae)}var Ye=/^inline(-block|-table)?$/i;function Be(ae){return ae&&ae.nodeType==1&&!Ye.test(Ae(ae,"display"))}var Je=/[^\r\n\t\f \u200B]/;function gt(ae){if(ae.data.length==0)return!0;if(Je.test(ae.data))return!1;var re=Ae(ae.parentNode,"whiteSpace");switch(re){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(ae.data))return!1}return Be(ae.previousSibling)||Be(ae.nextSibling)}function le(ae){var re=[],je,vt;for(je=0;vt=ae[je++];)re.push(new a(vt.startContainer,vt.startOffset),new a(vt.endContainer,vt.endOffset));return re}function Ze(ae,re){for(var je=0,vt,q,kt,Rt=ae.length;je<Rt;++je)vt=ae[je],q=re[je*2],kt=re[je*2+1],vt.setStartAndEnd(q.node,q.offset,kt.node,kt.offset)}function pe(ae,re){return i.isCharacterDataNode(ae)?re==0?!!ae.previousSibling:re==ae.length?!!ae.nextSibling:!0:re>0&&re<ae.childNodes.length}function se(ae,re,je,vt){var q,kt,Rt=je==0;if(i.isAncestorOf(re,ae))return ae;if(i.isCharacterDataNode(re)){var Gt=i.getNodeIndex(re);if(je==0)je=Gt;else if(je==re.length)je=Gt+1;else throw r.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+je+" in "+re.data);re=re.parentNode}if(pe(re,je)){q=re.cloneNode(!1),kt=re.parentNode,q.id&&q.removeAttribute("id");for(var Pn,qt=0;Pn=re.childNodes[je];)z(Pn,q,qt++,vt);return z(q,kt,i.getNodeIndex(re)+1,vt),re==ae?q:se(ae,kt,i.getNodeIndex(q),vt)}else if(ae!=re){q=re.parentNode;var On=i.getNodeIndex(re);return Rt||On++,se(ae,q,On,vt)}return ae}function we(ae,re){return ae.namespaceURI==re.namespaceURI&&ae.tagName.toLowerCase()==re.tagName.toLowerCase()&&P(ae,re)&&ie(ae,re)&&Ae(ae,"display")=="inline"&&Ae(re,"display")=="inline"}function $e(ae){var re=ae?"nextSibling":"previousSibling";return function(je,vt){var q=je.parentNode,kt=je[re];if(kt){if(kt&&kt.nodeType==3)return kt}else if(vt&&(kt=q[re],kt&&kt.nodeType==1&&we(q,kt))){var Rt=kt[ae?"firstChild":"lastChild"];if(Rt&&Rt.nodeType==3)return Rt}return null}}var rt=$e(!1),pt=$e(!0);function Lt(ae){this.isElementMerge=ae.nodeType==1,this.textNodes=[];var re=this.isElementMerge?ae.lastChild:ae;re&&(this.textNodes[0]=re)}Lt.prototype={doMerge:function(ae){var re=this.textNodes,je=re[0];if(re.length>1){var vt=i.getNodeIndex(je),q=[],kt=0,Rt;f(re,function(Gt,Pn){Rt=Gt.parentNode,Pn>0&&(Rt.removeChild(Gt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Gt&&(qt.node=je,qt.offset+=kt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&Pn<re.length-1&&(qt.node=je,qt.offset=kt))})),q[Pn]=Gt.data,kt+=Gt.data.length}),je.data=q.join("")}return je.data},getLength:function(){for(var ae=this.textNodes.length,re=0;ae--;)re+=this.textNodes[ae].length;return re},toString:function(){var ae=[];return f(this.textNodes,function(re,je){ae[je]="'"+re.data+"'"}),"[Merge("+ae.join(",")+")]"}};var Jt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],en={};function zt(ae,re,je){var vt,q,kt,Rt,Gt=this;Gt.cssClass=Gt.className=ae;var Pn=null,qt={};if(typeof re=="object"&&re!==null){for(typeof re.elementTagName<"u"&&(re.elementTagName=re.elementTagName.toLowerCase()),je=re.tagNames,Pn=re.elementProperties,qt=re.elementAttributes,q=0;Rt=Jt[q++];)re.hasOwnProperty(Rt)&&(Gt[Rt]=re[Rt]);vt=re.normalize}else vt=re;Gt.normalize=typeof vt>"u"?!0:vt,Gt.attrExceptions=[];var On=document.createElement(Gt.elementTagName);Gt.elementProperties=Gt.copyPropertiesToElement(Pn,On,!0),b(qt,function(Ke,Le){Gt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Gt.elementAttributes=qt,Gt.elementSortedClassName=Gt.elementProperties.hasOwnProperty("className")?$(Gt.elementProperties.className+" "+ae):ae,Gt.applyToAnyTagName=!1;var ke=typeof je;if(ke=="string")je=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames=E(je.toLowerCase()).split(/\s*,\s*/);else if(ke=="object"&&typeof je.length=="number")for(Gt.tagNames=[],q=0,kt=je.length;q<kt;++q)je[q]=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames.push(je[q].toLowerCase());else Gt.tagNames=[Gt.elementTagName]}zt.prototype={elementTagName:h,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(ae,re,je){var vt,q,kt={},Rt,Gt,Pn,qt;for(var On in ae)if(ae.hasOwnProperty(On))if(Gt=ae[On],Pn=re[On],On=="className")S(re,Gt),S(re,this.className),re[On]=$(re[On]),je&&(kt[On]=Gt);else if(On=="style"){q=Pn,je&&(kt[On]=Rt={});for(vt in ae[On])ae[On].hasOwnProperty(vt)&&(q[vt]=Gt[vt],je&&(Rt[vt]=q[vt]));this.attrExceptions.push(On)}else re[On]=Gt,je&&(kt[On]=re[On],qt=en.hasOwnProperty(On)?en[On]:On,this.attrExceptions.push(qt));return je?kt:""},copyAttributesToElement:function(ae,re){for(var je in ae)ae.hasOwnProperty(je)&&!/^class(?:Name)?$/i.test(je)&&re.setAttribute(je,ae[je])},appliesToElement:function(ae){return s(this.tagNames,ae.tagName.toLowerCase())},getEmptyElements:function(ae){var re=this;return ae.getNodes([1],function(je){return re.appliesToElement(je)&&!je.hasChildNodes()})},hasClass:function(ae){return ae.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(ae))&&w(ae,this.className)},getSelfOrAncestorWithClass:function(ae){for(;ae;){if(this.hasClass(ae))return ae;ae=ae.parentNode}return null},isModifiable:function(ae){return!this.applyToEditableOnly||ze(ae)},isIgnorableWhiteSpaceNode:function(ae){return this.ignoreWhiteSpace&&ae&&ae.nodeType==3&>(ae)},postApply:function(ae,re,je,vt){var q=ae[0],kt=ae[ae.length-1],Rt=[],Gt,Pn=q,qt=kt,On=0,ke=kt.length,Ke;f(ae,function(Tt){Ke=rt(Tt,!vt),Ke?(Gt||(Gt=new Lt(Ke),Rt.push(Gt)),Gt.textNodes.push(Tt),Tt===q&&(Pn=Gt.textNodes[0],On=Pn.length),Tt===kt&&(qt=Gt.textNodes[0],ke=Gt.getLength())):Gt=null});var Le=pt(kt,!vt);if(Le&&(Gt||(Gt=new Lt(kt),Rt.push(Gt)),Gt.textNodes.push(Le)),Rt.length){for(var dt=0,At=Rt.length;dt<At;++dt)Rt[dt].doMerge(je);re.setStartAndEnd(Pn,On,qt,ke)}},createContainer:function(ae){var re=i.getDocument(ae),je=v&&!i.isHtmlNamespace(ae)&&ae.namespaceURI?re.createElementNS(ae.namespaceURI,this.elementTagName):re.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,je,!1),this.copyAttributesToElement(this.elementAttributes,je),S(je,this.className),this.onElementCreate&&this.onElementCreate(je,this),je},elementHasProperties:function(ae,re){var je=this;return b(re,function(vt,q){if(vt=="className")return B(ae,q);if(typeof q=="object"){if(!je.elementHasProperties(ae[vt],q))return!1}else if(ae[vt]!==q)return!1})},elementHasAttributes:function(ae,re){return b(re,function(je,vt){if(ae.getAttribute(je)!==vt)return!1})},applyToTextNode:function(ae,re){if(F(ae)){var je=ae.parentNode;if(je.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(je)&&this.elementHasProperties(je,this.elementProperties)&&this.elementHasAttributes(je,this.elementAttributes))S(je,this.className);else{var vt=ae.parentNode,q=this.createContainer(vt);vt.insertBefore(q,ae),q.appendChild(ae)}}},isRemovable:function(ae){return ae.tagName.toLowerCase()==this.elementTagName&&D(ae)==this.elementSortedClassName&&this.elementHasProperties(ae,this.elementProperties)&&!Se(ae,this.attrExceptions)&&this.elementHasAttributes(ae,this.elementAttributes)&&this.isModifiable(ae)},isEmptyContainer:function(ae){var re=ae.childNodes.length;return ae.nodeType==1&&this.isRemovable(ae)&&(re==0||re==1&&this.isEmptyContainer(ae.firstChild))},removeEmptyContainers:function(ae){var re=this,je=ae.getNodes([1],function(kt){return re.isEmptyContainer(kt)}),vt=[ae],q=le(vt);f(je,function(kt){X(kt,q)}),Ze(vt,q)},undoToTextNode:function(ae,re,je,vt){if(!re.containsNode(je)){var q=re.cloneRange();q.selectNode(je),q.isPointInRange(re.endContainer,re.endOffset)&&(se(je,re.endContainer,re.endOffset,vt),re.setEndAfter(je)),q.isPointInRange(re.startContainer,re.startOffset)&&(je=se(je,re.startContainer,re.startOffset,vt))}this.isRemovable(je)?W(je,vt):M(je,this.className)},splitAncestorWithClass:function(ae,re,je){var vt=this.getSelfOrAncestorWithClass(ae);vt&&se(vt,ae,re,je)},undoToAncestor:function(ae,re){this.isRemovable(ae)?W(ae,re):M(ae,this.className)},applyToRange:function(ae,re){var je=this;re=re||[];var vt=le(re||[]);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae);var q=J(ae);if(q.length){f(q,function(Gt){!je.isIgnorableWhiteSpaceNode(Gt)&&!je.getSelfOrAncestorWithClass(Gt)&&je.isModifiable(Gt)&&je.applyToTextNode(Gt,vt)});var kt=q[q.length-1];ae.setStartAndEnd(q[0],0,kt,kt.length),je.normalize&&je.postApply(q,ae,vt,!1),Ze(re,vt)}var Rt=je.getEmptyElements(ae);f(Rt,function(Gt){S(Gt,je.className)})},applyToRanges:function(ae){for(var re=ae.length;re--;)this.applyToRange(ae[re],ae);return ae},applyToSelection:function(ae){var re=o.getSelection(ae);re.setRanges(this.applyToRanges(re.getAllRanges()))},undoToRange:function(ae,re){var je=this;re=re||[];var vt=le(re);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae,vt);var q=J(ae),kt,Rt,Gt=q[q.length-1];if(q.length){je.splitAncestorWithClass(ae.endContainer,ae.endOffset,vt),je.splitAncestorWithClass(ae.startContainer,ae.startOffset,vt);for(var Pn=0,qt=q.length;Pn<qt;++Pn)kt=q[Pn],Rt=je.getSelfOrAncestorWithClass(kt),Rt&&je.isModifiable(kt)&&je.undoToAncestor(Rt,vt);ae.setStartAndEnd(q[0],0,Gt,Gt.length),je.normalize&&je.postApply(q,ae,vt,!0),Ze(re,vt)}var On=je.getEmptyElements(ae);f(On,function(ke){M(ke,je.className)})},undoToRanges:function(ae){for(var re=ae.length;re--;)this.undoToRange(ae[re],ae);return ae},undoToSelection:function(ae){var re=o.getSelection(ae),je=o.getSelection(ae).getAllRanges();this.undoToRanges(je),re.setRanges(je)},isAppliedToRange:function(ae){if(ae.collapsed||ae.toString()=="")return!!this.getSelfOrAncestorWithClass(ae.commonAncestorContainer);var re=ae.getNodes([3]);if(re.length){for(var je=0,vt;vt=re[je++];)if(!this.isIgnorableWhiteSpaceNode(vt)&&Q(ae,vt)&&this.isModifiable(vt)&&!this.getSelfOrAncestorWithClass(vt))return!1}return!0},isAppliedToRanges:function(ae){var re=ae.length;if(re==0)return!1;for(;re--;)if(!this.isAppliedToRange(ae[re]))return!1;return!0},isAppliedToSelection:function(ae){var re=o.getSelection(ae);return this.isAppliedToRanges(re.getAllRanges())},toggleRange:function(ae){this.isAppliedToRange(ae)?this.undoToRange(ae):this.applyToRange(ae)},toggleSelection:function(ae){this.isAppliedToSelection(ae)?this.undoToSelection(ae):this.applyToSelection(ae)},getElementsWithClassIntersectingRange:function(ae){var re=[],je=this;return ae.getNodes([3],function(vt){var q=je.getSelfOrAncestorWithClass(vt);q&&!s(re,q)&&re.push(q)}),re},detach:function(){}};function it(ae,re,je){return new zt(ae,re,je)}zt.util={hasClass:w,addClass:S,removeClass:M,getClass:T,hasSameClasses:P,hasAllClasses:B,replaceWithOwnChildren:W,elementsHaveSameNonClassAttributes:ie,elementHasNonClassAttributes:Se,splitNodeAt:se,isEditableElement:Pe,isEditingHost:De,isEditable:ze},o.CssClassApplier=o.ClassApplier=zt,o.createClassApplier=it,l.createAliasForDeprecatedMethod(o,"createCssClassApplier","createClassApplier",r)}),n})})(wS)),wS.exports}Ane();var wR={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function ER(t){var e,n,o=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),r=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),i=o||r;return i?i.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{_R.init()}catch{console.error("rangy.init failed")}try{(l=(s=o==null?void 0:o.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new KI({parent:this.button||void 0,color:"#000",onDone:function(f){var h,v,b,E,O;try{a.coloredText&&(!((v=(h=a.coloredText).isAppliedToSelection)===null||v===void 0)&&v.call(h))&&a.coloredText.undoToSelection(),a.coloredText=_R.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:f.hex}},normalize:!0}),a.coloredText.toggleSelection(),(E=(b=a.base)===null||b===void 0?void 0:b.checkContentChanged)===null||E===void 0||E.call(b),(O=a.setInactive)===null||O===void 0||O.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),(function(){function a(){}return a})())}var Mne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Tne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},xR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};(function(t){Mne(e,t);function e(n){var o=t.call(this,n)||this;o.labelMap=new Map;var r=n.lf,i=n.graphModel;return o.lf=r,o.graphModel=i,o.state={tick:0},o}return e.prototype.componentDidMount=function(){var n=this,o=this.props.graphModel;this.editor=new D0(".lf-label-editor",Yv(wR,{autoLink:!0,extensions:{colorPicker:new(ER(D0))}})),o.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),o.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new D0(".lf-label-editor",Yv(wR,{autoLink:!0,extensions:{colorPicker:new(ER(D0))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,o=this.props,r=o.lf.extension,i=o.graphModel,a=OR(OR([],xR(i.nodes),!1),xR(i.edges),!1),s=r.label;if(s){var l=[];return ri(a,function(f){var h,v,b=f.getData(),E=(v=(h=b.properties)===null||h===void 0?void 0:h._label)!==null&&v!==void 0?v:[];ri(E,function(O){var w=n.labelMap,S=new vne(O,f,i);w.set(S.id,S),l.push($t(pne,{label:S,element:f,graphModel:i},S.id))})}),l}return null},e.prototype.render=function(){return $t("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=Tne([xs],e),e})(ko);var SR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},AR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Cne=(function(){function t(e){var n=e.lf,o=e.options,r=this,i;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;r.handleMouseDown(s)},this.draw=function(a){var s=r.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,f=s.y;if(r.endPoint={x:l,y:f},r.startPoint){var h=r.startPoint,v=h.x,b=h.y,E=v,O=b,w=l-v,S=f-b;l<v&&(E=l,w=v-l),f<b&&(O=f,S=b-f),r.wrapper&&(r.wrapper.style.left="".concat(E,"px"),r.wrapper.style.top="".concat(O,"px"),r.wrapper.style.width="".concat(w,"px"),r.wrapper.style.height="".concat(S,"px"))}},this.drawOff=function(a){if(r.lf.updateEditConfig({stopMoveGraph:r.originalStopMoveGraph}),r.originStatusSaved=!1,r.mouseDownInfo){var s=r.mouseDownInfo,l=s.x,f=s.y,h=s.time,v=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-f)<5&&Date.now()-h<200;if(v){r.lf.clearSelectElements(),r.cleanupSelectionState();return}}var b=to(r.startPoint),E=to(r.endPoint);if(document.removeEventListener("mousemove",r.draw),r.exclusiveMode||document.removeEventListener("mouseup",r.drawOff),b&&E){var l=b.x,f=b.y,O=E.x,w=E.y,S=[Math.min(l,O),Math.min(f,w)],M=[Math.max(l,O),Math.max(f,w)];if(r.lf.emit("selection:selected-area",{topLeft:S,bottomRight:M}),Math.abs(O-l)<10&&Math.abs(w-f)<10){r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0);return}var T=r.lf.graphModel.getAreaElement(S,M,r.isWholeEdge,r.isWholeNode,!0),$=r.lf.graphModel,D=$.dynamicGroup,P=$.group,B=[],F=r.lf.getSelectElements(),I=new Set(AR(AR([],SR(F.nodes.map(function(X){return X.id})),!1),SR(F.edges.map(function(X){return X.id})),!1));T.forEach(function(X){if(P){var Y=P.getNodeGroup(X.id);if(T.includes(Y))return}if(D){var Y=D.getGroupByNodeId(X.id);if(T.includes(Y))return}if(r.exclusiveMode&&I.has(X.id)){r.lf.deselectElementById(X.id);return}r.lf.selectElementById(X.id,!0),B.push(X)}),r.startPoint=void 0,r.endPoint=void 0,B.length>0&&r.lf.emit("selection:drop",{e:a}),r.lf.emit("selection:selected",{elements:B,leftTopPoint:S,rightBottomPoint:M})}r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0)},this.lf=n,this.exclusiveMode=(i=o==null?void 0:o.exclusiveMode)!==null&&i!==void 0?i:!1,n.openSelectionSelect=function(){r.openSelectionSelect()},n.closeSelectionSelect=function(){r.closeSelectionSelect()},n.setSelectionSelectMode=function(a){r.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var o=e.button===2;if(!o){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var r=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,i=r.x,a=r.y;this.startPoint={x:i,y:a},this.endPoint={x:i,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(f){f.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=to(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t})();var JI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Eg=function(){return Eg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Eg.apply(this,arguments)},v_=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nne={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function kne(t){for(var e=t,n=1;n<e.length-1;){var o=v_(e[n-1],2),r=o[0],i=o[1],a=v_(e[n],2),s=a[0],l=a[1],f=v_(e[n+1],2),h=f[0],v=f[1];r===s&&s===h||i===l&&l===v?e.splice(n,1):n++}return e}function Pne(t,e,n,o){var r=[t[0],t[1]],i=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(r[1]+=o,i[0]+=o):e==="lb"&&(r[0]+=o,i[1]+=o),[r,i];case"tr":return e==="tl"?(r[1]+=o,i[0]-=o):e==="rb"&&(r[0]-=o,i[1]+=o),[r,i];case"bl":return e==="br"?(r[1]-=o,i[0]+=o):e==="lt"&&(r[0]+=o,i[1]-=o),[r,i];case"br":return e==="bl"?(r[1]-=o,i[0]-=o):e==="rt"&&(r[0]-=o,i[1]-=o),[r,i];default:return[]}}function Rne(t,e,n,o){var r,i=1,a=function(S,M){var T=M[0]-S[0],$=M[1]-S[1],D=Math.abs(T),P=Math.abs($);return P<=i&&D>i?T<0?"l":"r":D<=i&&P>i?$<0?"t":"b":D<=i&&P<=i?"":D<P?T<0?"l":"r":$<0?"t":"b"},s=a(t,e),l=a(e,n),f=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||1/5*o,h="".concat(s).concat(l),v=Nne[h]||"-",b="";if(v==="-")b+="L ".concat(e[0]," ").concat(e[1]);else{var E=v_(Pne(e,h,v,f),2),O=E[0],w=E[1];O&&w&&(b+="L ".concat(O[0]," ").concat(O[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(w[0]," ").concat(w[1]),r=v_(w,2),e[0]=r[0],e[1]=r[1])}return b}function Dne(t,e){var n=0,o="";if(t.length===2)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var r=t[n-1],i=t[n],a=t[n+++1];o+=Rne(r,i,a,e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}(function(t){JI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),f=n.getEdgeAnimationStyle(),h=kne(o.split(" ").map(function(E){return E.split(",").map(function(O){return+O})})),v=Dne(h,s),b=Eg(Eg(Eg({style:r?f:{}},l),i),{fill:"none"});return Lr("path",Eg({d:v},b))},e})($_);(function(t){JI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(F_);var QI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u1=function(){return u1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u1.apply(this,arguments)},MR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},jne=(function(t){QI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.id,r=n.x,i=n.y,a=n.width,s=n.height,l=n.properties,f=this.props.model.getNodeStyle();return Lr("svg",{x:r-a/2,y:i-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Lr("text",{x:0,y:-5,fontSize:"16px",fill:f.stroke},l.labelText):"",l.disabledDelete?"":Lr("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:f.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,o)},"x")])},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",u1(u1({},l),{x:o-i/2,y:r-a/2,width:i,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var o=this.props.graphModel;o.deleteNode(n)},e})(zw),Lne=(function(t){QI(e,t);function e(){var n=t.apply(this,TR([],MR(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,o;this.points=[],((o=this.properties)===null||o===void 0?void 0:o.node_selection_ids).length>1&&setTimeout(function(){var r;n.updatePointsByNodes(((r=n.properties)===null||r===void 0?void 0:r.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var o=n.x,r=n.y;this.x=o,this.y=r},e.prototype.updatePointsByNodes=function(n){var o=this,r=[],i=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(f){var h=o.graphModel.getNodeModelById(f);if(h){var v=h.width,b=h.height,E=h.x,O=h.y;i=Math.min(i,E-v/2-o.d),a=Math.min(a,O-b/2-o.d),s=Math.max(s,E+v/2+o.d),l=Math.max(l,O+b/2+o.d)}}),r.push([i,a],[s,a],[s,l],[i,l]),![i,a,s,l].some(function(f){return Math.abs(f)===1/0})&&(this.updatePoints(r),this.updateCoordinate({x:(s+i)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var o;this.isResize=!0;for(var r=n.width,i=n.height,a={x:r/this.width,y:i/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],f=new Set;s.length;){var h=s.shift(),v=(o=this.graphModel.nodesMap[h])===null||o===void 0?void 0:o.model;if(v){if(!ew(v)){l.push(v);continue}f.has(v.id)||(f.add(v.id),s.push.apply(s,TR([],MR(v.properties.node_selection_ids||[]),!1)))}}var b={x:this.x-this.width/2,y:this.y-this.height/2},E=t.prototype.resize.call(this,n),O={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(w){w.width=w.width*a.x,w.height=w.height*a.y;var S=(w.x-b.x)*a.x+O.x-w.x,M=(w.y-b.y)*a.y+O.y-w.y;w.move(S,M,!0)}),this.isResize=!1,E},e})(Uw),v2="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:v2,view:jne,model:Lne})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,o=this.lf.getGraphRawData(),r=n.filter(function(i){return i!==e.currentClickNode.id});return o.nodes.find(function(i){if(i.type==="node-selection"){var a=om(i,"properties.node_selection_ids",[]);return r.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var o=e.graphModel.nodes.filter(function(r){if(!ew(r))return!1;var i=r.properties.node_selection_ids||[];return i.includes(n.id)});Promise.resolve().then(function(){o.forEach(function(r){r.updatePointsByNodes(r.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(o){var r;if(!(!o.e.shiftKey||o.data.type===v2)){n.currentClickNode=o.data;var i=!1;n.selectNodesIds.includes(o.data.id)&&((r=n.lf.getNodeModelById(o.data.id))===null||r===void 0||r.setSelected(!1),i=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?i?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(o,r,i){if(n.onNodeChange(e,o),ew(o)&&!o.isResize){var a=o.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,r,i,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(o){return ew(o)||n.onNodeChange(e,o),!0})},t.pluginName="node-selection",t})();var ew=function(t){return!!(t&&t.type===v2)},Ine=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c1=function(){return c1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c1.apply(this,arguments)};(function(t){Ine(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.properties;return Lr("text",{x:o-i/2+5,y:r-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",c1(c1({},s),{fill:"#FFFFFF",x:o-i/2,y:r-a/2})),this.getLabelShape()])},e})(Zv);var I0={exports:{}},CR;function Fne(){return CR||(CR=1,(function(t,e){(function(n,o){t.exports=o()})(window,(function(){return(function(n){var o={};function r(i){if(o[i])return o[i].exports;var a=o[i]={i,l:!1,exports:{}};return n[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=n,r.c=o,r.d=function(i,a,s){r.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:s})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,a){if(1&a&&(i=r(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var l in i)r.d(s,l,(function(f){return i[f]}).bind(null,l));return s},r.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(a,"a",a),a},r.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},r.p="",r(r.s=222)})([function(n,o,r){r.d(o,"a",(function(){return P})),r.d(o,"b",(function(){return D})),r.d(o,"c",(function(){return le})),r.d(o,"d",(function(){return Ze})),r.d(o,"e",(function(){return M})),r.d(o,"f",(function(){return $})),r.d(o,"g",(function(){return M})),r.d(o,"h",(function(){return gt})),r.d(o,"i",(function(){return a})),r.d(o,"j",(function(){return Je})),r.d(o,"k",(function(){return Y}));var i,a,s,l,f,h,v,b={},E=[],O=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function w(pe,se){for(var we in se)pe[we]=se[we];return pe}function S(pe){var se=pe.parentNode;se&&se.removeChild(pe)}function M(pe,se,we){var $e,rt,pt,Lt={};for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];if(arguments.length>2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),typeof pe=="function"&&pe.defaultProps!=null)for(pt in pe.defaultProps)Lt[pt]===void 0&&(Lt[pt]=pe.defaultProps[pt]);return T(pe,Lt,$e,rt,null)}function T(pe,se,we,$e,rt){var pt={type:pe,props:se,key:we,ref:$e,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:rt??++s};return rt==null&&a.vnode!=null&&a.vnode(pt),pt}function $(){return{current:null}}function D(pe){return pe.children}function P(pe,se){this.props=pe,this.context=se}function B(pe,se){if(se==null)return pe.__?B(pe.__,pe.__.__k.indexOf(pe)+1):null;for(var we;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null)return we.__e;return typeof pe.type=="function"?B(pe):null}function F(pe){var se,we;if((pe=pe.__)!=null&&pe.__c!=null){for(pe.__e=pe.__c.base=null,se=0;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null){pe.__e=pe.__c.base=we.__e;break}return F(pe)}}function I(pe){(!pe.__d&&(pe.__d=!0)&&l.push(pe)&&!V.__r++||h!==a.debounceRendering)&&((h=a.debounceRendering)||f)(V)}function V(){for(var pe;V.__r=l.length;)pe=l.sort((function(se,we){return se.__v.__b-we.__v.__b})),l=[],pe.some((function(se){var we,$e,rt,pt,Lt,Jt;se.__d&&(Lt=(pt=(we=se).__v).__e,(Jt=we.__P)&&($e=[],(rt=w({},pt)).__v=pt.__v+1,Ae(Jt,pt,rt,we.__n,Jt.ownerSVGElement!==void 0,pt.__h!=null?[Lt]:null,$e,Lt??B(pt),pt.__h),Pe($e,pt),pt.__e!=Lt&&F(pt)))}))}function z(pe,se,we,$e,rt,pt,Lt,Jt,en,zt){var it,ae,re,je,vt,q,kt,Rt=$e&&$e.__k||E,Gt=Rt.length;for(we.__k=[],it=0;it<se.length;it++)if((je=we.__k[it]=(je=se[it])==null||typeof je=="boolean"?null:typeof je=="string"||typeof je=="number"||typeof je=="bigint"?T(null,je,null,null,je):Array.isArray(je)?T(D,{children:je},null,null,null):je.__b>0?T(je.type,je.props,je.key,null,je.__v):je)!=null){if(je.__=we,je.__b=we.__b+1,(re=Rt[it])===null||re&&je.key==re.key&&je.type===re.type)Rt[it]=void 0;else for(ae=0;ae<Gt;ae++){if((re=Rt[ae])&&je.key==re.key&&je.type===re.type){Rt[ae]=void 0;break}re=null}Ae(pe,je,re=re||b,rt,pt,Lt,Jt,en,zt),vt=je.__e,(ae=je.ref)&&re.ref!=ae&&(kt||(kt=[]),re.ref&&kt.push(re.ref,null,je),kt.push(ae,je.__c||vt,je)),vt!=null?(q==null&&(q=vt),typeof je.type=="function"&&je.__k===re.__k?je.__d=en=X(je,en,pe):en=W(pe,je,re,Rt,vt,en),typeof we.type=="function"&&(we.__d=en)):en&&re.__e==en&&en.parentNode!=pe&&(en=B(re))}for(we.__e=q,it=Gt;it--;)Rt[it]!=null&&(typeof we.type=="function"&&Rt[it].__e!=null&&Rt[it].__e==we.__d&&(we.__d=B($e,it+1)),Ye(Rt[it],Rt[it]));if(kt)for(it=0;it<kt.length;it++)ze(kt[it],kt[++it],kt[++it])}function X(pe,se,we){for(var $e,rt=pe.__k,pt=0;rt&&pt<rt.length;pt++)($e=rt[pt])&&($e.__=pe,se=typeof $e.type=="function"?X($e,se,we):W(we,$e,$e,rt,$e.__e,se));return se}function Y(pe,se){return se=se||[],pe==null||typeof pe=="boolean"||(Array.isArray(pe)?pe.some((function(we){Y(we,se)})):se.push(pe)),se}function W(pe,se,we,$e,rt,pt){var Lt,Jt,en;if(se.__d!==void 0)Lt=se.__d,se.__d=void 0;else if(we==null||rt!=pt||rt.parentNode==null)e:if(pt==null||pt.parentNode!==pe)pe.appendChild(rt),Lt=null;else{for(Jt=pt,en=0;(Jt=Jt.nextSibling)&&en<$e.length;en+=2)if(Jt==rt)break e;pe.insertBefore(rt,pt),Lt=pt}return Lt!==void 0?Lt:rt.nextSibling}function Q(pe,se,we){se[0]==="-"?pe.setProperty(se,we):pe[se]=we==null?"":typeof we!="number"||O.test(se)?we:we+"px"}function J(pe,se,we,$e,rt){var pt;e:if(se==="style")if(typeof we=="string")pe.style.cssText=we;else{if(typeof $e=="string"&&(pe.style.cssText=$e=""),$e)for(se in $e)we&&se in we||Q(pe.style,se,"");if(we)for(se in we)$e&&we[se]===$e[se]||Q(pe.style,se,we[se])}else if(se[0]==="o"&&se[1]==="n")pt=se!==(se=se.replace(/Capture$/,"")),se=se.toLowerCase()in pe?se.toLowerCase().slice(2):se.slice(2),pe.l||(pe.l={}),pe.l[se+pt]=we,we?$e||pe.addEventListener(se,pt?Se:ie,pt):pe.removeEventListener(se,pt?Se:ie,pt);else if(se!=="dangerouslySetInnerHTML"){if(rt)se=se.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(se!=="href"&&se!=="list"&&se!=="form"&&se!=="tabIndex"&&se!=="download"&&se in pe)try{pe[se]=we??"";break e}catch{}typeof we=="function"||(we!=null&&(we!==!1||se[0]==="a"&&se[1]==="r")?pe.setAttribute(se,we):pe.removeAttribute(se))}}function ie(pe){this.l[pe.type+!1](a.event?a.event(pe):pe)}function Se(pe){this.l[pe.type+!0](a.event?a.event(pe):pe)}function Ae(pe,se,we,$e,rt,pt,Lt,Jt,en){var zt,it,ae,re,je,vt,q,kt,Rt,Gt,Pn,qt=se.type;if(se.constructor!==void 0)return null;we.__h!=null&&(en=we.__h,Jt=se.__e=we.__e,se.__h=null,pt=[Jt]),(zt=a.__b)&&zt(se);try{e:if(typeof qt=="function"){if(kt=se.props,Rt=(zt=qt.contextType)&&$e[zt.__c],Gt=zt?Rt?Rt.props.value:zt.__:$e,we.__c?q=(it=se.__c=we.__c).__=it.__E:("prototype"in qt&&qt.prototype.render?se.__c=it=new qt(kt,Gt):(se.__c=it=new P(kt,Gt),it.constructor=qt,it.render=Be),Rt&&Rt.sub(it),it.props=kt,it.state||(it.state={}),it.context=Gt,it.__n=$e,ae=it.__d=!0,it.__h=[]),it.__s==null&&(it.__s=it.state),qt.getDerivedStateFromProps!=null&&(it.__s==it.state&&(it.__s=w({},it.__s)),w(it.__s,qt.getDerivedStateFromProps(kt,it.__s))),re=it.props,je=it.state,ae)qt.getDerivedStateFromProps==null&&it.componentWillMount!=null&&it.componentWillMount(),it.componentDidMount!=null&&it.__h.push(it.componentDidMount);else{if(qt.getDerivedStateFromProps==null&&kt!==re&&it.componentWillReceiveProps!=null&&it.componentWillReceiveProps(kt,Gt),!it.__e&&it.shouldComponentUpdate!=null&&it.shouldComponentUpdate(kt,it.__s,Gt)===!1||se.__v===we.__v){it.props=kt,it.state=it.__s,se.__v!==we.__v&&(it.__d=!1),it.__v=se,se.__e=we.__e,se.__k=we.__k,se.__k.forEach((function(On){On&&(On.__=se)})),it.__h.length&&Lt.push(it);break e}it.componentWillUpdate!=null&&it.componentWillUpdate(kt,it.__s,Gt),it.componentDidUpdate!=null&&it.__h.push((function(){it.componentDidUpdate(re,je,vt)}))}it.context=Gt,it.props=kt,it.state=it.__s,(zt=a.__r)&&zt(se),it.__d=!1,it.__v=se,it.__P=pe,zt=it.render(it.props,it.state,it.context),it.state=it.__s,it.getChildContext!=null&&($e=w(w({},$e),it.getChildContext())),ae||it.getSnapshotBeforeUpdate==null||(vt=it.getSnapshotBeforeUpdate(re,je)),Pn=zt!=null&&zt.type===D&&zt.key==null?zt.props.children:zt,z(pe,Array.isArray(Pn)?Pn:[Pn],se,we,$e,rt,pt,Lt,Jt,en),it.base=se.__e,se.__h=null,it.__h.length&&Lt.push(it),q&&(it.__E=it.__=null),it.__e=!1}else pt==null&&se.__v===we.__v?(se.__k=we.__k,se.__e=we.__e):se.__e=De(we.__e,se,we,$e,rt,pt,Lt,en);(zt=a.diffed)&&zt(se)}catch(On){se.__v=null,(en||pt!=null)&&(se.__e=Jt,se.__h=!!en,pt[pt.indexOf(Jt)]=null),a.__e(On,se,we)}}function Pe(pe,se){a.__c&&a.__c(se,pe),pe.some((function(we){try{pe=we.__h,we.__h=[],pe.some((function($e){$e.call(we)}))}catch($e){a.__e($e,we.__v)}}))}function De(pe,se,we,$e,rt,pt,Lt,Jt){var en,zt,it,ae=we.props,re=se.props,je=se.type,vt=0;if(je==="svg"&&(rt=!0),pt!=null){for(;vt<pt.length;vt++)if((en=pt[vt])&&"setAttribute"in en==!!je&&(je?en.localName===je:en.nodeType===3)){pe=en,pt[vt]=null;break}}if(pe==null){if(je===null)return document.createTextNode(re);pe=rt?document.createElementNS("http://www.w3.org/2000/svg",je):document.createElement(je,re.is&&re),pt=null,Jt=!1}if(je===null)ae===re||Jt&&pe.data===re||(pe.data=re);else{if(pt=pt&&i.call(pe.childNodes),zt=(ae=we.props||b).dangerouslySetInnerHTML,it=re.dangerouslySetInnerHTML,!Jt){if(pt!=null)for(ae={},vt=0;vt<pe.attributes.length;vt++)ae[pe.attributes[vt].name]=pe.attributes[vt].value;(it||zt)&&(it&&(zt&&it.__html==zt.__html||it.__html===pe.innerHTML)||(pe.innerHTML=it&&it.__html||""))}if((function(q,kt,Rt,Gt,Pn){var qt;for(qt in Rt)qt==="children"||qt==="key"||qt in kt||J(q,qt,null,Rt[qt],Gt);for(qt in kt)Pn&&typeof kt[qt]!="function"||qt==="children"||qt==="key"||qt==="value"||qt==="checked"||Rt[qt]===kt[qt]||J(q,qt,kt[qt],Rt[qt],Gt)})(pe,re,ae,rt,Jt),it)se.__k=[];else if(vt=se.props.children,z(pe,Array.isArray(vt)?vt:[vt],se,we,$e,rt&&je!=="foreignObject",pt,Lt,pt?pt[0]:we.__k&&B(we,0),Jt),pt!=null)for(vt=pt.length;vt--;)pt[vt]!=null&&S(pt[vt]);Jt||("value"in re&&(vt=re.value)!==void 0&&(vt!==ae.value||vt!==pe.value||je==="progress"&&!vt)&&J(pe,"value",vt,ae.value,!1),"checked"in re&&(vt=re.checked)!==void 0&&vt!==pe.checked&&J(pe,"checked",vt,ae.checked,!1))}return pe}function ze(pe,se,we){try{typeof pe=="function"?pe(se):pe.current=se}catch($e){a.__e($e,we)}}function Ye(pe,se,we){var $e,rt;if(a.unmount&&a.unmount(pe),($e=pe.ref)&&($e.current&&$e.current!==pe.__e||ze($e,null,se)),($e=pe.__c)!=null){if($e.componentWillUnmount)try{$e.componentWillUnmount()}catch(pt){a.__e(pt,se)}$e.base=$e.__P=null}if($e=pe.__k)for(rt=0;rt<$e.length;rt++)$e[rt]&&Ye($e[rt],se,typeof pe.type!="function");we||pe.__e==null||S(pe.__e),pe.__e=pe.__d=void 0}function Be(pe,se,we){return this.constructor(pe,we)}function Je(pe,se,we){var $e,rt,pt;a.__&&a.__(pe,se),rt=($e=typeof we=="function")?null:we&&we.__k||se.__k,pt=[],Ae(se,pe=(!$e&&we||se).__k=M(D,null,[pe]),rt||b,b,se.ownerSVGElement!==void 0,!$e&&we?[we]:rt?null:se.firstChild?i.call(se.childNodes):null,pt,!$e&&we?we:rt?rt.__e:se.firstChild,$e),Pe(pt,pe)}function gt(pe,se){Je(pe,se,gt)}function le(pe,se,we){var $e,rt,pt,Lt=w({},pe.props);for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];return arguments.length>2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),T(pe.type,Lt,$e||pe.key,rt||pe.ref,null)}function Ze(pe,se){var we={__c:se="__cC"+v++,__:pe,Consumer:function($e,rt){return $e.children(rt)},Provider:function($e){var rt,pt;return this.getChildContext||(rt=[],(pt={})[se]=this,this.getChildContext=function(){return pt},this.shouldComponentUpdate=function(Lt){this.props.value!==Lt.value&&rt.some(I)},this.sub=function(Lt){rt.push(Lt);var Jt=Lt.componentWillUnmount;Lt.componentWillUnmount=function(){rt.splice(rt.indexOf(Lt),1),Jt&&Jt.call(Lt)}}),$e.children}};return we.Provider.__=we.Consumer.contextType=we}i=E.slice,a={__e:function(pe,se){for(var we,$e,rt;se=se.__;)if((we=se.__c)&&!we.__)try{if(($e=we.constructor)&&$e.getDerivedStateFromError!=null&&(we.setState($e.getDerivedStateFromError(pe)),rt=we.__d),we.componentDidCatch!=null&&(we.componentDidCatch(pe),rt=we.__d),rt)return we.__E=we}catch(pt){pe=pt}throw pe}},s=0,P.prototype.setState=function(pe,se){var we;we=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof pe=="function"&&(pe=pe(w({},we),this.props)),pe&&w(we,pe),pe!=null&&this.__v&&(se&&this.__h.push(se),I(this))},P.prototype.forceUpdate=function(pe){this.__v&&(this.__e=!0,pe&&this.__h.push(pe),I(this))},P.prototype.render=D,l=[],f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V.__r=0,v=0},function(n,o,r){(function(i,a){r.d(o,"a",(function(){return I})),r.d(o,"b",(function(){return lf})),r.d(o,"c",(function(){return Na})),r.d(o,"d",(function(){return rr})),r.d(o,"e",(function(){return Tt})),r.d(o,"f",(function(){return At})),r.d(o,"g",(function(){return qn})),r.d(o,"h",(function(){return ka})),r.d(o,"i",(function(){return Pn})),r.d(o,"j",(function(){return Nn})),r.d(o,"k",(function(){return br})),r.d(o,"l",(function(){return ht})),r.d(o,"m",(function(){return q})),r.d(o,"n",(function(){return or})),r.d(o,"o",(function(){return X})),r.d(o,"p",(function(){return Uh})),r.d(o,"q",(function(){return lr})),r.d(o,"r",(function(){return Fl})),r.d(o,"s",(function(){return sl})),r.d(o,"t",(function(){return vi})),r.d(o,"u",(function(){return si})),r.d(o,"v",(function(){return id})),r.d(o,"w",(function(){return _u})),r.d(o,"x",(function(){return ra})),r.d(o,"y",(function(){return xl})),r.d(o,"z",(function(){return Wi})),r.d(o,"A",(function(){return ia})),r.d(o,"B",(function(){return wl})),r.d(o,"C",(function(){return zt})),r.d(o,"D",(function(){return gp})),r.d(o,"E",(function(){return nr})),r.d(o,"F",(function(){return Cn})),r.d(o,"G",(function(){return so})),r.d(o,"H",(function(){return ve})),r.d(o,"I",(function(){return rf})),r.d(o,"J",(function(){return oa})),r.d(o,"K",(function(){return Ke})),r.d(o,"L",(function(){return qo})),r.d(o,"M",(function(){return ad}));var s=[];Object.freeze(s);var l={};function f(){return++Sn.mobxGuid}function h(R){throw v(!1,R),"X"}function v(R,L){if(!R)throw new Error("[mobx] "+(L||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(l);function b(R){var L=!1;return function(){if(!L)return L=!0,R.apply(this,arguments)}}var E=function(){};function O(R){return R!==null&&typeof R=="object"}function w(R){if(R===null||typeof R!="object")return!1;var L=Object.getPrototypeOf(R);return L===Object.prototype||L===null}function S(R,L,Z){Object.defineProperty(R,L,{enumerable:!1,writable:!0,configurable:!0,value:Z})}function M(R,L){var Z="isMobX"+R;return L.prototype[Z]=!0,function(fe){return O(fe)&&fe[Z]===!0}}function T(R){return R instanceof Map}function $(R){return R instanceof Set}function D(R){var L=new Set;for(var Z in R)L.add(Z);return Object.getOwnPropertySymbols(R).forEach((function(fe){Object.getOwnPropertyDescriptor(R,fe).enumerable&&L.add(fe)})),Array.from(L)}function P(R){return R&&R.toString?R.toString():new String(R).toString()}function B(R){return R===null?null:typeof R=="object"?""+R:R}var F=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:Object.getOwnPropertyNames,I=Symbol("mobx administration"),V=(function(){function R(L){L===void 0&&(L="Atom@"+f()),this.name=L,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ae.NOT_TRACKING}return R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.reportObserved=function(){return gl(this)},R.prototype.reportChanged=function(){Ui(),(function(L){L.lowestObserverState!==ae.STALE&&(L.lowestObserverState=ae.STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale()),Z.dependenciesState=ae.STALE})))})(this),gr()},R.prototype.toString=function(){return this.name},R})(),z=M("Atom",V);function X(R,L,Z){L===void 0&&(L=E),Z===void 0&&(Z=E);var fe,Re=new V(R);return L!==E&&Mn("onBecomeObserved",Re,L,fe),Z!==E&&nr(Re,Z),Re}var Y={structural:function(R,L){return un(R,L)},default:function(R,L){return Object.is(R,L)}},W=function(R,L){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,fe){Z.__proto__=fe}||function(Z,fe){for(var Re in fe)fe.hasOwnProperty(Re)&&(Z[Re]=fe[Re])},W(R,L)};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var Q=function(){return Q=Object.assign||function(R){for(var L,Z=1,fe=arguments.length;Z<fe;Z++)for(var Re in L=arguments[Z])Object.prototype.hasOwnProperty.call(L,Re)&&(R[Re]=L[Re]);return R},Q.apply(this,arguments)};function J(R){var L=typeof Symbol=="function"&&R[Symbol.iterator],Z=0;return L?L.call(R):{next:function(){return R&&Z>=R.length&&(R=void 0),{value:R&&R[Z++],done:!R}}}}function ie(R,L){var Z=typeof Symbol=="function"&&R[Symbol.iterator];if(!Z)return R;var fe,Re,lt=Z.call(R),It=[];try{for(;(L===void 0||L-- >0)&&!(fe=lt.next()).done;)It.push(fe.value)}catch(bn){Re={error:bn}}finally{try{fe&&!fe.done&&(Z=lt.return)&&Z.call(lt)}finally{if(Re)throw Re.error}}return It}function Se(){for(var R=[],L=0;L<arguments.length;L++)R=R.concat(ie(arguments[L]));return R}var Ae=Symbol("mobx did run lazy initializers"),Pe=Symbol("mobx pending decorators"),De={},ze={};function Ye(R,L){var Z=L?De:ze;return Z[R]||(Z[R]={configurable:!0,enumerable:L,get:function(){return Be(this),this[R]},set:function(fe){Be(this),this[R]=fe}})}function Be(R){var L,Z;if(R[Ae]!==!0){var fe=R[Pe];if(fe){S(R,Ae,!0);var Re=Se(Object.getOwnPropertySymbols(fe),Object.keys(fe));try{for(var lt=J(Re),It=lt.next();!It.done;It=lt.next()){var bn=fe[It.value];bn.propertyCreator(R,bn.prop,bn.descriptor,bn.decoratorTarget,bn.decoratorArguments)}}catch(Jn){L={error:Jn}}finally{try{It&&!It.done&&(Z=lt.return)&&Z.call(lt)}finally{if(L)throw L.error}}}}}function Je(R,L){return function(){var Z,fe=function(Re,lt,It,bn){if(bn===!0)return L(Re,lt,It,Re,Z),null;if(!Object.prototype.hasOwnProperty.call(Re,Pe)){var Jn=Re[Pe];S(Re,Pe,Q({},Jn))}return Re[Pe][lt]={prop:lt,propertyCreator:L,descriptor:It,decoratorTarget:Re,decoratorArguments:Z},Ye(lt,R)};return gt(arguments)?(Z=s,fe.apply(null,arguments)):(Z=Array.prototype.slice.call(arguments),fe)}}function gt(R){return(R.length===2||R.length===3)&&(typeof R[1]=="string"||typeof R[1]=="symbol")||R.length===4&&R[3]===!0}function le(R,L,Z){return ra(R)?R:Array.isArray(R)?zt.array(R,{name:Z}):w(R)?zt.object(R,void 0,{name:Z}):T(R)?zt.map(R,{name:Z}):$(R)?zt.set(R,{name:Z}):R}function Ze(R){return R}function pe(R){v(R);var L=Je(!0,(function(fe,Re,lt,It,bn){var Jn=lt?lt.initializer?lt.initializer.call(fe):lt.value:void 0;ll(fe).addObservableProp(Re,Jn,R)})),Z=(i!==void 0&&i.env,L);return Z.enhancer=R,Z}var se={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function we(R){return R==null?se:typeof R=="string"?{name:R,deep:!0,proxy:!0}:R}Object.freeze(se);var $e=pe(le),rt=pe((function(R,L,Z){return R==null||ia(R)||xl(R)||Wi(R)||Ki(R)?R:Array.isArray(R)?zt.array(R,{name:Z,deep:!1}):w(R)?zt.object(R,void 0,{name:Z,deep:!1}):T(R)?zt.map(R,{name:Z,deep:!1}):$(R)?zt.set(R,{name:Z,deep:!1}):h(!1)})),pt=pe(Ze),Lt=pe((function(R,L,Z){return un(R,L)?L:R}));function Jt(R){return R.defaultDecorator?R.defaultDecorator.enhancer:R.deep===!1?Ze:le}var en={box:function(R,L){arguments.length>2&&it("box");var Z=we(L);return new In(R,Jt(Z),Z.name,!0,Z.equals)},array:function(R,L){arguments.length>2&&it("array");var Z=we(L);return Ks(R,Jt(Z),Z.name)},map:function(R,L){arguments.length>2&&it("map");var Z=we(L);return new lf(R,Jt(Z),Z.name)},set:function(R,L){arguments.length>2&&it("set");var Z=we(L);return new os(R,Jt(Z),Z.name)},object:function(R,L,Z){typeof arguments[1]=="string"&&it("object");var fe=we(Z);if(fe.proxy===!1)return lr({},R,L,fe);var Re=qr(fe),lt=lr({},void 0,void 0,fe),It=bu(lt);return na(It,R,L,Re),It},ref:pt,shallow:rt,deep:$e,struct:Lt},zt=function(R,L,Z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return $e.apply(null,arguments);if(ra(R))return R;var fe=w(R)?zt.object(R,L,Z):Array.isArray(R)?zt.array(R,L):T(R)?zt.map(R,L):$(R)?zt.set(R,L):R;if(fe!==R)return fe;h(!1)};function it(R){h("Expected one or two arguments to observable."+R+". Did you accidentally try to use observable."+R+" as decorator?")}Object.keys(en).forEach((function(R){return zt[R]=en[R]}));var ae,re,je=Je(!1,(function(R,L,Z,fe,Re){var lt=Z.get,It=Z.set,bn=Re[0]||{};ll(R).addComputedProp(R,L,Q({get:lt,set:It,context:R},bn))})),vt=je({equals:Y.structural}),q=function(R,L,Z){if(typeof L=="string"||R!==null&&typeof R=="object"&&arguments.length===1)return je.apply(null,arguments);var fe=typeof L=="object"?L:{};return fe.get=R,fe.set=typeof L=="function"?L:fe.set,fe.name=fe.name||R.name||"",new wo(fe)};q.struct=vt,(function(R){R[R.NOT_TRACKING=-1]="NOT_TRACKING",R[R.UP_TO_DATE=0]="UP_TO_DATE",R[R.POSSIBLY_STALE=1]="POSSIBLY_STALE",R[R.STALE=2]="STALE"})(ae||(ae={})),(function(R){R[R.NONE=0]="NONE",R[R.LOG=1]="LOG",R[R.BREAK=2]="BREAK"})(re||(re={}));var kt=function(R){this.cause=R};function Rt(R){return R instanceof kt}function Gt(R){switch(R.dependenciesState){case ae.UP_TO_DATE:return!1;case ae.NOT_TRACKING:case ae.STALE:return!0;case ae.POSSIBLY_STALE:for(var L=At(!0),Z=Le(),fe=R.observing,Re=fe.length,lt=0;lt<Re;lt++){var It=fe[lt];if(oo(It)){if(Sn.disableErrorBoundaries)It.get();else try{It.get()}catch{return dt(Z),Tt(L),!0}if(R.dependenciesState===ae.STALE)return dt(Z),Tt(L),!0}}return En(R),dt(Z),Tt(L),!1}}function Pn(){return Sn.trackingDerivation!==null}function qt(R){var L=R.observers.size>0;Sn.computationDepth>0&&L&&h(!1),Sn.allowStateChanges||!L&&Sn.enforceActions!=="strict"||h(!1)}function On(R,L,Z){var fe=At(!0);En(R),R.newObserving=new Array(R.observing.length+100),R.unboundDepsCount=0,R.runId=++Sn.runId;var Re,lt=Sn.trackingDerivation;if(Sn.trackingDerivation=R,Sn.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new kt(It)}return Sn.trackingDerivation=lt,(function(It){for(var bn=It.observing,Jn=It.observing=It.newObserving,no=ae.UP_TO_DATE,$n=0,Do=It.unboundDepsCount,Kr=0;Kr<Do;Kr++)(So=Jn[Kr]).diffValue===0&&(So.diffValue=1,$n!==Kr&&(Jn[$n]=So),$n++),So.dependenciesState>no&&(no=So.dependenciesState);for(Jn.length=$n,It.newObserving=null,Do=bn.length;Do--;)(So=bn[Do]).diffValue===0&&Oo(So,It),So.diffValue=0;for(;$n--;){var So;(So=Jn[$n]).diffValue===1&&(So.diffValue=0,Ts(So,It))}no!==ae.UP_TO_DATE&&(It.dependenciesState=no,It.onBecomeStale())})(R),Tt(fe),Re}function ke(R){var L=R.observing;R.observing=[];for(var Z=L.length;Z--;)Oo(L[Z],R);R.dependenciesState=ae.NOT_TRACKING}function Ke(R){var L=Le();try{return R()}finally{dt(L)}}function Le(){var R=Sn.trackingDerivation;return Sn.trackingDerivation=null,R}function dt(R){Sn.trackingDerivation=R}function At(R){var L=Sn.allowStateReads;return Sn.allowStateReads=R,L}function Tt(R){Sn.allowStateReads=R}function En(R){if(R.dependenciesState!==ae.UP_TO_DATE){R.dependenciesState=ae.UP_TO_DATE;for(var L=R.observing,Z=L.length;Z--;)L[Z].lowestObserverState=ae.UP_TO_DATE}}var Zn=0,ao=1,Lo=Object.getOwnPropertyDescriptor((function(){}),"name");Lo&&Lo.configurable;function yo(R,L,Z){var fe=function(){return ho(R,L,Z||this,arguments)};return fe.isMobxAction=!0,fe}function ho(R,L,Z,fe){var Re=Nn();try{return L.apply(Z,fe)}catch(lt){throw Re.error=lt,lt}finally{qn(Re)}}function Nn(R,L,Z){var fe=0,Re=Le();Ui();var lt={prevDerivation:Re,prevAllowStateChanges:ut(!0),prevAllowStateReads:At(!0),notifySpy:!1,startTime:fe,actionId:ao++,parentActionId:Zn};return Zn=lt.actionId,lt}function qn(R){Zn!==R.actionId&&h("invalid action stack. did you forget to finish an action?"),Zn=R.parentActionId,R.error!==void 0&&(Sn.suppressReactionErrors=!0),vn(R.prevAllowStateChanges),Tt(R.prevAllowStateReads),gr(),dt(R.prevDerivation),R.notifySpy,Sn.suppressReactionErrors=!1}function rr(R,L){var Z,fe=ut(R);try{Z=L()}finally{vn(fe)}return Z}function ut(R){var L=Sn.allowStateChanges;return Sn.allowStateChanges=R,L}function vn(R){Sn.allowStateChanges=R}var In=(function(R){function L(Z,fe,Re,lt,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=Y.default);var bn=R.call(this,Re)||this;return bn.enhancer=fe,bn.name=Re,bn.equals=It,bn.hasUnreportedChange=!1,bn.value=fe(Z,void 0,Re),bn}return(function(Z,fe){function Re(){this.constructor=Z}W(Z,fe),Z.prototype=fe===null?Object.create(fe):(Re.prototype=fe.prototype,new Re)})(L,R),L.prototype.dehanceValue=function(Z){return this.dehancer!==void 0?this.dehancer(Z):Z},L.prototype.set=function(Z){this.value,(Z=this.prepareNewValue(Z))!==Sn.UNCHANGED&&this.setNewValue(Z)},L.prototype.prepareNewValue=function(Z){if(qt(this),Ja(this)){var fe=vo(this,{object:this,type:"update",newValue:Z});if(!fe)return Sn.UNCHANGED;Z=fe.newValue}return Z=this.enhancer(Z,this.value,this.name),this.equals(this.value,Z)?Sn.UNCHANGED:Z},L.prototype.setNewValue=function(Z){var fe=this.value;this.value=Z,this.reportChanged(),Ua(this)&&ha(this,{type:"update",object:this,newValue:Z,oldValue:fe})},L.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},L.prototype.intercept=function(Z){return El(this,Z)},L.prototype.observe=function(Z,fe){return fe&&Z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Bl(this,Z)},L.prototype.toJSON=function(){return this.get()},L.prototype.toString=function(){return this.name+"["+this.value+"]"},L.prototype.valueOf=function(){return B(this.get())},L.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},L})(V),sr=M("ObservableValue",In),wo=(function(){function R(L){this.dependenciesState=ae.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new kt(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=re.NONE,v(L.get,"missing option for computed: get"),this.derivation=L.get,this.name=L.name||"ComputedValue@"+f(),L.set&&(this.setter=yo(this.name+"-setter",L.set)),this.equals=L.equals||(L.compareStructural||L.struct?Y.structural:Y.default),this.scope=L.context,this.requiresReaction=!!L.requiresReaction,this.keepAlive=!!L.keepAlive}return R.prototype.onBecomeStale=function(){(function(L){L.lowestObserverState===ae.UP_TO_DATE&&(L.lowestObserverState=ae.POSSIBLY_STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.dependenciesState=ae.POSSIBLY_STALE,Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale())})))})(this)},R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.get=function(){this.isComputing&&h("Cycle detected in computation "+this.name+": "+this.derivation),Sn.inBatch!==0||this.observers.size!==0||this.keepAlive?(gl(this),Gt(this)&&this.trackAndCompute()&&(function(Z){Z.lowestObserverState!==ae.STALE&&(Z.lowestObserverState=ae.STALE,Z.observers.forEach((function(fe){fe.dependenciesState===ae.POSSIBLY_STALE?fe.dependenciesState=ae.STALE:fe.dependenciesState===ae.UP_TO_DATE&&(Z.lowestObserverState=ae.UP_TO_DATE)})))})(this)):Gt(this)&&(this.warnAboutUntrackedRead(),Ui(),this.value=this.computeValue(!1),gr());var L=this.value;if(Rt(L))throw L.cause;return L},R.prototype.peek=function(){var L=this.computeValue(!1);if(Rt(L))throw L.cause;return L},R.prototype.set=function(L){if(this.setter){v(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,L)}finally{this.isRunningSetter=!1}}else v(!1,!1)},R.prototype.trackAndCompute=function(){var L=this.value,Z=this.dependenciesState===ae.NOT_TRACKING,fe=this.computeValue(!0),Re=Z||Rt(L)||Rt(fe)||!this.equals(L,fe);return Re&&(this.value=fe),Re},R.prototype.computeValue=function(L){var Z;if(this.isComputing=!0,Sn.computationDepth++,L)Z=On(this,this.derivation,this.scope);else if(Sn.disableErrorBoundaries===!0)Z=this.derivation.call(this.scope);else try{Z=this.derivation.call(this.scope)}catch(fe){Z=new kt(fe)}return Sn.computationDepth--,this.isComputing=!1,Z},R.prototype.suspend=function(){this.keepAlive||(ke(this),this.value=void 0)},R.prototype.observe=function(L,Z){var fe=this,Re=!0,lt=void 0;return ht((function(){var It=fe.get();if(!Re||Z){var bn=Le();L({type:"update",object:fe,newValue:It,oldValue:lt}),dt(bn)}Re=!1,lt=It}))},R.prototype.warnAboutUntrackedRead=function(){},R.prototype.toJSON=function(){return this.get()},R.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},R.prototype.valueOf=function(){return B(this.get())},R.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},R})(),oo=M("ComputedValue",wo),ta=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Ca={};function Yi(){return typeof window<"u"?window:a!==void 0?a:typeof self<"u"?self:Ca}var fa=!0,Ka=!1,Sn=(function(){var R=Yi();return R.__mobxInstanceCount>0&&!R.__mobxGlobals&&(fa=!1),R.__mobxGlobals&&R.__mobxGlobals.version!==new ta().version&&(fa=!1),fa?R.__mobxGlobals?(R.__mobxInstanceCount+=1,R.__mobxGlobals.UNCHANGED||(R.__mobxGlobals.UNCHANGED={}),R.__mobxGlobals):(R.__mobxInstanceCount=1,R.__mobxGlobals=new ta):(setTimeout((function(){Ka||h("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ta)})();function Ts(R,L){R.observers.add(L),R.lowestObserverState>L.dependenciesState&&(R.lowestObserverState=L.dependenciesState)}function Oo(R,L){R.observers.delete(L),R.observers.size===0&&es(R)}function es(R){R.isPendingUnobservation===!1&&(R.isPendingUnobservation=!0,Sn.pendingUnobservations.push(R))}function Ui(){Sn.inBatch++}function gr(){if(--Sn.inBatch==0){yl();for(var R=Sn.pendingUnobservations,L=0;L<R.length;L++){var Z=R[L];Z.isPendingUnobservation=!1,Z.observers.size===0&&(Z.isBeingObserved&&(Z.isBeingObserved=!1,Z.onBecomeUnobserved()),Z instanceof wo&&Z.suspend())}Sn.pendingUnobservations=[]}}function gl(R){var L=Sn.trackingDerivation;return L!==null?(L.runId!==R.lastAccessedBy&&(R.lastAccessedBy=L.runId,L.newObserving[L.unboundDepsCount++]=R,R.isBeingObserved||(R.isBeingObserved=!0,R.onBecomeObserved())),!0):(R.observers.size===0&&Sn.inBatch>0&&es(R),!1)}function pa(R,L){if(R.isTracing===re.BREAK){var Z=[];qi(vi(R),Z,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+R.name+`'
|
||
|
||
You are entering this break point because derivation '`+R.name+"' is being traced and '"+L.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(R instanceof wo?R.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+Z.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function qi(R,L,Z){L.length>=1e3?L.push("(and many more)"):(L.push(""+new Array(Z).join(" ")+R.name),R.dependencies&&R.dependencies.forEach((function(fe){return qi(fe,L,Z+1)})))}var Na=(function(){function R(L,Z,fe,Re){L===void 0&&(L="Reaction@"+f()),Re===void 0&&(Re=!1),this.name=L,this.onInvalidate=Z,this.errorHandler=fe,this.requiresObservable=Re,this.observing=[],this.newObserving=[],this.dependenciesState=ae.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=re.NONE}return R.prototype.onBecomeStale=function(){this.schedule()},R.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Sn.pendingReactions.push(this),yl())},R.prototype.isScheduled=function(){return this._isScheduled},R.prototype.runReaction=function(){if(!this.isDisposed){if(Ui(),this._isScheduled=!1,Gt(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(L){this.reportExceptionInDerivation(L)}}gr()}},R.prototype.track=function(L){if(!this.isDisposed){Ui(),this._isRunning=!0;var Z=On(this,L,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ke(this),Rt(Z)&&this.reportExceptionInDerivation(Z.cause),gr()}},R.prototype.reportExceptionInDerivation=function(L){var Z=this;if(this.errorHandler)this.errorHandler(L,this);else{if(Sn.disableErrorBoundaries)throw L;Sn.suppressReactionErrors,Sn.globalReactionErrorHandlers.forEach((function(fe){return fe(L,Z)}))}},R.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ui(),ke(this),gr()))},R.prototype.getDisposer=function(){var L=this.dispose.bind(this);return L[I]=this,L},R.prototype.toString=function(){return"Reaction["+this.name+"]"},R.prototype.trace=function(L){L===void 0&&(L=!1),(function(){for(var Z=[],fe=0;fe<arguments.length;fe++)Z[fe]=arguments[fe];var Re=!1;typeof Z[Z.length-1]=="boolean"&&(Re=Z.pop());var lt=Mo(Z);if(!lt)return h(!1);lt.isTracing,re.NONE,lt.isTracing=Re?re.BREAK:re.LOG})(this,L)},R})(),al=function(R){return R()};function yl(){Sn.inBatch>0||Sn.isRunningReactions||al(Cs)}function Cs(){Sn.isRunningReactions=!0;for(var R=Sn.pendingReactions,L=0;R.length>0;){++L==100&&R.splice(0);for(var Z=R.splice(0),fe=0,Re=Z.length;fe<Re;fe++)Z[fe].runReaction()}Sn.isRunningReactions=!1}var _l=M("Reaction",Na);function ts(R){var L=al;al=function(Z){return R((function(){return L(Z)}))}}function ve(R){return function(){}}function mt(){h(!1)}function cn(R){return function(L,Z,fe){if(fe){if(fe.value)return{value:yo(R,fe.value),enumerable:!1,configurable:!0,writable:!0};var Re=fe.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return yo(R,Re.call(this))}}}return Kn(R).apply(this,arguments)}}function Kn(R){return function(L,Z,fe){Object.defineProperty(L,Z,{configurable:!0,enumerable:!1,get:function(){},set:function(Re){S(this,Z,br(R,Re))}})}}var br=function(R,L,Z,fe){return arguments.length===1&&typeof R=="function"?yo(R.name||"<unnamed action>",R):arguments.length===2&&typeof L=="function"?yo(R,L):arguments.length===1&&typeof R=="string"?cn(R):fe!==!0?cn(L).apply(null,arguments):void S(R,L,yo(R.name||L,Z.value,this))};function so(R,L){return ho(typeof R=="string"?R:R.name||"<unnamed action>",typeof R=="function"?R:L,this,void 0)}function si(R){return typeof R=="function"&&R.isMobxAction===!0}function ye(R,L,Z){S(R,L,yo(L,Z.bind(R)))}function ht(R,L){L===void 0&&(L=l);var Z,fe=L&&L.name||R.name||"Autorun@"+f();if(!L.scheduler&&!L.delay)Z=new Na(fe,(function(){this.track(It)}),L.onError,L.requiresObservable);else{var Re=Rn(L),lt=!1;Z=new Na(fe,(function(){lt||(lt=!0,Re((function(){lt=!1,Z.isDisposed||Z.track(It)})))}),L.onError,L.requiresObservable)}function It(){R(Z)}return Z.schedule(),Z.getDisposer()}br.bound=function(R,L,Z,fe){return fe===!0?(ye(R,L,Z.value),null):Z?{configurable:!0,enumerable:!1,get:function(){return ye(this,L,Z.value||Z.initializer.call(this)),this[L]},set:mt}:{enumerable:!1,configurable:!0,set:function(Re){ye(this,L,Re)},get:function(){}}};var fn=function(R){return R()};function Rn(R){return R.scheduler?R.scheduler:R.delay?function(L){return setTimeout(L,R.delay)}:fn}function Cn(R,L,Z){Z===void 0&&(Z=l);var fe,Re,lt,It=Z.name||"Reaction@"+f(),bn=br(It,Z.onError?(fe=Z.onError,Re=L,function(){try{return Re.apply(this,arguments)}catch(wi){fe.call(this,wi)}}):L),Jn=!Z.scheduler&&!Z.delay,no=Rn(Z),$n=!0,Do=!1,Kr=Z.compareStructural?Y.structural:Z.equals||Y.default,So=new Na(It,(function(){$n||Jn?ul():Do||(Do=!0,no(ul))}),Z.onError,Z.requiresObservable);function ul(){if(Do=!1,!So.isDisposed){var wi=!1;So.track((function(){var el=R(So);wi=$n||!Kr(lt,el),lt=el})),$n&&Z.fireImmediately&&bn(lt,So),$n||wi!==!0||bn(lt,So),$n&&($n=!1)}}return So.schedule(),So.getDisposer()}function nr(R,L,Z){return Mn("onBecomeUnobserved",R,L,Z)}function Mn(R,L,Z,fe){var Re=typeof fe=="function"?sl(L,Z):sl(L),lt=typeof fe=="function"?fe:Z,It=R+"Listeners";return Re[It]?Re[It].add(lt):Re[It]=new Set([lt]),typeof Re[R]!="function"?h(!1):function(){var bn=Re[It];bn&&(bn.delete(lt),bn.size===0&&delete Re[It])}}function or(R){var L=R.enforceActions,Z=R.computedRequiresReaction,fe=R.computedConfigurable,Re=R.disableErrorBoundaries,lt=R.reactionScheduler,It=R.reactionRequiresObservable,bn=R.observableRequiresReaction;if(R.isolateGlobalState===!0&&((Sn.pendingReactions.length||Sn.inBatch||Sn.isRunningReactions)&&h("isolateGlobalState should be called before MobX is running any reactions"),Ka=!0,fa&&(--Yi().__mobxInstanceCount==0&&(Yi().__mobxGlobals=void 0),Sn=new ta)),L!==void 0){var Jn=void 0;switch(L){case!0:case"observed":Jn=!0;break;case!1:case"never":Jn=!1;break;case"strict":case"always":Jn="strict";break;default:h("Invalid value for 'enforceActions': '"+L+"', expected 'never', 'always' or 'observed'")}Sn.enforceActions=Jn,Sn.allowStateChanges=Jn!==!0&&Jn!=="strict"}Z!==void 0&&(Sn.computedRequiresReaction=!!Z),It!==void 0&&(Sn.reactionRequiresObservable=!!It),bn!==void 0&&(Sn.observableRequiresReaction=!!bn,Sn.allowStateReads=!Sn.observableRequiresReaction),fe!==void 0&&(Sn.computedConfigurable=!!fe),Re!==void 0&&(Sn.disableErrorBoundaries=!!Re),lt&&ts(lt)}function lr(R,L,Z,fe){var Re=qr(fe=we(fe));return Be(R),ll(R,fe.name,Re.enhancer),L&&na(R,L,Z,Re),R}function qr(R){return R.defaultDecorator||(R.deep===!1?pt:$e)}function na(R,L,Z,fe){var Re,lt;Ui();try{var It=F(L);try{for(var bn=J(It),Jn=bn.next();!Jn.done;Jn=bn.next()){var no=Jn.value,$n=Object.getOwnPropertyDescriptor(L,no),Do=(Z&&no in Z?Z[no]:$n.get?je:fe)(R,no,$n,!0);Do&&Object.defineProperty(R,no,Do)}}catch(Kr){Re={error:Kr}}finally{try{Jn&&!Jn.done&&(lt=bn.return)&<.call(bn)}finally{if(Re)throw Re.error}}}finally{gr()}}function vi(R,L){return bl(sl(R,L))}function bl(R){var L,Z,fe={name:R.name};return R.observing&&R.observing.length>0&&(fe.dependencies=(L=R.observing,Z=[],L.forEach((function(Re){Z.indexOf(Re)===-1&&Z.push(Re)})),Z).map(bl)),fe}var Vi=0;function Ns(){this.message="FLOW_CANCELLED"}function Fl(R){arguments.length!==1&&h("Flow expects 1 argument and cannot be used as decorator");var L=R.name||"<unnamed flow>";return function(){var Z,fe=this,Re=arguments,lt=++Vi,It=br(L+" - runid: "+lt+" - init",R).apply(fe,Re),bn=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.next).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function So(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.throw).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function ul(wi){if(!wi||typeof wi.then!="function")return wi.done?no(wi.value):(bn=Promise.resolve(wi.value)).then(Kr,So);wi.then(ul,$n)}Z=$n,Kr(void 0)}));return Jn.cancel=br(L+" - runid: "+lt+" - cancel",(function(){try{bn&&Ro(bn);var no=It.return(void 0),$n=Promise.resolve(no.value);$n.then(E,E),Ro($n),Z(new Ns)}catch(Do){Z(Do)}})),Jn}}function Ro(R){typeof R.cancel=="function"&&R.cancel()}function La(R,L){if(R==null)return!1;if(L!==void 0){if(ia(R)===!1||!R[I].values.has(L))return!1;var Z=sl(R,L);return oo(Z)}return oo(R)}function id(R){return arguments.length>1?h(!1):La(R)}function _u(R,L){return typeof L!="string"?h(!1):La(R,L)}function Ia(R,L){return R!=null&&(L!==void 0?!!ia(R)&&R[I].values.has(L):ia(R)||!!R[I]||z(R)||_l(R)||oo(R))}function ra(R){return arguments.length!==1&&h(!1),Ia(R)}function wl(R){return ia(R)?R[I].getKeys():Wi(R)||Ki(R)?Array.from(R.keys()):xl(R)?R.map((function(L,Z){return Z})):h(!1)}function qo(R){return ia(R)?wl(R).map((function(L){return R[L]})):Wi(R)?wl(R).map((function(L){return R.get(L)})):Ki(R)?Array.from(R.values()):xl(R)?R.slice():h(!1)}function Uh(R){return ia(R)?wl(R).map((function(L){return[L,R[L]]})):Wi(R)?wl(R).map((function(L){return[L,R.get(L)]})):Ki(R)?Array.from(R.entries()):xl(R)?R.map((function(L,Z){return[Z,L]})):h(!1)}function Fa(R,L,Z){if(arguments.length!==2||Ki(R))if(ia(R)){var fe=R[I],Re=fe.values.get(L);Re?fe.write(L,Z):fe.addObservableProp(L,Z,fe.defaultEnhancer)}else if(Wi(R))R.set(L,Z);else if(Ki(R))R.add(L);else{if(!xl(R))return h(!1);typeof L!="number"&&(L=parseInt(L,10)),v(L>=0,"Not a valid index: '"+L+"'"),Ui(),L>=R.length&&(R.length=L+1),R[L]=Z,gr()}else{Ui();var lt=L;try{for(var It in lt)Fa(R,It,lt[It])}finally{gr()}}}function gp(R,L,Z,fe){return typeof Z=="function"?(function(Re,lt,It,bn){return ka(Re,lt).observe(It,bn)})(R,L,Z,fe):(function(Re,lt,It){return ka(Re).observe(lt,It)})(R,L,Z)}Ns.prototype=Object.create(Error.prototype);var yp={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ba(R,L,Z,fe){return fe.detectCycles&&R.set(L,Z),Z}function Za(R,L,Z){if(!L.recurseEverything&&!ra(R)||typeof R!="object")return R;if(R===null)return null;if(R instanceof Date)return R;if(sr(R))return Za(R.get(),L,Z);if(ra(R)&&wl(R),L.detectCycles===!0&&R!==null&&Z.has(R))return Z.get(R);if(xl(R)||Array.isArray(R)){var fe=Ba(Z,R,[],L),Re=R.map((function(Kr){return Za(Kr,L,Z)}));fe.length=Re.length;for(var lt=0,It=Re.length;lt<It;lt++)fe[lt]=Re[lt];return fe}if(Ki(R)||Object.getPrototypeOf(R)===Set.prototype){if(L.exportMapsAsObjects===!1){var bn=Ba(Z,R,new Set,L);return R.forEach((function(Kr){bn.add(Za(Kr,L,Z))})),bn}var Jn=Ba(Z,R,[],L);return R.forEach((function(Kr){Jn.push(Za(Kr,L,Z))})),Jn}if(Wi(R)||Object.getPrototypeOf(R)===Map.prototype){if(L.exportMapsAsObjects===!1){var no=Ba(Z,R,new Map,L);return R.forEach((function(Kr,So){no.set(So,Za(Kr,L,Z))})),no}var $n=Ba(Z,R,{},L);return R.forEach((function(Kr,So){$n[So]=Za(Kr,L,Z)})),$n}var Do=Ba(Z,R,{},L);return D(R).forEach((function(Kr){Do[Kr]=Za(R[Kr],L,Z)})),Do}function rf(R,L){var Z;return typeof L=="boolean"&&(L={detectCycles:L}),L||(L=yp),L.detectCycles=L.detectCycles===void 0?L.recurseEverything===!0:L.detectCycles===!0,L.detectCycles&&(Z=new Map),Za(R,L,Z)}function Mo(R){switch(R.length){case 0:return Sn.trackingDerivation;case 1:return sl(R[0]);case 2:return sl(R[0],R[1])}}function oa(R,L){L===void 0&&(L=void 0),Ui();try{return R.apply(L)}finally{gr()}}function ad(R,L,Z){return arguments.length===1||L&&typeof L=="object"?of(R,L):_p(R,L,Z||{})}function _p(R,L,Z){var fe;typeof Z.timeout=="number"&&(fe=setTimeout((function(){if(!lt[I].isDisposed){lt();var It=new Error("WHEN_TIMEOUT");if(!Z.onError)throw It;Z.onError(It)}}),Z.timeout)),Z.name=Z.name||"When@"+f();var Re=yo(Z.name+"-effect",L),lt=ht((function(It){R()&&(It.dispose(),fe&&clearTimeout(fe),Re())}),Z);return lt}function of(R,L){var Z,fe=new Promise((function(Re,lt){var It=_p(R,Re,Q(Q({},L),{onError:lt}));Z=function(){It(),lt("WHEN_CANCELLED")}}));return fe.cancel=Z,fe}function ld(R){return R[I]}function ns(R){return typeof R=="string"||typeof R=="number"||typeof R=="symbol"}var $a={has:function(R,L){if(L===I||L==="constructor"||L===Ae)return!0;var Z=ld(R);return ns(L)?Z.has(L):L in R},get:function(R,L){if(L===I||L==="constructor"||L===Ae)return R[L];var Z=ld(R),fe=Z.values.get(L);if(fe instanceof V){var Re=fe.get();return Re===void 0&&Z.has(L),Re}return ns(L)&&Z.has(L),R[L]},set:function(R,L,Z){return!!ns(L)&&(Fa(R,L,Z),!0)},deleteProperty:function(R,L){return!!ns(L)&&(ld(R).remove(L),!0)},ownKeys:function(R){return ld(R).keysAtom.reportObserved(),Reflect.ownKeys(R)},preventExtensions:function(R){return h("Dynamic observable objects cannot be frozen"),!1}};function bu(R){var L=new Proxy(R,$a);return R[I].proxy=L,L}function Ja(R){return R.interceptors!==void 0&&R.interceptors.length>0}function El(R,L){var Z=R.interceptors||(R.interceptors=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function vo(R,L){var Z=Le();try{for(var fe=Se(R.interceptors||[]),Re=0,lt=fe.length;Re<lt&&(v(!(L=fe[Re](L))||L.type,"Intercept handlers should return nothing or a change object"),L);Re++);return L}finally{dt(Z)}}function Ua(R){return R.changeListeners!==void 0&&R.changeListeners.length>0}function Bl(R,L){var Z=R.changeListeners||(R.changeListeners=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function ha(R,L){var Z=Le(),fe=R.changeListeners;if(fe){for(var Re=0,lt=(fe=fe.slice()).length;Re<lt;Re++)fe[Re](L);dt(Z)}}var wu={get:function(R,L){return L===I?R[I]:L==="length"?R[I].getArrayLength():typeof L=="number"?ui.get.call(R,L):typeof L!="string"||isNaN(L)?ui.hasOwnProperty(L)?ui[L]:R[L]:ui.get.call(R,parseInt(L))},set:function(R,L,Z){return L==="length"&&R[I].setArrayLength(Z),typeof L=="number"&&ui.set.call(R,L,Z),typeof L=="symbol"||isNaN(L)?R[L]=Z:ui.set.call(R,parseInt(L),Z),!0},preventExtensions:function(R){return h("Observable arrays cannot be frozen"),!1}};function Ks(R,L,Z,fe){Z===void 0&&(Z="ObservableArray@"+f()),fe===void 0&&(fe=!1);var Re,lt,It,bn=new $l(Z,L,fe);Re=bn.values,lt=I,It=bn,Object.defineProperty(Re,lt,{enumerable:!1,writable:!1,configurable:!0,value:It});var Jn=new Proxy(bn.values,wu);if(bn.proxy=Jn,R&&R.length){var no=ut(!0);bn.spliceWithArray(0,0,R),vn(no)}return Jn}var $l=(function(){function R(L,Z,fe){this.owned=fe,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new V(L||"ObservableArray@"+f()),this.enhancer=function(Re,lt){return Z(Re,lt,L+"[..]")}}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.dehanceValues=function(L){return this.dehancer!==void 0&&L.length>0?L.map(this.dehancer):L},R.prototype.intercept=function(L){return El(this,L)},R.prototype.observe=function(L,Z){return Z===void 0&&(Z=!1),Z&&L({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Bl(this,L)},R.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},R.prototype.setArrayLength=function(L){if(typeof L!="number"||L<0)throw new Error("[mobx.array] Out of range: "+L);var Z=this.values.length;if(L!==Z)if(L>Z){for(var fe=new Array(L-Z),Re=0;Re<L-Z;Re++)fe[Re]=void 0;this.spliceWithArray(Z,0,fe)}else this.spliceWithArray(L,Z-L)},R.prototype.updateArrayLength=function(L,Z){if(L!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=Z},R.prototype.spliceWithArray=function(L,Z,fe){var Re=this;qt(this.atom);var lt=this.values.length;if(L===void 0?L=0:L>lt?L=lt:L<0&&(L=Math.max(0,lt+L)),Z=arguments.length===1?lt-L:Z==null?0:Math.max(0,Math.min(Z,lt-L)),fe===void 0&&(fe=s),Ja(this)){var It=vo(this,{object:this.proxy,type:"splice",index:L,removedCount:Z,added:fe});if(!It)return s;Z=It.removedCount,fe=It.added}fe=fe.length===0?fe:fe.map((function(Jn){return Re.enhancer(Jn,void 0)}));var bn=this.spliceItemsIntoValues(L,Z,fe);return Z===0&&fe.length===0||this.notifyArraySplice(L,fe,bn),this.dehanceValues(bn)},R.prototype.spliceItemsIntoValues=function(L,Z,fe){var Re;if(fe.length<1e4)return(Re=this.values).splice.apply(Re,Se([L,Z],fe));var lt=this.values.slice(L,L+Z);return this.values=this.values.slice(0,L).concat(fe,this.values.slice(L+Z)),lt},R.prototype.notifyArrayChildUpdate=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"update",index:L,newValue:Z,oldValue:fe}:null;this.atom.reportChanged(),lt&&ha(this,It)},R.prototype.notifyArraySplice=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"splice",index:L,removed:fe,added:Z,removedCount:fe.length,addedCount:Z.length}:null;this.atom.reportChanged(),lt&&ha(this,It)},R})(),ui={intercept:function(R){return this[I].intercept(R)},observe:function(R,L){return L===void 0&&(L=!1),this[I].observe(R,L)},clear:function(){return this.splice(0)},replace:function(R){var L=this[I];return L.spliceWithArray(0,L.values.length,R)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(R,L){for(var Z=[],fe=2;fe<arguments.length;fe++)Z[fe-2]=arguments[fe];var Re=this[I];switch(arguments.length){case 0:return[];case 1:return Re.spliceWithArray(R);case 2:return Re.spliceWithArray(R,L)}return Re.spliceWithArray(R,L,Z)},spliceWithArray:function(R,L,Z){return this[I].spliceWithArray(R,L,Z)},push:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(Z.values.length,0,R),Z.values.length},pop:function(){return this.splice(Math.max(this[I].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(0,0,R),Z.values.length},reverse:function(){var R=this.slice();return R.reverse.apply(R,arguments)},sort:function(R){var L=this.slice();return L.sort.apply(L,arguments)},remove:function(R){var L=this[I],Z=L.dehanceValues(L.values).indexOf(R);return Z>-1&&(this.splice(Z,1),!0)},get:function(R){var L=this[I];if(L&&R<L.values.length)return L.atom.reportObserved(),L.dehanceValue(L.values[R])},set:function(R,L){var Z=this[I],fe=Z.values;if(R<fe.length){qt(Z.atom);var Re=fe[R];if(Ja(Z)){var lt=vo(Z,{type:"update",object:Z.proxy,index:R,newValue:L});if(!lt)return;L=lt.newValue}(L=Z.enhancer(L,Re))!==Re&&(fe[R]=L,Z.notifyArrayChildUpdate(R,L,Re))}else{if(R!==fe.length)throw new Error("[mobx.array] Index out of bounds, "+R+" is larger than "+fe.length);Z.spliceWithArray(R,0,[L])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(){var L=this[I];L.atom.reportObserved();var Z=L.dehanceValues(L.values);return Z[R].apply(Z,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(L,Z){var fe=this,Re=this[I];return Re.atom.reportObserved(),Re.dehanceValues(Re.values)[R]((function(lt,It){return L.call(Z,lt,It,fe)}),Z)})})),["reduce","reduceRight"].forEach((function(R){ui[R]=function(){var L=this,Z=this[I];Z.atom.reportObserved();var fe=arguments[0];return arguments[0]=function(Re,lt,It){return lt=Z.dehanceValue(lt),fe(Re,lt,It,L)},Z.values[R].apply(Z.values,arguments)}}));var lc,rs=M("ObservableArrayAdministration",$l);function xl(R){return O(R)&&rs(R[I])}var af,Vh={},lf=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableMap@"+f()),this.enhancer=Z,this.name=fe,this[lc]=Vh,this._keysAtom=X(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(L)}return R.prototype._has=function(L){return this._data.has(L)},R.prototype.has=function(L){var Z=this;if(!Sn.trackingDerivation)return this._has(L);var fe=this._hasMap.get(L);if(!fe){var Re=fe=new In(this._has(L),Ze,this.name+"."+P(L)+"?",!1);this._hasMap.set(L,Re),nr(Re,(function(){return Z._hasMap.delete(L)}))}return fe.get()},R.prototype.set=function(L,Z){var fe=this._has(L);if(Ja(this)){var Re=vo(this,{type:fe?"update":"add",object:this,newValue:Z,name:L});if(!Re)return this;Z=Re.newValue}return fe?this._updateValue(L,Z):this._addValue(L,Z),this},R.prototype.delete=function(L){var Z=this;if(qt(this._keysAtom),Ja(this)&&!(Re=vo(this,{type:"delete",object:this,name:L})))return!1;if(this._has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:this._data.get(L).value,name:L}:null;return oa((function(){Z._keysAtom.reportChanged(),Z._updateHasMapEntry(L,!1),Z._data.get(L).setNewValue(void 0),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},R.prototype._updateHasMapEntry=function(L,Z){var fe=this._hasMap.get(L);fe&&fe.setNewValue(Z)},R.prototype._updateValue=function(L,Z){var fe=this._data.get(L);if((Z=fe.prepareNewValue(Z))!==Sn.UNCHANGED){var Re=Ua(this),lt=Re?{type:"update",object:this,oldValue:fe.value,name:L,newValue:Z}:null;fe.setNewValue(Z),Re&&ha(this,lt)}},R.prototype._addValue=function(L,Z){var fe=this;qt(this._keysAtom),oa((function(){var It=new In(Z,fe.enhancer,fe.name+"."+P(L),!1);fe._data.set(L,It),Z=It.value,fe._updateHasMapEntry(L,!0),fe._keysAtom.reportChanged()}));var Re=Ua(this),lt=Re?{type:"add",object:this,name:L,newValue:Z}:null;Re&&ha(this,lt)},R.prototype.get=function(L){return this.has(L)?this.dehanceValue(this._data.get(L).get()):this.dehanceValue(void 0)},R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},R.prototype.values=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:L.get(lt)}}})},R.prototype.entries=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:[lt,L.get(lt)]}}})},R.prototype[lc=I,Symbol.iterator]=function(){return this.entries()},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var bn=ie(It.value,2),Jn=bn[0],no=bn[1];L.call(Z,no,Jn,this)}}catch($n){fe={error:$n}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},R.prototype.merge=function(L){var Z=this;return Wi(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{w(L)?D(L).forEach((function(Re){return Z.set(Re,L[Re])})):Array.isArray(L)?L.forEach((function(Re){var lt=ie(Re,2),It=lt[0],bn=lt[1];return Z.set(It,bn)})):T(L)?(L.constructor!==Map&&h("Cannot initialize from classes that inherit from Map: "+L.constructor.name),L.forEach((function(Re,lt){return Z.set(lt,Re)}))):L!=null&&h("Cannot initialize map from "+L)}finally{vn(fe)}})),this},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L.keys()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.replace=function(L){var Z=this;return oa((function(){var fe,Re,lt,It,bn=(function(Zi){if(T(Zi)||Wi(Zi))return Zi;if(Array.isArray(Zi))return new Map(Zi);if(w(Zi)){var Js=new Map;for(var Rs in Zi)Js.set(Rs,Zi[Rs]);return Js}return h("Cannot convert to map from '"+Zi+"'")})(L),Jn=new Map,no=!1;try{for(var $n=J(Z._data.keys()),Do=$n.next();!Do.done;Do=$n.next()){var Kr=Do.value;if(!bn.has(Kr))if(Z.delete(Kr))no=!0;else{var So=Z._data.get(Kr);Jn.set(Kr,So)}}}catch(Zi){fe={error:Zi}}finally{try{Do&&!Do.done&&(Re=$n.return)&&Re.call($n)}finally{if(fe)throw fe.error}}try{for(var ul=J(bn.entries()),wi=ul.next();!wi.done;wi=ul.next()){var el=ie(wi.value,2),ks=(Kr=el[0],So=el[1],Z._data.has(Kr));if(Z.set(Kr,So),Z._data.has(Kr)){var Ps=Z._data.get(Kr);Jn.set(Kr,Ps),ks||(no=!0)}}}catch(Zi){lt={error:Zi}}finally{try{wi&&!wi.done&&(It=ul.return)&&It.call(ul)}finally{if(lt)throw lt.error}}if(!no)if(Z._data.size!==Jn.size)Z._keysAtom.reportChanged();else for(var Zs=Z._data.keys(),Eu=Jn.keys(),is=Zs.next(),xu=Eu.next();!is.done;){if(is.value!==xu.value){Z._keysAtom.reportChanged();break}is=Zs.next(),xu=Eu.next()}Z._data=Jn})),this},Object.defineProperty(R.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.prototype.toPOJO=function(){var L,Z,fe={};try{for(var Re=J(this),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),bn=It[0],Jn=It[1];fe[typeof bn=="symbol"?bn:P(bn)]=Jn}}catch(no){L={error:no}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R.prototype.toJS=function(){return new Map(this)},R.prototype.toJSON=function(){return this.toPOJO()},R.prototype.toString=function(){var L=this;return this.name+"[{ "+Array.from(this.keys()).map((function(Z){return P(Z)+": "+L.get(Z)})).join(", ")+" }]"},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R})(),Wi=M("ObservableMap",lf),sc={},os=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableSet@"+f()),this.name=fe,this[af]=sc,this._data=new Set,this._atom=X(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(Re,lt){return Z(Re,lt,fe)},L&&this.replace(L)}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L._data.values()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var bn=It.value;L.call(Z,bn,bn,this)}}catch(Jn){fe={error:Jn}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},Object.defineProperty(R.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.prototype.add=function(L){var Z=this;if(qt(this._atom),Ja(this)&&!(Re=vo(this,{type:"add",object:this,newValue:L})))return this;if(!this.has(L)){oa((function(){Z._data.add(Z.enhancer(L,void 0)),Z._atom.reportChanged()}));var fe=Ua(this),Re=fe?{type:"add",object:this,newValue:L}:null;fe&&ha(this,Re)}return this},R.prototype.delete=function(L){var Z=this;if(Ja(this)&&!(Re=vo(this,{type:"delete",object:this,oldValue:L})))return!1;if(this.has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:L}:null;return oa((function(){Z._atom.reportChanged(),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},R.prototype.has=function(L){return this._atom.reportObserved(),this._data.has(this.dehanceValue(L))},R.prototype.entries=function(){var L=0,Z=Array.from(this.keys()),fe=Array.from(this.values());return mo({next:function(){var Re=L;return L+=1,Re<fe.length?{value:[Z[Re],fe[Re]],done:!1}:{done:!0}}})},R.prototype.keys=function(){return this.values()},R.prototype.values=function(){this._atom.reportObserved();var L=this,Z=0,fe=Array.from(this._data.values());return mo({next:function(){return Z<fe.length?{value:L.dehanceValue(fe[Z++]),done:!1}:{done:!0}}})},R.prototype.replace=function(L){var Z=this;return Ki(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{Array.isArray(L)||$(L)?(Z.clear(),L.forEach((function(Re){return Z.add(Re)}))):L!=null&&h("Cannot initialize set from "+L)}finally{vn(fe)}})),this},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R.prototype.toJS=function(){return new Set(this)},R.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},R.prototype[af=I,Symbol.iterator]=function(){return this.values()},R})(),Ki=M("ObservableSet",os),sf=(function(){function R(L,Z,fe,Re){Z===void 0&&(Z=new Map),this.target=L,this.values=Z,this.name=fe,this.defaultEnhancer=Re,this.keysAtom=new V(fe+".keys")}return R.prototype.read=function(L){return this.values.get(L).get()},R.prototype.write=function(L,Z){var fe=this.target,Re=this.values.get(L);if(Re instanceof wo)Re.set(Z);else{if(Ja(this)){if(!(It=vo(this,{type:"update",object:this.proxy||fe,name:L,newValue:Z})))return;Z=It.newValue}if((Z=Re.prepareNewValue(Z))!==Sn.UNCHANGED){var lt=Ua(this),It=lt?{type:"update",object:this.proxy||fe,oldValue:Re.value,name:L,newValue:Z}:null;Re.setNewValue(Z),lt&&ha(this,It)}}},R.prototype.has=function(L){var Z=this.pendingKeys||(this.pendingKeys=new Map),fe=Z.get(L);if(fe)return fe.get();var Re=!!this.values.get(L);return fe=new In(Re,Ze,this.name+"."+P(L)+"?",!1),Z.set(L,fe),fe.get()},R.prototype.addObservableProp=function(L,Z,fe){fe===void 0&&(fe=this.defaultEnhancer);var Re=this.target;if(Ja(this)){var lt=vo(this,{object:this.proxy||Re,name:L,type:"add",newValue:Z});if(!lt)return;Z=lt.newValue}var It=new In(Z,fe,this.name+"."+P(L),!1);this.values.set(L,It),Z=It.value,Object.defineProperty(Re,L,(function(bn){return Ol[bn]||(Ol[bn]={configurable:!0,enumerable:!0,get:function(){return this[I].read(bn)},set:function(Jn){this[I].write(bn,Jn)}})})(L)),this.notifyPropertyAddition(L,Z)},R.prototype.addComputedProp=function(L,Z,fe){var Re,lt,It,bn=this.target;fe.name=fe.name||this.name+"."+P(Z),this.values.set(Z,new wo(fe)),(L===bn||(Re=L,lt=Z,!(It=Object.getOwnPropertyDescriptor(Re,lt))||It.configurable!==!1&&It.writable!==!1))&&Object.defineProperty(L,Z,(function(Jn){return sd[Jn]||(sd[Jn]={configurable:Sn.computedConfigurable,enumerable:!1,get:function(){return Va(this).read(Jn)},set:function(no){Va(this).write(Jn,no)}})})(Z))},R.prototype.remove=function(L){if(this.values.has(L)){var Z=this.target;if(Ja(this)&&!(Jn=vo(this,{object:this.proxy||Z,name:L,type:"remove"})))return;try{Ui();var fe=Ua(this),Re=!1,lt=this.values.get(L),It=lt&<.get();if(lt&<.set(void 0),this.keysAtom.reportChanged(),this.values.delete(L),this.pendingKeys){var bn=this.pendingKeys.get(L);bn&&bn.set(!1)}delete this.target[L];var Jn=fe?{type:"remove",object:this.proxy||Z,oldValue:It,name:L}:null;fe&&ha(this,Jn)}finally{gr()}}},R.prototype.illegalAccess=function(L,Z){},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R.prototype.notifyPropertyAddition=function(L,Z){var fe=Ua(this),Re=fe?{type:"add",object:this.proxy||this.target,name:L,newValue:Z}:null;if(fe&&ha(this,Re),this.pendingKeys){var lt=this.pendingKeys.get(L);lt&<.set(!0)}this.keysAtom.reportChanged()},R.prototype.getKeys=function(){var L,Z;this.keysAtom.reportObserved();var fe=[];try{for(var Re=J(this.values),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),bn=It[0];It[1]instanceof In&&fe.push(bn)}}catch(Jn){L={error:Jn}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R})();function ll(R,L,Z){if(L===void 0&&(L=""),Z===void 0&&(Z=le),Object.prototype.hasOwnProperty.call(R,I))return R[I];w(R)||(L=(R.constructor.name||"ObservableObject")+"@"+f()),L||(L="ObservableObject@"+f());var fe=new sf(R,new Map,P(L),Z);return S(R,I,fe),fe}var Ol=Object.create(null),sd=Object.create(null);function Va(R){var L=R[I];return L||(Be(R),R[I])}var Qa=M("ObservableObjectAdministration",sf);function ia(R){return!!O(R)&&(Be(R),Qa(R[I]))}function sl(R,L){if(typeof R=="object"&&R!==null){if(xl(R))return L!==void 0&&h(!1),R[I].atom;if(Ki(R))return R[I];if(Wi(R)){var Z=R;return L===void 0?Z._keysAtom:((fe=Z._data.get(L)||Z._hasMap.get(L))||h(!1),fe)}var fe;if(Be(R),L&&!R[I]&&R[L],ia(R))return L?((fe=R[I].values.get(L))||h(!1),fe):h(!1);if(z(R)||oo(R)||_l(R))return R}else if(typeof R=="function"&&_l(R[I]))return R[I];return h(!1)}function ka(R,L){return R||h("Expecting some object"),L!==void 0?ka(sl(R,L)):z(R)||oo(R)||_l(R)||Wi(R)||Ki(R)?R:(Be(R),R[I]?R[I]:void h(!1))}var Ct=Object.prototype.toString;function un(R,L,Z){return Z===void 0&&(Z=-1),dn(R,L,Z)}function dn(R,L,Z,fe,Re){if(R===L)return R!==0||1/R==1/L;if(R==null||L==null)return!1;if(R!=R)return L!=L;var lt=typeof R;if(lt!=="function"&<!=="object"&&typeof L!="object")return!1;var It=Ct.call(R);if(It!==Ct.call(L))return!1;switch(It){case"[object RegExp]":case"[object String]":return""+R==""+L;case"[object Number]":return+R!=+R?+L!=+L:+R==0?1/+R==1/L:+R==+L;case"[object Date]":case"[object Boolean]":return+R==+L;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(R)===Symbol.valueOf.call(L);case"[object Map]":case"[object Set]":Z>=0&&Z++}R=Gn(R),L=Gn(L);var bn=It==="[object Array]";if(!bn){if(typeof R!="object"||typeof L!="object")return!1;var Jn=R.constructor,no=L.constructor;if(Jn!==no&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof no=="function"&&no instanceof no)&&"constructor"in R&&"constructor"in L)return!1}if(Z===0)return!1;Z<0&&(Z=-1),Re=Re||[];for(var $n=(fe=fe||[]).length;$n--;)if(fe[$n]===R)return Re[$n]===L;if(fe.push(R),Re.push(L),bn){if(($n=R.length)!==L.length)return!1;for(;$n--;)if(!dn(R[$n],L[$n],Z-1,fe,Re))return!1}else{var Do=Object.keys(R),Kr=void 0;if($n=Do.length,Object.keys(L).length!==$n)return!1;for(;$n--;)if(!Wr(L,Kr=Do[$n])||!dn(R[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Gn(R){return xl(R)?R.slice():T(R)||Wi(R)||$(R)||Ki(R)?Array.from(R.entries()):R}function Wr(R,L){return Object.prototype.hasOwnProperty.call(R,L)}function mo(R){return R[Symbol.iterator]=ci,R}function ci(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ve,extras:{getDebugName:function(R,L){return(L!==void 0?sl(R,L):ia(R)||Wi(R)||Ki(R)?ka(R):sl(R)).name}},$mobx:I})}).call(this,r(163),r(68))},function(n,o,r){var i=r(113),a=r(42),s=r(179);i||a(Object.prototype,"toString",s,{unsafe:!0})},function(n,o,r){var i=r(41),a=r(100),s=r(80),l=r(58),f=r(116),h="Array Iterator",v=l.set,b=l.getterFor(h);n.exports=f(Array,"Array",(function(E,O){v(this,{type:h,target:i(E),index:0,kind:O})}),(function(){var E=b(this),O=E.target,w=E.kind,S=E.index++;return!O||S>=O.length?(E.target=void 0,{value:void 0,done:!0}):w=="keys"?{value:S,done:!1}:w=="values"?{value:O[S],done:!1}:{value:[S,O[S]],done:!1}}),"values"),s.Arguments=s.Array,a("keys"),a("values"),a("entries")},function(n,o,r){var i=r(16),a=r(7),s=r(46),l=r(76),f=r(34),h=r(15),v=r(71),b=r(36),E=r(108),O=r(18),w=r(35),S=r(96),M=r(30),T=r(33),$=r(54),D=r(87),P=r(32),B=r(40),F=r(41),I=r(86),V=r(39),z=r(69),X=r(60),Y=r(77),W=r(74),Q=r(139),J=r(112),ie=r(50),Se=r(38),Ae=r(84),Pe=r(98),De=r(42),ze=r(89),Ye=r(93),Be=r(72),Je=r(90),gt=r(28),le=r(140),Ze=r(141),pe=r(78),se=r(58),we=r(79).forEach,$e=Ye("hidden"),rt="Symbol",pt=gt("toPrimitive"),Lt=se.set,Jt=se.getterFor(rt),en=Object.prototype,zt=a.Symbol,it=zt&&zt.prototype,ae=a.TypeError,re=a.QObject,je=s("JSON","stringify"),vt=ie.f,q=Se.f,kt=Q.f,Rt=Ae.f,Gt=h([].push),Pn=ze("symbols"),qt=ze("op-symbols"),On=ze("string-to-symbol-registry"),ke=ze("symbol-to-string-registry"),Ke=ze("wks"),Le=!re||!re.prototype||!re.prototype.findChild,dt=b&&O((function(){return X(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a!=7}))?function(Nn,qn,rr){var ut=vt(en,qn);ut&&delete en[qn],q(Nn,qn,rr),ut&&Nn!==en&&q(en,qn,ut)}:q,At=function(Nn,qn){var rr=Pn[Nn]=X(it);return Lt(rr,{type:rt,tag:Nn,description:qn}),b||(rr.description=qn),rr},Tt=function(Nn,qn,rr){Nn===en&&Tt(qt,qn,rr),P(Nn);var ut=I(qn);return P(rr),w(Pn,ut)?(rr.enumerable?(w(Nn,$e)&&Nn[$e][ut]&&(Nn[$e][ut]=!1),rr=X(rr,{enumerable:z(0,!1)})):(w(Nn,$e)||q(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):q(Nn,ut,rr)},En=function(Nn,qn){P(Nn);var rr=F(qn),ut=Y(rr).concat(yo(rr));return we(ut,(function(vn){b&&!f(Zn,rr,vn)||Tt(Nn,vn,rr[vn])})),Nn},Zn=function(Nn){var qn=I(Nn),rr=f(Rt,this,qn);return!(this===en&&w(Pn,qn)&&!w(qt,qn))&&(!(rr||!w(this,qn)||!w(Pn,qn)||w(this,$e)&&this[$e][qn])||rr)},ao=function(Nn,qn){var rr=F(Nn),ut=I(qn);if(rr!==en||!w(Pn,ut)||w(qt,ut)){var vn=vt(rr,ut);return!vn||!w(Pn,ut)||w(rr,$e)&&rr[$e][ut]||(vn.enumerable=!0),vn}},Lo=function(Nn){var qn=kt(F(Nn)),rr=[];return we(qn,(function(ut){w(Pn,ut)||w(Be,ut)||Gt(rr,ut)})),rr},yo=function(Nn){var qn=Nn===en,rr=kt(qn?qt:F(Nn)),ut=[];return we(rr,(function(vn){!w(Pn,vn)||qn&&!w(en,vn)||Gt(ut,Pn[vn])})),ut};if(E||(zt=function(){if($(it,this))throw ae("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?V(arguments[0]):void 0,qn=Je(Nn),rr=function(ut){this===en&&f(rr,qt,ut),w(this,$e)&&w(this[$e],qn)&&(this[$e][qn]=!1),dt(this,qn,z(1,ut))};return b&&Le&&dt(en,qn,{configurable:!0,set:rr}),At(qn,Nn)},De(it=zt.prototype,"toString",(function(){return Jt(this).tag})),De(zt,"withoutSetter",(function(Nn){return At(Je(Nn),Nn)})),Ae.f=Zn,Se.f=Tt,ie.f=ao,W.f=Q.f=Lo,J.f=yo,le.f=function(Nn){return At(gt(Nn),Nn)},b&&(q(it,"description",{configurable:!0,get:function(){return Jt(this).description}}),v||De(en,"propertyIsEnumerable",Zn,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!E,sham:!E},{Symbol:zt}),we(Y(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!E},{for:function(Nn){var qn=V(Nn);if(w(On,qn))return On[qn];var rr=zt(qn);return On[qn]=rr,ke[rr]=qn,rr},keyFor:function(Nn){if(!D(Nn))throw ae(Nn+" is not a symbol");if(w(ke,Nn))return ke[Nn]},useSetter:function(){Le=!0},useSimple:function(){Le=!1}}),i({target:"Object",stat:!0,forced:!E,sham:!b},{create:function(Nn,qn){return qn===void 0?X(Nn):En(X(Nn),qn)},defineProperty:Tt,defineProperties:En,getOwnPropertyDescriptor:ao}),i({target:"Object",stat:!0,forced:!E},{getOwnPropertyNames:Lo,getOwnPropertySymbols:yo}),i({target:"Object",stat:!0,forced:O((function(){J.f(1)}))},{getOwnPropertySymbols:function(Nn){return J.f(B(Nn))}}),je&&i({target:"JSON",stat:!0,forced:!E||O((function(){var Nn=zt();return je([Nn])!="[null]"||je({a:Nn})!="{}"||je(Object(Nn))!="{}"}))},{stringify:function(Nn,qn,rr){var ut=Pe(arguments),vn=qn;if((T(qn)||Nn!==void 0)&&!D(Nn))return S(qn)||(qn=function(In,sr){if(M(vn)&&(sr=f(vn,this,In,sr)),!D(sr))return sr}),ut[1]=qn,l(je,null,ut)}}),!it[pt]){var ho=it.valueOf;De(it,pt,(function(Nn){return f(ho,this)}))}pe(zt,rt),Be[$e]=!0},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(3),f=r(57),h=r(28),v=h("iterator"),b=h("toStringTag"),E=l.values,O=function(S,M){if(S){if(S[v]!==E)try{f(S,v,E)}catch{S[v]=E}if(S[b]||f(S,b,M),a[M]){for(var T in l)if(S[T]!==l[T])try{f(S,T,l[T])}catch{S[T]=l[T]}}}};for(var w in a)O(i[w]&&i[w].prototype,w);O(s,"DOMTokenList")},function(n,o,r){var i=r(151).charAt,a=r(39),s=r(58),l=r(116),f="String Iterator",h=s.set,v=s.getterFor(f);l(String,"String",(function(b){h(this,{type:f,string:a(b),index:0})}),(function(){var b,E=v(this),O=E.string,w=E.index;return w>=O.length?{value:void 0,done:!0}:(b=i(O,w),E.index+=b.length,{value:b,done:!1})}))},function(n,o,r){(function(i){var a=function(s){return s&&s.Math==Math&&s};n.exports=a(typeof globalThis=="object"&&globalThis)||a(typeof window=="object"&&window)||a(typeof self=="object"&&self)||a(typeof i=="object"&&i)||(function(){return this})()||Function("return this")()}).call(this,r(68))},function(n,o,r){var i=r(16),a=r(36),s=r(7),l=r(15),f=r(35),h=r(30),v=r(54),b=r(39),E=r(38).f,O=r(134),w=s.Symbol,S=w&&w.prototype;if(a&&h(w)&&(!("description"in S)||w().description!==void 0)){var M={},T=function(){var V=arguments.length<1||arguments[0]===void 0?void 0:b(arguments[0]),z=v(S,this)?new w(V):V===void 0?w():w(V);return V===""&&(M[z]=!0),z};O(T,w),T.prototype=S,S.constructor=T;var $=String(w("test"))=="Symbol(test)",D=l(S.toString),P=l(S.valueOf),B=/^Symbol\((.*)\)[^)]+$/,F=l("".replace),I=l("".slice);E(S,"description",{configurable:!0,get:function(){var V=P(this),z=D(V);if(f(M,V))return"";var X=$?I(z,7,-1):F(z,B,"$1");return X===""?void 0:X}}),i({global:!0,forced:!0},{Symbol:T})}},function(n,o,r){r(141)("iterator")},function(n,o,r){r.d(o,"a",(function(){return l.a})),r.d(o,"c",(function(){return l.e})),r.d(o,"h",(function(){return B})),r.d(o,"i",(function(){return $})),r.d(o,"j",(function(){return M})),r.d(o,"b",(function(){return ie})),r.d(o,"e",(function(){return De})),r.d(o,"f",(function(){return Se})),r.d(o,"g",(function(){return Pn}));var i,a,s,l=r(0),f=0,h=[],v=l.i.__b,b=l.i.__r,E=l.i.diffed,O=l.i.__c,w=l.i.unmount;function S(ke,Ke){l.i.__h&&l.i.__h(a,ke,f||Ke),f=0;var Le=a.__H||(a.__H={__:[],__h:[]});return ke>=Le.__.length&&Le.__.push({}),Le.__[ke]}function M(ke){return f=1,T(W,ke)}function T(ke,Ke,Le){var dt=S(i++,2);return dt.t=ke,dt.__c||(dt.__=[Le?Le(Ke):W(void 0,Ke),function(At){var Tt=dt.t(dt.__[0],At);dt.__[0]!==Tt&&(dt.__=[Tt,dt.__[1]],dt.__c.setState({}))}],dt.__c=a),dt.__}function $(ke,Ke){var Le=S(i++,3);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__H.__h.push(Le))}function D(ke,Ke){var Le=S(i++,4);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__h.push(Le))}function P(ke,Ke){var Le=S(i++,7);return Y(Le.__H,Ke)&&(Le.__=ke(),Le.__H=Ke,Le.__h=ke),Le.__}function B(ke,Ke){return f=8,P((function(){return ke}),Ke)}function F(){var ke;for(h.sort((function(Ke,Le){return Ke.__v.__b-Le.__v.__b}));ke=h.pop();)if(ke.__P)try{ke.__H.__h.forEach(z),ke.__H.__h.forEach(X),ke.__H.__h=[]}catch(Ke){ke.__H.__h=[],l.i.__e(Ke,ke.__v)}}l.i.__b=function(ke){a=null,v&&v(ke)},l.i.__r=function(ke){b&&b(ke),i=0;var Ke=(a=ke.__c).__H;Ke&&(Ke.__h.forEach(z),Ke.__h.forEach(X),Ke.__h=[])},l.i.diffed=function(ke){E&&E(ke);var Ke=ke.__c;Ke&&Ke.__H&&Ke.__H.__h.length&&(h.push(Ke)!==1&&s===l.i.requestAnimationFrame||((s=l.i.requestAnimationFrame)||V)(F)),a=null},l.i.__c=function(ke,Ke){Ke.some((function(Le){try{Le.__h.forEach(z),Le.__h=Le.__h.filter((function(dt){return!dt.__||X(dt)}))}catch(dt){Ke.some((function(At){At.__h&&(At.__h=[])})),Ke=[],l.i.__e(dt,Le.__v)}})),O&&O(ke,Ke)},l.i.unmount=function(ke){w&&w(ke);var Ke,Le=ke.__c;Le&&Le.__H&&(Le.__H.__.forEach((function(dt){try{z(dt)}catch(At){Ke=At}})),Ke&&l.i.__e(Ke,Le.__v))};var I=typeof requestAnimationFrame=="function";function V(ke){var Ke,Le=function(){clearTimeout(dt),I&&cancelAnimationFrame(Ke),setTimeout(ke)},dt=setTimeout(Le,100);I&&(Ke=requestAnimationFrame(Le))}function z(ke){var Ke=a,Le=ke.__c;typeof Le=="function"&&(ke.__c=void 0,Le()),a=Ke}function X(ke){var Ke=a;ke.__c=ke.__(),a=Ke}function Y(ke,Ke){return!ke||ke.length!==Ke.length||Ke.some((function(Le,dt){return Le!==ke[dt]}))}function W(ke,Ke){return typeof Ke=="function"?Ke(ke):Ke}function Q(ke,Ke){for(var Le in Ke)ke[Le]=Ke[Le];return ke}function J(ke,Ke){for(var Le in ke)if(Le!=="__source"&&!(Le in Ke))return!0;for(var dt in Ke)if(dt!=="__source"&&ke[dt]!==Ke[dt])return!0;return!1}function ie(ke){this.props=ke}function Se(ke,Ke){function Le(At){var Tt=this.props.ref,En=Tt==At.ref;return!En&&Tt&&(Tt.call?Tt(null):Tt.current=null),Ke?!Ke(this.props,At)||!En:J(this.props,At)}function dt(At){return this.shouldComponentUpdate=Le,Object(l.e)(ke,At)}return dt.displayName="Memo("+(ke.displayName||ke.name)+")",dt.prototype.isReactComponent=!0,dt.__f=!0,dt}(ie.prototype=new l.a).isPureReactComponent=!0,ie.prototype.shouldComponentUpdate=function(ke,Ke){return J(this.props,ke)||J(this.state,Ke)};var Ae=l.i.__b;l.i.__b=function(ke){ke.type&&ke.type.__f&&ke.ref&&(ke.props.ref=ke.ref,ke.ref=null),Ae&&Ae(ke)};var Pe=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function De(ke){function Ke(Le,dt){var At=Q({},Le);return delete At.ref,ke(At,!(dt=Le.ref||dt)||typeof dt=="object"&&!("current"in dt)?null:dt)}return Ke.$$typeof=Pe,Ke.render=Ke,Ke.prototype.isReactComponent=Ke.__f=!0,Ke.displayName="ForwardRef("+(ke.displayName||ke.name)+")",Ke}var ze=function(ke,Ke){return ke==null?null:Object(l.k)(Object(l.k)(ke).map(Ke))},Ye={map:ze,forEach:ze,count:function(ke){return ke?Object(l.k)(ke).length:0},only:function(ke){var Ke=Object(l.k)(ke);if(Ke.length!==1)throw"Children.only";return Ke[0]},toArray:l.k},Be=l.i.__e;l.i.__e=function(ke,Ke,Le){if(ke.then){for(var dt,At=Ke;At=At.__;)if((dt=At.__c)&&dt.__c)return Ke.__e==null&&(Ke.__e=Le.__e,Ke.__k=Le.__k),dt.__c(ke,Ke)}Be(ke,Ke,Le)};var Je=l.i.unmount;function gt(ke,Ke,Le){return ke&&(ke.__c&&ke.__c.__H&&(ke.__c.__H.__.forEach((function(dt){typeof dt.__c=="function"&&dt.__c()})),ke.__c.__H=null),(ke=Q({},ke)).__c!=null&&(ke.__c.__P===Le&&(ke.__c.__P=Ke),ke.__c=null),ke.__k=ke.__k&&ke.__k.map((function(dt){return gt(dt,Ke,Le)}))),ke}function le(ke,Ke,Le){return ke&&(ke.__v=null,ke.__k=ke.__k&&ke.__k.map((function(dt){return le(dt,Ke,Le)})),ke.__c&&ke.__c.__P===Ke&&(ke.__e&&Le.insertBefore(ke.__e,ke.__d),ke.__c.__e=!0,ke.__c.__P=Le)),ke}function Ze(){this.__u=0,this.t=null,this.__b=null}function pe(ke){var Ke=ke.__.__c;return Ke&&Ke.__e&&Ke.__e(ke)}function se(){this.u=null,this.o=null}l.i.unmount=function(ke){var Ke=ke.__c;Ke&&Ke.__R&&Ke.__R(),Ke&&ke.__h===!0&&(ke.type=null),Je&&Je(ke)},(Ze.prototype=new l.a).__c=function(ke,Ke){var Le=Ke.__c,dt=this;dt.t==null&&(dt.t=[]),dt.t.push(Le);var At=pe(dt.__v),Tt=!1,En=function(){Tt||(Tt=!0,Le.__R=null,At?At(Zn):Zn())};Le.__R=En;var Zn=function(){if(!--dt.__u){if(dt.state.__e){var Lo=dt.state.__e;dt.__v.__k[0]=le(Lo,Lo.__c.__P,Lo.__c.__O)}var yo;for(dt.setState({__e:dt.__b=null});yo=dt.t.pop();)yo.forceUpdate()}},ao=Ke.__h===!0;dt.__u++||ao||dt.setState({__e:dt.__b=dt.__v.__k[0]}),ke.then(En,En)},Ze.prototype.componentWillUnmount=function(){this.t=[]},Ze.prototype.render=function(ke,Ke){if(this.__b){if(this.__v.__k){var Le=document.createElement("div"),dt=this.__v.__k[0].__c;this.__v.__k[0]=gt(this.__b,Le,dt.__O=dt.__P)}this.__b=null}var At=Ke.__e&&Object(l.e)(l.b,null,ke.fallback);return At&&(At.__h=null),[Object(l.e)(l.b,null,Ke.__e?null:ke.children),At]};var we=function(ke,Ke,Le){if(++Le[1]===Le[0]&&ke.o.delete(Ke),ke.props.revealOrder&&(ke.props.revealOrder[0]!=="t"||!ke.o.size))for(Le=ke.u;Le;){for(;Le.length>3;)Le.pop()();if(Le[1]<Le[0])break;ke.u=Le=Le[2]}};function $e(ke){return this.getChildContext=function(){return ke.context},ke.children}function rt(ke){var Ke=this,Le=ke.i;Ke.componentWillUnmount=function(){Object(l.j)(null,Ke.l),Ke.l=null,Ke.i=null},Ke.i&&Ke.i!==Le&&Ke.componentWillUnmount(),ke.__v?(Ke.l||(Ke.i=Le,Ke.l={nodeType:1,parentNode:Le,childNodes:[],appendChild:function(dt){this.childNodes.push(dt),Ke.i.appendChild(dt)},insertBefore:function(dt,At){this.childNodes.push(dt),Ke.i.appendChild(dt)},removeChild:function(dt){this.childNodes.splice(this.childNodes.indexOf(dt)>>>1,1),Ke.i.removeChild(dt)}}),Object(l.j)(Object(l.e)($e,{context:Ke.context},ke.__v),Ke.l)):Ke.l&&Ke.componentWillUnmount()}(se.prototype=new l.a).__e=function(ke){var Ke=this,Le=pe(Ke.__v),dt=Ke.o.get(ke);return dt[0]++,function(At){var Tt=function(){Ke.props.revealOrder?(dt.push(At),we(Ke,ke,dt)):At()};Le?Le(Tt):Tt()}},se.prototype.render=function(ke){this.u=null,this.o=new Map;var Ke=Object(l.k)(ke.children);ke.revealOrder&&ke.revealOrder[0]==="b"&&Ke.reverse();for(var Le=Ke.length;Le--;)this.o.set(Ke[Le],this.u=[1,0,this.u]);return ke.children},se.prototype.componentDidUpdate=se.prototype.componentDidMount=function(){var ke=this;this.o.forEach((function(Ke,Le){we(ke,Le,Ke)}))};var pt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Jt=typeof document<"u",en=function(ke){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(ke)};l.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(ke){Object.defineProperty(l.a.prototype,ke,{configurable:!0,get:function(){return this["UNSAFE_"+ke]},set:function(Ke){Object.defineProperty(this,ke,{configurable:!0,writable:!0,value:Ke})}})}));var zt=l.i.event;function it(){}function ae(){return this.cancelBubble}function re(){return this.defaultPrevented}l.i.event=function(ke){return zt&&(ke=zt(ke)),ke.persist=it,ke.isPropagationStopped=ae,ke.isDefaultPrevented=re,ke.nativeEvent=ke};var je,vt={configurable:!0,get:function(){return this.class}},q=l.i.vnode;l.i.vnode=function(ke){var Ke=ke.type,Le=ke.props,dt=Le;if(typeof Ke=="string"){var At=Ke.indexOf("-")===-1;for(var Tt in dt={},Le){var En=Le[Tt];Jt&&Tt==="children"&&Ke==="noscript"||Tt==="value"&&"defaultValue"in Le&&En==null||(Tt==="defaultValue"&&"value"in Le&&Le.value==null?Tt="value":Tt==="download"&&En===!0?En="":/ondoubleclick/i.test(Tt)?Tt="ondblclick":/^onchange(textarea|input)/i.test(Tt+Ke)&&!en(Le.type)?Tt="oninput":/^onfocus$/i.test(Tt)?Tt="onfocusin":/^onblur$/i.test(Tt)?Tt="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(Tt)?Tt=Tt.toLowerCase():At&&Lt.test(Tt)?Tt=Tt.replace(/[A-Z0-9]/,"-$&").toLowerCase():En===null&&(En=void 0),dt[Tt]=En)}Ke=="select"&&dt.multiple&&Array.isArray(dt.value)&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.value.indexOf(Zn.props.value)!=-1}))),Ke=="select"&&dt.defaultValue!=null&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.multiple?dt.defaultValue.indexOf(Zn.props.value)!=-1:dt.defaultValue==Zn.props.value}))),ke.props=dt,Le.class!=Le.className&&(vt.enumerable="className"in Le,Le.className!=null&&(dt.class=Le.className),Object.defineProperty(dt,"className",vt))}ke.$$typeof=pt,q&&q(ke)};var kt=l.i.__r;l.i.__r=function(ke){kt&&kt(ke),je=ke.__c};var Rt={ReactCurrentDispatcher:{current:{readContext:function(ke){return je.__n[ke.__c].props.value}}}};function Gt(ke){return!!ke&&ke.$$typeof===pt}var Pn=function(ke,Ke){return ke(Ke)},qt=l.b,On={useState:M,useReducer:T,useEffect:$,useLayoutEffect:D,useRef:function(ke){return f=5,P((function(){return{current:ke}}),[])},useImperativeHandle:function(ke,Ke,Le){f=6,D((function(){typeof ke=="function"?ke(Ke()):ke&&(ke.current=Ke())}),Le==null?Le:Le.concat(ke))},useMemo:P,useCallback:B,useContext:function(ke){var Ke=a.context[ke.__c],Le=S(i++,9);return Le.c=ke,Ke?(Le.__==null&&(Le.__=!0,Ke.sub(a)),Ke.props.value):ke.__},useDebugValue:function(ke,Ke){l.i.useDebugValue&&l.i.useDebugValue(Ke?Ke(ke):ke)},version:"17.0.2",Children:Ye,render:function(ke,Ke,Le){return Ke.__k==null&&(Ke.textContent=""),Object(l.j)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},hydrate:function(ke,Ke,Le){return Object(l.h)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},unmountComponentAtNode:function(ke){return!!ke.__k&&(Object(l.j)(null,ke),!0)},createPortal:function(ke,Ke){return Object(l.e)(rt,{__v:ke,i:Ke})},createElement:l.e,createContext:l.d,createFactory:function(ke){return l.e.bind(null,ke)},cloneElement:function(ke){return Gt(ke)?l.c.apply(null,arguments):ke},createRef:l.f,Fragment:l.b,isValidElement:Gt,findDOMNode:function(ke){return ke&&(ke.base||ke.nodeType===1&&ke)||null},Component:l.a,PureComponent:ie,memo:Se,forwardRef:De,flushSync:function(ke,Ke){return ke(Ke)},unstable_batchedUpdates:Pn,StrictMode:qt,Suspense:Ze,SuspenseList:se,lazy:function(ke){var Ke,Le,dt;function At(Tt){if(Ke||(Ke=ke()).then((function(En){Le=En.default||En}),(function(En){dt=En})),dt)throw dt;if(!Le)throw Ke;return Object(l.e)(Le,Tt)}return At.displayName="Lazy",At.__f=!0,At},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Rt};o.d=On},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(187),f=r(57),h=function(b){if(b&&b.forEach!==l)try{f(b,"forEach",l)}catch{b.forEach=l}};for(var v in a)a[v]&&h(i[v]&&i[v].prototype);h(s)},function(n,o,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,o,r){var i=r(16),a=r(18),s=r(40),l=r(101),f=r(143);i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!f},{getPrototypeOf:function(h){return l(s(h))}})},function(n,o,r){var i=r(16),a=r(46),s=r(76),l=r(203),f=r(165),h=r(32),v=r(33),b=r(60),E=r(18),O=a("Reflect","construct"),w=Object.prototype,S=[].push,M=E((function(){function D(){}return!(O((function(){}),[],D)instanceof D)})),T=!E((function(){O((function(){}))})),$=M||T;i({target:"Reflect",stat:!0,forced:$,sham:$},{construct:function(D,P){f(D),h(P);var B=arguments.length<3?D:f(arguments[2]);if(T&&!M)return O(D,P,B);if(D==B){switch(P.length){case 0:return new D;case 1:return new D(P[0]);case 2:return new D(P[0],P[1]);case 3:return new D(P[0],P[1],P[2]);case 4:return new D(P[0],P[1],P[2],P[3])}var F=[null];return s(S,F,P),new(s(l,D,F))}var I=B.prototype,V=b(v(I)?I:w),z=s(D,V,P);return v(z)?z:V}})},function(n,o){var r=Function.prototype,i=r.bind,a=r.call,s=i&&i.bind(a);n.exports=i?function(l){return l&&s(a,l)}:function(l){return l&&function(){return a.apply(l,arguments)}}},function(n,o,r){var i=r(7),a=r(50).f,s=r(57),l=r(42),f=r(110),h=r(134),v=r(95);n.exports=function(b,E){var O,w,S,M,T,$=b.target,D=b.global,P=b.stat;if(O=D?i:P?i[$]||f($,{}):(i[$]||{}).prototype)for(w in E){if(M=E[w],S=b.noTargetGet?(T=a(O,w))&&T.value:O[w],!v(D?w:$+(P?".":"#")+w,b.forced)&&S!==void 0){if(typeof M==typeof S)continue;h(M,S)}(b.sham||S&&S.sham)&&s(M,"sham",!0),l(O,w,M,b)}}},function(n,o,r){var i=r(16),a=r(7),s=r(96),l=r(99),f=r(33),h=r(75),v=r(45),b=r(41),E=r(63),O=r(28),w=r(81),S=r(98),M=w("slice"),T=O("species"),$=a.Array,D=Math.max;i({target:"Array",proto:!0,forced:!M},{slice:function(P,B){var F,I,V,z=b(this),X=v(z),Y=h(P,X),W=h(B===void 0?X:B,X);if(s(z)&&(F=z.constructor,(l(F)&&(F===$||s(F.prototype))||f(F)&&(F=F[T])===null)&&(F=void 0),F===$||F===void 0))return S(z,Y,W);for(I=new(F===void 0?$:F)(D(W-Y,0)),V=0;Y<W;Y++,V++)Y in z&&E(I,V,z[Y]);return I.length=V,I}})},function(n,o){n.exports=function(r){try{return!!r()}catch{return!0}}},function(n,o,r){var i=r(16),a=r(103);i({target:"RegExp",proto:!0,forced:/./.exec!==a},{exec:a})},function(n,o,r){var i=r(16),a=r(40),s=r(77);i({target:"Object",stat:!0,forced:r(18)((function(){s(1)}))},{keys:function(l){return s(a(l))}})},function(n,o,r){var i=r(36),a=r(73).EXISTS,s=r(15),l=r(38).f,f=Function.prototype,h=s(f.toString),v=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,b=s(v.exec);i&&!a&&l(f,"name",{configurable:!0,get:function(){try{return b(v,h(this))[1]}catch{return""}}})},function(n,o,r){var i=r(16),a=r(18),s=r(41),l=r(50).f,f=r(36),h=a((function(){l(1)}));i({target:"Object",stat:!0,forced:!f||h,sham:!f},{getOwnPropertyDescriptor:function(v,b){return l(s(v),b)}})},function(n,o,r){var i=r(16),a=r(188);i({target:"Array",stat:!0,forced:!r(120)((function(s){Array.from(s)}))},{from:a})},function(n,o,r){var i=r(16),a=r(79).filter;i({target:"Array",proto:!0,forced:!r(81)("filter")},{filter:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(16),a=r(36),s=r(135),l=r(41),f=r(50),h=r(63);i({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(v){for(var b,E,O=l(v),w=f.f,S=s(O),M={},T=0;S.length>T;)(E=w(O,b=S[T++]))!==void 0&&h(M,b,E);return M}})},,function(n,o,r){var i=r(16),a=r(7),s=r(18),l=r(96),f=r(33),h=r(40),v=r(45),b=r(63),E=r(115),O=r(81),w=r(28),S=r(70),M=w("isConcatSpreadable"),T=9007199254740991,$="Maximum allowed index exceeded",D=a.TypeError,P=S>=51||!s((function(){var I=[];return I[M]=!1,I.concat()[0]!==I})),B=O("concat"),F=function(I){if(!f(I))return!1;var V=I[M];return V!==void 0?!!V:l(I)};i({target:"Array",proto:!0,forced:!P||!B},{concat:function(I){var V,z,X,Y,W,Q=h(this),J=E(Q,0),ie=0;for(V=-1,X=arguments.length;V<X;V++)if(F(W=V===-1?Q:arguments[V])){if(ie+(Y=v(W))>T)throw D($);for(z=0;z<Y;z++,ie++)z in W&&b(J,ie,W[z])}else{if(ie>=T)throw D($);b(J,ie++,W)}return J.length=ie,J}})},function(n,o,r){var i=r(7),a=r(89),s=r(35),l=r(90),f=r(108),h=r(132),v=a("wks"),b=i.Symbol,E=b&&b.for,O=h?b:b&&b.withoutSetter||l;n.exports=function(w){if(!s(v,w)||!f&&typeof v[w]!="string"){var S="Symbol."+w;f&&s(b,w)?v[w]=b[w]:v[w]=h&&E?E(S):O(S)}return v[w]}},function(n,o,r){var i=r(16),a=r(202);i({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(n,o){n.exports=function(r){return typeof r=="function"}},function(n,o,r){var i=r(106),a=typeof self=="object"&&self&&self.Object===Object&&self,s=i.a||a||Function("return this")();o.a=s},function(n,o,r){var i=r(7),a=r(33),s=i.String,l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not an object")}},function(n,o,r){var i=r(30);n.exports=function(a){return typeof a=="object"?a!==null:i(a)}},function(n,o){var r=Function.prototype.call;n.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(n,o,r){var i=r(15),a=r(40),s=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,f){return s(a(l),f)}},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}))},function(n,o,r){var i=r(16),a=r(79).map;i({target:"Array",proto:!0,forced:!r(81)("map")},{map:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(7),a=r(36),s=r(133),l=r(32),f=r(86),h=i.TypeError,v=Object.defineProperty;o.f=a?v:function(b,E,O){if(l(b),E=f(E),l(O),s)try{return v(b,E,O)}catch{}if("get"in O||"set"in O)throw h("Accessors not supported");return"value"in O&&(b[E]=O.value),b}},function(n,o,r){var i=r(7),a=r(97),s=i.String;n.exports=function(l){if(a(l)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return s(l)}},function(n,o,r){var i=r(7),a=r(44),s=i.Object;n.exports=function(l){return s(a(l))}},function(n,o,r){var i=r(85),a=r(44);n.exports=function(s){return i(a(s))}},function(n,o,r){var i=r(7),a=r(30),s=r(35),l=r(57),f=r(110),h=r(92),v=r(58),b=r(73).CONFIGURABLE,E=v.get,O=v.enforce,w=String(String).split("String");(n.exports=function(S,M,T,$){var D,P=!!$&&!!$.unsafe,B=!!$&&!!$.enumerable,F=!!$&&!!$.noTargetGet,I=$&&$.name!==void 0?$.name:M;a(T)&&(String(I).slice(0,7)==="Symbol("&&(I="["+String(I).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!s(T,"name")||b&&T.name!==I)&&l(T,"name",I),(D=O(T)).source||(D.source=w.join(typeof I=="string"?I:""))),S!==i?(P?!F&&S[M]&&(B=!0):delete S[M],B?S[M]=T:l(S,M,T)):B?S[M]=T:f(M,T)})(Function.prototype,"toString",(function(){return a(this)&&E(this).source||h(this)}))},function(n,o,r){(function(i){r.d(o,"d",(function(){return l})),r.d(o,"c",(function(){return f})),r.d(o,"b",(function(){return h})),r.d(o,"a",(function(){return b}));var a=r(10),s=function(E,O){var w=typeof Symbol=="function"&&E[Symbol.iterator];if(!w)return E;var S,M,T=w.call(E),$=[];try{for(;(O===void 0||O-- >0)&&!(S=T.next()).done;)$.push(S.value)}catch(D){M={error:D}}finally{try{S&&!S.done&&(w=T.return)&&w.call(T)}finally{if(M)throw M.error}}return $};function l(){var E=s(Object(a.j)(0),2)[1];return Object(a.h)((function(){E((function(O){return O+1}))}),[])}function f(E){if(!E||typeof E!="object")return!1;var O=Object.getPrototypeOf(E);return!O||O===Object.prototype}function h(E){return typeof Symbol=="function"?Symbol.for(E):"__$mobx-react "+E+"__"}var v={};function b(){return typeof window<"u"?window:i!==void 0?i:typeof self<"u"?self:v}}).call(this,r(68))},function(n,o,r){var i=r(7).TypeError;n.exports=function(a){if(a==null)throw i("Can't call method on "+a);return a}},function(n,o,r){var i=r(94);n.exports=function(a){return i(a.length)}},function(n,o,r){var i=r(7),a=r(30),s=function(l){return a(l)?l:void 0};n.exports=function(l,f){return arguments.length<2?s(i[l]):i[l]&&i[l][f]}},function(n,o,r){var i=r(16),a=r(34),s=r(33),l=r(32),f=r(204),h=r(50),v=r(101);i({target:"Reflect",stat:!0},{get:function b(E,O){var w,S,M=arguments.length<3?E:arguments[2];return l(E)===M?E[O]:(w=h.f(E,O))?f(w)?w.value:w.get===void 0?void 0:a(w.get,M):s(S=v(E))?b(S,O,M):void 0}})},function(n,o,r){(function(i){var a=r(31),s=r(171),l=e&&!e.nodeType&&e,f=l&&typeof i=="object"&&i&&!i.nodeType&&i,h=f&&f.exports===l?a.a.Buffer:void 0,v=(h?h.isBuffer:void 0)||s.a;o.a=v}).call(this,r(122)(n))},function(n,o,r){(function(i){var a=r(106),s=e&&!e.nodeType&&e,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s&&a.a.process,h=(function(){try{var v=l&&l.require&&l.require("util").types;return v||f&&f.binding&&f.binding("util")}catch{}})();o.a=h}).call(this,r(122)(n))},function(n,o,r){var i=r(36),a=r(34),s=r(84),l=r(69),f=r(41),h=r(86),v=r(35),b=r(133),E=Object.getOwnPropertyDescriptor;o.f=i?E:function(O,w){if(O=f(O),w=h(w),b)try{return E(O,w)}catch{}if(v(O,w))return l(!a(s.f,O,w),O[w])}},function(n,o,r){var i=r(15),a=i({}.toString),s=i("".slice);n.exports=function(l){return s(a(l),8,-1)}},function(n,o,r){r(182)("Map",(function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}}),r(186))},function(n,o,r){var i=r(16),a=r(220).entries;i({target:"Object",stat:!0},{entries:function(s){return a(s)}})},function(n,o,r){var i=r(15);n.exports=i({}.isPrototypeOf)},function(n,o,r){var i=r(46);n.exports=i("navigator","userAgent")||""},function(n,o,r){var i=r(7),a=r(30),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a function")}},function(n,o,r){var i=r(36),a=r(38),s=r(69);n.exports=i?function(l,f,h){return a.f(l,f,s(1,h))}:function(l,f,h){return l[f]=h,l}},function(n,o,r){var i,a,s,l=r(175),f=r(7),h=r(15),v=r(33),b=r(57),E=r(35),O=r(109),w=r(93),S=r(72),M="Object already initialized",T=f.TypeError,$=f.WeakMap;if(l||O.state){var D=O.state||(O.state=new $),P=h(D.get),B=h(D.has),F=h(D.set);i=function(V,z){if(B(D,V))throw new T(M);return z.facade=V,F(D,V,z),z},a=function(V){return P(D,V)||{}},s=function(V){return B(D,V)}}else{var I=w("state");S[I]=!0,i=function(V,z){if(E(V,I))throw new T(M);return z.facade=V,b(V,I,z),z},a=function(V){return E(V,I)?V[I]:{}},s=function(V){return E(V,I)}}n.exports={set:i,get:a,has:s,enforce:function(V){return s(V)?a(V):i(V,{})},getterFor:function(V){return function(z){var X;if(!v(z)||(X=a(z)).type!==V)throw T("Incompatible receiver, "+V+" required");return X}}}},function(n,o){var r=Math.ceil,i=Math.floor;n.exports=function(a){var s=+a;return s!=s||s===0?0:(s>0?i:r)(s)}},function(n,o,r){var i,a=r(32),s=r(176),l=r(111),f=r(72),h=r(138),v=r(91),b=r(93),E=b("IE_PROTO"),O=function(){},w=function(T){return"<script>"+T+"<\/script>"},S=function(T){T.write(w("")),T.close();var $=T.parentWindow.Object;return T=null,$},M=function(){try{i=new ActiveXObject("htmlfile")}catch{}var T,$;M=typeof document<"u"?document.domain&&i?S(i):(($=v("iframe")).style.display="none",h.appendChild($),$.src="javascript:",(T=$.contentWindow.document).open(),T.write(w("document.F=Object")),T.close(),T.F):S(i);for(var D=l.length;D--;)delete M.prototype[l[D]];return M()};f[E]=!0,n.exports=Object.create||function(T,$){var D;return T!==null?(O.prototype=a(T),D=new O,O.prototype=null,D[E]=T):D=M(),$===void 0?D:s(D,$)}},function(n,o,r){var i=r(36),a=r(7),s=r(15),l=r(95),f=r(42),h=r(35),v=r(148),b=r(54),E=r(87),O=r(131),w=r(18),S=r(74).f,M=r(50).f,T=r(38).f,$=r(160),D=r(161).trim,P="Number",B=a.Number,F=B.prototype,I=a.TypeError,V=s("".slice),z=s("".charCodeAt),X=function(Se){var Ae=O(Se,"number");return typeof Ae=="bigint"?Ae:Y(Ae)},Y=function(Se){var Ae,Pe,De,ze,Ye,Be,Je,gt,le=O(Se,"number");if(E(le))throw I("Cannot convert a Symbol value to a number");if(typeof le=="string"&&le.length>2){if(le=D(le),(Ae=z(le,0))===43||Ae===45){if((Pe=z(le,2))===88||Pe===120)return NaN}else if(Ae===48){switch(z(le,1)){case 66:case 98:De=2,ze=49;break;case 79:case 111:De=8,ze=55;break;default:return+le}for(Be=(Ye=V(le,2)).length,Je=0;Je<Be;Je++)if((gt=z(Ye,Je))<48||gt>ze)return NaN;return parseInt(Ye,De)}}return+le};if(l(P,!B(" 0o1")||!B("0b1")||B("+0x1"))){for(var W,Q=function(Se){var Ae=arguments.length<1?0:B(X(Se)),Pe=this;return b(F,Pe)&&w((function(){$(Pe)}))?v(Object(Ae),Pe,Q):Ae},J=i?S(B):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),ie=0;J.length>ie;ie++)h(B,W=J[ie])&&!h(Q,W)&&T(Q,W,M(B,W));Q.prototype=F,F.constructor=Q,f(a,P,Q)}},function(n,o,r){var i=r(56);n.exports=function(a,s){var l=a[s];return l==null?void 0:i(l)}},function(n,o,r){var i=r(86),a=r(38),s=r(69);n.exports=function(l,f,h){var v=i(f);v in l?a.f(l,v,s(0,h)):l[v]=h}},function(n,o,r){var i=r(15),a=r(56),s=i(i.bind);n.exports=function(l,f){return a(l),f===void 0?l:s?s(l,f):function(){return l.apply(f,arguments)}}},function(n,o,r){var i=r(16),a=r(15),s=r(85),l=r(41),f=r(121),h=a([].join),v=s!=Object,b=f("join",",");i({target:"Array",proto:!0,forced:v||!b},{join:function(E){return h(l(this),E===void 0?",":E)}})},function(n,o,r){var i=r(15),a=r(73).PROPER,s=r(42),l=r(32),f=r(54),h=r(39),v=r(18),b=r(154),E="toString",O=RegExp.prototype,w=O.toString,S=i(b),M=v((function(){return w.call({source:"a",flags:"b"})!="/a/b"})),T=a&&w.name!=E;(M||T)&&s(RegExp.prototype,E,(function(){var $=l(this),D=h($.source),P=$.flags;return"/"+D+"/"+h(P===void 0&&f(O,$)&&!("flags"in O)?S($):P)}),{unsafe:!0})},function(n,o,r){var i=r(16),a=r(217),s=r(100);i({target:"Array",proto:!0},{fill:a}),s("fill")},function(n,o){var r;r=(function(){return this})();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}n.exports=r},function(n,o){n.exports=function(r,i){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:i}}},function(n,o,r){var i,a,s=r(7),l=r(55),f=s.process,h=s.Deno,v=f&&f.versions||h&&h.version,b=v&&v.v8;b&&(a=(i=b.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!a&&l&&(!(i=l.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=l.match(/Chrome\/(\d+)/))&&(a=+i[1]),n.exports=a},function(n,o){n.exports=!1},function(n,o){n.exports={}},function(n,o,r){var i=r(36),a=r(35),s=Function.prototype,l=i&&Object.getOwnPropertyDescriptor,f=a(s,"name"),h=f&&(function(){}).name==="something",v=f&&(!i||i&&l(s,"name").configurable);n.exports={EXISTS:f,PROPER:h,CONFIGURABLE:v}},function(n,o,r){var i=r(136),a=r(111).concat("length","prototype");o.f=Object.getOwnPropertyNames||function(s){return i(s,a)}},function(n,o,r){var i=r(59),a=Math.max,s=Math.min;n.exports=function(l,f){var h=i(l);return h<0?a(h+f,0):s(h,f)}},function(n,o){var r=Function.prototype,i=r.apply,a=r.bind,s=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(a?s.bind(i):function(){return s.apply(i,arguments)})},function(n,o,r){var i=r(136),a=r(111);n.exports=Object.keys||function(s){return i(s,a)}},function(n,o,r){var i=r(38).f,a=r(35),s=r(28)("toStringTag");n.exports=function(l,f,h){l&&!a(l=h?l:l.prototype,s)&&i(l,s,{configurable:!0,value:f})}},function(n,o,r){var i=r(64),a=r(15),s=r(85),l=r(40),f=r(45),h=r(115),v=a([].push),b=function(E){var O=E==1,w=E==2,S=E==3,M=E==4,T=E==6,$=E==7,D=E==5||T;return function(P,B,F,I){for(var V,z,X=l(P),Y=s(X),W=i(B,F),Q=f(Y),J=0,ie=I||h,Se=O?ie(P,Q):w||$?ie(P,0):void 0;Q>J;J++)if((D||J in Y)&&(z=W(V=Y[J],J,X),E))if(O)Se[J]=z;else if(z)switch(E){case 3:return!0;case 5:return V;case 6:return J;case 2:v(Se,V)}else switch(E){case 4:return!1;case 7:v(Se,V)}return T?-1:S||M?M:Se}};n.exports={forEach:b(0),map:b(1),filter:b(2),some:b(3),every:b(4),find:b(5),findIndex:b(6),filterReject:b(7)}},function(n,o){n.exports={}},function(n,o,r){var i=r(18),a=r(28),s=r(70),l=a("species");n.exports=function(f){return s>=51||!i((function(){var h=[];return(h.constructor={})[l]=function(){return{foo:1}},h[f](Boolean).foo!==1}))}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(159),h=r(32),v=r(44),b=r(164),E=r(124),O=r(94),w=r(39),S=r(62),M=r(114),T=r(125),$=r(103),D=r(155),P=r(18),B=D.UNSUPPORTED_Y,F=4294967295,I=Math.min,V=[].push,z=s(/./.exec),X=s(V),Y=s("".slice),W=!P((function(){var Q=/(?:)/,J=Q.exec;Q.exec=function(){return J.apply(this,arguments)};var ie="ab".split(Q);return ie.length!==2||ie[0]!=="a"||ie[1]!=="b"}));l("split",(function(Q,J,ie){var Se;return Se="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(Ae,Pe){var De=w(v(this)),ze=Pe===void 0?F:Pe>>>0;if(ze===0)return[];if(Ae===void 0)return[De];if(!f(Ae))return a(J,De,Ae,ze);for(var Ye,Be,Je,gt=[],le=(Ae.ignoreCase?"i":"")+(Ae.multiline?"m":"")+(Ae.unicode?"u":"")+(Ae.sticky?"y":""),Ze=0,pe=new RegExp(Ae.source,le+"g");(Ye=a($,pe,De))&&!((Be=pe.lastIndex)>Ze&&(X(gt,Y(De,Ze,Ye.index)),Ye.length>1&&Ye.index<De.length&&i(V,gt,M(Ye,1)),Je=Ye[0].length,Ze=Be,gt.length>=ze));)pe.lastIndex===Ye.index&&pe.lastIndex++;return Ze===De.length?!Je&&z(pe,"")||X(gt,""):X(gt,Y(De,Ze)),gt.length>ze?M(gt,0,ze):gt}:"0".split(void 0,0).length?function(Ae,Pe){return Ae===void 0&&Pe===0?[]:a(J,this,Ae,Pe)}:J,[function(Ae,Pe){var De=v(this),ze=Ae==null?void 0:S(Ae,Q);return ze?a(ze,Ae,De,Pe):a(Se,w(De),Ae,Pe)},function(Ae,Pe){var De=h(this),ze=w(Ae),Ye=ie(Se,De,ze,Pe,Se!==J);if(Ye.done)return Ye.value;var Be=b(De,RegExp),Je=De.unicode,gt=(De.ignoreCase?"i":"")+(De.multiline?"m":"")+(De.unicode?"u":"")+(B?"g":"y"),le=new Be(B?"^(?:"+De.source+")":De,gt),Ze=Pe===void 0?F:Pe>>>0;if(Ze===0)return[];if(ze.length===0)return T(le,ze)===null?[ze]:[];for(var pe=0,se=0,we=[];se<ze.length;){le.lastIndex=B?0:se;var $e,rt=T(le,B?Y(ze,se):ze);if(rt===null||($e=I(O(le.lastIndex+(B?se:0)),ze.length))===pe)se=E(ze,se,Je);else{if(X(we,Y(ze,pe,se)),we.length===Ze)return we;for(var pt=1;pt<=rt.length-1;pt++)if(X(we,rt[pt]),we.length===Ze)return we;se=pe=$e}}return X(we,Y(ze,pe)),we}]}),!W,B)},function(n,o,r){r(16)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(n,o,r){var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,s=a&&!i.call({1:2},1);o.f=s?function(l){var f=a(this,l);return!!f&&f.enumerable}:i},function(n,o,r){var i=r(7),a=r(15),s=r(18),l=r(51),f=i.Object,h=a("".split);n.exports=s((function(){return!f("z").propertyIsEnumerable(0)}))?function(v){return l(v)=="String"?h(v,""):f(v)}:f},function(n,o,r){var i=r(131),a=r(87);n.exports=function(s){var l=i(s,"string");return a(l)?l:l+""}},function(n,o,r){var i=r(7),a=r(46),s=r(30),l=r(54),f=r(132),h=i.Object;n.exports=f?function(v){return typeof v=="symbol"}:function(v){var b=a("Symbol");return s(b)&&l(b.prototype,h(v))}},function(n,o,r){var i=r(7).String;n.exports=function(a){try{return i(a)}catch{return"Object"}}},function(n,o,r){var i=r(71),a=r(109);(n.exports=function(s,l){return a[s]||(a[s]=l!==void 0?l:{})})("versions",[]).push({version:"3.19.3",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(n,o,r){var i=r(15),a=0,s=Math.random(),l=i(1 .toString);n.exports=function(f){return"Symbol("+(f===void 0?"":f)+")_"+l(++a+s,36)}},function(n,o,r){var i=r(7),a=r(33),s=i.document,l=a(s)&&a(s.createElement);n.exports=function(f){return l?s.createElement(f):{}}},function(n,o,r){var i=r(15),a=r(30),s=r(109),l=i(Function.toString);a(s.inspectSource)||(s.inspectSource=function(f){return l(f)}),n.exports=s.inspectSource},function(n,o,r){var i=r(89),a=r(90),s=i("keys");n.exports=function(l){return s[l]||(s[l]=a(l))}},function(n,o,r){var i=r(59),a=Math.min;n.exports=function(s){return s>0?a(i(s),9007199254740991):0}},function(n,o,r){var i=r(18),a=r(30),s=/#|\.prototype\./,l=function(E,O){var w=h[f(E)];return w==b||w!=v&&(a(O)?i(O):!!O)},f=l.normalize=function(E){return String(E).replace(s,".").toLowerCase()},h=l.data={},v=l.NATIVE="N",b=l.POLYFILL="P";n.exports=l},function(n,o,r){var i=r(51);n.exports=Array.isArray||function(a){return i(a)=="Array"}},function(n,o,r){var i=r(7),a=r(113),s=r(30),l=r(51),f=r(28)("toStringTag"),h=i.Object,v=l((function(){return arguments})())=="Arguments";n.exports=a?l:function(b){var E,O,w;return b===void 0?"Undefined":b===null?"Null":typeof(O=(function(S,M){try{return S[M]}catch{}})(E=h(b),f))=="string"?O:v?l(E):(w=l(E))=="Object"&&s(E.callee)?"Arguments":w}},function(n,o,r){var i=r(15);n.exports=i([].slice)},function(n,o,r){var i=r(15),a=r(18),s=r(30),l=r(97),f=r(46),h=r(92),v=function(){},b=[],E=f("Reflect","construct"),O=/^\s*(?:class|function)\b/,w=i(O.exec),S=!O.exec(v),M=function(T){if(!s(T))return!1;try{return E(v,b,T),!0}catch{return!1}};n.exports=!E||a((function(){var T;return M(M.call)||!M(Object)||!M((function(){T=!0}))||T}))?function(T){if(!s(T))return!1;switch(l(T)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return S||!!w(O,h(T))}:M},function(n,o,r){var i=r(28),a=r(60),s=r(38),l=i("unscopables"),f=Array.prototype;f[l]==null&&s.f(f,l,{configurable:!0,value:a(null)}),n.exports=function(h){f[l][h]=!0}},function(n,o,r){var i=r(7),a=r(35),s=r(30),l=r(40),f=r(93),h=r(143),v=f("IE_PROTO"),b=i.Object,E=b.prototype;n.exports=h?b.getPrototypeOf:function(O){var w=l(O);if(a(w,v))return w[v];var S=w.constructor;return s(S)&&w instanceof S?S.prototype:w instanceof b?E:null}},function(n,o,r){var i=r(15),a=r(32),s=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l,f=!1,h={};try{(l=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(h,[]),f=h instanceof Array}catch{}return function(v,b){return a(v),s(b),f?l(v,b):v.__proto__=b,v}})():void 0)},function(n,o,r){var i,a,s=r(34),l=r(15),f=r(39),h=r(154),v=r(155),b=r(89),E=r(60),O=r(58).get,w=r(190),S=r(191),M=b("native-string-replace",String.prototype.replace),T=RegExp.prototype.exec,$=T,D=l("".charAt),P=l("".indexOf),B=l("".replace),F=l("".slice),I=(a=/b*/g,s(T,i=/a/,"a"),s(T,a,"a"),i.lastIndex!==0||a.lastIndex!==0),V=v.BROKEN_CARET,z=/()??/.exec("")[1]!==void 0;(I||z||V||w||S)&&($=function(X){var Y,W,Q,J,ie,Se,Ae,Pe=this,De=O(Pe),ze=f(X),Ye=De.raw;if(Ye)return Ye.lastIndex=Pe.lastIndex,Y=s($,Ye,ze),Pe.lastIndex=Ye.lastIndex,Y;var Be=De.groups,Je=V&&Pe.sticky,gt=s(h,Pe),le=Pe.source,Ze=0,pe=ze;if(Je&&(gt=B(gt,"y",""),P(gt,"g")===-1&&(gt+="g"),pe=F(ze,Pe.lastIndex),Pe.lastIndex>0&&(!Pe.multiline||Pe.multiline&&D(ze,Pe.lastIndex-1)!==`
|
||
`)&&(le="(?: "+le+")",pe=" "+pe,Ze++),W=new RegExp("^(?:"+le+")",gt)),z&&(W=new RegExp("^"+le+"$(?!\\s)",gt)),I&&(Q=Pe.lastIndex),J=s(T,Je?W:Pe,pe),Je?J?(J.input=F(J.input,Ze),J[0]=F(J[0],Ze),J.index=Pe.lastIndex,Pe.lastIndex+=J[0].length):Pe.lastIndex=0:I&&J&&(Pe.lastIndex=Pe.global?J.index+J[0].length:Q),z&&J&&J.length>1&&s(M,J[0],W,(function(){for(ie=1;ie<arguments.length-2;ie++)arguments[ie]===void 0&&(J[ie]=void 0)})),J&&Be)for(J.groups=Se=E(null),ie=0;ie<Be.length;ie++)Se[(Ae=Be[ie])[0]]=J[Ae[1]];return J}),n.exports=$},function(n,o,r){var i=r(16),a=r(7),s=r(75),l=r(59),f=r(45),h=r(40),v=r(115),b=r(63),E=r(81)("splice"),O=a.TypeError,w=Math.max,S=Math.min,M=9007199254740991,T="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!E},{splice:function($,D){var P,B,F,I,V,z,X=h(this),Y=f(X),W=s($,Y),Q=arguments.length;if(Q===0?P=B=0:Q===1?(P=0,B=Y-W):(P=Q-2,B=S(w(l(D),0),Y-W)),Y+P-B>M)throw O(T);for(F=v(X,B),I=0;I<B;I++)(V=W+I)in X&&b(F,I,X[V]);if(F.length=B,P<B){for(I=W;I<Y-B;I++)z=I+P,(V=I+B)in X?X[z]=X[V]:delete X[z];for(I=Y;I>Y-B+P;I--)delete X[I-1]}else if(P>B)for(I=Y-B;I>W;I--)z=I+P-1,(V=I+B-1)in X?X[z]=X[V]:delete X[z];for(I=0;I<P;I++)X[I+W]=arguments[I+2];return X.length=Y-B+P,F}})},function(n,o,r){var i=r(16),a=r(205);i({target:"String",proto:!0,forced:r(206)("anchor")},{anchor:function(s){return a(this,"a","name",s)}})},function(n,o,r){(function(i){var a=typeof i=="object"&&i&&i.Object===Object&&i;o.a=a}).call(this,r(68))},function(n,o,r){(function(i){var a=r(31),s=e&&!e.nodeType&&e,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s?a.a.Buffer:void 0,h=f?f.allocUnsafe:void 0;o.a=function(v,b){if(b)return v.slice();var E=v.length,O=h?h(E):new v.constructor(E);return v.copy(O),O}}).call(this,r(122)(n))},function(n,o,r){var i=r(70),a=r(18);n.exports=!!Object.getOwnPropertySymbols&&!a((function(){var s=Symbol();return!String(s)||!(Object(s)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},function(n,o,r){var i=r(7),a=r(110),s="__core-js_shared__",l=i[s]||a(s,{});n.exports=l},function(n,o,r){var i=r(7),a=Object.defineProperty;n.exports=function(s,l){try{a(i,s,{value:l,configurable:!0,writable:!0})}catch{i[s]=l}return l}},function(n,o){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(n,o){o.f=Object.getOwnPropertySymbols},function(n,o,r){var i={};i[r(28)("toStringTag")]="z",n.exports=String(i)==="[object z]"},function(n,o,r){var i=r(7),a=r(75),s=r(45),l=r(63),f=i.Array,h=Math.max;n.exports=function(v,b,E){for(var O=s(v),w=a(b,O),S=a(E===void 0?O:E,O),M=f(h(S-w,0)),T=0;w<S;w++,T++)l(M,T,v[w]);return M.length=T,M}},function(n,o,r){var i=r(178);n.exports=function(a,s){return new(i(a))(s===0?0:s)}},function(n,o,r){var i=r(16),a=r(34),s=r(71),l=r(73),f=r(30),h=r(180),v=r(101),b=r(102),E=r(78),O=r(57),w=r(42),S=r(28),M=r(80),T=r(142),$=l.PROPER,D=l.CONFIGURABLE,P=T.IteratorPrototype,B=T.BUGGY_SAFARI_ITERATORS,F=S("iterator"),I="keys",V="values",z="entries",X=function(){return this};n.exports=function(Y,W,Q,J,ie,Se,Ae){h(Q,W,J);var Pe,De,ze,Ye=function(se){if(se===ie&&Ze)return Ze;if(!B&&se in gt)return gt[se];switch(se){case I:case V:case z:return function(){return new Q(this,se)}}return function(){return new Q(this)}},Be=W+" Iterator",Je=!1,gt=Y.prototype,le=gt[F]||gt["@@iterator"]||ie&>[ie],Ze=!B&&le||Ye(ie),pe=W=="Array"&>.entries||le;if(pe&&(Pe=v(pe.call(new Y)))!==Object.prototype&&Pe.next&&(s||v(Pe)===P||(b?b(Pe,P):f(Pe[F])||w(Pe,F,X)),E(Pe,Be,!0,!0),s&&(M[Be]=X)),$&&ie==V&&le&&le.name!==V&&(!s&&D?O(gt,"name",V):(Je=!0,Ze=function(){return a(le,this)})),ie)if(De={values:Ye(V),keys:Se?Ze:Ye(I),entries:Ye(z)},Ae)for(ze in De)(B||Je||!(ze in gt))&&w(gt,ze,De[ze]);else i({target:W,proto:!0,forced:B||Je},De);return s&&!Ae||gt[F]===Ze||w(gt,F,Ze,{name:ie}),M[W]=Ze,De}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(32),f=r(88),h=r(145),v=r(45),b=r(54),E=r(146),O=r(118),w=r(147),S=i.TypeError,M=function($,D){this.stopped=$,this.result=D},T=M.prototype;n.exports=function($,D,P){var B,F,I,V,z,X,Y,W=P&&P.that,Q=!(!P||!P.AS_ENTRIES),J=!(!P||!P.IS_ITERATOR),ie=!(!P||!P.INTERRUPTED),Se=a(D,W),Ae=function(De){return B&&w(B,"normal",De),new M(!0,De)},Pe=function(De){return Q?(l(De),ie?Se(De[0],De[1],Ae):Se(De[0],De[1])):ie?Se(De,Ae):Se(De)};if(J)B=$;else{if(!(F=O($)))throw S(f($)+" is not iterable");if(h(F)){for(I=0,V=v($);V>I;I++)if((z=Pe($[I]))&&b(T,z))return z;return new M(!1)}B=E($,F)}for(X=B.next;!(Y=s(X,B)).done;){try{z=Pe(Y.value)}catch(De){w(B,"throw",De)}if(typeof z=="object"&&z&&b(T,z))return z}return new M(!1)}},function(n,o,r){var i=r(97),a=r(62),s=r(80),l=r(28)("iterator");n.exports=function(f){if(f!=null)return a(f,l)||a(f,"@@iterator")||s[i(f)]}},function(n,o,r){var i=r(7),a=r(54),s=i.TypeError;n.exports=function(l,f){if(a(f,l))return l;throw s("Incorrect invocation")}},function(n,o,r){var i=r(28)("iterator"),a=!1;try{var s=0,l={next:function(){return{done:!!s++}},return:function(){a=!0}};l[i]=function(){return this},Array.from(l,(function(){throw 2}))}catch{}n.exports=function(f,h){if(!h&&!a)return!1;var v=!1;try{var b={};b[i]=function(){return{next:function(){return{done:v=!0}}}},f(b)}catch{}return v}},function(n,o,r){var i=r(18);n.exports=function(a,s){var l=[][a];return!!l&&i((function(){l.call(null,s||function(){throw 1},1)}))}},function(n,o){n.exports=function(r){if(!r.webpackPolyfill){var i=Object.create(r);i.children||(i.children=[]),Object.defineProperty(i,"loaded",{enumerable:!0,get:function(){return i.l}}),Object.defineProperty(i,"id",{enumerable:!0,get:function(){return i.i}}),Object.defineProperty(i,"exports",{enumerable:!0}),i.webpackPolyfill=1}return i}},function(n,o,r){r(19);var i=r(15),a=r(42),s=r(103),l=r(18),f=r(28),h=r(57),v=f("species"),b=RegExp.prototype;n.exports=function(E,O,w,S){var M=f(E),T=!l((function(){var B={};return B[M]=function(){return 7},""[E](B)!=7})),$=T&&!l((function(){var B=!1,F=/a/;return E==="split"&&((F={}).constructor={},F.constructor[v]=function(){return F},F.flags="",F[M]=/./[M]),F.exec=function(){return B=!0,null},F[M](""),!B}));if(!T||!$||w){var D=i(/./[M]),P=O(M,""[E],(function(B,F,I,V,z){var X=i(B),Y=F.exec;return Y===s||Y===b.exec?T&&!z?{done:!0,value:D(F,I,V)}:{done:!0,value:X(I,F,V)}:{done:!1}}));a(String.prototype,E,P[0]),a(b,M,P[1])}S&&h(b[M],"sham",!0)}},function(n,o,r){var i=r(151).charAt;n.exports=function(a,s,l){return s+(l?i(a,s).length:1)}},function(n,o,r){var i=r(7),a=r(34),s=r(32),l=r(30),f=r(51),h=r(103),v=i.TypeError;n.exports=function(b,E){var O=b.exec;if(l(O)){var w=a(O,b,E);return w!==null&&s(w),w}if(f(b)==="RegExp")return a(h,b,E);throw v("RegExp#exec called on incompatible receiver")}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(18),h=r(32),v=r(30),b=r(59),E=r(94),O=r(39),w=r(44),S=r(124),M=r(62),T=r(201),$=r(125),D=r(28)("replace"),P=Math.max,B=Math.min,F=s([].concat),I=s([].push),V=s("".indexOf),z=s("".slice),X="a".replace(/./,"$0")==="$0",Y=!!/./[D]&&/./[D]("a","$0")==="";l("replace",(function(W,Q,J){var ie=Y?"$":"$0";return[function(Se,Ae){var Pe=w(this),De=Se==null?void 0:M(Se,D);return De?a(De,Se,Pe,Ae):a(Q,O(Pe),Se,Ae)},function(Se,Ae){var Pe=h(this),De=O(Se);if(typeof Ae=="string"&&V(Ae,ie)===-1&&V(Ae,"$<")===-1){var ze=J(Q,Pe,De,Ae);if(ze.done)return ze.value}var Ye=v(Ae);Ye||(Ae=O(Ae));var Be=Pe.global;if(Be){var Je=Pe.unicode;Pe.lastIndex=0}for(var gt=[];;){var le=$(Pe,De);if(le===null||(I(gt,le),!Be))break;O(le[0])===""&&(Pe.lastIndex=S(De,E(Pe.lastIndex),Je))}for(var Ze,pe="",se=0,we=0;we<gt.length;we++){for(var $e=O((le=gt[we])[0]),rt=P(B(b(le.index),De.length),0),pt=[],Lt=1;Lt<le.length;Lt++)I(pt,(Ze=le[Lt])===void 0?Ze:String(Ze));var Jt=le.groups;if(Ye){var en=F([$e],pt,rt,De);Jt!==void 0&&I(en,Jt);var zt=O(i(Ae,void 0,en))}else zt=T($e,De,rt,pt,Jt,Ae);rt>=se&&(pe+=z(De,se,rt)+zt,se=rt+$e.length)}return pe+z(De,se)}]}),!!f((function(){var W=/./;return W.exec=function(){var Q=[];return Q.groups={a:"7"},Q},"".replace(W,"$<a>")!=="7"}))||!X||Y)},function(n,o,r){var i=r(16),a=Math.hypot,s=Math.abs,l=Math.sqrt;i({target:"Math",stat:!0,forced:!!a&&a(1/0,NaN)!==1/0},{hypot:function(f,h){for(var v,b,E=0,O=0,w=arguments.length,S=0;O<w;)S<(v=s(arguments[O++]))?(E=E*(b=S/v)*b+1,S=v):E+=v>0?(b=v/S)*b:v;return S===1/0?1/0:S*l(E)}})},function(n,o,r){var i=r(51),a=r(7);n.exports=i(a.process)=="process"},function(n,o,r){r(16)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(n,o,r){(function(i,a){var s;/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/(function(){var l,f="Expected a function",h="__lodash_hash_undefined__",v="__lodash_placeholder__",b=16,E=32,O=64,w=128,S=256,M=1/0,T=9007199254740991,$=NaN,D=4294967295,P=[["ary",w],["bind",1],["bindKey",2],["curry",8],["curryRight",b],["flip",512],["partial",E],["partialRight",O],["rearg",S]],B="[object Arguments]",F="[object Array]",I="[object Boolean]",V="[object Date]",z="[object Error]",X="[object Function]",Y="[object GeneratorFunction]",W="[object Map]",Q="[object Number]",J="[object Object]",ie="[object Promise]",Se="[object RegExp]",Ae="[object Set]",Pe="[object String]",De="[object Symbol]",ze="[object WeakMap]",Ye="[object ArrayBuffer]",Be="[object DataView]",Je="[object Float32Array]",gt="[object Float64Array]",le="[object Int8Array]",Ze="[object Int16Array]",pe="[object Int32Array]",se="[object Uint8Array]",we="[object Uint8ClampedArray]",$e="[object Uint16Array]",rt="[object Uint32Array]",pt=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,en=/&(?:amp|lt|gt|quot|#39);/g,zt=/[&<>"']/g,it=RegExp(en.source),ae=RegExp(zt.source),re=/<%-([\s\S]+?)%>/g,je=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kt=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gt=/[\\^$.*+?()[\]{}|]/g,Pn=RegExp(Gt.source),qt=/^\s+/,On=/\s/,ke=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,At=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,En=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zn=/\w*$/,ao=/^[-+]0x[0-9a-f]+$/i,Lo=/^0b[01]+$/i,yo=/^\[object .+?Constructor\]$/,ho=/^0o[0-7]+$/i,Nn=/^(?:0|[1-9]\d*)$/,qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rr=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,vn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",In="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",wo="A-Z\\xc0-\\xd6\\xd8-\\xde",oo="\\ufe0e\\ufe0f",ta="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ca="['’]",Yi="[\\ud800-\\udfff]",fa="["+ta+"]",Ka="["+vn+"]",Sn="\\d+",Ts="[\\u2700-\\u27bf]",Oo="["+sr+"]",es="[^\\ud800-\\udfff"+ta+Sn+In+sr+wo+"]",Ui="\\ud83c[\\udffb-\\udfff]",gr="[^\\ud800-\\udfff]",gl="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",qi="["+wo+"]",Na="(?:"+Oo+"|"+es+")",al="(?:"+qi+"|"+es+")",yl="(?:['’](?:d|ll|m|re|s|t|ve))?",Cs="(?:['’](?:D|LL|M|RE|S|T|VE))?",_l="(?:"+Ka+"|"+Ui+")?",ts="[\\ufe0e\\ufe0f]?",ve=ts+_l+("(?:\\u200d(?:"+[gr,gl,pa].join("|")+")"+ts+_l+")*"),mt="(?:"+[Ts,gl,pa].join("|")+")"+ve,cn="(?:"+[gr+Ka+"?",Ka,gl,pa,Yi].join("|")+")",Kn=RegExp(Ca,"g"),br=RegExp(Ka,"g"),so=RegExp(Ui+"(?="+Ui+")|"+cn+ve,"g"),si=RegExp([qi+"?"+Oo+"+"+yl+"(?="+[fa,qi,"$"].join("|")+")",al+"+"+Cs+"(?="+[fa,qi+Na,"$"].join("|")+")",qi+"?"+Na+"+"+yl,qi+"+"+Cs,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,mt].join("|"),"g"),ye=RegExp("[\\u200d\\ud800-\\udfff"+vn+oo+"]"),ht=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rn=-1,Cn={};Cn[Je]=Cn[gt]=Cn[le]=Cn[Ze]=Cn[pe]=Cn[se]=Cn[we]=Cn[$e]=Cn[rt]=!0,Cn[B]=Cn[F]=Cn[Ye]=Cn[I]=Cn[Be]=Cn[V]=Cn[z]=Cn[X]=Cn[W]=Cn[Q]=Cn[J]=Cn[Se]=Cn[Ae]=Cn[Pe]=Cn[ze]=!1;var nr={};nr[B]=nr[F]=nr[Ye]=nr[Be]=nr[I]=nr[V]=nr[Je]=nr[gt]=nr[le]=nr[Ze]=nr[pe]=nr[W]=nr[Q]=nr[J]=nr[Se]=nr[Ae]=nr[Pe]=nr[De]=nr[se]=nr[we]=nr[$e]=nr[rt]=!0,nr[z]=nr[X]=nr[ze]=!1;var Mn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},or=parseFloat,lr=parseInt,qr=typeof i=="object"&&i&&i.Object===Object&&i,na=typeof self=="object"&&self&&self.Object===Object&&self,vi=qr||na||Function("return this")(),bl=o&&!o.nodeType&&o,Vi=bl&&typeof a=="object"&&a&&!a.nodeType&&a,Ns=Vi&&Vi.exports===bl,Fl=Ns&&qr.process,Ro=(function(){try{var Ct=Vi&&Vi.require&&Vi.require("util").types;return Ct||Fl&&Fl.binding&&Fl.binding("util")}catch{}})(),La=Ro&&Ro.isArrayBuffer,id=Ro&&Ro.isDate,_u=Ro&&Ro.isMap,Ia=Ro&&Ro.isRegExp,ra=Ro&&Ro.isSet,wl=Ro&&Ro.isTypedArray;function qo(Ct,un,dn){switch(dn.length){case 0:return Ct.call(un);case 1:return Ct.call(un,dn[0]);case 2:return Ct.call(un,dn[0],dn[1]);case 3:return Ct.call(un,dn[0],dn[1],dn[2])}return Ct.apply(un,dn)}function Uh(Ct,un,dn,Gn){for(var Wr=-1,mo=Ct==null?0:Ct.length;++Wr<mo;){var ci=Ct[Wr];un(Gn,ci,dn(ci),Ct)}return Gn}function Fa(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function gp(Ct,un){for(var dn=Ct==null?0:Ct.length;dn--&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function yp(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn;)if(!un(Ct[dn],dn,Ct))return!1;return!0}function Ba(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length,Wr=0,mo=[];++dn<Gn;){var ci=Ct[dn];un(ci,dn,Ct)&&(mo[Wr++]=ci)}return mo}function Za(Ct,un){return!!(Ct!=null&&Ct.length)&&bu(Ct,un,0)>-1}function rf(Ct,un,dn){for(var Gn=-1,Wr=Ct==null?0:Ct.length;++Gn<Wr;)if(dn(un,Ct[Gn]))return!0;return!1}function Mo(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length,Wr=Array(Gn);++dn<Gn;)Wr[dn]=un(Ct[dn],dn,Ct);return Wr}function oa(Ct,un){for(var dn=-1,Gn=un.length,Wr=Ct.length;++dn<Gn;)Ct[Wr+dn]=un[dn];return Ct}function ad(Ct,un,dn,Gn){var Wr=-1,mo=Ct==null?0:Ct.length;for(Gn&&mo&&(dn=Ct[++Wr]);++Wr<mo;)dn=un(dn,Ct[Wr],Wr,Ct);return dn}function _p(Ct,un,dn,Gn){var Wr=Ct==null?0:Ct.length;for(Gn&&Wr&&(dn=Ct[--Wr]);Wr--;)dn=un(dn,Ct[Wr],Wr,Ct);return dn}function of(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn;)if(un(Ct[dn],dn,Ct))return!0;return!1}var ld=Ua("length");function ns(Ct,un,dn){var Gn;return dn(Ct,(function(Wr,mo,ci){if(un(Wr,mo,ci))return Gn=mo,!1})),Gn}function $a(Ct,un,dn,Gn){for(var Wr=Ct.length,mo=dn+(Gn?1:-1);Gn?mo--:++mo<Wr;)if(un(Ct[mo],mo,Ct))return mo;return-1}function bu(Ct,un,dn){return un==un?(function(Gn,Wr,mo){for(var ci=mo-1,R=Gn.length;++ci<R;)if(Gn[ci]===Wr)return ci;return-1})(Ct,un,dn):$a(Ct,El,dn)}function Ja(Ct,un,dn,Gn){for(var Wr=dn-1,mo=Ct.length;++Wr<mo;)if(Gn(Ct[Wr],un))return Wr;return-1}function El(Ct){return Ct!=Ct}function vo(Ct,un){var dn=Ct==null?0:Ct.length;return dn?wu(Ct,un)/dn:$}function Ua(Ct){return function(un){return un==null?l:un[Ct]}}function Bl(Ct){return function(un){return Ct==null?l:Ct[un]}}function ha(Ct,un,dn,Gn,Wr){return Wr(Ct,(function(mo,ci,R){dn=Gn?(Gn=!1,mo):un(dn,mo,ci,R)})),dn}function wu(Ct,un){for(var dn,Gn=-1,Wr=Ct.length;++Gn<Wr;){var mo=un(Ct[Gn]);mo!==l&&(dn=dn===l?mo:dn+mo)}return dn}function Ks(Ct,un){for(var dn=-1,Gn=Array(Ct);++dn<Ct;)Gn[dn]=un(dn);return Gn}function $l(Ct){return Ct&&Ct.slice(0,ia(Ct)+1).replace(qt,"")}function ui(Ct){return function(un){return Ct(un)}}function lc(Ct,un){return Mo(un,(function(dn){return Ct[dn]}))}function rs(Ct,un){return Ct.has(un)}function xl(Ct,un){for(var dn=-1,Gn=Ct.length;++dn<Gn&&bu(un,Ct[dn],0)>-1;);return dn}function af(Ct,un){for(var dn=Ct.length;dn--&&bu(un,Ct[dn],0)>-1;);return dn}function Vh(Ct,un){for(var dn=Ct.length,Gn=0;dn--;)Ct[dn]===un&&++Gn;return Gn}var lf=Bl({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Wi=Bl({"&":"&","<":"<",">":">",'"':""","'":"'"});function sc(Ct){return"\\"+Mn[Ct]}function os(Ct){return ye.test(Ct)}function Ki(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn,Wr){dn[++un]=[Wr,Gn]})),dn}function sf(Ct,un){return function(dn){return Ct(un(dn))}}function ll(Ct,un){for(var dn=-1,Gn=Ct.length,Wr=0,mo=[];++dn<Gn;){var ci=Ct[dn];ci!==un&&ci!==v||(Ct[dn]=v,mo[Wr++]=dn)}return mo}function Ol(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn){dn[++un]=Gn})),dn}function sd(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn){dn[++un]=[Gn,Gn]})),dn}function Va(Ct){return os(Ct)?(function(un){for(var dn=so.lastIndex=0;so.test(un);)++dn;return dn})(Ct):ld(Ct)}function Qa(Ct){return os(Ct)?(function(un){return un.match(so)||[]})(Ct):(function(un){return un.split("")})(Ct)}function ia(Ct){for(var un=Ct.length;un--&&On.test(Ct.charAt(un)););return un}var sl=Bl({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ka=(function Ct(un){var dn,Gn=(un=un==null?vi:ka.defaults(vi.Object(),un,ka.pick(vi,fn))).Array,Wr=un.Date,mo=un.Error,ci=un.Function,R=un.Math,L=un.Object,Z=un.RegExp,fe=un.String,Re=un.TypeError,lt=Gn.prototype,It=ci.prototype,bn=L.prototype,Jn=un["__core-js_shared__"],no=It.toString,$n=bn.hasOwnProperty,Do=0,Kr=(dn=/[^.]+$/.exec(Jn&&Jn.keys&&Jn.keys.IE_PROTO||""))?"Symbol(src)_1."+dn:"",So=bn.toString,ul=no.call(L),wi=vi._,el=Z("^"+no.call($n).replace(Gt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ks=Ns?un.Buffer:l,Ps=un.Symbol,Zs=un.Uint8Array,Eu=ks?ks.allocUnsafe:l,is=sf(L.getPrototypeOf,L),xu=L.create,Zi=bn.propertyIsEnumerable,Js=lt.splice,Rs=Ps?Ps.isConcatSpreadable:l,as=Ps?Ps.iterator:l,ls=Ps?Ps.toStringTag:l,uc=(function(){try{var g=hs(L,"defineProperty");return g({},"",{}),g}catch{}})(),fm=un.clearTimeout!==vi.clearTimeout&&un.clearTimeout,pm=Wr&&Wr.now!==vi.Date.now&&Wr.now,Wh=un.setTimeout!==vi.setTimeout&&un.setTimeout,uf=R.ceil,cc=R.floor,bp=L.getOwnPropertySymbols,hm=ks?ks.isBuffer:l,dc=un.isFinite,cf=lt.join,wp=sf(L.keys,L),ji=R.max,Wa=R.min,Ep=Wr.now,xp=un.parseInt,ud=R.random,dy=lt.reverse,cd=hs(un,"DataView"),dd=hs(un,"Map"),df=hs(un,"Promise"),fc=hs(un,"Set"),Ou=hs(un,"WeakMap"),fd=hs(L,"create"),ff=Ou&&new Ou,Su={},fy=Ru(cd),pf=Ru(dd),py=Ru(df),hy=Ru(fc),vm=Ru(Ou),Op=Ps?Ps.prototype:l,Pa=Op?Op.valueOf:l,mm=Op?Op.toString:l;function he(g){if(Bi(g)&&!Jr(g)&&!(g instanceof go)){if(g instanceof Ul)return g;if($n.call(g,"__wrapped__"))return Xp(g)}return new Ul(g)}var pc=(function(){function g(){}return function(x){if(!Ni(x))return{};if(xu)return xu(x);g.prototype=x;var C=new g;return g.prototype=l,C}})();function Qs(){}function Ul(g,x){this.__wrapped__=g,this.__actions__=[],this.__chain__=!!x,this.__index__=0,this.__values__=l}function go(g){this.__wrapped__=g,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function ba(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var G=g[x];this.set(G[0],G[1])}}function To(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var G=g[x];this.set(G[0],G[1])}}function ss(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var G=g[x];this.set(G[0],G[1])}}function eu(g){var x=-1,C=g==null?0:g.length;for(this.__data__=new ss;++x<C;)this.add(g[x])}function Sl(g){var x=this.__data__=new To(g);this.size=x.size}function Sp(g,x){var C=Jr(g),G=!C&&Nc(g),te=!C&&!G&&nl(g),ce=!C&&!G&&!te&&yt(g),Oe=C||G||te||ce,Fe=Oe?Ks(g.length,fe):[],et=Fe.length;for(var jt in g)!x&&!$n.call(g,jt)||Oe&&(jt=="length"||te&&(jt=="offset"||jt=="parent")||ce&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||Ra(jt,et))||Fe.push(jt);return Fe}function Ap(g){var x=g.length;return x?g[ev(0,x-1)]:l}function Gh(g,x){return Bs(va(g),Au(x,0,g.length))}function gm(g){return Bs(va(g))}function tu(g,x,C){(C!==l&&!zl(g[x],C)||C===l&&!(x in g))&&us(g,x,C)}function Li(g,x,C){var G=g[x];$n.call(g,x)&&zl(G,C)&&(C!==l||x in g)||us(g,x,C)}function pd(g,x){for(var C=g.length;C--;)if(zl(g[C][0],x))return C;return-1}function zh(g,x,C,G){return mi(g,(function(te,ce,Oe){x(G,te,C(te),Oe)})),G}function nu(g,x){return g&&ds(x,on(x),g)}function us(g,x,C){x=="__proto__"&&uc?uc(g,x,{configurable:!0,enumerable:!0,value:C,writable:!0}):g[x]=C}function hf(g,x){for(var C=-1,G=x.length,te=Gn(G),ce=g==null;++C<G;)te[C]=ce?l:_n(g,x[C]);return te}function Au(g,x,C){return g==g&&(C!==l&&(g=g<=C?g:C),x!==l&&(g=g>=x?g:x)),g}function Al(g,x,C,G,te,ce){var Oe,Fe=1&x,et=2&x,jt=4&x;if(C&&(Oe=te?C(g,G,te,ce):C(g)),Oe!==l)return Oe;if(!Ni(g))return g;var Vt=Jr(g);if(Vt){if(Oe=(function(an){var Tn=an.length,Br=new an.constructor(Tn);return Tn&&typeof an[0]=="string"&&$n.call(an,"index")&&(Br.index=an.index,Br.input=an.input),Br})(g),!Fe)return va(g,Oe)}else{var yn=Ti(g),Yn=yn==X||yn==Y;if(nl(g))return Sm(g,Fe);if(yn==J||yn==B||Yn&&!te){if(Oe=et||Yn?{}:tl(g),!Fe)return et?(function(an,Tn){return ds(an,Ec(an),Tn)})(g,(function(an,Tn){return an&&ds(Tn,Zt(Tn),an)})(Oe,g)):(function(an,Tn){return ds(an,aa(an),Tn)})(g,nu(Oe,g))}else{if(!nr[yn])return te?g:{};Oe=(function(an,Tn,Br){var ir=an.constructor;switch(Tn){case Ye:return mc(an);case I:case V:return new ir(+an);case Be:return(function(Yr,Ao){var Mr=Ao?mc(Yr.buffer):Yr.buffer;return new Yr.constructor(Mr,Yr.byteOffset,Yr.byteLength)})(an,Br);case Je:case gt:case le:case Ze:case pe:case se:case we:case $e:case rt:return Am(an,Br);case W:return new ir;case Q:case Pe:return new ir(an);case Se:return(function(Yr){var Ao=new Yr.constructor(Yr.source,Zn.exec(Yr));return Ao.lastIndex=Yr.lastIndex,Ao})(an);case Ae:return new ir;case De:return at=an,Pa?L(Pa.call(at)):{}}var at})(g,yn,Fe)}}ce||(ce=new Sl);var Qn=ce.get(g);if(Qn)return Qn;ce.set(g,Oe),Ie(g)?g.forEach((function(an){Oe.add(Al(an,x,C,an,g,ce))})):Jp(g)&&g.forEach((function(an,Tn){Oe.set(Tn,Al(an,x,C,Tn,g,ce))}));var Sr=Vt?l:(jt?et?Vp:xf:et?Zt:on)(g);return Fa(Sr||g,(function(an,Tn){Sr&&(an=g[Tn=an]),Li(Oe,Tn,Al(an,x,C,Tn,g,ce))})),Oe}function Hh(g,x,C){var G=C.length;if(g==null)return!G;for(g=L(g);G--;){var te=C[G],ce=x[te],Oe=g[te];if(Oe===l&&!(te in g)||!ce(Oe))return!1}return!0}function Xh(g,x,C){if(typeof g!="function")throw new Re(f);return Sc((function(){g.apply(l,C)}),x)}function cs(g,x,C,G){var te=-1,ce=Za,Oe=!0,Fe=g.length,et=[],jt=x.length;if(!Fe)return et;C&&(x=Mo(x,ui(C))),G?(ce=rf,Oe=!1):x.length>=200&&(ce=rs,Oe=!1,x=new eu(x));e:for(;++te<Fe;){var Vt=g[te],yn=C==null?Vt:C(Vt);if(Vt=G||Vt!==0?Vt:0,Oe&&yn==yn){for(var Yn=jt;Yn--;)if(x[Yn]===yn)continue e;et.push(Vt)}else ce(x,yn,G)||et.push(Vt)}return et}he.templateSettings={escape:re,evaluate:je,interpolate:vt,variable:"",imports:{_:he}},he.prototype=Qs.prototype,he.prototype.constructor=he,Ul.prototype=pc(Qs.prototype),Ul.prototype.constructor=Ul,go.prototype=pc(Qs.prototype),go.prototype.constructor=go,ba.prototype.clear=function(){this.__data__=fd?fd(null):{},this.size=0},ba.prototype.delete=function(g){var x=this.has(g)&&delete this.__data__[g];return this.size-=x?1:0,x},ba.prototype.get=function(g){var x=this.__data__;if(fd){var C=x[g];return C===h?l:C}return $n.call(x,g)?x[g]:l},ba.prototype.has=function(g){var x=this.__data__;return fd?x[g]!==l:$n.call(x,g)},ba.prototype.set=function(g,x){var C=this.__data__;return this.size+=this.has(g)?0:1,C[g]=fd&&x===l?h:x,this},To.prototype.clear=function(){this.__data__=[],this.size=0},To.prototype.delete=function(g){var x=this.__data__,C=pd(x,g);return!(C<0)&&(C==x.length-1?x.pop():Js.call(x,C,1),--this.size,!0)},To.prototype.get=function(g){var x=this.__data__,C=pd(x,g);return C<0?l:x[C][1]},To.prototype.has=function(g){return pd(this.__data__,g)>-1},To.prototype.set=function(g,x){var C=this.__data__,G=pd(C,g);return G<0?(++this.size,C.push([g,x])):C[G][1]=x,this},ss.prototype.clear=function(){this.size=0,this.__data__={hash:new ba,map:new(dd||To),string:new ba}},ss.prototype.delete=function(g){var x=wd(this,g).delete(g);return this.size-=x?1:0,x},ss.prototype.get=function(g){return wd(this,g).get(g)},ss.prototype.has=function(g){return wd(this,g).has(g)},ss.prototype.set=function(g,x){var C=wd(this,g),G=C.size;return C.set(g,x),this.size+=C.size==G?0:1,this},eu.prototype.add=eu.prototype.push=function(g){return this.__data__.set(g,h),this},eu.prototype.has=function(g){return this.__data__.has(g)},Sl.prototype.clear=function(){this.__data__=new To,this.size=0},Sl.prototype.delete=function(g){var x=this.__data__,C=x.delete(g);return this.size=x.size,C},Sl.prototype.get=function(g){return this.__data__.get(g)},Sl.prototype.has=function(g){return this.__data__.has(g)},Sl.prototype.set=function(g,x){var C=this.__data__;if(C instanceof To){var G=C.__data__;if(!dd||G.length<199)return G.push([g,x]),this.size=++C.size,this;C=this.__data__=new ss(G)}return C.set(g,x),this.size=C.size,this};var mi=_c(ur),ym=_c(ti,!0);function Yh(g,x){var C=!0;return mi(g,(function(G,te,ce){return C=!!x(G,te,ce)})),C}function Ii(g,x,C){for(var G=-1,te=g.length;++G<te;){var ce=g[G],Oe=x(ce);if(Oe!=null&&(Fe===l?Oe==Oe&&!Dt(Oe):C(Oe,Fe)))var Fe=Oe,et=ce}return et}function Io(g,x){var C=[];return mi(g,(function(G,te,ce){x(G,te,ce)&&C.push(G)})),C}function Ji(g,x,C,G,te){var ce=-1,Oe=g.length;for(C||(C=Sf),te||(te=[]);++ce<Oe;){var Fe=g[ce];x>0&&C(Fe)?x>1?Ji(Fe,x-1,C,G,te):oa(te,Fe):G||(te[te.length]=Fe)}return te}var lo=bc(),ei=bc(!0);function ur(g,x){return g&&lo(g,x,on)}function ti(g,x){return g&&ei(g,x,on)}function vf(g,x){return Ba(x,(function(C){return Cl(g[C])}))}function Ds(g,x){for(var C=0,G=(x=jo(x,g)).length;g!=null&&C<G;)g=g[vs(x[C++])];return C&&C==G?g:l}function Mp(g,x,C){var G=x(g);return Jr(g)?G:oa(G,C(g))}function Ei(g){return g==null?g===l?"[object Undefined]":"[object Null]":ls&&ls in L(g)?(function(x){var C=$n.call(x,ls),G=x[ls];try{x[ls]=l;var te=!0}catch{}var ce=So.call(x);return te&&(C?x[ls]=G:delete x[ls]),ce})(g):(function(x){return So.call(x)})(g)}function Mi(g,x){return g>x}function qh(g,x){return g!=null&&$n.call(g,x)}function Kh(g,x){return g!=null&&x in L(g)}function mf(g,x,C){for(var G=C?rf:Za,te=g[0].length,ce=g.length,Oe=ce,Fe=Gn(ce),et=1/0,jt=[];Oe--;){var Vt=g[Oe];Oe&&x&&(Vt=Mo(Vt,ui(x))),et=Wa(Vt.length,et),Fe[Oe]=!C&&(x||te>=120&&Vt.length>=120)?new eu(Oe&&Vt):l}Vt=g[0];var yn=-1,Yn=Fe[0];e:for(;++yn<te&&jt.length<et;){var Qn=Vt[yn],Sr=x?x(Qn):Qn;if(Qn=C||Qn!==0?Qn:0,!(Yn?rs(Yn,Sr):G(jt,Sr,C))){for(Oe=ce;--Oe;){var an=Fe[Oe];if(!(an?rs(an,Sr):G(g[Oe],Sr,C)))continue e}Yn&&Yn.push(Sr),jt.push(Qn)}}return jt}function Ga(g,x,C){var G=(g=Pu(g,x=jo(x,g)))==null?g:g[vs(gi(x))];return G==null?l:qo(G,g,C)}function Tp(g){return Bi(g)&&Ei(g)==B}function hd(g,x,C,G,te){return g===x||(g==null||x==null||!Bi(g)&&!Bi(x)?g!=g&&x!=x:(function(ce,Oe,Fe,et,jt,Vt){var yn=Jr(ce),Yn=Jr(Oe),Qn=yn?F:Ti(ce),Sr=Yn?F:Ti(Oe),an=(Qn=Qn==B?J:Qn)==J,Tn=(Sr=Sr==B?J:Sr)==J,Br=Qn==Sr;if(Br&&nl(ce)){if(!nl(Oe))return!1;yn=!0,an=!1}if(Br&&!an)return Vt||(Vt=new Sl),yn||yt(ce)?bd(ce,Oe,Fe,et,jt,Vt):(function(Mr,Ur,xa,Hl,uu,Oa,Iu){switch(xa){case Be:if(Mr.byteLength!=Ur.byteLength||Mr.byteOffset!=Ur.byteOffset)return!1;Mr=Mr.buffer,Ur=Ur.buffer;case Ye:return!(Mr.byteLength!=Ur.byteLength||!Oa(new Zs(Mr),new Zs(Ur)));case I:case V:case Q:return zl(+Mr,+Ur);case z:return Mr.name==Ur.name&&Mr.message==Ur.message;case Se:case Pe:return Mr==Ur+"";case W:var Pc=Ki;case Ae:var Qp=1&Hl;if(Pc||(Pc=Ol),Mr.size!=Ur.size&&!Qp)return!1;var yv=Iu.get(Mr);if(yv)return yv==Ur;Hl|=2,Iu.set(Mr,Ur);var Fu=bd(Pc(Mr),Pc(Ur),Hl,uu,Oa,Iu);return Iu.delete(Mr),Fu;case De:if(Pa)return Pa.call(Mr)==Pa.call(Ur)}return!1})(ce,Oe,Qn,Fe,et,jt,Vt);if(!(1&Fe)){var ir=an&&$n.call(ce,"__wrapped__"),at=Tn&&$n.call(Oe,"__wrapped__");if(ir||at){var Yr=ir?ce.value():ce,Ao=at?Oe.value():Oe;return Vt||(Vt=new Sl),jt(Yr,Ao,Fe,et,Vt)}}return Br?(Vt||(Vt=new Sl),(function(Mr,Ur,xa,Hl,uu,Oa){var Iu=1&xa,Pc=xf(Mr),Qp=Pc.length,yv=xf(Ur).length;if(Qp!=yv&&!Iu)return!1;for(var Fu=Qp;Fu--;){var Sd=Pc[Fu];if(!(Iu?Sd in Ur:$n.call(Ur,Sd)))return!1}var wy=Oa.get(Mr),eh=Oa.get(Ur);if(wy&&eh)return wy==Ur&&eh==Mr;var _v=!0;Oa.set(Mr,Ur),Oa.set(Ur,Mr);for(var Ey=Iu;++Fu<Qp;){var bv=Mr[Sd=Pc[Fu]],Vf=Ur[Sd];if(Hl)var Wf=Iu?Hl(Vf,bv,Sd,Ur,Mr,Oa):Hl(bv,Vf,Sd,Mr,Ur,Oa);if(!(Wf===l?bv===Vf||uu(bv,Vf,xa,Hl,Oa):Wf)){_v=!1;break}Ey||(Ey=Sd=="constructor")}if(_v&&!Ey){var Rc=Mr.constructor,wv=Ur.constructor;Rc==wv||!("constructor"in Mr)||!("constructor"in Ur)||typeof Rc=="function"&&Rc instanceof Rc&&typeof wv=="function"&&wv instanceof wv||(_v=!1)}return Oa.delete(Mr),Oa.delete(Ur),_v})(ce,Oe,Fe,et,jt,Vt)):!1})(g,x,C,G,hd,te))}function Vl(g,x,C,G){var te=C.length,ce=te,Oe=!G;if(g==null)return!ce;for(g=L(g);te--;){var Fe=C[te];if(Oe&&Fe[2]?Fe[1]!==g[Fe[0]]:!(Fe[0]in g))return!1}for(;++te<ce;){var et=(Fe=C[te])[0],jt=g[et],Vt=Fe[1];if(Oe&&Fe[2]){if(jt===l&&!(et in g))return!1}else{var yn=new Sl;if(G)var Yn=G(jt,Vt,et,g,x,yn);if(!(Yn===l?hd(Vt,jt,3,G,yn):Yn))return!1}}return!0}function Mu(g){return!(!Ni(g)||(x=g,Kr&&Kr in x))&&(Cl(g)?el:yo).test(Ru(g));var x}function ru(g){return typeof g=="function"?g:g==null?Nr:typeof g=="object"?Jr(g)?Jh(g[0],g[1]):Zh(g):xe(g)}function Wl(g){if(!Qt(g))return wp(g);var x=[];for(var C in L(g))$n.call(g,C)&&C!="constructor"&&x.push(C);return x}function _m(g){if(!Ni(g))return(function(te){var ce=[];if(te!=null)for(var Oe in L(te))ce.push(Oe);return ce})(g);var x=Qt(g),C=[];for(var G in g)(G!="constructor"||!x&&$n.call(g,G))&&C.push(G);return C}function js(g,x){return g<x}function Ml(g,x){var C=-1,G=fl(g)?Gn(g.length):[];return mi(g,(function(te,ce,Oe){G[++C]=x(te,ce,Oe)})),G}function Zh(g){var x=Of(g);return x.length==1&&x[0][2]?Af(x[0][0],x[0][1]):function(C){return C===g||Vl(C,g,x)}}function Jh(g,x){return Is(g)&&xc(x)?Af(vs(g),x):function(C){var G=_n(C,g);return G===l&&G===x?Yt(C,g):hd(x,G,3)}}function Cp(g,x,C,G,te){g!==x&&lo(x,(function(ce,Oe){if(te||(te=new Sl),Ni(ce))(function(et,jt,Vt,yn,Yn,Qn,Sr){var an=zp(et,Vt),Tn=zp(jt,Vt),Br=Sr.get(Tn);if(Br)return void tu(et,Vt,Br);var ir=Qn?Qn(an,Tn,Vt+"",et,jt,Sr):l,at=ir===l;if(at){var Yr=Jr(Tn),Ao=!Yr&&nl(Tn),Mr=!Yr&&!Ao&&yt(Tn);ir=Tn,Yr||Ao||Mr?Jr(an)?ir=an:Oi(an)?ir=va(an):Ao?(at=!1,ir=Sm(Tn,!0)):Mr?(at=!1,ir=Am(Tn,!0)):ir=[]:K(Tn)||Nc(Tn)?(ir=an,Nc(an)?ir=rn(an):Ni(an)&&!Cl(an)||(ir=tl(Tn))):at=!1}at&&(Sr.set(Tn,ir),Yn(ir,Tn,yn,Qn,Sr),Sr.delete(Tn)),tu(et,Vt,ir)})(g,x,Oe,C,Cp,G,te);else{var Fe=G?G(zp(g,Oe),ce,Oe+"",g,x,te):l;Fe===l&&(Fe=ce),tu(g,Oe,Fe)}}),Zt)}function bm(g,x){var C=g.length;if(C)return Ra(x+=x<0?C:0,C)?g[x]:l}function wm(g,x,C){x=x.length?Mo(x,(function(ce){return Jr(ce)?function(Oe){return Ds(Oe,ce.length===1?ce[0]:ce)}:ce})):[Nr];var G=-1;x=Mo(x,ui(Rr()));var te=Ml(g,(function(ce,Oe,Fe){var et=Mo(x,(function(jt){return jt(ce)}));return{criteria:et,index:++G,value:ce}}));return(function(ce,Oe){var Fe=ce.length;for(ce.sort(Oe);Fe--;)ce[Fe]=ce[Fe].value;return ce})(te,(function(ce,Oe){return(function(Fe,et,jt){for(var Vt=-1,yn=Fe.criteria,Yn=et.criteria,Qn=yn.length,Sr=jt.length;++Vt<Qn;){var an=vd(yn[Vt],Yn[Vt]);if(an)return Vt>=Sr?an:an*(jt[Vt]=="desc"?-1:1)}return Fe.index-et.index})(ce,Oe,C)}))}function Em(g,x,C){for(var G=-1,te=x.length,ce={};++G<te;){var Oe=x[G],Fe=Ds(g,Oe);C(Fe,Oe)&&hc(ce,jo(Oe,g),Fe)}return ce}function Np(g,x,C,G){var te=G?Ja:bu,ce=-1,Oe=x.length,Fe=g;for(g===x&&(x=va(x)),C&&(Fe=Mo(g,ui(C)));++ce<Oe;)for(var et=0,jt=x[ce],Vt=C?C(jt):jt;(et=te(Fe,Vt,et,G))>-1;)Fe!==g&&Js.call(Fe,et,1),Js.call(g,et,1);return g}function Qh(g,x){for(var C=g?x.length:0,G=C-1;C--;){var te=x[C];if(C==G||te!==ce){var ce=te;Ra(te)?Js.call(g,te,1):Pp(g,te)}}return g}function ev(g,x){return g+cc(ud()*(x-g+1))}function gf(g,x){var C="";if(!g||x<1||x>T)return C;do x%2&&(C+=g),(x=cc(x/2))&&(g+=g);while(x);return C}function uo(g,x){return Tf(Mf(g,x,Nr),g+"")}function vy(g){return Ap(Qr(g))}function tv(g,x){var C=Qr(g);return Bs(C,Au(x,0,C.length))}function hc(g,x,C,G){if(!Ni(g))return g;for(var te=-1,ce=(x=jo(x,g)).length,Oe=ce-1,Fe=g;Fe!=null&&++te<ce;){var et=vs(x[te]),jt=C;if(et==="__proto__"||et==="constructor"||et==="prototype")return g;if(te!=Oe){var Vt=Fe[et];(jt=G?G(Vt,et,Fe):l)===l&&(jt=Ni(Vt)?Vt:Ra(x[te+1])?[]:{})}Li(Fe,et,jt),Fe=Fe[et]}return g}var yf=ff?function(g,x){return ff.set(g,x),g}:Nr,my=uc?function(g,x){return uc(g,"toString",{configurable:!0,enumerable:!1,value:co(x),writable:!0})}:Nr;function xm(g){return Bs(Qr(g))}function Tl(g,x,C){var G=-1,te=g.length;x<0&&(x=-x>te?0:te+x),(C=C>te?te:C)<0&&(C+=te),te=x>C?0:C-x>>>0,x>>>=0;for(var ce=Gn(te);++G<te;)ce[G]=g[G+x];return ce}function gy(g,x){var C;return mi(g,(function(G,te,ce){return!(C=x(G,te,ce))})),!!C}function _f(g,x,C){var G=0,te=g==null?G:g.length;if(typeof x=="number"&&x==x&&te<=2147483647){for(;G<te;){var ce=G+te>>>1,Oe=g[ce];Oe!==null&&!Dt(Oe)&&(C?Oe<=x:Oe<x)?G=ce+1:te=ce}return te}return kp(g,x,Nr,C)}function kp(g,x,C,G){var te=0,ce=g==null?0:g.length;if(ce===0)return 0;for(var Oe=(x=C(x))!=x,Fe=x===null,et=Dt(x),jt=x===l;te<ce;){var Vt=cc((te+ce)/2),yn=C(g[Vt]),Yn=yn!==l,Qn=yn===null,Sr=yn==yn,an=Dt(yn);if(Oe)var Tn=G||Sr;else Tn=jt?Sr&&(G||Yn):Fe?Sr&&Yn&&(G||!Qn):et?Sr&&Yn&&!Qn&&(G||!an):!Qn&&!an&&(G?yn<=x:yn<x);Tn?te=Vt+1:ce=Vt}return Wa(ce,4294967294)}function nv(g,x){for(var C=-1,G=g.length,te=0,ce=[];++C<G;){var Oe=g[C],Fe=x?x(Oe):Oe;if(!C||!zl(Fe,et)){var et=Fe;ce[te++]=Oe===0?0:Oe}}return ce}function Om(g){return typeof g=="number"?g:Dt(g)?$:+g}function cl(g){if(typeof g=="string")return g;if(Jr(g))return Mo(g,cl)+"";if(Dt(g))return mm?mm.call(g):"";var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Tu(g,x,C){var G=-1,te=Za,ce=g.length,Oe=!0,Fe=[],et=Fe;if(C)Oe=!1,te=rf;else if(ce>=200){var jt=x?null:Tm(g);if(jt)return Ol(jt);Oe=!1,te=rs,et=new eu}else et=x?[]:Fe;e:for(;++G<ce;){var Vt=g[G],yn=x?x(Vt):Vt;if(Vt=C||Vt!==0?Vt:0,Oe&&yn==yn){for(var Yn=et.length;Yn--;)if(et[Yn]===yn)continue e;x&&et.push(yn),Fe.push(Vt)}else te(et,yn,C)||(et!==Fe&&et.push(yn),Fe.push(Vt))}return Fe}function Pp(g,x){return(g=Pu(g,x=jo(x,g)))==null||delete g[vs(gi(x))]}function vc(g,x,C,G){return hc(g,x,C(Ds(g,x)),G)}function Rp(g,x,C,G){for(var te=g.length,ce=G?te:-1;(G?ce--:++ce<te)&&x(g[ce],ce,g););return C?Tl(g,G?0:ce,G?ce+1:te):Tl(g,G?ce+1:0,G?te:ce)}function rv(g,x){var C=g;return C instanceof go&&(C=C.value()),ad(x,(function(G,te){return te.func.apply(te.thisArg,oa([G],te.args))}),C)}function Dp(g,x,C){var G=g.length;if(G<2)return G?Tu(g[0]):[];for(var te=-1,ce=Gn(G);++te<G;)for(var Oe=g[te],Fe=-1;++Fe<G;)Fe!=te&&(ce[te]=cs(ce[te]||Oe,g[Fe],x,C));return Tu(Ji(ce,1),x,C)}function bf(g,x,C){for(var G=-1,te=g.length,ce=x.length,Oe={};++G<te;){var Fe=G<ce?x[G]:l;C(Oe,g[G],Fe)}return Oe}function jp(g){return Oi(g)?g:[]}function Lp(g){return typeof g=="function"?g:Nr}function jo(g,x){return Jr(g)?g:Is(g,x)?[g]:dv(Wt(g))}var yy=uo;function Uo(g,x,C){var G=g.length;return C=C===l?G:C,!x&&C>=G?g:Tl(g,x,C)}var Ip=fm||function(g){return vi.clearTimeout(g)};function Sm(g,x){if(x)return g.slice();var C=g.length,G=Eu?Eu(C):new g.constructor(C);return g.copy(G),G}function mc(g){var x=new g.constructor(g.byteLength);return new Zs(x).set(new Zs(g)),x}function Am(g,x){var C=x?mc(g.buffer):g.buffer;return new g.constructor(C,g.byteOffset,g.length)}function vd(g,x){if(g!==x){var C=g!==l,G=g===null,te=g==g,ce=Dt(g),Oe=x!==l,Fe=x===null,et=x==x,jt=Dt(x);if(!Fe&&!jt&&!ce&&g>x||ce&&Oe&&et&&!Fe&&!jt||G&&Oe&&et||!C&&et||!te)return 1;if(!G&&!ce&&!jt&&g<x||jt&&C&&te&&!G&&!ce||Fe&&C&&te||!Oe&&te||!et)return-1}return 0}function Mm(g,x,C,G){for(var te=-1,ce=g.length,Oe=C.length,Fe=-1,et=x.length,jt=ji(ce-Oe,0),Vt=Gn(et+jt),yn=!G;++Fe<et;)Vt[Fe]=x[Fe];for(;++te<Oe;)(yn||te<ce)&&(Vt[C[te]]=g[te]);for(;jt--;)Vt[Fe++]=g[te++];return Vt}function gc(g,x,C,G){for(var te=-1,ce=g.length,Oe=-1,Fe=C.length,et=-1,jt=x.length,Vt=ji(ce-Fe,0),yn=Gn(Vt+jt),Yn=!G;++te<Vt;)yn[te]=g[te];for(var Qn=te;++et<jt;)yn[Qn+et]=x[et];for(;++Oe<Fe;)(Yn||te<ce)&&(yn[Qn+C[Oe]]=g[te++]);return yn}function va(g,x){var C=-1,G=g.length;for(x||(x=Gn(G));++C<G;)x[C]=g[C];return x}function ds(g,x,C,G){var te=!C;C||(C={});for(var ce=-1,Oe=x.length;++ce<Oe;){var Fe=x[ce],et=G?G(C[Fe],g[Fe],Fe,C,g):l;et===l&&(et=g[Fe]),te?us(C,Fe,et):Li(C,Fe,et)}return C}function ou(g,x){return function(C,G){var te=Jr(C)?Uh:zh,ce=x?x():{};return te(C,g,Rr(G,2),ce)}}function yc(g){return uo((function(x,C){var G=-1,te=C.length,ce=te>1?C[te-1]:l,Oe=te>2?C[2]:l;for(ce=g.length>3&&typeof ce=="function"?(te--,ce):l,Oe&&Fi(C[0],C[1],Oe)&&(ce=te<3?l:ce,te=1),x=L(x);++G<te;){var Fe=C[G];Fe&&g(x,Fe,G,ce)}return x}))}function _c(g,x){return function(C,G){if(C==null)return C;if(!fl(C))return g(C,G);for(var te=C.length,ce=x?te:-1,Oe=L(C);(x?ce--:++ce<te)&&G(Oe[ce],ce,Oe)!==!1;);return C}}function bc(g){return function(x,C,G){for(var te=-1,ce=L(x),Oe=G(x),Fe=Oe.length;Fe--;){var et=Oe[g?Fe:++te];if(C(ce[et],et,ce)===!1)break}return x}}function Fp(g){return function(x){var C=os(x=Wt(x))?Qa(x):l,G=C?C[0]:x.charAt(0),te=C?Uo(C,1).join(""):x.slice(1);return G[g]()+te}}function iu(g){return function(x){return ad(di(jr(x).replace(Kn,"")),g,"")}}function wc(g){return function(){var x=arguments;switch(x.length){case 0:return new g;case 1:return new g(x[0]);case 2:return new g(x[0],x[1]);case 3:return new g(x[0],x[1],x[2]);case 4:return new g(x[0],x[1],x[2],x[3]);case 5:return new g(x[0],x[1],x[2],x[3],x[4]);case 6:return new g(x[0],x[1],x[2],x[3],x[4],x[5]);case 7:return new g(x[0],x[1],x[2],x[3],x[4],x[5],x[6])}var C=pc(g.prototype),G=g.apply(C,x);return Ni(G)?G:C}}function Bp(g){return function(x,C,G){var te=L(x);if(!fl(x)){var ce=Rr(C,3);x=on(x),C=function(Fe){return ce(te[Fe],Fe,te)}}var Oe=g(x,C,G);return Oe>-1?te[ce?x[Oe]:Oe]:l}}function fs(g){return Ls((function(x){var C=x.length,G=C,te=Ul.prototype.thru;for(g&&x.reverse();G--;){var ce=x[G];if(typeof ce!="function")throw new Re(f);if(te&&!Oe&&Cu(ce)=="wrapper")var Oe=new Ul([],!0)}for(G=Oe?G:C;++G<C;){var Fe=Cu(ce=x[G]),et=Fe=="wrapper"?Wp(ce):l;Oe=et&&Fs(et[0])&&et[1]==424&&!et[4].length&&et[9]==1?Oe[Cu(et[0])].apply(Oe,et[3]):ce.length==1&&Fs(ce)?Oe[Fe]():Oe.thru(ce)}return function(){var jt=arguments,Vt=jt[0];if(Oe&&jt.length==1&&Jr(Vt))return Oe.plant(Vt).value();for(var yn=0,Yn=C?x[yn].apply(this,jt):Vt;++yn<C;)Yn=x[yn].call(this,Yn);return Yn}}))}function wf(g,x,C,G,te,ce,Oe,Fe,et,jt){var Vt=x&w,yn=1&x,Yn=2&x,Qn=24&x,Sr=512&x,an=Yn?l:wc(g);return function Tn(){for(var Br=arguments.length,ir=Gn(Br),at=Br;at--;)ir[at]=arguments[at];if(Qn)var Yr=Nu(Tn),Ao=Vh(ir,Yr);if(G&&(ir=Mm(ir,G,te,Qn)),ce&&(ir=gc(ir,ce,Oe,Qn)),Br-=Ao,Qn&&Br<jt){var Mr=ll(ir,Yr);return ov(g,x,wf,Tn.placeholder,C,ir,Mr,Fe,et,jt-Br)}var Ur=yn?C:this,xa=Yn?Ur[g]:g;return Br=ir.length,Fe?ir=Oc(ir,Fe):Sr&&Br>1&&ir.reverse(),Vt&&et<Br&&(ir.length=et),this&&this!==vi&&this instanceof Tn&&(xa=an||wc(xa)),xa.apply(Ur,ir)}}function Ef(g,x){return function(C,G){return(function(te,ce,Oe,Fe){return ur(te,(function(et,jt,Vt){ce(Fe,Oe(et),jt,Vt)})),Fe})(C,g,x(G),{})}}function md(g,x){return function(C,G){var te;if(C===l&&G===l)return x;if(C!==l&&(te=C),G!==l){if(te===l)return G;typeof C=="string"||typeof G=="string"?(C=cl(C),G=cl(G)):(C=Om(C),G=Om(G)),te=g(C,G)}return te}}function gd(g){return Ls((function(x){return x=Mo(x,ui(Rr())),uo((function(C){var G=this;return g(x,(function(te){return qo(te,G,C)}))}))}))}function yd(g,x){var C=(x=x===l?" ":cl(x)).length;if(C<2)return C?gf(x,g):x;var G=gf(x,uf(g/Va(x)));return os(x)?Uo(Qa(G),0,g).join(""):G.slice(0,g)}function $p(g){return function(x,C,G){return G&&typeof G!="number"&&Fi(x,C,G)&&(C=G=l),x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(te,ce,Oe,Fe){for(var et=-1,jt=ji(uf((ce-te)/(Oe||1)),0),Vt=Gn(jt);jt--;)Vt[Fe?jt:++et]=te,te+=Oe;return Vt})(x,C,G=G===l?x<C?1:-1:nn(G),g)}}function _d(g){return function(x,C){return typeof x=="string"&&typeof C=="string"||(x=pn(x),C=pn(C)),g(x,C)}}function ov(g,x,C,G,te,ce,Oe,Fe,et,jt){var Vt=8&x;x|=Vt?E:O,4&(x&=~(Vt?O:E))||(x&=-4);var yn=[g,x,te,Vt?ce:l,Vt?Oe:l,Vt?l:ce,Vt?l:Oe,Fe,et,jt],Yn=C.apply(l,yn);return Fs(g)&&uv(Yn,yn),Yn.placeholder=G,Hp(Yn,g,x)}function Up(g){var x=R[g];return function(C,G){if(C=pn(C),(G=G==null?0:Wa(Mt(G),292))&&dc(C)){var te=(Wt(C)+"e").split("e");return+((te=(Wt(x(te[0]+"e"+(+te[1]+G)))+"e").split("e"))[0]+"e"+(+te[1]-G))}return x(C)}}var Tm=fc&&1/Ol(new fc([,-0]))[1]==M?function(g){return new fc(g)}:Et;function iv(g){return function(x){var C=Ti(x);return C==W?Ki(x):C==Ae?sd(x):(function(G,te){return Mo(te,(function(ce){return[ce,G[ce]]}))})(x,g(x))}}function ps(g,x,C,G,te,ce,Oe,Fe){var et=2&x;if(!et&&typeof g!="function")throw new Re(f);var jt=G?G.length:0;if(jt||(x&=-97,G=te=l),Oe=Oe===l?Oe:ji(Mt(Oe),0),Fe=Fe===l?Fe:Mt(Fe),jt-=te?te.length:0,x&O){var Vt=G,yn=te;G=te=l}var Yn=et?l:Wp(g),Qn=[g,x,C,G,te,Vt,yn,ce,Oe,Fe];if(Yn&&(function(an,Tn){var Br=an[1],ir=Tn[1],at=Br|ir,Yr=at<131,Ao=ir==w&&Br==8||ir==w&&Br==S&&an[7].length<=Tn[8]||ir==384&&Tn[7].length<=Tn[8]&&Br==8;if(!Yr&&!Ao)return an;1&ir&&(an[2]=Tn[2],at|=1&Br?0:4);var Mr=Tn[3];if(Mr){var Ur=an[3];an[3]=Ur?Mm(Ur,Mr,Tn[4]):Mr,an[4]=Ur?ll(an[3],v):Tn[4]}(Mr=Tn[5])&&(Ur=an[5],an[5]=Ur?gc(Ur,Mr,Tn[6]):Mr,an[6]=Ur?ll(an[5],v):Tn[6]),(Mr=Tn[7])&&(an[7]=Mr),ir&w&&(an[8]=an[8]==null?Tn[8]:Wa(an[8],Tn[8])),an[9]==null&&(an[9]=Tn[9]),an[0]=Tn[0],an[1]=at})(Qn,Yn),g=Qn[0],x=Qn[1],C=Qn[2],G=Qn[3],te=Qn[4],!(Fe=Qn[9]=Qn[9]===l?et?0:g.length:ji(Qn[9]-jt,0))&&24&x&&(x&=-25),x&&x!=1)Sr=x==8||x==b?(function(an,Tn,Br){var ir=wc(an);return function at(){for(var Yr=arguments.length,Ao=Gn(Yr),Mr=Yr,Ur=Nu(at);Mr--;)Ao[Mr]=arguments[Mr];var xa=Yr<3&&Ao[0]!==Ur&&Ao[Yr-1]!==Ur?[]:ll(Ao,Ur);return(Yr-=xa.length)<Br?ov(an,Tn,wf,at.placeholder,l,Ao,xa,l,l,Br-Yr):qo(this&&this!==vi&&this instanceof at?ir:an,this,Ao)}})(g,x,Fe):x!=E&&x!=33||te.length?wf.apply(l,Qn):(function(an,Tn,Br,ir){var at=1&Tn,Yr=wc(an);return function Ao(){for(var Mr=-1,Ur=arguments.length,xa=-1,Hl=ir.length,uu=Gn(Hl+Ur),Oa=this&&this!==vi&&this instanceof Ao?Yr:an;++xa<Hl;)uu[xa]=ir[xa];for(;Ur--;)uu[xa++]=arguments[++Mr];return qo(Oa,at?Br:this,uu)}})(g,x,C,G);else var Sr=(function(an,Tn,Br){var ir=1&Tn,at=wc(an);return function Yr(){return(this&&this!==vi&&this instanceof Yr?at:an).apply(ir?Br:this,arguments)}})(g,x,C);return Hp((Yn?yf:uv)(Sr,Qn),g,x)}function av(g,x,C,G){return g===l||zl(g,bn[C])&&!$n.call(G,C)?x:g}function lv(g,x,C,G,te,ce){return Ni(g)&&Ni(x)&&(ce.set(x,g),Cp(g,x,l,lv,ce),ce.delete(x)),g}function sv(g){return K(g)?l:g}function bd(g,x,C,G,te,ce){var Oe=1&C,Fe=g.length,et=x.length;if(Fe!=et&&!(Oe&&et>Fe))return!1;var jt=ce.get(g),Vt=ce.get(x);if(jt&&Vt)return jt==x&&Vt==g;var yn=-1,Yn=!0,Qn=2&C?new eu:l;for(ce.set(g,x),ce.set(x,g);++yn<Fe;){var Sr=g[yn],an=x[yn];if(G)var Tn=Oe?G(an,Sr,yn,x,g,ce):G(Sr,an,yn,g,x,ce);if(Tn!==l){if(Tn)continue;Yn=!1;break}if(Qn){if(!of(x,(function(Br,ir){if(!rs(Qn,ir)&&(Sr===Br||te(Sr,Br,C,G,ce)))return Qn.push(ir)}))){Yn=!1;break}}else if(Sr!==an&&!te(Sr,an,C,G,ce)){Yn=!1;break}}return ce.delete(g),ce.delete(x),Yn}function Ls(g){return Tf(Mf(g,l,Cf),g+"")}function xf(g){return Mp(g,on,aa)}function Vp(g){return Mp(g,Zt,Ec)}var Wp=ff?function(g){return ff.get(g)}:Et;function Cu(g){for(var x=g.name+"",C=Su[x],G=$n.call(Su,x)?C.length:0;G--;){var te=C[G],ce=te.func;if(ce==null||ce==g)return te.name}return x}function Nu(g){return($n.call(he,"placeholder")?he:g).placeholder}function Rr(){var g=he.iteratee||fi;return g=g===fi?ru:g,arguments.length?g(arguments[0],arguments[1]):g}function wd(g,x){var C,G,te=g.__data__;return((G=typeof(C=x))=="string"||G=="number"||G=="symbol"||G=="boolean"?C!=="__proto__":C===null)?te[typeof x=="string"?"string":"hash"]:te.map}function Of(g){for(var x=on(g),C=x.length;C--;){var G=x[C],te=g[G];x[C]=[G,te,xc(te)]}return x}function hs(g,x){var C=(function(G,te){return G==null?l:G[te]})(g,x);return Mu(C)?C:l}var aa=bp?function(g){return g==null?[]:(g=L(g),Ba(bp(g),(function(x){return Zi.call(g,x)})))}:tt,Ec=bp?function(g){for(var x=[];g;)oa(x,aa(g)),g=is(g);return x}:tt,Ti=Ei;function ku(g,x,C){for(var G=-1,te=(x=jo(x,g)).length,ce=!1;++G<te;){var Oe=vs(x[G]);if(!(ce=g!=null&&C(g,Oe)))break;g=g[Oe]}return ce||++G!=te?ce:!!(te=g==null?0:g.length)&&Uf(te)&&Ra(Oe,te)&&(Jr(g)||Nc(g))}function tl(g){return typeof g.constructor!="function"||Qt(g)?{}:pc(is(g))}function Sf(g){return Jr(g)||Nc(g)||!!(Rs&&g&&g[Rs])}function Ra(g,x){var C=typeof g;return!!(x=x??T)&&(C=="number"||C!="symbol"&&Nn.test(g))&&g>-1&&g%1==0&&g<x}function Fi(g,x,C){if(!Ni(C))return!1;var G=typeof x;return!!(G=="number"?fl(C)&&Ra(x,C.length):G=="string"&&x in C)&&zl(C[x],g)}function Is(g,x){if(Jr(g))return!1;var C=typeof g;return!(C!="number"&&C!="symbol"&&C!="boolean"&&g!=null&&!Dt(g))||kt.test(g)||!q.test(g)||x!=null&&g in L(x)}function Fs(g){var x=Cu(g),C=he[x];if(typeof C!="function"||!(x in go.prototype))return!1;if(g===C)return!0;var G=Wp(C);return!!G&&g===G[0]}(cd&&Ti(new cd(new ArrayBuffer(1)))!=Be||dd&&Ti(new dd)!=W||df&&Ti(df.resolve())!=ie||fc&&Ti(new fc)!=Ae||Ou&&Ti(new Ou)!=ze)&&(Ti=function(g){var x=Ei(g),C=x==J?g.constructor:l,G=C?Ru(C):"";if(G)switch(G){case fy:return Be;case pf:return W;case py:return ie;case hy:return Ae;case vm:return ze}return x});var Gp=Jn?Cl:ct;function Qt(g){var x=g&&g.constructor;return g===(typeof x=="function"&&x.prototype||bn)}function xc(g){return g==g&&!Ni(g)}function Af(g,x){return function(C){return C!=null&&C[g]===x&&(x!==l||g in L(C))}}function Mf(g,x,C){return x=ji(x===l?g.length-1:x,0),function(){for(var G=arguments,te=-1,ce=ji(G.length-x,0),Oe=Gn(ce);++te<ce;)Oe[te]=G[x+te];te=-1;for(var Fe=Gn(x+1);++te<x;)Fe[te]=G[te];return Fe[x]=C(Oe),qo(g,this,Fe)}}function Pu(g,x){return x.length<2?g:Ds(g,Tl(x,0,-1))}function Oc(g,x){for(var C=g.length,G=Wa(x.length,C),te=va(g);G--;){var ce=x[G];g[G]=Ra(ce,C)?te[ce]:l}return g}function zp(g,x){if((x!=="constructor"||typeof g[x]!="function")&&x!="__proto__")return g[x]}var uv=cv(yf),Sc=Wh||function(g,x){return vi.setTimeout(g,x)},Tf=cv(my);function Hp(g,x,C){var G=x+"";return Tf(g,(function(te,ce){var Oe=ce.length;if(!Oe)return te;var Fe=Oe-1;return ce[Fe]=(Oe>1?"& ":"")+ce[Fe],ce=ce.join(Oe>2?", ":" "),te.replace(ke,`{
|
||
/* [wrapped with `+ce+`] */
|
||
`)})(G,(function(te,ce){return Fa(P,(function(Oe){var Fe="_."+Oe[0];ce&Oe[1]&&!Za(te,Fe)&&te.push(Fe)})),te.sort()})((function(te){var ce=te.match(Ke);return ce?ce[1].split(Le):[]})(G),C)))}function cv(g){var x=0,C=0;return function(){var G=Ep(),te=16-(G-C);if(C=G,te>0){if(++x>=800)return arguments[0]}else x=0;return g.apply(l,arguments)}}function Bs(g,x){var C=-1,G=g.length,te=G-1;for(x=x===l?G:x;++C<x;){var ce=ev(C,te),Oe=g[ce];g[ce]=g[C],g[C]=Oe}return g.length=x,g}var dv=(function(g){var x=su(g,(function(G){return C.size===500&&C.clear(),G})),C=x.cache;return x})((function(g){var x=[];return g.charCodeAt(0)===46&&x.push(""),g.replace(Rt,(function(C,G,te,ce){x.push(te?ce.replace(Tt,"$1"):G||C)})),x}));function vs(g){if(typeof g=="string"||Dt(g))return g;var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Ru(g){if(g!=null){try{return no.call(g)}catch{}try{return g+""}catch{}}return""}function Xp(g){if(g instanceof go)return g.clone();var x=new Ul(g.__wrapped__,g.__chain__);return x.__actions__=va(g.__actions__),x.__index__=g.__index__,x.__values__=g.__values__,x}var Cm=uo((function(g,x){return Oi(g)?cs(g,Ji(x,1,Oi,!0)):[]})),Nm=uo((function(g,x){var C=gi(x);return Oi(C)&&(C=l),Oi(g)?cs(g,Ji(x,1,Oi,!0),Rr(C,2)):[]})),km=uo((function(g,x){var C=gi(x);return Oi(C)&&(C=l),Oi(g)?cs(g,Ji(x,1,Oi,!0),l,C):[]}));function fv(g,x,C){var G=g==null?0:g.length;if(!G)return-1;var te=C==null?0:Mt(C);return te<0&&(te=ji(G+te,0)),$a(g,Rr(x,3),te)}function Yp(g,x,C){var G=g==null?0:g.length;if(!G)return-1;var te=G-1;return C!==l&&(te=Mt(C),te=C<0?ji(G+te,0):Wa(te,G-1)),$a(g,Rr(x,3),te,!0)}function Cf(g){return g!=null&&g.length?Ji(g,1):[]}function Pm(g){return g&&g.length?g[0]:l}var ms=uo((function(g){var x=Mo(g,jp);return x.length&&x[0]===g[0]?mf(x):[]})),Du=uo((function(g){var x=gi(g),C=Mo(g,jp);return x===gi(C)?x=l:C.pop(),C.length&&C[0]===g[0]?mf(C,Rr(x,2)):[]})),_y=uo((function(g){var x=gi(g),C=Mo(g,jp);return(x=typeof x=="function"?x:l)&&C.pop(),C.length&&C[0]===g[0]?mf(C,l,x):[]}));function gi(g){var x=g==null?0:g.length;return x?g[x-1]:l}var Nf=uo(Ac);function Ac(g,x){return g&&g.length&&x&&x.length?Np(g,x):g}var kf=Ls((function(g,x){var C=g==null?0:g.length,G=hf(g,x);return Qh(g,Mo(x,(function(te){return Ra(te,C)?+te:te})).sort(vd)),G}));function Ed(g){return g==null?g:dy.call(g)}var Pf=uo((function(g){return Tu(Ji(g,1,Oi,!0))})),Rf=uo((function(g){var x=gi(g);return Oi(x)&&(x=l),Tu(Ji(g,1,Oi,!0),Rr(x,2))})),Df=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:l,Tu(Ji(g,1,Oi,!0),l,x)}));function Mc(g){if(!g||!g.length)return[];var x=0;return g=Ba(g,(function(C){if(Oi(C))return x=ji(C.length,x),!0})),Ks(x,(function(C){return Mo(g,Ua(C))}))}function au(g,x){if(!g||!g.length)return[];var C=Mc(g);return x==null?C:Mo(C,(function(G){return qo(x,l,G)}))}var ma=uo((function(g,x){return Oi(g)?cs(g,x):[]})),qp=uo((function(g){return Dp(Ba(g,Oi))})),jf=uo((function(g){var x=gi(g);return Oi(x)&&(x=l),Dp(Ba(g,Oi),Rr(x,2))})),Tc=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:l,Dp(Ba(g,Oi),l,x)})),xd=uo(Mc),wa=uo((function(g){var x=g.length,C=x>1?g[x-1]:l;return C=typeof C=="function"?(g.pop(),C):l,au(g,C)}));function xi(g){var x=he(g);return x.__chain__=!0,x}function Lf(g,x){return x(g)}var za=Ls((function(g){var x=g.length,C=x?g[0]:0,G=this.__wrapped__,te=function(ce){return hf(ce,g)};return!(x>1||this.__actions__.length)&&G instanceof go&&Ra(C)?((G=G.slice(C,+C+(x?1:0))).__actions__.push({func:Lf,args:[te],thisArg:l}),new Ul(G,this.__chain__).thru((function(ce){return x&&!ce.length&&ce.push(l),ce}))):this.thru(te)})),wr=ou((function(g,x,C){$n.call(g,C)?++g[C]:us(g,C,1)})),Kp=Bp(fv),If=Bp(Yp);function Zp(g,x){return(Jr(g)?Fa:mi)(g,Rr(x,3))}function pv(g,x){return(Jr(g)?gp:ym)(g,Rr(x,3))}var Rm=ou((function(g,x,C){$n.call(g,C)?g[C].push(x):us(g,C,[x])})),ju=uo((function(g,x,C){var G=-1,te=typeof x=="function",ce=fl(g)?Gn(g.length):[];return mi(g,(function(Oe){ce[++G]=te?qo(x,Oe,C):Ga(Oe,x,C)})),ce})),Dm=ou((function(g,x,C){us(g,C,x)}));function Cc(g,x){return(Jr(g)?Mo:Ml)(g,Rr(x,3))}var jm=ou((function(g,x,C){g[C?0:1].push(x)}),(function(){return[[],[]]})),hv=uo((function(g,x){if(g==null)return[];var C=x.length;return C>1&&Fi(g,x[0],x[1])?x=[]:C>2&&Fi(x[0],x[1],x[2])&&(x=[x[0]]),wm(g,Ji(x,1),[])})),Ff=pm||function(){return vi.Date.now()};function Lm(g,x,C){return x=C?l:x,x=g&&x==null?g.length:x,ps(g,w,l,l,l,l,x)}function Gl(g,x){var C;if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){return--g>0&&(C=x.apply(this,arguments)),g<=1&&(x=l),C}}var lu=uo((function(g,x,C){var G=1;if(C.length){var te=ll(C,Nu(lu));G|=E}return ps(g,G,x,C,te)})),Lu=uo((function(g,x,C){var G=3;if(C.length){var te=ll(C,Nu(Lu));G|=E}return ps(x,G,g,C,te)}));function Er(g,x,C){var G,te,ce,Oe,Fe,et,jt=0,Vt=!1,yn=!1,Yn=!0;if(typeof g!="function")throw new Re(f);function Qn(at){var Yr=G,Ao=te;return G=te=l,jt=at,Oe=g.apply(Ao,Yr)}function Sr(at){return jt=at,Fe=Sc(Tn,x),Vt?Qn(at):Oe}function an(at){var Yr=at-et;return et===l||Yr>=x||Yr<0||yn&&at-jt>=ce}function Tn(){var at=Ff();if(an(at))return Br(at);Fe=Sc(Tn,(function(Yr){var Ao=x-(Yr-et);return yn?Wa(Ao,ce-(Yr-jt)):Ao})(at))}function Br(at){return Fe=l,Yn&&G?Qn(at):(G=te=l,Oe)}function ir(){var at=Ff(),Yr=an(at);if(G=arguments,te=this,et=at,Yr){if(Fe===l)return Sr(et);if(yn)return Ip(Fe),Fe=Sc(Tn,x),Qn(et)}return Fe===l&&(Fe=Sc(Tn,x)),Oe}return x=pn(x)||0,Ni(C)&&(Vt=!!C.leading,ce=(yn="maxWait"in C)?ji(pn(C.maxWait)||0,x):ce,Yn="trailing"in C?!!C.trailing:Yn),ir.cancel=function(){Fe!==l&&Ip(Fe),jt=0,G=et=te=Fe=l},ir.flush=function(){return Fe===l?Oe:Br(Ff())},ir}var vv=uo((function(g,x){return Xh(g,1,x)})),Od=uo((function(g,x,C){return Xh(g,pn(x)||0,C)}));function su(g,x){if(typeof g!="function"||x!=null&&typeof x!="function")throw new Re(f);var C=function(){var G=arguments,te=x?x.apply(this,G):G[0],ce=C.cache;if(ce.has(te))return ce.get(te);var Oe=g.apply(this,G);return C.cache=ce.set(te,Oe)||ce,Oe};return C.cache=new(su.Cache||ss),C}function Bf(g){if(typeof g!="function")throw new Re(f);return function(){var x=arguments;switch(x.length){case 0:return!g.call(this);case 1:return!g.call(this,x[0]);case 2:return!g.call(this,x[0],x[1]);case 3:return!g.call(this,x[0],x[1],x[2])}return!g.apply(this,x)}}su.Cache=ss;var Ha=yy((function(g,x){var C=(x=x.length==1&&Jr(x[0])?Mo(x[0],ui(Rr())):Mo(Ji(x,1),ui(Rr()))).length;return uo((function(G){for(var te=-1,ce=Wa(G.length,C);++te<ce;)G[te]=x[te].call(this,G[te]);return qo(g,this,G)}))})),gs=uo((function(g,x){var C=ll(x,Nu(gs));return ps(g,E,l,x,C)})),Ci=uo((function(g,x){var C=ll(x,Nu(Ci));return ps(g,O,l,x,C)})),dl=Ls((function(g,x){return ps(g,S,l,l,l,x)}));function zl(g,x){return g===x||g!=g&&x!=x}var by=_d(Mi),$f=_d((function(g,x){return g>=x})),Nc=Tp((function(){return arguments})())?Tp:function(g){return Bi(g)&&$n.call(g,"callee")&&!Zi.call(g,"callee")},Jr=Gn.isArray,Im=La?ui(La):function(g){return Bi(g)&&Ei(g)==Ye};function fl(g){return g!=null&&Uf(g.length)&&!Cl(g)}function Oi(g){return Bi(g)&&fl(g)}var nl=hm||ct,mv=id?ui(id):function(g){return Bi(g)&&Ei(g)==V};function Ea(g){if(!Bi(g))return!1;var x=Ei(g);return x==z||x=="[object DOMException]"||typeof g.message=="string"&&typeof g.name=="string"&&!K(g)}function Cl(g){if(!Ni(g))return!1;var x=Ei(g);return x==X||x==Y||x=="[object AsyncFunction]"||x=="[object Proxy]"}function kc(g){return typeof g=="number"&&g==Mt(g)}function Uf(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=T}function Ni(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Bi(g){return g!=null&&typeof g=="object"}var Jp=_u?ui(_u):function(g){return Bi(g)&&Ti(g)==W};function gv(g){return typeof g=="number"||Bi(g)&&Ei(g)==Q}function K(g){if(!Bi(g)||Ei(g)!=J)return!1;var x=is(g);if(x===null)return!0;var C=$n.call(x,"constructor")&&x.constructor;return typeof C=="function"&&C instanceof C&&no.call(C)==ul}var me=Ia?ui(Ia):function(g){return Bi(g)&&Ei(g)==Se},Ie=ra?ui(ra):function(g){return Bi(g)&&Ti(g)==Ae};function wt(g){return typeof g=="string"||!Jr(g)&&Bi(g)&&Ei(g)==Pe}function Dt(g){return typeof g=="symbol"||Bi(g)&&Ei(g)==De}var yt=wl?ui(wl):function(g){return Bi(g)&&Uf(g.length)&&!!Cn[Ei(g)]},Nt=_d(js),tn=_d((function(g,x){return g<=x}));function sn(g){if(!g)return[];if(fl(g))return wt(g)?Qa(g):va(g);if(as&&g[as])return(function(C){for(var G,te=[];!(G=C.next()).done;)te.push(G.value);return te})(g[as]());var x=Ti(g);return(x==W?Ki:x==Ae?Ol:Qr)(g)}function nn(g){return g?(g=pn(g))===M||g===-1/0?17976931348623157e292*(g<0?-1:1):g==g?g:0:g===0?g:0}function Mt(g){var x=nn(g),C=x%1;return x==x?C?x-C:x:0}function wn(g){return g?Au(Mt(g),0,D):0}function pn(g){if(typeof g=="number")return g;if(Dt(g))return $;if(Ni(g)){var x=typeof g.valueOf=="function"?g.valueOf():g;g=Ni(x)?x+"":x}if(typeof g!="string")return g===0?g:+g;g=$l(g);var C=Lo.test(g);return C||ho.test(g)?lr(g.slice(2),C?2:8):ao.test(g)?$:+g}function rn(g){return ds(g,Zt(g))}function Wt(g){return g==null?"":cl(g)}var st=yc((function(g,x){if(Qt(x)||fl(x))ds(x,on(x),g);else for(var C in x)$n.call(x,C)&&Li(g,C,x[C])})),St=yc((function(g,x){ds(x,Zt(x),g)})),ln=yc((function(g,x,C,G){ds(x,Zt(x),g,G)})),An=yc((function(g,x,C,G){ds(x,on(x),g,G)})),Xt=Ls(hf),kn=uo((function(g,x){g=L(g);var C=-1,G=x.length,te=G>2?x[2]:l;for(te&&Fi(x[0],x[1],te)&&(G=1);++C<G;)for(var ce=x[C],Oe=Zt(ce),Fe=-1,et=Oe.length;++Fe<et;){var jt=Oe[Fe],Vt=g[jt];(Vt===l||zl(Vt,bn[jt])&&!$n.call(g,jt))&&(g[jt]=ce[jt])}return g})),Kt=uo((function(g){return g.push(l,lv),qo(fr,l,g)}));function _n(g,x,C){var G=g==null?l:Ds(g,x);return G===l?C:G}function Yt(g,x){return g!=null&&ku(g,x,Kh)}var xn=Ef((function(g,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),g[x]=C}),co(Nr)),ar=Ef((function(g,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),$n.call(g,x)?g[x].push(C):g[x]=[C]}),Rr),xr=uo(Ga);function on(g){return fl(g)?Sp(g):Wl(g)}function Zt(g){return fl(g)?Sp(g,!0):_m(g)}var Ht=yc((function(g,x,C){Cp(g,x,C)})),fr=yc((function(g,x,C,G){Cp(g,x,C,G)})),Dr=Ls((function(g,x){var C={};if(g==null)return C;var G=!1;x=Mo(x,(function(ce){return ce=jo(ce,g),G||(G=ce.length>1),ce})),ds(g,Vp(g),C),G&&(C=Al(C,7,sv));for(var te=x.length;te--;)Pp(C,x[te]);return C})),Un=Ls((function(g,x){return g==null?{}:(function(C,G){return Em(C,G,(function(te,ce){return Yt(C,ce)}))})(g,x)}));function $r(g,x){if(g==null)return{};var C=Mo(Vp(g),(function(G){return[G]}));return x=Rr(x),Em(g,C,(function(G,te){return x(G,te[0])}))}var Or=iv(on),Fr=iv(Zt);function Qr(g){return g==null?[]:lc(g,on(g))}var ki=iu((function(g,x,C){return x=x.toLowerCase(),g+(C?Si(x):x)}));function Si(g){return zi(Wt(g).toLowerCase())}function jr(g){return(g=Wt(g))&&g.replace(qn,lf).replace(br,"")}var Gi=iu((function(g,x,C){return g+(C?"-":"")+x.toLowerCase()})),Ko=iu((function(g,x,C){return g+(C?" ":"")+x.toLowerCase()})),Pi=Fp("toLowerCase"),$i=iu((function(g,x,C){return g+(C?"_":"")+x.toLowerCase()})),Qi=iu((function(g,x,C){return g+(C?" ":"")+zi(x)})),la=iu((function(g,x,C){return g+(C?" ":"")+x.toUpperCase()})),zi=Fp("toUpperCase");function di(g,x,C){return g=Wt(g),(x=C?l:x)===l?(function(G){return ht.test(G)})(g)?(function(G){return G.match(si)||[]})(g):(function(G){return G.match(dt)||[]})(g):g.match(x)||[]}var Cr=uo((function(g,x){try{return qo(g,l,x)}catch(C){return Ea(C)?C:new mo(C)}})),sa=Ls((function(g,x){return Fa(x,(function(C){C=vs(C),us(g,C,lu(g[C],g))})),g}));function co(g){return function(){return g}}var cr=fs(),Xr=fs(!0);function Nr(g){return g}function fi(g){return ru(typeof g=="function"?g:Al(g,1))}var $s=uo((function(g,x){return function(C){return Ga(C,g,x)}})),yi=uo((function(g,x){return function(C){return Ga(g,C,x)}}));function Te(g,x,C){var G=on(x),te=vf(x,G);C!=null||Ni(x)&&(te.length||!G.length)||(C=x,x=g,g=this,te=vf(x,on(x)));var ce=!(Ni(C)&&"chain"in C&&!C.chain),Oe=Cl(g);return Fa(te,(function(Fe){var et=x[Fe];g[Fe]=et,Oe&&(g.prototype[Fe]=function(){var jt=this.__chain__;if(ce||jt){var Vt=g(this.__wrapped__),yn=Vt.__actions__=va(this.__actions__);return yn.push({func:et,args:arguments,thisArg:g}),Vt.__chain__=jt,Vt}return et.apply(g,oa([this.value()],arguments))})})),g}function Et(){}var _t=gd(Mo),Ln=gd(yp),Gr=gd(of);function xe(g){return Is(g)?Ua(vs(g)):(function(x){return function(C){return Ds(C,x)}})(g)}var de=$p(),We=$p(!0);function tt(){return[]}function ct(){return!1}var Xe=md((function(g,x){return g+x}),0),Ge=Up("ceil"),Qe=md((function(g,x){return g/x}),1),Ee=Up("floor"),Ue,be=md((function(g,x){return g*x}),1),nt=Up("round"),ot=md((function(g,x){return g-x}),0);return he.after=function(g,x){if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){if(--g<1)return x.apply(this,arguments)}},he.ary=Lm,he.assign=st,he.assignIn=St,he.assignInWith=ln,he.assignWith=An,he.at=Xt,he.before=Gl,he.bind=lu,he.bindAll=sa,he.bindKey=Lu,he.castArray=function(){if(!arguments.length)return[];var g=arguments[0];return Jr(g)?g:[g]},he.chain=xi,he.chunk=function(g,x,C){x=(C?Fi(g,x,C):x===l)?1:ji(Mt(x),0);var G=g==null?0:g.length;if(!G||x<1)return[];for(var te=0,ce=0,Oe=Gn(uf(G/x));te<G;)Oe[ce++]=Tl(g,te,te+=x);return Oe},he.compact=function(g){for(var x=-1,C=g==null?0:g.length,G=0,te=[];++x<C;){var ce=g[x];ce&&(te[G++]=ce)}return te},he.concat=function(){var g=arguments.length;if(!g)return[];for(var x=Gn(g-1),C=arguments[0],G=g;G--;)x[G-1]=arguments[G];return oa(Jr(C)?va(C):[C],Ji(x,1))},he.cond=function(g){var x=g==null?0:g.length,C=Rr();return g=x?Mo(g,(function(G){if(typeof G[1]!="function")throw new Re(f);return[C(G[0]),G[1]]})):[],uo((function(G){for(var te=-1;++te<x;){var ce=g[te];if(qo(ce[0],this,G))return qo(ce[1],this,G)}}))},he.conforms=function(g){return(function(x){var C=on(x);return function(G){return Hh(G,x,C)}})(Al(g,1))},he.constant=co,he.countBy=wr,he.create=function(g,x){var C=pc(g);return x==null?C:nu(C,x)},he.curry=function g(x,C,G){var te=ps(x,8,l,l,l,l,l,C=G?l:C);return te.placeholder=g.placeholder,te},he.curryRight=function g(x,C,G){var te=ps(x,b,l,l,l,l,l,C=G?l:C);return te.placeholder=g.placeholder,te},he.debounce=Er,he.defaults=kn,he.defaultsDeep=Kt,he.defer=vv,he.delay=Od,he.difference=Cm,he.differenceBy=Nm,he.differenceWith=km,he.drop=function(g,x,C){var G=g==null?0:g.length;return G?Tl(g,(x=C||x===l?1:Mt(x))<0?0:x,G):[]},he.dropRight=function(g,x,C){var G=g==null?0:g.length;return G?Tl(g,0,(x=G-(x=C||x===l?1:Mt(x)))<0?0:x):[]},he.dropRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0,!0):[]},he.dropWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0):[]},he.fill=function(g,x,C,G){var te=g==null?0:g.length;return te?(C&&typeof C!="number"&&Fi(g,x,C)&&(C=0,G=te),(function(ce,Oe,Fe,et){var jt=ce.length;for((Fe=Mt(Fe))<0&&(Fe=-Fe>jt?0:jt+Fe),(et=et===l||et>jt?jt:Mt(et))<0&&(et+=jt),et=Fe>et?0:wn(et);Fe<et;)ce[Fe++]=Oe;return ce})(g,x,C,G)):[]},he.filter=function(g,x){return(Jr(g)?Ba:Io)(g,Rr(x,3))},he.flatMap=function(g,x){return Ji(Cc(g,x),1)},he.flatMapDeep=function(g,x){return Ji(Cc(g,x),M)},he.flatMapDepth=function(g,x,C){return C=C===l?1:Mt(C),Ji(Cc(g,x),C)},he.flatten=Cf,he.flattenDeep=function(g){return g!=null&&g.length?Ji(g,M):[]},he.flattenDepth=function(g,x){return g!=null&&g.length?Ji(g,x=x===l?1:Mt(x)):[]},he.flip=function(g){return ps(g,512)},he.flow=cr,he.flowRight=Xr,he.fromPairs=function(g){for(var x=-1,C=g==null?0:g.length,G={};++x<C;){var te=g[x];G[te[0]]=te[1]}return G},he.functions=function(g){return g==null?[]:vf(g,on(g))},he.functionsIn=function(g){return g==null?[]:vf(g,Zt(g))},he.groupBy=Rm,he.initial=function(g){return g!=null&&g.length?Tl(g,0,-1):[]},he.intersection=ms,he.intersectionBy=Du,he.intersectionWith=_y,he.invert=xn,he.invertBy=ar,he.invokeMap=ju,he.iteratee=fi,he.keyBy=Dm,he.keys=on,he.keysIn=Zt,he.map=Cc,he.mapKeys=function(g,x){var C={};return x=Rr(x,3),ur(g,(function(G,te,ce){us(C,x(G,te,ce),G)})),C},he.mapValues=function(g,x){var C={};return x=Rr(x,3),ur(g,(function(G,te,ce){us(C,te,x(G,te,ce))})),C},he.matches=function(g){return Zh(Al(g,1))},he.matchesProperty=function(g,x){return Jh(g,Al(x,1))},he.memoize=su,he.merge=Ht,he.mergeWith=fr,he.method=$s,he.methodOf=yi,he.mixin=Te,he.negate=Bf,he.nthArg=function(g){return g=Mt(g),uo((function(x){return bm(x,g)}))},he.omit=Dr,he.omitBy=function(g,x){return $r(g,Bf(Rr(x)))},he.once=function(g){return Gl(2,g)},he.orderBy=function(g,x,C,G){return g==null?[]:(Jr(x)||(x=x==null?[]:[x]),Jr(C=G?l:C)||(C=C==null?[]:[C]),wm(g,x,C))},he.over=_t,he.overArgs=Ha,he.overEvery=Ln,he.overSome=Gr,he.partial=gs,he.partialRight=Ci,he.partition=jm,he.pick=Un,he.pickBy=$r,he.property=xe,he.propertyOf=function(g){return function(x){return g==null?l:Ds(g,x)}},he.pull=Nf,he.pullAll=Ac,he.pullAllBy=function(g,x,C){return g&&g.length&&x&&x.length?Np(g,x,Rr(C,2)):g},he.pullAllWith=function(g,x,C){return g&&g.length&&x&&x.length?Np(g,x,l,C):g},he.pullAt=kf,he.range=de,he.rangeRight=We,he.rearg=dl,he.reject=function(g,x){return(Jr(g)?Ba:Io)(g,Bf(Rr(x,3)))},he.remove=function(g,x){var C=[];if(!g||!g.length)return C;var G=-1,te=[],ce=g.length;for(x=Rr(x,3);++G<ce;){var Oe=g[G];x(Oe,G,g)&&(C.push(Oe),te.push(G))}return Qh(g,te),C},he.rest=function(g,x){if(typeof g!="function")throw new Re(f);return uo(g,x=x===l?x:Mt(x))},he.reverse=Ed,he.sampleSize=function(g,x,C){return x=(C?Fi(g,x,C):x===l)?1:Mt(x),(Jr(g)?Gh:tv)(g,x)},he.set=function(g,x,C){return g==null?g:hc(g,x,C)},he.setWith=function(g,x,C,G){return G=typeof G=="function"?G:l,g==null?g:hc(g,x,C,G)},he.shuffle=function(g){return(Jr(g)?gm:xm)(g)},he.slice=function(g,x,C){var G=g==null?0:g.length;return G?(C&&typeof C!="number"&&Fi(g,x,C)?(x=0,C=G):(x=x==null?0:Mt(x),C=C===l?G:Mt(C)),Tl(g,x,C)):[]},he.sortBy=hv,he.sortedUniq=function(g){return g&&g.length?nv(g):[]},he.sortedUniqBy=function(g,x){return g&&g.length?nv(g,Rr(x,2)):[]},he.split=function(g,x,C){return C&&typeof C!="number"&&Fi(g,x,C)&&(x=C=l),(C=C===l?D:C>>>0)?(g=Wt(g))&&(typeof x=="string"||x!=null&&!me(x))&&!(x=cl(x))&&os(g)?Uo(Qa(g),0,C):g.split(x,C):[]},he.spread=function(g,x){if(typeof g!="function")throw new Re(f);return x=x==null?0:ji(Mt(x),0),uo((function(C){var G=C[x],te=Uo(C,0,x);return G&&oa(te,G),qo(g,this,te)}))},he.tail=function(g){var x=g==null?0:g.length;return x?Tl(g,1,x):[]},he.take=function(g,x,C){return g&&g.length?Tl(g,0,(x=C||x===l?1:Mt(x))<0?0:x):[]},he.takeRight=function(g,x,C){var G=g==null?0:g.length;return G?Tl(g,(x=G-(x=C||x===l?1:Mt(x)))<0?0:x,G):[]},he.takeRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!1,!0):[]},he.takeWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3)):[]},he.tap=function(g,x){return x(g),g},he.throttle=function(g,x,C){var G=!0,te=!0;if(typeof g!="function")throw new Re(f);return Ni(C)&&(G="leading"in C?!!C.leading:G,te="trailing"in C?!!C.trailing:te),Er(g,x,{leading:G,maxWait:x,trailing:te})},he.thru=Lf,he.toArray=sn,he.toPairs=Or,he.toPairsIn=Fr,he.toPath=function(g){return Jr(g)?Mo(g,vs):Dt(g)?[g]:va(dv(Wt(g)))},he.toPlainObject=rn,he.transform=function(g,x,C){var G=Jr(g),te=G||nl(g)||yt(g);if(x=Rr(x,4),C==null){var ce=g&&g.constructor;C=te?G?new ce:[]:Ni(g)&&Cl(ce)?pc(is(g)):{}}return(te?Fa:ur)(g,(function(Oe,Fe,et){return x(C,Oe,Fe,et)})),C},he.unary=function(g){return Lm(g,1)},he.union=Pf,he.unionBy=Rf,he.unionWith=Df,he.uniq=function(g){return g&&g.length?Tu(g):[]},he.uniqBy=function(g,x){return g&&g.length?Tu(g,Rr(x,2)):[]},he.uniqWith=function(g,x){return x=typeof x=="function"?x:l,g&&g.length?Tu(g,l,x):[]},he.unset=function(g,x){return g==null||Pp(g,x)},he.unzip=Mc,he.unzipWith=au,he.update=function(g,x,C){return g==null?g:vc(g,x,Lp(C))},he.updateWith=function(g,x,C,G){return G=typeof G=="function"?G:l,g==null?g:vc(g,x,Lp(C),G)},he.values=Qr,he.valuesIn=function(g){return g==null?[]:lc(g,Zt(g))},he.without=ma,he.words=di,he.wrap=function(g,x){return gs(Lp(x),g)},he.xor=qp,he.xorBy=jf,he.xorWith=Tc,he.zip=xd,he.zipObject=function(g,x){return bf(g||[],x||[],Li)},he.zipObjectDeep=function(g,x){return bf(g||[],x||[],hc)},he.zipWith=wa,he.entries=Or,he.entriesIn=Fr,he.extend=St,he.extendWith=ln,Te(he,he),he.add=Xe,he.attempt=Cr,he.camelCase=ki,he.capitalize=Si,he.ceil=Ge,he.clamp=function(g,x,C){return C===l&&(C=x,x=l),C!==l&&(C=(C=pn(C))==C?C:0),x!==l&&(x=(x=pn(x))==x?x:0),Au(pn(g),x,C)},he.clone=function(g){return Al(g,4)},he.cloneDeep=function(g){return Al(g,5)},he.cloneDeepWith=function(g,x){return Al(g,5,x=typeof x=="function"?x:l)},he.cloneWith=function(g,x){return Al(g,4,x=typeof x=="function"?x:l)},he.conformsTo=function(g,x){return x==null||Hh(g,x,on(x))},he.deburr=jr,he.defaultTo=function(g,x){return g==null||g!=g?x:g},he.divide=Qe,he.endsWith=function(g,x,C){g=Wt(g),x=cl(x);var G=g.length,te=C=C===l?G:Au(Mt(C),0,G);return(C-=x.length)>=0&&g.slice(C,te)==x},he.eq=zl,he.escape=function(g){return(g=Wt(g))&&ae.test(g)?g.replace(zt,Wi):g},he.escapeRegExp=function(g){return(g=Wt(g))&&Pn.test(g)?g.replace(Gt,"\\$&"):g},he.every=function(g,x,C){var G=Jr(g)?yp:Yh;return C&&Fi(g,x,C)&&(x=l),G(g,Rr(x,3))},he.find=Kp,he.findIndex=fv,he.findKey=function(g,x){return ns(g,Rr(x,3),ur)},he.findLast=If,he.findLastIndex=Yp,he.findLastKey=function(g,x){return ns(g,Rr(x,3),ti)},he.floor=Ee,he.forEach=Zp,he.forEachRight=pv,he.forIn=function(g,x){return g==null?g:lo(g,Rr(x,3),Zt)},he.forInRight=function(g,x){return g==null?g:ei(g,Rr(x,3),Zt)},he.forOwn=function(g,x){return g&&ur(g,Rr(x,3))},he.forOwnRight=function(g,x){return g&&ti(g,Rr(x,3))},he.get=_n,he.gt=by,he.gte=$f,he.has=function(g,x){return g!=null&&ku(g,x,qh)},he.hasIn=Yt,he.head=Pm,he.identity=Nr,he.includes=function(g,x,C,G){g=fl(g)?g:Qr(g),C=C&&!G?Mt(C):0;var te=g.length;return C<0&&(C=ji(te+C,0)),wt(g)?C<=te&&g.indexOf(x,C)>-1:!!te&&bu(g,x,C)>-1},he.indexOf=function(g,x,C){var G=g==null?0:g.length;if(!G)return-1;var te=C==null?0:Mt(C);return te<0&&(te=ji(G+te,0)),bu(g,x,te)},he.inRange=function(g,x,C){return x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(G,te,ce){return G>=Wa(te,ce)&&G<ji(te,ce)})(g=pn(g),x,C)},he.invoke=xr,he.isArguments=Nc,he.isArray=Jr,he.isArrayBuffer=Im,he.isArrayLike=fl,he.isArrayLikeObject=Oi,he.isBoolean=function(g){return g===!0||g===!1||Bi(g)&&Ei(g)==I},he.isBuffer=nl,he.isDate=mv,he.isElement=function(g){return Bi(g)&&g.nodeType===1&&!K(g)},he.isEmpty=function(g){if(g==null)return!0;if(fl(g)&&(Jr(g)||typeof g=="string"||typeof g.splice=="function"||nl(g)||yt(g)||Nc(g)))return!g.length;var x=Ti(g);if(x==W||x==Ae)return!g.size;if(Qt(g))return!Wl(g).length;for(var C in g)if($n.call(g,C))return!1;return!0},he.isEqual=function(g,x){return hd(g,x)},he.isEqualWith=function(g,x,C){var G=(C=typeof C=="function"?C:l)?C(g,x):l;return G===l?hd(g,x,l,C):!!G},he.isError=Ea,he.isFinite=function(g){return typeof g=="number"&&dc(g)},he.isFunction=Cl,he.isInteger=kc,he.isLength=Uf,he.isMap=Jp,he.isMatch=function(g,x){return g===x||Vl(g,x,Of(x))},he.isMatchWith=function(g,x,C){return C=typeof C=="function"?C:l,Vl(g,x,Of(x),C)},he.isNaN=function(g){return gv(g)&&g!=+g},he.isNative=function(g){if(Gp(g))throw new mo("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mu(g)},he.isNil=function(g){return g==null},he.isNull=function(g){return g===null},he.isNumber=gv,he.isObject=Ni,he.isObjectLike=Bi,he.isPlainObject=K,he.isRegExp=me,he.isSafeInteger=function(g){return kc(g)&&g>=-9007199254740991&&g<=T},he.isSet=Ie,he.isString=wt,he.isSymbol=Dt,he.isTypedArray=yt,he.isUndefined=function(g){return g===l},he.isWeakMap=function(g){return Bi(g)&&Ti(g)==ze},he.isWeakSet=function(g){return Bi(g)&&Ei(g)=="[object WeakSet]"},he.join=function(g,x){return g==null?"":cf.call(g,x)},he.kebabCase=Gi,he.last=gi,he.lastIndexOf=function(g,x,C){var G=g==null?0:g.length;if(!G)return-1;var te=G;return C!==l&&(te=(te=Mt(C))<0?ji(G+te,0):Wa(te,G-1)),x==x?(function(ce,Oe,Fe){for(var et=Fe+1;et--;)if(ce[et]===Oe)return et;return et})(g,x,te):$a(g,El,te,!0)},he.lowerCase=Ko,he.lowerFirst=Pi,he.lt=Nt,he.lte=tn,he.max=function(g){return g&&g.length?Ii(g,Nr,Mi):l},he.maxBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),Mi):l},he.mean=function(g){return vo(g,Nr)},he.meanBy=function(g,x){return vo(g,Rr(x,2))},he.min=function(g){return g&&g.length?Ii(g,Nr,js):l},he.minBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),js):l},he.stubArray=tt,he.stubFalse=ct,he.stubObject=function(){return{}},he.stubString=function(){return""},he.stubTrue=function(){return!0},he.multiply=be,he.nth=function(g,x){return g&&g.length?bm(g,Mt(x)):l},he.noConflict=function(){return vi._===this&&(vi._=wi),this},he.noop=Et,he.now=Ff,he.pad=function(g,x,C){g=Wt(g);var G=(x=Mt(x))?Va(g):0;if(!x||G>=x)return g;var te=(x-G)/2;return yd(cc(te),C)+g+yd(uf(te),C)},he.padEnd=function(g,x,C){g=Wt(g);var G=(x=Mt(x))?Va(g):0;return x&&G<x?g+yd(x-G,C):g},he.padStart=function(g,x,C){g=Wt(g);var G=(x=Mt(x))?Va(g):0;return x&&G<x?yd(x-G,C)+g:g},he.parseInt=function(g,x,C){return C||x==null?x=0:x&&(x=+x),xp(Wt(g).replace(qt,""),x||0)},he.random=function(g,x,C){if(C&&typeof C!="boolean"&&Fi(g,x,C)&&(x=C=l),C===l&&(typeof x=="boolean"?(C=x,x=l):typeof g=="boolean"&&(C=g,g=l)),g===l&&x===l?(g=0,x=1):(g=nn(g),x===l?(x=g,g=0):x=nn(x)),g>x){var G=g;g=x,x=G}if(C||g%1||x%1){var te=ud();return Wa(g+te*(x-g+or("1e-"+((te+"").length-1))),x)}return ev(g,x)},he.reduce=function(g,x,C){var G=Jr(g)?ad:ha,te=arguments.length<3;return G(g,Rr(x,4),C,te,mi)},he.reduceRight=function(g,x,C){var G=Jr(g)?_p:ha,te=arguments.length<3;return G(g,Rr(x,4),C,te,ym)},he.repeat=function(g,x,C){return x=(C?Fi(g,x,C):x===l)?1:Mt(x),gf(Wt(g),x)},he.replace=function(){var g=arguments,x=Wt(g[0]);return g.length<3?x:x.replace(g[1],g[2])},he.result=function(g,x,C){var G=-1,te=(x=jo(x,g)).length;for(te||(te=1,g=l);++G<te;){var ce=g==null?l:g[vs(x[G])];ce===l&&(G=te,ce=C),g=Cl(ce)?ce.call(g):ce}return g},he.round=nt,he.runInContext=Ct,he.sample=function(g){return(Jr(g)?Ap:vy)(g)},he.size=function(g){if(g==null)return 0;if(fl(g))return wt(g)?Va(g):g.length;var x=Ti(g);return x==W||x==Ae?g.size:Wl(g).length},he.snakeCase=$i,he.some=function(g,x,C){var G=Jr(g)?of:gy;return C&&Fi(g,x,C)&&(x=l),G(g,Rr(x,3))},he.sortedIndex=function(g,x){return _f(g,x)},he.sortedIndexBy=function(g,x,C){return kp(g,x,Rr(C,2))},he.sortedIndexOf=function(g,x){var C=g==null?0:g.length;if(C){var G=_f(g,x);if(G<C&&zl(g[G],x))return G}return-1},he.sortedLastIndex=function(g,x){return _f(g,x,!0)},he.sortedLastIndexBy=function(g,x,C){return kp(g,x,Rr(C,2),!0)},he.sortedLastIndexOf=function(g,x){if(g!=null&&g.length){var C=_f(g,x,!0)-1;if(zl(g[C],x))return C}return-1},he.startCase=Qi,he.startsWith=function(g,x,C){return g=Wt(g),C=C==null?0:Au(Mt(C),0,g.length),x=cl(x),g.slice(C,C+x.length)==x},he.subtract=ot,he.sum=function(g){return g&&g.length?wu(g,Nr):0},he.sumBy=function(g,x){return g&&g.length?wu(g,Rr(x,2)):0},he.template=function(g,x,C){var G=he.templateSettings;C&&Fi(g,x,C)&&(x=l),g=Wt(g),x=ln({},x,G,av);var te,ce,Oe=ln({},x.imports,G.imports,av),Fe=on(Oe),et=lc(Oe,Fe),jt=0,Vt=x.interpolate||rr,yn="__p += '",Yn=Z((x.escape||rr).source+"|"+Vt.source+"|"+(Vt===vt?En:rr).source+"|"+(x.evaluate||rr).source+"|$","g"),Qn="//# sourceURL="+($n.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rn+"]")+`
|
||
`;g.replace(Yn,(function(Tn,Br,ir,at,Yr,Ao){return ir||(ir=at),yn+=g.slice(jt,Ao).replace(ut,sc),Br&&(te=!0,yn+=`' +
|
||
__e(`+Br+`) +
|
||
'`),Yr&&(ce=!0,yn+=`';
|
||
`+Yr+`;
|
||
__p += '`),ir&&(yn+=`' +
|
||
((__t = (`+ir+`)) == null ? '' : __t) +
|
||
'`),jt=Ao+Tn.length,Tn})),yn+=`';
|
||
`;var Sr=$n.call(x,"variable")&&x.variable;if(Sr){if(At.test(Sr))throw new mo("Invalid `variable` option passed into `_.template`")}else yn=`with (obj) {
|
||
`+yn+`
|
||
}
|
||
`;yn=(ce?yn.replace(pt,""):yn).replace(Lt,"$1").replace(Jt,"$1;"),yn="function("+(Sr||"obj")+`) {
|
||
`+(Sr?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+yn+`return __p
|
||
}`;var an=Cr((function(){return ci(Fe,Qn+"return "+yn).apply(l,et)}));if(an.source=yn,Ea(an))throw an;return an},he.times=function(g,x){if((g=Mt(g))<1||g>T)return[];var C=D,G=Wa(g,D);x=Rr(x),g-=D;for(var te=Ks(G,x);++C<g;)x(C);return te},he.toFinite=nn,he.toInteger=Mt,he.toLength=wn,he.toLower=function(g){return Wt(g).toLowerCase()},he.toNumber=pn,he.toSafeInteger=function(g){return g?Au(Mt(g),-9007199254740991,T):g===0?g:0},he.toString=Wt,he.toUpper=function(g){return Wt(g).toUpperCase()},he.trim=function(g,x,C){if((g=Wt(g))&&(C||x===l))return $l(g);if(!g||!(x=cl(x)))return g;var G=Qa(g),te=Qa(x);return Uo(G,xl(G,te),af(G,te)+1).join("")},he.trimEnd=function(g,x,C){if((g=Wt(g))&&(C||x===l))return g.slice(0,ia(g)+1);if(!g||!(x=cl(x)))return g;var G=Qa(g);return Uo(G,0,af(G,Qa(x))+1).join("")},he.trimStart=function(g,x,C){if((g=Wt(g))&&(C||x===l))return g.replace(qt,"");if(!g||!(x=cl(x)))return g;var G=Qa(g);return Uo(G,xl(G,Qa(x))).join("")},he.truncate=function(g,x){var C=30,G="...";if(Ni(x)){var te="separator"in x?x.separator:te;C="length"in x?Mt(x.length):C,G="omission"in x?cl(x.omission):G}var ce=(g=Wt(g)).length;if(os(g)){var Oe=Qa(g);ce=Oe.length}if(C>=ce)return g;var Fe=C-Va(G);if(Fe<1)return G;var et=Oe?Uo(Oe,0,Fe).join(""):g.slice(0,Fe);if(te===l)return et+G;if(Oe&&(Fe+=et.length-Fe),me(te)){if(g.slice(Fe).search(te)){var jt,Vt=et;for(te.global||(te=Z(te.source,Wt(Zn.exec(te))+"g")),te.lastIndex=0;jt=te.exec(Vt);)var yn=jt.index;et=et.slice(0,yn===l?Fe:yn)}}else if(g.indexOf(cl(te),Fe)!=Fe){var Yn=et.lastIndexOf(te);Yn>-1&&(et=et.slice(0,Yn))}return et+G},he.unescape=function(g){return(g=Wt(g))&&it.test(g)?g.replace(en,sl):g},he.uniqueId=function(g){var x=++Do;return Wt(g)+x},he.upperCase=la,he.upperFirst=zi,he.each=Zp,he.eachRight=pv,he.first=Pm,Te(he,(Ue={},ur(he,(function(g,x){$n.call(he.prototype,x)||(Ue[x]=g)})),Ue),{chain:!1}),he.VERSION="4.17.21",Fa(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(g){he[g].placeholder=he})),Fa(["drop","take"],(function(g,x){go.prototype[g]=function(C){C=C===l?1:ji(Mt(C),0);var G=this.__filtered__&&!x?new go(this):this.clone();return G.__filtered__?G.__takeCount__=Wa(C,G.__takeCount__):G.__views__.push({size:Wa(C,D),type:g+(G.__dir__<0?"Right":"")}),G},go.prototype[g+"Right"]=function(C){return this.reverse()[g](C).reverse()}})),Fa(["filter","map","takeWhile"],(function(g,x){var C=x+1,G=C==1||C==3;go.prototype[g]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Rr(te,3),type:C}),ce.__filtered__=ce.__filtered__||G,ce}})),Fa(["head","last"],(function(g,x){var C="take"+(x?"Right":"");go.prototype[g]=function(){return this[C](1).value()[0]}})),Fa(["initial","tail"],(function(g,x){var C="drop"+(x?"":"Right");go.prototype[g]=function(){return this.__filtered__?new go(this):this[C](1)}})),go.prototype.compact=function(){return this.filter(Nr)},go.prototype.find=function(g){return this.filter(g).head()},go.prototype.findLast=function(g){return this.reverse().find(g)},go.prototype.invokeMap=uo((function(g,x){return typeof g=="function"?new go(this):this.map((function(C){return Ga(C,g,x)}))})),go.prototype.reject=function(g){return this.filter(Bf(Rr(g)))},go.prototype.slice=function(g,x){g=Mt(g);var C=this;return C.__filtered__&&(g>0||x<0)?new go(C):(g<0?C=C.takeRight(-g):g&&(C=C.drop(g)),x!==l&&(C=(x=Mt(x))<0?C.dropRight(-x):C.take(x-g)),C)},go.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},go.prototype.toArray=function(){return this.take(D)},ur(go.prototype,(function(g,x){var C=/^(?:filter|find|map|reject)|While$/.test(x),G=/^(?:head|last)$/.test(x),te=he[G?"take"+(x=="last"?"Right":""):x],ce=G||/^find/.test(x);te&&(he.prototype[x]=function(){var Oe=this.__wrapped__,Fe=G?[1]:arguments,et=Oe instanceof go,jt=Fe[0],Vt=et||Jr(Oe),yn=function(Br){var ir=te.apply(he,oa([Br],Fe));return G&&Yn?ir[0]:ir};Vt&&C&&typeof jt=="function"&&jt.length!=1&&(et=Vt=!1);var Yn=this.__chain__,Qn=!!this.__actions__.length,Sr=ce&&!Yn,an=et&&!Qn;if(!ce&&Vt){Oe=an?Oe:new go(this);var Tn=g.apply(Oe,Fe);return Tn.__actions__.push({func:Lf,args:[yn],thisArg:l}),new Ul(Tn,Yn)}return Sr&&an?g.apply(this,Fe):(Tn=this.thru(yn),Sr?G?Tn.value()[0]:Tn.value():Tn)})})),Fa(["pop","push","shift","sort","splice","unshift"],(function(g){var x=lt[g],C=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",G=/^(?:pop|shift)$/.test(g);he.prototype[g]=function(){var te=arguments;if(G&&!this.__chain__){var ce=this.value();return x.apply(Jr(ce)?ce:[],te)}return this[C]((function(Oe){return x.apply(Jr(Oe)?Oe:[],te)}))}})),ur(go.prototype,(function(g,x){var C=he[x];if(C){var G=C.name+"";$n.call(Su,G)||(Su[G]=[]),Su[G].push({name:x,func:C})}})),Su[wf(l,2).name]=[{name:"wrapper",func:l}],go.prototype.clone=function(){var g=new go(this.__wrapped__);return g.__actions__=va(this.__actions__),g.__dir__=this.__dir__,g.__filtered__=this.__filtered__,g.__iteratees__=va(this.__iteratees__),g.__takeCount__=this.__takeCount__,g.__views__=va(this.__views__),g},go.prototype.reverse=function(){if(this.__filtered__){var g=new go(this);g.__dir__=-1,g.__filtered__=!0}else(g=this.clone()).__dir__*=-1;return g},go.prototype.value=function(){var g=this.__wrapped__.value(),x=this.__dir__,C=Jr(g),G=x<0,te=C?g.length:0,ce=(function(Ao,Mr,Ur){for(var xa=-1,Hl=Ur.length;++xa<Hl;){var uu=Ur[xa],Oa=uu.size;switch(uu.type){case"drop":Ao+=Oa;break;case"dropRight":Mr-=Oa;break;case"take":Mr=Wa(Mr,Ao+Oa);break;case"takeRight":Ao=ji(Ao,Mr-Oa)}}return{start:Ao,end:Mr}})(0,te,this.__views__),Oe=ce.start,Fe=ce.end,et=Fe-Oe,jt=G?Fe:Oe-1,Vt=this.__iteratees__,yn=Vt.length,Yn=0,Qn=Wa(et,this.__takeCount__);if(!C||!G&&te==et&&Qn==et)return rv(g,this.__actions__);var Sr=[];e:for(;et--&&Yn<Qn;){for(var an=-1,Tn=g[jt+=x];++an<yn;){var Br=Vt[an],ir=Br.iteratee,at=Br.type,Yr=ir(Tn);if(at==2)Tn=Yr;else if(!Yr){if(at==1)continue e;break e}}Sr[Yn++]=Tn}return Sr},he.prototype.at=za,he.prototype.chain=function(){return xi(this)},he.prototype.commit=function(){return new Ul(this.value(),this.__chain__)},he.prototype.next=function(){this.__values__===l&&(this.__values__=sn(this.value()));var g=this.__index__>=this.__values__.length;return{done:g,value:g?l:this.__values__[this.__index__++]}},he.prototype.plant=function(g){for(var x,C=this;C instanceof Qs;){var G=Xp(C);G.__index__=0,G.__values__=l,x?te.__wrapped__=G:x=G;var te=G;C=C.__wrapped__}return te.__wrapped__=g,x},he.prototype.reverse=function(){var g=this.__wrapped__;if(g instanceof go){var x=g;return this.__actions__.length&&(x=new go(this)),(x=x.reverse()).__actions__.push({func:Lf,args:[Ed],thisArg:l}),new Ul(x,this.__chain__)}return this.thru(Ed)},he.prototype.toJSON=he.prototype.valueOf=he.prototype.value=function(){return rv(this.__wrapped__,this.__actions__)},he.prototype.first=he.prototype.head,as&&(he.prototype[as]=function(){return this}),he})();vi._=ka,(s=(function(){return ka}).call(o,r,o,a))===l||(a.exports=s)}).call(this)}).call(this,r(68),r(221)(n))},function(n,o,r){var i=r(7),a=r(34),s=r(33),l=r(87),f=r(62),h=r(174),v=r(28),b=i.TypeError,E=v("toPrimitive");n.exports=function(O,w){if(!s(O)||l(O))return O;var S,M=f(O,E);if(M){if(w===void 0&&(w="default"),S=a(M,O,w),!s(S)||l(S))return S;throw b("Can't convert object to primitive value")}return w===void 0&&(w="number"),h(O,w)}},function(n,o,r){var i=r(108);n.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(n,o,r){var i=r(36),a=r(18),s=r(91);n.exports=!i&&!a((function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7}))},function(n,o,r){var i=r(35),a=r(135),s=r(50),l=r(38);n.exports=function(f,h){for(var v=a(h),b=l.f,E=s.f,O=0;O<v.length;O++){var w=v[O];i(f,w)||b(f,w,E(h,w))}}},function(n,o,r){var i=r(46),a=r(15),s=r(74),l=r(112),f=r(32),h=a([].concat);n.exports=i("Reflect","ownKeys")||function(v){var b=s.f(f(v)),E=l.f;return E?h(b,E(v)):b}},function(n,o,r){var i=r(15),a=r(35),s=r(41),l=r(137).indexOf,f=r(72),h=i([].push);n.exports=function(v,b){var E,O=s(v),w=0,S=[];for(E in O)!a(f,E)&&a(O,E)&&h(S,E);for(;b.length>w;)a(O,E=b[w++])&&(~l(S,E)||h(S,E));return S}},function(n,o,r){var i=r(41),a=r(75),s=r(45),l=function(f){return function(h,v,b){var E,O=i(h),w=s(O),S=a(b,w);if(f&&v!=v){for(;w>S;)if((E=O[S++])!=E)return!0}else for(;w>S;S++)if((f||S in O)&&O[S]===v)return f||S||0;return!f&&-1}};n.exports={includes:l(!0),indexOf:l(!1)}},function(n,o,r){var i=r(46);n.exports=i("document","documentElement")},function(n,o,r){var i=r(51),a=r(41),s=r(74).f,l=r(114),f=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(h){return f&&i(h)=="Window"?(function(v){try{return s(v)}catch{return l(f)}})(h):s(a(h))}},function(n,o,r){var i=r(28);o.f=i},function(n,o,r){var i=r(177),a=r(35),s=r(140),l=r(38).f;n.exports=function(f){var h=i.Symbol||(i.Symbol={});a(h,f)||l(h,f,{value:s.f(f)})}},function(n,o,r){var i,a,s,l=r(18),f=r(30),h=r(60),v=r(101),b=r(42),E=r(28),O=r(71),w=E("iterator"),S=!1;[].keys&&("next"in(s=[].keys())?(a=v(v(s)))!==Object.prototype&&(i=a):S=!0),i==null||l((function(){var M={};return i[w].call(M)!==M}))?i={}:O&&(i=h(i)),f(i[w])||b(i,w,(function(){return this})),n.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:S}},function(n,o,r){var i=r(18);n.exports=!i((function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}))},function(n,o,r){var i=r(16),a=r(15),s=r(72),l=r(33),f=r(35),h=r(38).f,v=r(74),b=r(139),E=r(183),O=r(90),w=r(185),S=!1,M=O("meta"),T=0,$=function(P){h(P,M,{value:{objectID:"O"+T++,weakData:{}}})},D=n.exports={enable:function(){D.enable=function(){},S=!0;var P=v.f,B=a([].splice),F={};F[M]=1,P(F).length&&(v.f=function(I){for(var V=P(I),z=0,X=V.length;z<X;z++)if(V[z]===M){B(V,z,1);break}return V},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:b.f}))},fastKey:function(P,B){if(!l(P))return typeof P=="symbol"?P:(typeof P=="string"?"S":"P")+P;if(!f(P,M)){if(!E(P))return"F";if(!B)return"E";$(P)}return P[M].objectID},getWeakData:function(P,B){if(!f(P,M)){if(!E(P))return!0;if(!B)return!1;$(P)}return P[M].weakData},onFreeze:function(P){return w&&S&&E(P)&&!f(P,M)&&$(P),P}};s[M]=!0},function(n,o,r){var i=r(28),a=r(80),s=i("iterator"),l=Array.prototype;n.exports=function(f){return f!==void 0&&(a.Array===f||l[s]===f)}},function(n,o,r){var i=r(7),a=r(34),s=r(56),l=r(32),f=r(88),h=r(118),v=i.TypeError;n.exports=function(b,E){var O=arguments.length<2?h(b):E;if(s(O))return l(a(O,b));throw v(f(b)+" is not iterable")}},function(n,o,r){var i=r(34),a=r(32),s=r(62);n.exports=function(l,f,h){var v,b;a(l);try{if(!(v=s(l,"return"))){if(f==="throw")throw h;return h}v=i(v,l)}catch(E){b=!0,v=E}if(f==="throw")throw h;if(b)throw v;return a(v),h}},function(n,o,r){var i=r(30),a=r(33),s=r(102);n.exports=function(l,f,h){var v,b;return s&&i(v=f.constructor)&&v!==h&&a(b=v.prototype)&&b!==h.prototype&&s(l,b),l}},function(n,o,r){var i=r(42);n.exports=function(a,s,l){for(var f in s)i(a,f,s[f],l);return a}},function(n,o,r){var i=r(46),a=r(38),s=r(28),l=r(36),f=s("species");n.exports=function(h){var v=i(h),b=a.f;l&&v&&!v[f]&&b(v,f,{configurable:!0,get:function(){return this}})}},function(n,o,r){var i=r(15),a=r(59),s=r(39),l=r(44),f=i("".charAt),h=i("".charCodeAt),v=i("".slice),b=function(E){return function(O,w){var S,M,T=s(l(O)),$=a(w),D=T.length;return $<0||$>=D?E?"":void 0:(S=h(T,$))<55296||S>56319||$+1===D||(M=h(T,$+1))<56320||M>57343?E?f(T,$):S:E?v(T,$,$+2):M-56320+(S-55296<<10)+65536}};n.exports={codeAt:b(!1),charAt:b(!0)}},function(n,o){n.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(n,o,r){var i=r(91)("span").classList,a=i&&i.constructor&&i.constructor.prototype;n.exports=a===Object.prototype?void 0:a},function(n,o,r){var i=r(32);n.exports=function(){var a=i(this),s="";return a.global&&(s+="g"),a.ignoreCase&&(s+="i"),a.multiline&&(s+="m"),a.dotAll&&(s+="s"),a.unicode&&(s+="u"),a.sticky&&(s+="y"),s}},function(n,o,r){var i=r(18),a=r(7).RegExp,s=i((function(){var h=a("a","y");return h.lastIndex=2,h.exec("abcd")!=null})),l=s||i((function(){return!a("a","y").sticky})),f=s||i((function(){var h=a("^r","gy");return h.lastIndex=2,h.exec("str")!=null}));n.exports={BROKEN_CARET:f,MISSED_STICKY:l,UNSUPPORTED_Y:s}},function(n,o,r){var i=r(16),a=r(79).find,s=r(100),l="find",f=!0;l in[]&&Array(1).find((function(){f=!1})),i({target:"Array",proto:!0,forced:f},{find:function(h){return a(this,h,arguments.length>1?arguments[1]:void 0)}}),s(l)},function(n,o,r){var i=r(16),a=r(137).includes,s=r(100);i({target:"Array",proto:!0},{includes:function(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}}),s("includes")},function(n,o,r){var i=r(16),a=r(15),s=r(197),l=r(44),f=r(39),h=r(198),v=a("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function(b){return!!~v(f(l(this)),f(s(b)),arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(33),a=r(51),s=r(28)("match");n.exports=function(l){var f;return i(l)&&((f=l[s])!==void 0?!!f:a(l)=="RegExp")}},function(n,o,r){var i=r(15);n.exports=i(1 .valueOf)},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=r(162),f=i("".replace),h="["+l+"]",v=RegExp("^"+h+h+"*"),b=RegExp(h+h+"*$"),E=function(O){return function(w){var S=s(a(w));return 1&O&&(S=f(S,v,"")),2&O&&(S=f(S,b,"")),S}};n.exports={start:E(1),end:E(2),trim:E(3)}},function(n,o){n.exports=`
|
||
\v\f\r \u2028\u2029\uFEFF`},function(n,o){var r,i,a=n.exports={};function s(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function f(T){if(r===setTimeout)return setTimeout(T,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(T,0);try{return r(T,0)}catch{try{return r.call(null,T,0)}catch{return r.call(this,T,0)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:s}catch{r=s}try{i=typeof clearTimeout=="function"?clearTimeout:l}catch{i=l}})();var h,v=[],b=!1,E=-1;function O(){b&&h&&(b=!1,h.length?v=h.concat(v):E=-1,v.length&&w())}function w(){if(!b){var T=f(O);b=!0;for(var $=v.length;$;){for(h=v,v=[];++E<$;)h&&h[E].run();E=-1,$=v.length}h=null,b=!1,(function(D){if(i===clearTimeout)return clearTimeout(D);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(D);try{i(D)}catch{try{return i.call(null,D)}catch{return i.call(this,D)}}})(T)}}function S(T,$){this.fun=T,this.array=$}function M(){}a.nextTick=function(T){var $=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)$[D-1]=arguments[D];v.push(new S(T,$)),v.length!==1||b||f(w)},S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=M,a.addListener=M,a.once=M,a.off=M,a.removeListener=M,a.removeAllListeners=M,a.emit=M,a.prependListener=M,a.prependOnceListener=M,a.listeners=function(T){return[]},a.binding=function(T){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(T){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(n,o,r){var i=r(32),a=r(165),s=r(28)("species");n.exports=function(l,f){var h,v=i(l).constructor;return v===void 0||(h=i(v)[s])==null?f:a(h)}},function(n,o,r){var i=r(7),a=r(99),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a constructor")}},function(n,o,r){var i=r(16),a=r(161).trim;i({target:"String",proto:!0,forced:r(200)("trim")},{trim:function(){return a(this)}})},function(n,o,r){var i=r(34),a=r(123),s=r(32),l=r(94),f=r(39),h=r(44),v=r(62),b=r(124),E=r(125);a("match",(function(O,w,S){return[function(M){var T=h(this),$=M==null?void 0:v(M,O);return $?i($,M,T):new RegExp(M)[O](f(T))},function(M){var T=s(this),$=f(M),D=S(w,T,$);if(D.done)return D.value;if(!T.global)return E(T,$);var P=T.unicode;T.lastIndex=0;for(var B,F=[],I=0;(B=E(T,$))!==null;){var V=f(B[0]);F[I]=V,V===""&&(T.lastIndex=b($,l(T.lastIndex),P)),I++}return I===0?null:F}]}))},function(n,o,r){var i,a,s,l,f=r(7),h=r(76),v=r(64),b=r(30),E=r(35),O=r(18),w=r(138),S=r(98),M=r(91),T=r(169),$=r(128),D=f.setImmediate,P=f.clearImmediate,B=f.process,F=f.Dispatch,I=f.Function,V=f.MessageChannel,z=f.String,X=0,Y={},W="onreadystatechange";try{i=f.location}catch{}var Q=function(Ae){if(E(Y,Ae)){var Pe=Y[Ae];delete Y[Ae],Pe()}},J=function(Ae){return function(){Q(Ae)}},ie=function(Ae){Q(Ae.data)},Se=function(Ae){f.postMessage(z(Ae),i.protocol+"//"+i.host)};D&&P||(D=function(Ae){var Pe=S(arguments,1);return Y[++X]=function(){h(b(Ae)?Ae:I(Ae),void 0,Pe)},a(X),X},P=function(Ae){delete Y[Ae]},$?a=function(Ae){B.nextTick(J(Ae))}:F&&F.now?a=function(Ae){F.now(J(Ae))}:V&&!T?(l=(s=new V).port2,s.port1.onmessage=ie,a=v(l.postMessage,l)):f.addEventListener&&b(f.postMessage)&&!f.importScripts&&i&&i.protocol!=="file:"&&!O(Se)?(a=Se,f.addEventListener("message",ie,!1)):a=W in M("script")?function(Ae){w.appendChild(M("script")).onreadystatechange=function(){w.removeChild(this),Q(Ae)}}:function(Ae){setTimeout(J(Ae),0)}),n.exports={set:D,clear:P}},function(n,o,r){var i=r(55);n.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},function(n,o,r){var i=r(56),a=function(s){var l,f;this.promise=new s((function(h,v){if(l!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");l=h,f=v})),this.resolve=i(l),this.reject=i(f)};n.exports.f=function(s){return new a(s)}},function(n,o,r){o.a=function(){return!1}},function(n,o,r){(function(i){r.d(o,"a",(function(){return B}));var a=r(1);function s(V){throw new Error("[mobx-utils] "+V)}function l(V,z){z===void 0&&(z="Illegal state"),V||s(z)}var f=function(V){return V&&V!==Object.prototype&&Object.getOwnPropertyNames(V).concat(f(Object.getPrototypeOf(V))||[])},h=function(V){return(function(z){var X=f(z);return X.filter((function(Y,W){return X.indexOf(Y)===W}))})(V).filter((function(z){return z!=="constructor"&&!~z.indexOf("__")}))},v="pending",b="fulfilled",E="rejected";function O(V){switch(this.state){case v:return V.pending&&V.pending(this.value);case E:return V.rejected&&V.rejected(this.value);case b:return V.fulfilled?V.fulfilled(this.value):this.value}}function w(V,z){if(l(arguments.length<=2,"fromPromise expects up to two arguments"),l(typeof V=="function"||typeof V=="object"&&V&&typeof V.then=="function","Please pass a promise or function to fromPromise"),V.isPromiseBasedObservable===!0)return V;typeof V=="function"&&(V=new Promise(V));var X=V;V.then(Object(a.k)("observableFromPromise-resolve",(function(W){X.value=W,X.state=b})),Object(a.k)("observableFromPromise-reject",(function(W){X.value=W,X.state=E}))),X.isPromiseBasedObservable=!0,X.case=O;var Y=z&&z.state===b?z.value:void 0;return Object(a.q)(X,{value:Y,state:v},{},{deep:!1}),X}(function(V){V.reject=Object(a.k)("fromPromise.reject",(function(z){var X=V(Promise.reject(z));return X.state=E,X.value=z,X})),V.resolve=Object(a.k)("fromPromise.resolve",(function(z){z===void 0&&(z=void 0);var X=V(Promise.resolve(z));return X.state=b,X.value=z,X}))})(w||(w={}));var S=function(V,z,X,Y){var W,Q=arguments.length,J=Q<3?z:Y===null?Y=Object.getOwnPropertyDescriptor(z,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(V,z,X,Y);else for(var ie=V.length-1;ie>=0;ie--)(W=V[ie])&&(J=(Q<3?W(J):Q>3?W(z,X,J):W(z,X))||J);return Q>3&&J&&Object.defineProperty(z,X,J),J};(function(){function V(z,X){var Y=this;Object(a.G)((function(){Y.current=X,Y.subscription=z.subscribe(Y)}))}V.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},V.prototype.next=function(z){this.current=z},V.prototype.complete=function(){this.dispose()},V.prototype.error=function(z){this.current=z,this.dispose()},S([a.C.ref],V.prototype,"current",void 0),S([a.k.bound],V.prototype,"next",null),S([a.k.bound],V.prototype,"complete",null),S([a.k.bound],V.prototype,"error",null)})();var M=function(){return M=Object.assign||function(V){for(var z,X=1,Y=arguments.length;X<Y;X++)for(var W in z=arguments[X])Object.prototype.hasOwnProperty.call(z,W)&&(V[W]=z[W]);return V},M.apply(this,arguments)},T=function(V,z,X,Y){var W,Q=arguments.length,J=Q<3?z:Y===null?Y=Object.getOwnPropertyDescriptor(z,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(V,z,X,Y);else for(var ie=V.length-1;ie>=0;ie--)(W=V[ie])&&(J=(Q<3?W(J):Q>3?W(z,X,J):W(z,X))||J);return Q>3&&J&&Object.defineProperty(z,X,J),J},$=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function V(z){var X=this;this.model=z,this.localValues=a.C.map({}),this.localComputedValues=a.C.map({}),this.isPropertyDirty=function(Y){return X.localValues.has(Y)},l(Object(a.A)(z),"createViewModel expects an observable object"),h(z).forEach((function(Y){if(Y!==a.a&&Y!=="__mobxDidRunLazyInitializers"){if(l($.indexOf(Y)===-1,"The propertyname "+Y+" is reserved and cannot be used with viewModels"),Object(a.w)(z,Y)){var W=Object(a.h)(z,Y).derivation;X.localComputedValues.set(Y,Object(a.m)(W.bind(X)))}var Q=Object.getOwnPropertyDescriptor(z,Y),J=Q?{enumerable:Q.enumerable}:{};Object.defineProperty(X,Y,M(M({},J),{configurable:!0,get:function(){return Object(a.w)(z,Y)?X.localComputedValues.get(Y).get():X.isPropertyDirty(Y)?X.localValues.get(Y):X.model[Y]},set:Object(a.k)((function(ie){ie!==X.model[Y]?X.localValues.set(Y,ie):X.localValues.delete(Y)}))}))}}))}Object.defineProperty(V.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),V.prototype.submit=function(){var z=this;Object(a.B)(this.localValues).forEach((function(X){var Y=z.localValues.get(X),W=z.model[X];Object(a.y)(W)?W.replace(Y):Object(a.z)(W)?(W.clear(),W.merge(Y)):Object(a.v)(Y)||(z.model[X]=Y)})),this.localValues.clear()},V.prototype.reset=function(){this.localValues.clear()},V.prototype.resetProperty=function(z){this.localValues.delete(z)},T([a.m],V.prototype,"isDirty",null),T([a.m],V.prototype,"changedValues",null),T([a.k.bound],V.prototype,"submit",null),T([a.k.bound],V.prototype,"reset",null),T([a.k.bound],V.prototype,"resetProperty",null)})();function D(V){if(!V)return"ROOT";for(var z=[];V.parent;)z.push(V.path),V=V.parent;return z.reverse().join("/")}function P(V){return Object(a.A)(V)||Object(a.y)(V)||Object(a.z)(V)}function B(V,z){var X=new WeakMap;function Y(J){var ie=X.get(J.object);(function(Se,Ae){switch(Se.type){case"add":W(Se.newValue,Ae,Se.name);break;case"update":Q(Se.oldValue),W(Se.newValue,Ae,Se.name||""+Se.index);break;case"remove":case"delete":Q(Se.oldValue);break;case"splice":Se.removed.map(Q),Se.added.forEach((function(ze,Ye){return W(ze,Ae,""+(Se.index+Ye))}));for(var Pe=Se.index+Se.addedCount;Pe<Se.object.length;Pe++)if(P(Se.object[Pe])){var De=X.get(Se.object[Pe]);De&&(De.path=""+Pe)}}})(J,ie),z(J,D(ie),V)}function W(J,ie,Se){if(P(J)){var Ae=X.get(J);if(Ae){if(Ae.parent!==ie||Ae.path!==Se)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+D(ie)+"/"+Se+"', but it already exists at '"+D(Ae.parent)+"/"+Ae.path+"'")}else{var Pe={parent:ie,path:Se,dispose:Object(a.D)(J,Y)};X.set(J,Pe),Object(a.p)(J).forEach((function(De){var ze=De[0];return W(De[1],Pe,ze)}))}}}function Q(J){if(P(J)){var ie=X.get(J);if(!ie)return;X.delete(J),ie.dispose(),Object(a.L)(J).forEach(Q)}}return W(V,void 0,""),function(){Q(V)}}var F,I=(F=function(V,z){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Y){X.__proto__=Y}||function(X,Y){for(var W in Y)Y.hasOwnProperty(W)&&(X[W]=Y[W])},F(V,z)},function(V,z){function X(){this.constructor=V}F(V,z),V.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)});(function(V){function z(X,Y,W){var Q=W===void 0?{}:W,J=Q.name,ie=J===void 0?"ogm"+(1e3*Math.random()|0):J,Se=Q.keyToName,Ae=Se===void 0?function(ze){return""+ze}:Se,Pe=V.call(this)||this;Pe._keyToName=Ae,Pe._groupBy=Y,Pe._ogmInfoKey=Symbol("ogmInfo"+ie),Pe._base=X;for(var De=0;De<X.length;De++)Pe._addItem(X[De]);return Pe._disposeBaseObserver=Object(a.D)(Pe._base,(function(ze){if(ze.type==="splice")Object(a.J)((function(){for(var Ye=0,Be=ze.removed;Ye<Be.length;Ye++){var Je=Be[Ye];Pe._removeItem(Je)}for(var gt=0,le=ze.added;gt<le.length;gt++){var Ze=le[gt];Pe._addItem(Ze)}}));else{if(ze.type!=="update")throw new Error("illegal state");Object(a.J)((function(){Pe._removeItem(ze.oldValue),Pe._addItem(ze.newValue)}))}})),Pe}I(z,V),z.prototype.clear=function(){throw new Error("not supported")},z.prototype.delete=function(X){throw new Error("not supported")},z.prototype.set=function(X,Y){throw new Error("not supported")},z.prototype.dispose=function(){this._disposeBaseObserver();for(var X=0;X<this._base.length;X++){var Y=this._base[X];Y[this._ogmInfoKey].reaction(),delete Y[this._ogmInfoKey]}},z.prototype._getGroupArr=function(X){var Y=V.prototype.get.call(this,X);return Y===void 0&&(Y=Object(a.C)([],{name:"GroupArray["+this._keyToName(X)+"]",deep:!1}),V.prototype.set.call(this,X,Y)),Y},z.prototype._removeFromGroupArr=function(X,Y){var W=V.prototype.get.call(this,X);W.length===1?V.prototype.delete.call(this,X):(Y===W.length-1||(W[Y]=W[W.length-1],W[Y][this._ogmInfoKey].groupArrIndex=Y),W.length--)},z.prototype._addItem=function(X){var Y=this,W=this._groupBy(X),Q=this._getGroupArr(W),J={groupByValue:W,groupArrIndex:Q.length,reaction:Object(a.F)((function(){return Y._groupBy(X)}),(function(ie,Se){var Ae=X[Y._ogmInfoKey];Y._removeFromGroupArr(Ae.groupByValue,Ae.groupArrIndex);var Pe=Y._getGroupArr(ie),De=Pe.length;Pe.push(X),Ae.groupByValue=ie,Ae.groupArrIndex=De}))};Object.defineProperty(X,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:J}),Q.push(X)},z.prototype._removeItem=function(X){var Y=X[this._ogmInfoKey];this._removeFromGroupArr(Y.groupByValue,Y.groupArrIndex),Y.reaction(),delete X[this._ogmInfoKey]}})(a.b),(function(){function V(z,X){this.base=z,this.args=X,this.closestIdx=0,this.isDisposed=!1;for(var Y=this.closest=this.root=z,W=0;W<this.args.length-1&&(Y=Y.get(X[W]));W++)this.closest=Y;this.closestIdx=W}return V.prototype.exists=function(){this.assertNotDisposed();var z=this.args.length;return this.closestIdx>=z-1&&this.closest.has(this.args[z-1])},V.prototype.get=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");return this.closest.get(this.args[this.args.length-1])},V.prototype.set=function(z){this.assertNotDisposed();for(var X=this.args.length,Y=this.closest,W=this.closestIdx;W<X-1;W++){var Q=new Map;Y.set(this.args[W],Q),Y=Q}this.closestIdx=X-1,this.closest=Y,Y.set(this.args[X-1],z)},V.prototype.delete=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var z=this.args.length;this.closest.delete(this.args[z-1]);for(var X=this.root,Y=[X],W=0;W<z-1;W++)X=X.get(this.args[W]),Y.push(X);for(W=Y.length-1;W>0;W--)Y[W].size===0&&Y[W-1].delete(this.args[W-1]);this.isDisposed=!0},V.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},V})(),Promise.resolve(),typeof queueMicrotask<"u"||i!==void 0&&i.nextTick}).call(this,r(163))},function(n,o,r){var i;(function(a,s,l){if(a){for(var f,h={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"},v={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},b={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},E={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},O=1;O<20;++O)h[111+O]="f"+O;for(O=0;O<=9;++O)h[O+96]=O.toString();P.prototype.bind=function(B,F,I){var V=this;return B=B instanceof Array?B:[B],V._bindMultiple.call(V,B,F,I),V},P.prototype.unbind=function(B,F){return this.bind.call(this,B,(function(){}),F)},P.prototype.trigger=function(B,F){var I=this;return I._directMap[B+":"+F]&&I._directMap[B+":"+F]({},B),I},P.prototype.reset=function(){var B=this;return B._callbacks={},B._directMap={},B},P.prototype.stopCallback=function(B,F){if((" "+F.className+" ").indexOf(" mousetrap ")>-1||D(F,this.target))return!1;if("composedPath"in B&&typeof B.composedPath=="function"){var I=B.composedPath()[0];I!==B.target&&(F=I)}return F.tagName=="INPUT"||F.tagName=="SELECT"||F.tagName=="TEXTAREA"||F.isContentEditable},P.prototype.handleKey=function(){var B=this;return B._handleKey.apply(B,arguments)},P.addKeycodes=function(B){for(var F in B)B.hasOwnProperty(F)&&(h[F]=B[F]);f=null},P.init=function(){var B=P(s);for(var F in B)F.charAt(0)!=="_"&&(P[F]=(function(I){return function(){return B[I].apply(B,arguments)}})(F))},P.init(),a.Mousetrap=P,n.exports&&(n.exports=P),(i=(function(){return P}).call(o,r,o,n))===void 0||(n.exports=i)}function w(B,F,I){B.addEventListener?B.addEventListener(F,I,!1):B.attachEvent("on"+F,I)}function S(B){if(B.type=="keypress"){var F=String.fromCharCode(B.which);return B.shiftKey||(F=F.toLowerCase()),F}return h[B.which]?h[B.which]:v[B.which]?v[B.which]:String.fromCharCode(B.which).toLowerCase()}function M(B){return B=="shift"||B=="ctrl"||B=="alt"||B=="meta"}function T(B,F,I){return I||(I=(function(){if(!f)for(var V in f={},h)V>95&&V<112||h.hasOwnProperty(V)&&(f[h[V]]=V);return f})()[B]?"keydown":"keypress"),I=="keypress"&&F.length&&(I="keydown"),I}function $(B,F){var I,V,z,X=[];for(I=(function(Y){return Y==="+"?["+"]:(Y=Y.replace(/\+{2}/g,"+plus")).split("+")})(B),z=0;z<I.length;++z)V=I[z],E[V]&&(V=E[V]),F&&F!="keypress"&&b[V]&&(V=b[V],X.push("shift")),M(V)&&X.push(V);return{key:V,modifiers:X,action:F=T(V,X,F)}}function D(B,F){return B!==null&&B!==s&&(B===F||D(B.parentNode,F))}function P(B){var F=this;if(B=B||s,!(F instanceof P))return new P(B);F.target=B,F._callbacks={},F._directMap={};var I,V={},z=!1,X=!1,Y=!1;function W(Pe){Pe=Pe||{};var De,ze=!1;for(De in V)Pe[De]?ze=!0:V[De]=0;ze||(Y=!1)}function Q(Pe,De,ze,Ye,Be,Je){var gt,le,Ze,pe,se=[],we=ze.type;if(!F._callbacks[Pe])return[];for(we=="keyup"&&M(Pe)&&(De=[Pe]),gt=0;gt<F._callbacks[Pe].length;++gt)if(le=F._callbacks[Pe][gt],(Ye||!le.seq||V[le.seq]==le.level)&&we==le.action&&(we=="keypress"&&!ze.metaKey&&!ze.ctrlKey||(Ze=De,pe=le.modifiers,Ze.sort().join(",")===pe.sort().join(",")))){var $e=!Ye&&le.combo==Be,rt=Ye&&le.seq==Ye&&le.level==Je;($e||rt)&&F._callbacks[Pe].splice(gt,1),se.push(le)}return se}function J(Pe,De,ze,Ye){F.stopCallback(De,De.target||De.srcElement,ze,Ye)||Pe(De,ze)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(De),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(De))}function ie(Pe){typeof Pe.which!="number"&&(Pe.which=Pe.keyCode);var De=S(Pe);De&&(Pe.type!="keyup"||z!==De?F.handleKey(De,(function(ze){var Ye=[];return ze.shiftKey&&Ye.push("shift"),ze.altKey&&Ye.push("alt"),ze.ctrlKey&&Ye.push("ctrl"),ze.metaKey&&Ye.push("meta"),Ye})(Pe),Pe):z=!1)}function Se(Pe,De,ze,Ye){function Be(Ze){return function(){Y=Ze,++V[Pe],clearTimeout(I),I=setTimeout(W,1e3)}}function Je(Ze){J(ze,Ze,Pe),Ye!=="keyup"&&(z=S(Ze)),setTimeout(W,10)}V[Pe]=0;for(var gt=0;gt<De.length;++gt){var le=gt+1===De.length?Je:Be(Ye||$(De[gt+1]).action);Ae(De[gt],le,Ye,Pe,gt)}}function Ae(Pe,De,ze,Ye,Be){F._directMap[Pe+":"+ze]=De;var Je,gt=(Pe=Pe.replace(/\s+/g," ")).split(" ");gt.length>1?Se(Pe,gt,De,ze):(Je=$(Pe,ze),F._callbacks[Je.key]=F._callbacks[Je.key]||[],Q(Je.key,Je.modifiers,{type:Je.action},Ye,Pe,Be),F._callbacks[Je.key][Ye?"unshift":"push"]({callback:De,modifiers:Je.modifiers,action:Je.action,seq:Ye,level:Be,combo:Pe}))}F._handleKey=function(Pe,De,ze){var Ye,Be=Q(Pe,De,ze),Je={},gt=0,le=!1;for(Ye=0;Ye<Be.length;++Ye)Be[Ye].seq&&(gt=Math.max(gt,Be[Ye].level));for(Ye=0;Ye<Be.length;++Ye)if(Be[Ye].seq){if(Be[Ye].level!=gt)continue;le=!0,Je[Be[Ye].seq]=1,J(Be[Ye].callback,ze,Be[Ye].combo,Be[Ye].seq)}else le||J(Be[Ye].callback,ze,Be[Ye].combo);var Ze=ze.type=="keypress"&&X;ze.type!=Y||M(Pe)||Ze||W(Je),X=le&&ze.type=="keydown"},F._bindMultiple=function(Pe,De,ze){for(var Ye=0;Ye<Pe.length;++Ye)Ae(Pe[Ye],De,ze)},w(B,"keypress",ie),w(B,"keydown",ie),w(B,"keyup",ie)}})(typeof window<"u"?window:null,typeof window<"u"?document:null)},function(n,o,r){var i=r(7),a=r(34),s=r(30),l=r(33),f=i.TypeError;n.exports=function(h,v){var b,E;if(v==="string"&&s(b=h.toString)&&!l(E=a(b,h))||s(b=h.valueOf)&&!l(E=a(b,h))||v!=="string"&&s(b=h.toString)&&!l(E=a(b,h)))return E;throw f("Can't convert object to primitive value")}},function(n,o,r){var i=r(7),a=r(30),s=r(92),l=i.WeakMap;n.exports=a(l)&&/native code/.test(s(l))},function(n,o,r){var i=r(36),a=r(38),s=r(32),l=r(41),f=r(77);n.exports=i?Object.defineProperties:function(h,v){s(h);for(var b,E=l(v),O=f(v),w=O.length,S=0;w>S;)a.f(h,b=O[S++],E[b]);return h}},function(n,o,r){var i=r(7);n.exports=i},function(n,o,r){var i=r(7),a=r(96),s=r(99),l=r(33),f=r(28)("species"),h=i.Array;n.exports=function(v){var b;return a(v)&&(b=v.constructor,(s(b)&&(b===h||a(b.prototype))||l(b)&&(b=b[f])===null)&&(b=void 0)),b===void 0?h:b}},function(n,o,r){var i=r(113),a=r(97);n.exports=i?{}.toString:function(){return"[object "+a(this)+"]"}},function(n,o,r){var i=r(142).IteratorPrototype,a=r(60),s=r(69),l=r(78),f=r(80),h=function(){return this};n.exports=function(v,b,E,O){var w=b+" Iterator";return v.prototype=a(i,{next:s(+!O,E)}),l(v,w,!1,!0),f[w]=h,v}},function(n,o,r){var i=r(7),a=r(30),s=i.String,l=i.TypeError;n.exports=function(f){if(typeof f=="object"||a(f))return f;throw l("Can't set "+s(f)+" as a prototype")}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(95),f=r(42),h=r(144),v=r(117),b=r(119),E=r(30),O=r(33),w=r(18),S=r(120),M=r(78),T=r(148);n.exports=function($,D,P){var B=$.indexOf("Map")!==-1,F=$.indexOf("Weak")!==-1,I=B?"set":"add",V=a[$],z=V&&V.prototype,X=V,Y={},W=function(Pe){var De=s(z[Pe]);f(z,Pe,Pe=="add"?function(ze){return De(this,ze===0?0:ze),this}:Pe=="delete"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:Pe=="get"?function(ze){return F&&!O(ze)?void 0:De(this,ze===0?0:ze)}:Pe=="has"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:function(ze,Ye){return De(this,ze===0?0:ze,Ye),this})};if(l($,!E(V)||!(F||z.forEach&&!w((function(){new V().entries().next()})))))X=P.getConstructor(D,$,B,I),h.enable();else if(l($,!0)){var Q=new X,J=Q[I](F?{}:-0,1)!=Q,ie=w((function(){Q.has(1)})),Se=S((function(Pe){new V(Pe)})),Ae=!F&&w((function(){for(var Pe=new V,De=5;De--;)Pe[I](De,De);return!Pe.has(-0)}));Se||((X=D((function(Pe,De){b(Pe,z);var ze=T(new V,Pe,X);return De!=null&&v(De,ze[I],{that:ze,AS_ENTRIES:B}),ze}))).prototype=z,z.constructor=X),(ie||Ae)&&(W("delete"),W("has"),B&&W("get")),(Ae||J)&&W(I),F&&z.clear&&delete z.clear}return Y[$]=X,i({global:!0,forced:X!=V},Y),M(X,$),F||P.setStrong(X,$,B),X}},function(n,o,r){var i=r(18),a=r(33),s=r(51),l=r(184),f=Object.isExtensible,h=i((function(){}));n.exports=h||l?function(v){return!!a(v)&&(!l||s(v)!="ArrayBuffer")&&(!f||f(v))}:f},function(n,o,r){var i=r(18);n.exports=i((function(){if(typeof ArrayBuffer=="function"){var a=new ArrayBuffer(8);Object.isExtensible(a)&&Object.defineProperty(a,"a",{value:8})}}))},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(n,o,r){var i=r(38).f,a=r(60),s=r(149),l=r(64),f=r(119),h=r(117),v=r(116),b=r(150),E=r(36),O=r(144).fastKey,w=r(58),S=w.set,M=w.getterFor;n.exports={getConstructor:function(T,$,D,P){var B=T((function(X,Y){f(X,F),S(X,{type:$,index:a(null),first:void 0,last:void 0,size:0}),E||(X.size=0),Y!=null&&h(Y,X[P],{that:X,AS_ENTRIES:D})})),F=B.prototype,I=M($),V=function(X,Y,W){var Q,J,ie=I(X),Se=z(X,Y);return Se?Se.value=W:(ie.last=Se={index:J=O(Y,!0),key:Y,value:W,previous:Q=ie.last,next:void 0,removed:!1},ie.first||(ie.first=Se),Q&&(Q.next=Se),E?ie.size++:X.size++,J!=="F"&&(ie.index[J]=Se)),X},z=function(X,Y){var W,Q=I(X),J=O(Y);if(J!=="F")return Q.index[J];for(W=Q.first;W;W=W.next)if(W.key==Y)return W};return s(F,{clear:function(){for(var X=I(this),Y=X.index,W=X.first;W;)W.removed=!0,W.previous&&(W.previous=W.previous.next=void 0),delete Y[W.index],W=W.next;X.first=X.last=void 0,E?X.size=0:this.size=0},delete:function(X){var Y=this,W=I(Y),Q=z(Y,X);if(Q){var J=Q.next,ie=Q.previous;delete W.index[Q.index],Q.removed=!0,ie&&(ie.next=J),J&&(J.previous=ie),W.first==Q&&(W.first=J),W.last==Q&&(W.last=ie),E?W.size--:Y.size--}return!!Q},forEach:function(X){for(var Y,W=I(this),Q=l(X,arguments.length>1?arguments[1]:void 0);Y=Y?Y.next:W.first;)for(Q(Y.value,Y.key,this);Y&&Y.removed;)Y=Y.previous},has:function(X){return!!z(this,X)}}),s(F,D?{get:function(X){var Y=z(this,X);return Y&&Y.value},set:function(X,Y){return V(this,X===0?0:X,Y)}}:{add:function(X){return V(this,X=X===0?0:X,X)}}),E&&i(F,"size",{get:function(){return I(this).size}}),B},setStrong:function(T,$,D){var P=$+" Iterator",B=M($),F=M(P);v(T,$,(function(I,V){S(this,{type:P,target:I,state:B(I),kind:V,last:void 0})}),(function(){for(var I=F(this),V=I.kind,z=I.last;z&&z.removed;)z=z.previous;return I.target&&(I.last=z=z?z.next:I.state.first)?V=="keys"?{value:z.key,done:!1}:V=="values"?{value:z.value,done:!1}:{value:[z.key,z.value],done:!1}:(I.target=void 0,{value:void 0,done:!0})}),D?"entries":"values",!D,!0),b($)}}},function(n,o,r){var i=r(79).forEach,a=r(121)("forEach");n.exports=a?[].forEach:function(s){return i(this,s,arguments.length>1?arguments[1]:void 0)}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(40),f=r(189),h=r(145),v=r(99),b=r(45),E=r(63),O=r(146),w=r(118),S=i.Array;n.exports=function(M){var T=l(M),$=v(this),D=arguments.length,P=D>1?arguments[1]:void 0,B=P!==void 0;B&&(P=a(P,D>2?arguments[2]:void 0));var F,I,V,z,X,Y,W=w(T),Q=0;if(!W||this==S&&h(W))for(F=b(T),I=$?new this(F):S(F);F>Q;Q++)Y=B?P(T[Q],Q):T[Q],E(I,Q,Y);else for(X=(z=O(T,W)).next,I=$?new this:[];!(V=s(X,z)).done;Q++)Y=B?f(z,P,[V.value,Q],!0):V.value,E(I,Q,Y);return I.length=Q,I}},function(n,o,r){var i=r(32),a=r(147);n.exports=function(s,l,f,h){try{return h?l(i(f)[0],f[1]):l(f)}catch(v){a(s,"throw",v)}}},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a(".","s");return!(s.dotAll&&s.exec(`
|
||
`)&&s.flags==="s")}))},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a("(?<a>b)","g");return s.exec("b").groups.a!=="b"||"b".replace(s,"$<a>c")!=="bc"}))},function(n,o,r){var i=r(16),a=r(15),s=r(56),l=r(40),f=r(45),h=r(39),v=r(18),b=r(193),E=r(121),O=r(194),w=r(195),S=r(70),M=r(196),T=[],$=a(T.sort),D=a(T.push),P=v((function(){T.sort(void 0)})),B=v((function(){T.sort(null)})),F=E("sort"),I=!v((function(){if(S)return S<70;if(!(O&&O>3)){if(w)return!0;if(M)return M<603;var V,z,X,Y,W="";for(V=65;V<76;V++){switch(z=String.fromCharCode(V),V){case 66:case 69:case 70:case 72:X=3;break;case 68:case 71:X=4;break;default:X=2}for(Y=0;Y<47;Y++)T.push({k:z+Y,v:X})}for(T.sort((function(Q,J){return J.v-Q.v})),Y=0;Y<T.length;Y++)z=T[Y].k.charAt(0),W.charAt(W.length-1)!==z&&(W+=z);return W!=="DGBEFHACIJK"}}));i({target:"Array",proto:!0,forced:P||!B||!F||!I},{sort:function(V){V!==void 0&&s(V);var z=l(this);if(I)return V===void 0?$(z):$(z,V);var X,Y,W=[],Q=f(z);for(Y=0;Y<Q;Y++)Y in z&&D(W,z[Y]);for(b(W,(function(J){return function(ie,Se){return Se===void 0?-1:ie===void 0?1:J!==void 0?+J(ie,Se)||0:h(ie)>h(Se)?1:-1}})(V)),X=W.length,Y=0;Y<X;)z[Y]=W[Y++];for(;Y<Q;)delete z[Y++];return z}})},function(n,o,r){var i=r(114),a=Math.floor,s=function(h,v){var b=h.length,E=a(b/2);return b<8?l(h,v):f(h,s(i(h,0,E),v),s(i(h,E),v),v)},l=function(h,v){for(var b,E,O=h.length,w=1;w<O;){for(E=w,b=h[w];E&&v(h[E-1],b)>0;)h[E]=h[--E];E!==w++&&(h[E]=b)}return h},f=function(h,v,b,E){for(var O=v.length,w=b.length,S=0,M=0;S<O||M<w;)h[S+M]=S<O&&M<w?E(v[S],b[M])<=0?v[S++]:b[M++]:S<O?v[S++]:b[M++];return h};n.exports=s},function(n,o,r){var i=r(55).match(/firefox\/(\d+)/i);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(55);n.exports=/MSIE|Trident/.test(i)},function(n,o,r){var i=r(55).match(/AppleWebKit\/(\d+)\./);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(7),a=r(159),s=i.TypeError;n.exports=function(l){if(a(l))throw s("The method doesn't accept regular expressions");return l}},function(n,o,r){var i=r(28)("match");n.exports=function(a){var s=/./;try{"/./"[a](s)}catch{try{return s[i]=!1,"/./"[a](s)}catch{}}return!1}},function(n,o,r){r(16)({target:"Number",stat:!0},{isNaN:function(i){return i!=i}})},function(n,o,r){var i=r(73).PROPER,a=r(18),s=r(162);n.exports=function(l){return a((function(){return!!s[l]()||"
"[l]()!=="
"||i&&s[l].name!==l}))}},function(n,o,r){var i=r(15),a=r(40),s=Math.floor,l=i("".charAt),f=i("".replace),h=i("".slice),v=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,b=/\$([$&'`]|\d{1,2})/g;n.exports=function(E,O,w,S,M,T){var $=w+E.length,D=S.length,P=b;return M!==void 0&&(M=a(M),P=v),f(T,P,(function(B,F){var I;switch(l(F,0)){case"$":return"$";case"&":return E;case"`":return h(O,0,w);case"'":return h(O,$);case"<":I=M[h(F,1,-1)];break;default:var V=+F;if(V===0)return B;if(V>D){var z=s(V/10);return z===0?B:z<=D?S[z-1]===void 0?l(F,1):S[z-1]+l(F,1):B}I=S[V-1]}return I===void 0?"":I}))}},function(n,o,r){var i=r(36),a=r(15),s=r(34),l=r(18),f=r(77),h=r(112),v=r(84),b=r(40),E=r(85),O=Object.assign,w=Object.defineProperty,S=a([].concat);n.exports=!O||l((function(){if(i&&O({b:1},O(w({},"a",{enumerable:!0,get:function(){w(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var M={},T={},$=Symbol(),D="abcdefghijklmnopqrst";return M[$]=7,D.split("").forEach((function(P){T[P]=P})),O({},M)[$]!=7||f(O({},T)).join("")!=D}))?function(M,T){for(var $=b(M),D=arguments.length,P=1,B=h.f,F=v.f;D>P;)for(var I,V=E(arguments[P++]),z=B?S(f(V),B(V)):f(V),X=z.length,Y=0;X>Y;)I=z[Y++],i&&!s(F,V,I)||($[I]=V[I]);return $}:O},function(n,o,r){var i=r(7),a=r(15),s=r(56),l=r(33),f=r(35),h=r(98),v=i.Function,b=a([].concat),E=a([].join),O={},w=function(S,M,T){if(!f(O,M)){for(var $=[],D=0;D<M;D++)$[D]="a["+D+"]";O[M]=v("C,a","return new C("+E($,",")+")")}return O[M](S,T)};n.exports=v.bind||function(S){var M=s(this),T=M.prototype,$=h(arguments,1),D=function(){var P=b($,h(arguments));return this instanceof D?w(M,P.length,P):M.apply(S,P)};return l(T)&&(D.prototype=T),D}},function(n,o,r){var i=r(35);n.exports=function(a){return a!==void 0&&(i(a,"value")||i(a,"writable"))}},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=/"/g,f=i("".replace);n.exports=function(h,v,b,E){var O=s(a(h)),w="<"+v;return b!==""&&(w+=" "+b+'="'+f(s(E),l,""")+'"'),w+">"+O+"</"+v+">"}},function(n,o,r){var i=r(18);n.exports=function(a){return i((function(){var s=""[a]('"');return s!==s.toLowerCase()||s.split('"').length>3}))}},function(n,o,r){r(16)({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(n,o,r){var i,a,s,l,f=r(16),h=r(71),v=r(7),b=r(46),E=r(34),O=r(209),w=r(42),S=r(149),M=r(102),T=r(78),$=r(150),D=r(56),P=r(30),B=r(33),F=r(119),I=r(92),V=r(117),z=r(120),X=r(164),Y=r(168).set,W=r(210),Q=r(213),J=r(214),ie=r(170),Se=r(215),Ae=r(58),Pe=r(95),De=r(28),ze=r(216),Ye=r(128),Be=r(70),Je=De("species"),gt="Promise",le=Ae.getterFor(gt),Ze=Ae.set,pe=Ae.getterFor(gt),se=O&&O.prototype,we=O,$e=se,rt=v.TypeError,pt=v.document,Lt=v.process,Jt=ie.f,en=Jt,zt=!!(pt&&pt.createEvent&&v.dispatchEvent),it=P(v.PromiseRejectionEvent),ae="unhandledrejection",re=!1,je=Pe(gt,(function(){var Le=I(we),dt=Le!==String(we);if(!dt&&Be===66||h&&!$e.finally)return!0;if(Be>=51&&/native code/.test(Le))return!1;var At=new we((function(En){En(1)})),Tt=function(En){En((function(){}),(function(){}))};return(At.constructor={})[Je]=Tt,!(re=At.then((function(){}))instanceof Tt)||!dt&&ze&&!it})),vt=je||!z((function(Le){we.all(Le).catch((function(){}))})),q=function(Le){var dt;return!(!B(Le)||!P(dt=Le.then))&&dt},kt=function(Le,dt){if(!Le.notified){Le.notified=!0;var At=Le.reactions;W((function(){for(var Tt=Le.value,En=Le.state==1,Zn=0;At.length>Zn;){var ao,Lo,yo,ho=At[Zn++],Nn=En?ho.ok:ho.fail,qn=ho.resolve,rr=ho.reject,ut=ho.domain;try{Nn?(En||(Le.rejection===2&&qt(Le),Le.rejection=1),Nn===!0?ao=Tt:(ut&&ut.enter(),ao=Nn(Tt),ut&&(ut.exit(),yo=!0)),ao===ho.promise?rr(rt("Promise-chain cycle")):(Lo=q(ao))?E(Lo,ao,qn,rr):qn(ao)):rr(Tt)}catch(vn){ut&&!yo&&ut.exit(),rr(vn)}}Le.reactions=[],Le.notified=!1,dt&&!Le.rejection&&Gt(Le)}))}},Rt=function(Le,dt,At){var Tt,En;zt?((Tt=pt.createEvent("Event")).promise=dt,Tt.reason=At,Tt.initEvent(Le,!1,!0),v.dispatchEvent(Tt)):Tt={promise:dt,reason:At},!it&&(En=v["on"+Le])?En(Tt):Le===ae&&J("Unhandled promise rejection",At)},Gt=function(Le){E(Y,v,(function(){var dt,At=Le.facade,Tt=Le.value;if(Pn(Le)&&(dt=Se((function(){Ye?Lt.emit("unhandledRejection",Tt,At):Rt(ae,At,Tt)})),Le.rejection=Ye||Pn(Le)?2:1,dt.error))throw dt.value}))},Pn=function(Le){return Le.rejection!==1&&!Le.parent},qt=function(Le){E(Y,v,(function(){var dt=Le.facade;Ye?Lt.emit("rejectionHandled",dt):Rt("rejectionhandled",dt,Le.value)}))},On=function(Le,dt,At){return function(Tt){Le(dt,Tt,At)}},ke=function(Le,dt,At){Le.done||(Le.done=!0,At&&(Le=At),Le.value=dt,Le.state=2,kt(Le,!0))},Ke=function(Le,dt,At){if(!Le.done){Le.done=!0,At&&(Le=At);try{if(Le.facade===dt)throw rt("Promise can't be resolved itself");var Tt=q(dt);Tt?W((function(){var En={done:!1};try{E(Tt,dt,On(Ke,En,Le),On(ke,En,Le))}catch(Zn){ke(En,Zn,Le)}})):(Le.value=dt,Le.state=1,kt(Le,!1))}catch(En){ke({done:!1},En,Le)}}};if(je&&($e=(we=function(Le){F(this,$e),D(Le),E(i,this);var dt=le(this);try{Le(On(Ke,dt),On(ke,dt))}catch(At){ke(dt,At)}}).prototype,(i=function(Le){Ze(this,{type:gt,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=S($e,{then:function(Le,dt){var At=pe(this),Tt=At.reactions,En=Jt(X(this,we));return En.ok=!P(Le)||Le,En.fail=P(dt)&&dt,En.domain=Ye?Lt.domain:void 0,At.parent=!0,Tt[Tt.length]=En,At.state!=0&&kt(At,!1),En.promise},catch:function(Le){return this.then(void 0,Le)}}),a=function(){var Le=new i,dt=le(Le);this.promise=Le,this.resolve=On(Ke,dt),this.reject=On(ke,dt)},ie.f=Jt=function(Le){return Le===we||Le===s?new a(Le):en(Le)},!h&&P(O)&&se!==Object.prototype)){l=se.then,re||(w(se,"then",(function(Le,dt){var At=this;return new we((function(Tt,En){E(l,At,Tt,En)})).then(Le,dt)}),{unsafe:!0}),w(se,"catch",$e.catch,{unsafe:!0}));try{delete se.constructor}catch{}M&&M(se,$e)}f({global:!0,wrap:!0,forced:je},{Promise:we}),T(we,gt,!1,!0),$(gt),s=b(gt),f({target:gt,stat:!0,forced:je},{reject:function(Le){var dt=Jt(this);return E(dt.reject,void 0,Le),dt.promise}}),f({target:gt,stat:!0,forced:h||je},{resolve:function(Le){return Q(h&&this===s?we:this,Le)}}),f({target:gt,stat:!0,forced:vt},{all:function(Le){var dt=this,At=Jt(dt),Tt=At.resolve,En=At.reject,Zn=Se((function(){var ao=D(dt.resolve),Lo=[],yo=0,ho=1;V(Le,(function(Nn){var qn=yo++,rr=!1;ho++,E(ao,dt,Nn).then((function(ut){rr||(rr=!0,Lo[qn]=ut,--ho||Tt(Lo))}),En)})),--ho||Tt(Lo)}));return Zn.error&&En(Zn.value),At.promise},race:function(Le){var dt=this,At=Jt(dt),Tt=At.reject,En=Se((function(){var Zn=D(dt.resolve);V(Le,(function(ao){E(Zn,dt,ao).then(At.resolve,Tt)}))}));return En.error&&Tt(En.value),At.promise}})},function(n,o,r){var i=r(7);n.exports=i.Promise},function(n,o,r){var i,a,s,l,f,h,v,b,E=r(7),O=r(64),w=r(50).f,S=r(168).set,M=r(169),T=r(211),$=r(212),D=r(128),P=E.MutationObserver||E.WebKitMutationObserver,B=E.document,F=E.process,I=E.Promise,V=w(E,"queueMicrotask"),z=V&&V.value;z||(i=function(){var X,Y;for(D&&(X=F.domain)&&X.exit();a;){Y=a.fn,a=a.next;try{Y()}catch(W){throw a?l():s=void 0,W}}s=void 0,X&&X.enter()},M||D||$||!P||!B?!T&&I&&I.resolve?((v=I.resolve(void 0)).constructor=I,b=O(v.then,v),l=function(){b(i)}):D?l=function(){F.nextTick(i)}:(S=O(S,E),l=function(){S(i)}):(f=!0,h=B.createTextNode(""),new P(i).observe(h,{characterData:!0}),l=function(){h.data=f=!f})),n.exports=z||function(X){var Y={fn:X,next:void 0};s&&(s.next=Y),a||(a=Y,l()),s=Y}},function(n,o,r){var i=r(55),a=r(7);n.exports=/ipad|iphone|ipod/i.test(i)&&a.Pebble!==void 0},function(n,o,r){var i=r(55);n.exports=/web0s(?!.*chrome)/i.test(i)},function(n,o,r){var i=r(32),a=r(33),s=r(170);n.exports=function(l,f){if(i(l),a(f)&&f.constructor===l)return f;var h=s.f(l);return(0,h.resolve)(f),h.promise}},function(n,o,r){var i=r(7);n.exports=function(a,s){var l=i.console;l&&l.error&&(arguments.length==1?l.error(a):l.error(a,s))}},function(n,o){n.exports=function(r){try{return{error:!1,value:r()}}catch(i){return{error:!0,value:i}}}},function(n,o){n.exports=typeof window=="object"},function(n,o,r){var i=r(40),a=r(75),s=r(45);n.exports=function(l){for(var f=i(this),h=s(f),v=arguments.length,b=a(v>1?arguments[1]:void 0,h),E=v>2?arguments[2]:void 0,O=E===void 0?h:a(E,h);O>b;)f[b++]=l;return f}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(59),f=r(160),h=r(219),v=r(18),b=a.RangeError,E=a.String,O=Math.floor,w=s(h),S=s("".slice),M=s(1 .toFixed),T=function(B,F,I){return F===0?I:F%2==1?T(B,F-1,I*B):T(B*B,F/2,I)},$=function(B,F,I){for(var V=-1,z=I;++V<6;)z+=F*B[V],B[V]=z%1e7,z=O(z/1e7)},D=function(B,F){for(var I=6,V=0;--I>=0;)V+=B[I],B[I]=O(V/F),V=V%F*1e7},P=function(B){for(var F=6,I="";--F>=0;)if(I!==""||F===0||B[F]!==0){var V=E(B[F]);I=I===""?V:I+w("0",7-V.length)+V}return I};i({target:"Number",proto:!0,forced:v((function(){return M(8e-5,3)!=="0.000"||M(.9,0)!=="1"||M(1.255,2)!=="1.25"||M(0xde0b6b3a7640080,0)!=="1000000000000000128"}))||!v((function(){M({})}))},{toFixed:function(B){var F,I,V,z,X=f(this),Y=l(B),W=[0,0,0,0,0,0],Q="",J="0";if(Y<0||Y>20)throw b("Incorrect fraction digits");if(X!=X)return"NaN";if(X<=-1e21||X>=1e21)return E(X);if(X<0&&(Q="-",X=-X),X>1e-21)if(I=(F=(function(ie){for(var Se=0,Ae=ie;Ae>=4096;)Se+=12,Ae/=4096;for(;Ae>=2;)Se+=1,Ae/=2;return Se})(X*T(2,69,1))-69)<0?X*T(2,-F,1):X/T(2,F,1),I*=4503599627370496,(F=52-F)>0){for($(W,0,I),V=Y;V>=7;)$(W,1e7,0),V-=7;for($(W,T(10,V,1),0),V=F-1;V>=23;)D(W,1<<23),V-=23;D(W,1<<V),$(W,1,1),D(W,2),J=P(W)}else $(W,0,I),$(W,1<<-F,0),J=P(W)+w("0",Y);return J=Y>0?Q+((z=J.length)<=Y?"0."+w("0",Y-z)+J:S(J,0,z-Y)+"."+S(J,z-Y)):Q+J}})},function(n,o,r){var i=r(7),a=r(59),s=r(39),l=r(44),f=i.RangeError;n.exports=function(h){var v=s(l(this)),b="",E=a(h);if(E<0||E==1/0)throw f("Wrong number of repetitions");for(;E>0;(E>>>=1)&&(v+=v))1&E&&(b+=v);return b}},function(n,o,r){var i=r(36),a=r(15),s=r(77),l=r(41),f=a(r(84).f),h=a([].push),v=function(b){return function(E){for(var O,w=l(E),S=s(w),M=S.length,T=0,$=[];M>T;)O=S[T++],i&&!f(w,O)||h($,b?[O,w[O]]:w[O]);return $}};n.exports={entries:v(!0),values:v(!1)}},function(n,o){n.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(n,o,r){r.r(o),r.d(o,"observer",(function(){return Fc})),r.d(o,"LogicFlow",(function(){return XO})),r.d(o,"h",(function(){return re.g})),r.d(o,"LogicFlowUtil",(function(){return i})),r.d(o,"BaseNode",(function(){return Yf})),r.d(o,"RectNode",(function(){return Fx})),r.d(o,"CircleNode",(function(){return Vx})),r.d(o,"PolygonNode",(function(){return Xx})),r.d(o,"DiamondNode",(function(){return Zx})),r.d(o,"EllipseNode",(function(){return nO})),r.d(o,"TextNode",(function(){return iO})),r.d(o,"HtmlNode",(function(){return uO})),r.d(o,"BaseEdge",(function(){return Py})),r.d(o,"LineEdge",(function(){return xO})),r.d(o,"PolylineEdge",(function(){return TO})),r.d(o,"BezierEdge",(function(){return PO})),r.d(o,"Arrow",(function(){return VB})),r.d(o,"BaseEdgeModel",(function(){return Kp})),r.d(o,"BezierEdgeModel",(function(){return GE})),r.d(o,"LineEdgeModel",(function(){return Od})),r.d(o,"PolylineEdgeModel",(function(){return Cl})),r.d(o,"BaseNodeModel",(function(){return Xf})),r.d(o,"CircleNodeModel",(function(){return KE})),r.d(o,"DiamondNodeModel",(function(){return tx})),r.d(o,"EllipseNodeModel",(function(){return ix})),r.d(o,"PolygonNodeModel",(function(){return dx})),r.d(o,"RectNodeModel",(function(){return vx})),r.d(o,"TextNodeModel",(function(){return _x})),r.d(o,"HtmlNodeModel",(function(){return Ex})),r.d(o,"EditConfigModel",(function(){return Mp})),r.d(o,"GraphModel",(function(){return lT})),r.d(o,"SnaplineModel",(function(){return GC})),r.d(o,"Keyboard",(function(){return NN})),r.d(o,"get",(function(){return NT})),r.d(o,"defaults",(function(){return PT})),r.d(o,"ElementState",(function(){return Io})),r.d(o,"ModelType",(function(){return lo})),r.d(o,"ElementType",(function(){return ei})),r.d(o,"EventType",(function(){return ur})),r.d(o,"formateAnchorConnectValidateData",(function(){return au}));var i={};r.r(i),r.d(i,"createUuid",(function(){return tl})),r.d(i,"refreshGraphId",(function(){return Sf})),r.d(i,"StepDrag",(function(){return Te})),r.d(i,"setupEdgeModel",(function(){return sn})),r.d(i,"isBboxOverLapping",(function(){return nn})),r.d(i,"filterRepeatPoints",(function(){return Mt})),r.d(i,"getSimplePolyline",(function(){return wn})),r.d(i,"getExpandedBBox",(function(){return pn})),r.d(i,"pointDirection",(function(){return rn})),r.d(i,"getExpandedBBoxPoint",(function(){return Wt})),r.d(i,"mergeBBox",(function(){return st})),r.d(i,"getBBoxOfPoints",(function(){return St})),r.d(i,"getPointsFromBBox",(function(){return ln})),r.d(i,"isPointOutsideBBox",(function(){return An})),r.d(i,"getBBoxXCrossPoints",(function(){return Xt})),r.d(i,"getBBoxYCrossPoints",(function(){return kn})),r.d(i,"getBBoxCrossPointsByPoint",(function(){return Kt})),r.d(i,"estimateDistance",(function(){return _n})),r.d(i,"costByPoints",(function(){return Yt})),r.d(i,"heuristicCostEstimate",(function(){return xn})),r.d(i,"rebuildPath",(function(){return ar})),r.d(i,"removeClosePointFromOpenList",(function(){return xr})),r.d(i,"isSegmentsIntersected",(function(){return on})),r.d(i,"isSegmentCrossingBBox",(function(){return Zt})),r.d(i,"getNextNeighborPoints",(function(){return Ht})),r.d(i,"pathFinder",(function(){return fr})),r.d(i,"getBoxByOriginNode",(function(){return Dr})),r.d(i,"pointFilter",(function(){return Un})),r.d(i,"getPolylinePoints",(function(){return $r})),r.d(i,"getLongestEdge",(function(){return Or})),r.d(i,"isSegmentsInNode",(function(){return Fr})),r.d(i,"isSegmentsCrossNode",(function(){return Qr})),r.d(i,"getCrossPointInRect",(function(){return ki})),r.d(i,"segmentDirection",(function(){return Si})),r.d(i,"points2PointsList",(function(){return jr})),r.d(i,"getSimplePoints",(function(){return Gi})),r.d(i,"getBytesLength",(function(){return Pi})),r.d(i,"getTextWidth",(function(){return Qi})),r.d(i,"getAppendAttributes",(function(){return la})),r.d(i,"getBezierControlPoints",(function(){return zi})),r.d(i,"getBezierPoints",(function(){return di})),r.d(i,"getEndTangent",(function(){return sa})),r.d(i,"getClosestPointOfPolyline",(function(){return co})),r.d(i,"pickEdgeConfig",(function(){return cr})),r.d(i,"twoPointDistance",(function(){return Xr})),r.d(i,"createEdgeGenerator",(function(){return Nr})),r.d(i,"snapToGrid",(function(){return fs})),r.d(i,"getGridOffset",(function(){return wf})),r.d(i,"sampleCubic",(function(){return Ni})),r.d(i,"getThetaOfVector",(function(){return Jp})),r.d(i,"degrees",(function(){return gv})),r.d(i,"Vector",(function(){return ot})),r.d(i,"Point",(function(){return g})),r.d(i,"Matrix",(function(){return Fu})),r.d(i,"RotateMatrix",(function(){return Sd})),r.d(i,"ScaleMatrix",(function(){return wy})),r.d(i,"TranslateMatrix",(function(){return eh}));var a=r(1),s=r(10);if(!s.j)throw new Error("mobx-react-lite requires React with Hooks support");if(!a.H)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var l=r(43),f=Object(l.b)("observerBatching");function h(c){c()}var v=!1;function b(){return v}function E(c){return Object(a.t)(c)}var O,w=1e4,S=new Set;function M(){O===void 0&&(O=setTimeout(T,1e4))}function T(){O=void 0;var c=Date.now();S.forEach((function(u){var d=u.current;d&&c>=d.cleanAt&&(d.reaction.dispose(),u.current=null,S.delete(u))})),S.size>0&&M()}var $=!1,D=[],P={};function B(c){return"observer"+c}function F(c,u,d){u===void 0&&(u="observed"),d===void 0&&(d=P),b();var p,y=(function(U){return function(){$?D.push(U):U()}})((d.useForceUpdate||l.d)()),m=s.d.useRef(null);if(!m.current){var _=new a.c(B(u),(function(){A.mounted?y():(_.dispose(),m.current=null)})),A=(function(U){return{cleanAt:Date.now()+w,reaction:U}})(_);m.current=A,p=m,S.add(p),M()}var N=m.current.reaction;return s.d.useDebugValue(N,E),s.d.useEffect((function(){var U;return U=m,S.delete(U),m.current?m.current.mounted=!0:(m.current={reaction:new a.c(B(u),(function(){y()})),cleanAt:1/0},y()),function(){m.current.reaction.dispose(),m.current=null}}),[]),(function(U){$=!0,D=[];try{var H=U();$=!1;var oe=D.length>0?D:void 0;return s.d.useLayoutEffect((function(){oe&&oe.forEach((function(ue){return ue()}))}),[oe]),H}finally{$=!1}})((function(){var U,H;if(N.track((function(){try{U=c()}catch(oe){H=oe}})),H)throw H;return U}))}var I=function(){return I=Object.assign||function(c){for(var u,d=1,p=arguments.length;d<p;d++)for(var y in u=arguments[d])Object.prototype.hasOwnProperty.call(u,y)&&(c[y]=u[y]);return c},I.apply(this,arguments)};function V(c,u){var d,p,y,m=I({forwardRef:!1},u),_=c.displayName||c.name,A=function(N,U){return F((function(){return c(N,U)}),_)};return A.displayName=_,d=m.forwardRef?Object(s.f)(Object(s.e)(A)):Object(s.f)(A),p=c,y=d,Object.keys(p).forEach((function(N){z[N]||Object.defineProperty(y,N,Object.getOwnPropertyDescriptor(p,N))})),d.displayName=_,d}var z={$$typeof:!0,render:!0,compare:!0,type:!0};function X(c){var u=c.children,d=c.render,p=u||d;return typeof p!="function"?null:F(p)}function Y(c,u,d,p,y){var m=u==="children"?"render":"children",_=typeof c[u]=="function",A=typeof c[m]=="function";return _&&A?new Error("MobX Observer: Do not use children and render in the same time in`"+d):_||A?null:new Error("Invalid prop `"+y+"` of type `"+typeof c[u]+"` supplied to `"+d+"`, expected `function`.")}X.propTypes={children:Y,render:Y},X.displayName="Observer";var W;(W=s.g)||(W=h),Object(a.n)({reactionScheduler:W}),Object(l.a)()[f]=!0;var Q=0,J={};function ie(c){return J[c]||(J[c]=(function(u){if(typeof Symbol=="function")return Symbol(u);var d="__$mobx-react "+u+" ("+Q+")";return Q++,d})(c)),J[c]}function Se(c,u){if(Ae(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var d=Object.keys(c),p=Object.keys(u);if(d.length!==p.length)return!1;for(var y=0;y<d.length;y++)if(!Object.hasOwnProperty.call(u,d[y])||!Ae(c[d[y]],u[d[y]]))return!1;return!0}function Ae(c,u){return c===u?c!==0||1/c==1/u:c!=c&&u!=u}function Pe(c,u,d){Object.hasOwnProperty.call(c,u)?c[u]=d:Object.defineProperty(c,u,{enumerable:!1,configurable:!0,writable:!0,value:d})}var De=ie("patchMixins"),ze=ie("patchedDefinition");function Ye(c,u){for(var d=this,p=arguments.length,y=new Array(p>2?p-2:0),m=2;m<p;m++)y[m-2]=arguments[m];u.locks++;try{var _;return c!=null&&(_=c.apply(this,y)),_}finally{u.locks--,u.locks===0&&u.methods.forEach((function(A){A.apply(d,y)}))}}function Be(c,u){return function(){for(var d=arguments.length,p=new Array(d),y=0;y<d;y++)p[y]=arguments[y];Ye.call.apply(Ye,[this,c,u].concat(p))}}function Je(c,u,d){var p=(function(A,N){var U=A[De]=A[De]||{},H=U[N]=U[N]||{};return H.locks=H.locks||0,H.methods=H.methods||[],H})(c,u);p.methods.indexOf(d)<0&&p.methods.push(d);var y=Object.getOwnPropertyDescriptor(c,u);if(!y||!y[ze]){var m=c[u],_=gt(c,u,y?y.enumerable:void 0,p,m);Object.defineProperty(c,u,_)}}function gt(c,u,d,p,y){var m,_=Be(y,p);return(m={})[ze]=!0,m.get=function(){return _},m.set=function(A){if(this===c)_=Be(A,p);else{var N=gt(this,u,d,p,A);Object.defineProperty(this,u,N)}},m.configurable=!0,m.enumerable=d,m}var le=a.a||"$mobx",Ze=ie("isMobXReactObserver"),pe=ie("isUnmounted"),se=ie("skipRender"),we=ie("isForcingUpdate");function $e(c){var u=c.prototype;if(c[Ze]?rt(u):c[Ze]=!0,u.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(c.__proto__!==s.b)if(u.shouldComponentUpdate){if(u.shouldComponentUpdate!==Lt)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else u.shouldComponentUpdate=Lt;Jt(u,"props"),Jt(u,"state");var d=u.render;return u.render=function(){return pt.call(this,d)},Je(u,"componentWillUnmount",(function(){var p;(p=this.render[le])===null||p===void 0||p.dispose(),this[pe]=!0,!this.render[le]&&rt(this)})),c}function rt(c){return c.displayName||c.name||c.constructor&&(c.constructor.displayName||c.constructor.name)||"<component>"}function pt(c){var u=this;Pe(this,se,!1),Pe(this,we,!1);var d=rt(this),p=c.bind(this),y=!1,m=new a.c(d+".render()",(function(){if(!y&&(y=!0,u[pe]!==!0)){var A=!0;try{Pe(u,we,!0),u[se]||s.a.prototype.forceUpdate.call(u),A=!1}finally{Pe(u,we,!1),A&&m.dispose()}}}));function _(){y=!1;var A=void 0,N=void 0;if(m.track((function(){try{N=Object(a.d)(!1,p)}catch(U){A=U}})),A)throw A;return N}return m.reactComponent=this,_[le]=m,this.render=_,_.call(this)}function Lt(c,u){return this.state!==u||!Se(this.props,c)}function Jt(c,u){var d=ie("reactProp_"+u+"_valueHolder"),p=ie("reactProp_"+u+"_atomHolder");function y(){return this[p]||Pe(this,p,Object(a.o)("reactive "+u)),this[p]}Object.defineProperty(c,u,{configurable:!0,enumerable:!0,get:function(){var m=!1;return a.f&&a.e&&(m=Object(a.f)(!0)),y.call(this).reportObserved(),a.f&&a.e&&Object(a.e)(m),this[d]},set:function(m){this[we]||Se(this[d],m)?Pe(this,d,m):(Pe(this,d,m),Pe(this,se,!0),y.call(this).reportChanged(),Pe(this,se,!1))}})}var en=typeof Symbol=="function"&&Symbol.for,zt=en?Symbol.for("react.forward_ref"):typeof s.e=="function"&&Object(s.e)((function(c){return null})).$$typeof,it=en?Symbol.for("react.memo"):typeof s.f=="function"&&Object(s.f)((function(c){return null})).$$typeof;function ae(c){if(c.isMobxInjector,it&&c.$$typeof===it)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(zt&&c.$$typeof===zt){var u=c.render;if(typeof u!="function")throw new Error("render property of ForwardRef was not a function");return Object(s.e)((function(){var d=arguments;return Object(s.c)(X,null,(function(){return u.apply(void 0,d)}))}))}return typeof c!="function"||c.prototype&&c.prototype.render||c.isReactClass||Object.prototype.isPrototypeOf.call(s.a,c)?$e(c):V(c)}if(!s.a)throw new Error("mobx-react requires React to be available");if(!a.C)throw new Error("mobx-react requires mobx to be available");var re=r(0);r(4),r(8),r(2),r(3),r(52),r(6),r(5),r(11),r(37),r(27),r(21),r(20),r(24),r(22),r(25),r(9),r(17),r(23),r(19),r(192),r(156),r(104),r(157),r(158),r(199),r(61);var je=function(c,u){for(var d=-1,p=c==null?0:c.length,y=Array(p);++d<p;)y[d]=u(c[d],d,c);return y},vt=function(){this.__data__=[],this.size=0},q=function(c,u){return c===u||c!=c&&u!=u},kt=function(c,u){for(var d=c.length;d--;)if(q(c[d][0],u))return d;return-1},Rt=Array.prototype.splice,Gt=function(c){var u=this.__data__,d=kt(u,c);return!(d<0)&&(d==u.length-1?u.pop():Rt.call(u,d,1),--this.size,!0)},Pn=function(c){var u=this.__data__,d=kt(u,c);return d<0?void 0:u[d][1]},qt=function(c){return kt(this.__data__,c)>-1},On=function(c,u){var d=this.__data__,p=kt(d,c);return p<0?(++this.size,d.push([c,u])):d[p][1]=u,this};function ke(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}ke.prototype.clear=vt,ke.prototype.delete=Gt,ke.prototype.get=Pn,ke.prototype.has=qt,ke.prototype.set=On;var Ke=ke,Le=function(){this.__data__=new Ke,this.size=0},dt=function(c){var u=this.__data__,d=u.delete(c);return this.size=u.size,d},At=function(c){return this.__data__.get(c)},Tt=function(c){return this.__data__.has(c)},En=r(31),Zn=En.a.Symbol,ao=Object.prototype,Lo=ao.hasOwnProperty,yo=ao.toString,ho=Zn?Zn.toStringTag:void 0,Nn=function(c){var u=Lo.call(c,ho),d=c[ho];try{c[ho]=void 0;var p=!0}catch{}var y=yo.call(c);return p&&(u?c[ho]=d:delete c[ho]),y},qn=Object.prototype.toString,rr=function(c){return qn.call(c)},ut=Zn?Zn.toStringTag:void 0,vn=function(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":ut&&ut in Object(c)?Nn(c):rr(c)},In=function(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")},sr,wo=function(c){if(!In(c))return!1;var u=vn(c);return u=="[object Function]"||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"},oo=En.a["__core-js_shared__"],ta=(sr=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||""))?"Symbol(src)_1."+sr:"",Ca=function(c){return!!ta&&ta in c},Yi=Function.prototype.toString,fa=function(c){if(c!=null){try{return Yi.call(c)}catch{}try{return c+""}catch{}}return""},Ka=/^\[object .+?Constructor\]$/,Sn=Function.prototype,Ts=Object.prototype,Oo=Sn.toString,es=Ts.hasOwnProperty,Ui=RegExp("^"+Oo.call(es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=function(c){return!(!In(c)||Ca(c))&&(wo(c)?Ui:Ka).test(fa(c))},gl=function(c,u){return c==null?void 0:c[u]},pa=function(c,u){var d=gl(c,u);return gr(d)?d:void 0},qi=pa(En.a,"Map"),Na=pa(Object,"create"),al=function(){this.__data__=Na?Na(null):{},this.size=0},yl=function(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u},Cs=Object.prototype.hasOwnProperty,_l=function(c){var u=this.__data__;if(Na){var d=u[c];return d==="__lodash_hash_undefined__"?void 0:d}return Cs.call(u,c)?u[c]:void 0},ts=Object.prototype.hasOwnProperty,ve=function(c){var u=this.__data__;return Na?u[c]!==void 0:ts.call(u,c)},mt=function(c,u){var d=this.__data__;return this.size+=this.has(c)?0:1,d[c]=Na&&u===void 0?"__lodash_hash_undefined__":u,this};function cn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}cn.prototype.clear=al,cn.prototype.delete=yl,cn.prototype.get=_l,cn.prototype.has=ve,cn.prototype.set=mt;var Kn=cn,br=function(){this.size=0,this.__data__={hash:new Kn,map:new(qi||Ke),string:new Kn}},so=function(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null},si=function(c,u){var d=c.__data__;return so(u)?d[typeof u=="string"?"string":"hash"]:d.map},ye=function(c){var u=si(this,c).delete(c);return this.size-=u?1:0,u},ht=function(c){return si(this,c).get(c)},fn=function(c){return si(this,c).has(c)},Rn=function(c,u){var d=si(this,c),p=d.size;return d.set(c,u),this.size+=d.size==p?0:1,this};function Cn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}Cn.prototype.clear=br,Cn.prototype.delete=ye,Cn.prototype.get=ht,Cn.prototype.has=fn,Cn.prototype.set=Rn;var nr=Cn,Mn=function(c,u){var d=this.__data__;if(d instanceof Ke){var p=d.__data__;if(!qi||p.length<199)return p.push([c,u]),this.size=++d.size,this;d=this.__data__=new nr(p)}return d.set(c,u),this.size=d.size,this};function or(c){var u=this.__data__=new Ke(c);this.size=u.size}or.prototype.clear=Le,or.prototype.delete=dt,or.prototype.get=At,or.prototype.has=Tt,or.prototype.set=Mn;var lr=or,qr=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},na=function(c){return this.__data__.has(c)};function vi(c){var u=-1,d=c==null?0:c.length;for(this.__data__=new nr;++u<d;)this.add(c[u])}vi.prototype.add=vi.prototype.push=qr,vi.prototype.has=na;var bl=vi,Vi=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p;)if(u(c[d],d,c))return!0;return!1},Ns=function(c,u){return c.has(u)},Fl=function(c,u,d,p,y,m){var _=1&d,A=c.length,N=u.length;if(A!=N&&!(_&&N>A))return!1;var U=m.get(c),H=m.get(u);if(U&&H)return U==u&&H==c;var oe=-1,ue=!0,Ce=2&d?new bl:void 0;for(m.set(c,u),m.set(u,c);++oe<A;){var Ve=c[oe],qe=u[oe];if(p)var Ot=_?p(qe,Ve,oe,u,c,m):p(Ve,qe,oe,c,u,m);if(Ot!==void 0){if(Ot)continue;ue=!1;break}if(Ce){if(!Vi(u,(function(xt,Ft){if(!Ns(Ce,Ft)&&(Ve===xt||y(Ve,xt,d,p,m)))return Ce.push(Ft)}))){ue=!1;break}}else if(Ve!==qe&&!y(Ve,qe,d,p,m)){ue=!1;break}}return m.delete(c),m.delete(u),ue},Ro=En.a.Uint8Array,La=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p,y){d[++u]=[y,p]})),d},id=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p){d[++u]=p})),d},_u=Zn?Zn.prototype:void 0,Ia=_u?_u.valueOf:void 0,ra=function(c,u,d,p,y,m,_){switch(d){case"[object DataView]":if(c.byteLength!=u.byteLength||c.byteOffset!=u.byteOffset)return!1;c=c.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(c.byteLength!=u.byteLength||!m(new Ro(c),new Ro(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return q(+c,+u);case"[object Error]":return c.name==u.name&&c.message==u.message;case"[object RegExp]":case"[object String]":return c==u+"";case"[object Map]":var A=La;case"[object Set]":var N=1&p;if(A||(A=id),c.size!=u.size&&!N)return!1;var U=_.get(c);if(U)return U==u;p|=2,_.set(c,u);var H=Fl(A(c),A(u),p,y,m,_);return _.delete(c),H;case"[object Symbol]":if(Ia)return Ia.call(c)==Ia.call(u)}return!1},wl=function(c,u){for(var d=-1,p=u.length,y=c.length;++d<p;)c[y+d]=u[d];return c},qo=Array.isArray,Uh=function(c,u,d){var p=u(c);return qo(c)?p:wl(p,d(c))},Fa=function(c,u){for(var d=-1,p=c==null?0:c.length,y=0,m=[];++d<p;){var _=c[d];u(_,d,c)&&(m[y++]=_)}return m},gp=function(){return[]},yp=Object.prototype.propertyIsEnumerable,Ba=Object.getOwnPropertySymbols,Za=Ba?function(c){return c==null?[]:(c=Object(c),Fa(Ba(c),(function(u){return yp.call(c,u)})))}:gp,rf=function(c,u){for(var d=-1,p=Array(c);++d<c;)p[d]=u(d);return p},Mo=function(c){return c!=null&&typeof c=="object"},oa=function(c){return Mo(c)&&vn(c)=="[object Arguments]"},ad=Object.prototype,_p=ad.hasOwnProperty,of=ad.propertyIsEnumerable,ld=oa((function(){return arguments})())?oa:function(c){return Mo(c)&&_p.call(c,"callee")&&!of.call(c,"callee")},ns=ld,$a=r(48),bu=/^(?:0|[1-9]\d*)$/,Ja=function(c,u){var d=typeof c;return!!(u=u??9007199254740991)&&(d=="number"||d!="symbol"&&bu.test(c))&&c>-1&&c%1==0&&c<u},El=function(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991},vo={};vo["[object Float32Array]"]=vo["[object Float64Array]"]=vo["[object Int8Array]"]=vo["[object Int16Array]"]=vo["[object Int32Array]"]=vo["[object Uint8Array]"]=vo["[object Uint8ClampedArray]"]=vo["[object Uint16Array]"]=vo["[object Uint32Array]"]=!0,vo["[object Arguments]"]=vo["[object Array]"]=vo["[object ArrayBuffer]"]=vo["[object Boolean]"]=vo["[object DataView]"]=vo["[object Date]"]=vo["[object Error]"]=vo["[object Function]"]=vo["[object Map]"]=vo["[object Number]"]=vo["[object Object]"]=vo["[object RegExp]"]=vo["[object Set]"]=vo["[object String]"]=vo["[object WeakMap]"]=!1;var Ua=function(c){return Mo(c)&&El(c.length)&&!!vo[vn(c)]},Bl=function(c){return function(u){return c(u)}},ha=r(49),wu=ha.a&&ha.a.isTypedArray,Ks=wu?Bl(wu):Ua,$l=Object.prototype.hasOwnProperty,ui=function(c,u){var d=qo(c),p=!d&&ns(c),y=!d&&!p&&Object($a.a)(c),m=!d&&!p&&!y&&Ks(c),_=d||p||y||m,A=_?rf(c.length,String):[],N=A.length;for(var U in c)!u&&!$l.call(c,U)||_&&(U=="length"||y&&(U=="offset"||U=="parent")||m&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Ja(U,N))||A.push(U);return A},lc=Object.prototype,rs=function(c){var u=c&&c.constructor;return c===(typeof u=="function"&&u.prototype||lc)},xl=function(c,u){return function(d){return c(u(d))}},af=xl(Object.keys,Object),Vh=Object.prototype.hasOwnProperty,lf=function(c){if(!rs(c))return af(c);var u=[];for(var d in Object(c))Vh.call(c,d)&&d!="constructor"&&u.push(d);return u},Wi=function(c){return c!=null&&El(c.length)&&!wo(c)},sc=function(c){return Wi(c)?ui(c):lf(c)},os=function(c){return Uh(c,sc,Za)},Ki=Object.prototype.hasOwnProperty,sf=function(c,u,d,p,y,m){var _=1&d,A=os(c),N=A.length;if(N!=os(u).length&&!_)return!1;for(var U=N;U--;){var H=A[U];if(!(_?H in u:Ki.call(u,H)))return!1}var oe=m.get(c),ue=m.get(u);if(oe&&ue)return oe==u&&ue==c;var Ce=!0;m.set(c,u),m.set(u,c);for(var Ve=_;++U<N;){var qe=c[H=A[U]],Ot=u[H];if(p)var xt=_?p(Ot,qe,H,u,c,m):p(qe,Ot,H,c,u,m);if(!(xt===void 0?qe===Ot||y(qe,Ot,d,p,m):xt)){Ce=!1;break}Ve||(Ve=H=="constructor")}if(Ce&&!Ve){var Ft=c.constructor,hn=u.constructor;Ft==hn||!("constructor"in c)||!("constructor"in u)||typeof Ft=="function"&&Ft instanceof Ft&&typeof hn=="function"&&hn instanceof hn||(Ce=!1)}return m.delete(c),m.delete(u),Ce},ll=pa(En.a,"DataView"),Ol=pa(En.a,"Promise"),sd=pa(En.a,"Set"),Va=pa(En.a,"WeakMap"),Qa="[object Map]",ia="[object Promise]",sl="[object Set]",ka="[object WeakMap]",Ct="[object DataView]",un=fa(ll),dn=fa(qi),Gn=fa(Ol),Wr=fa(sd),mo=fa(Va),ci=vn;(ll&&ci(new ll(new ArrayBuffer(1)))!=Ct||qi&&ci(new qi)!=Qa||Ol&&ci(Ol.resolve())!=ia||sd&&ci(new sd)!=sl||Va&&ci(new Va)!=ka)&&(ci=function(c){var u=vn(c),d=u=="[object Object]"?c.constructor:void 0,p=d?fa(d):"";if(p)switch(p){case un:return Ct;case dn:return Qa;case Gn:return ia;case Wr:return sl;case mo:return ka}return u});var R=ci,L="[object Arguments]",Z="[object Array]",fe="[object Object]",Re=Object.prototype.hasOwnProperty,lt=function(c,u,d,p,y,m){var _=qo(c),A=qo(u),N=_?Z:R(c),U=A?Z:R(u),H=(N=N==L?fe:N)==fe,oe=(U=U==L?fe:U)==fe,ue=N==U;if(ue&&Object($a.a)(c)){if(!Object($a.a)(u))return!1;_=!0,H=!1}if(ue&&!H)return m||(m=new lr),_||Ks(c)?Fl(c,u,d,p,y,m):ra(c,u,N,d,p,y,m);if(!(1&d)){var Ce=H&&Re.call(c,"__wrapped__"),Ve=oe&&Re.call(u,"__wrapped__");if(Ce||Ve){var qe=Ce?c.value():c,Ot=Ve?u.value():u;return m||(m=new lr),y(qe,Ot,d,p,m)}}return!!ue&&(m||(m=new lr),sf(c,u,d,p,y,m))},It=function c(u,d,p,y,m){return u===d||(u==null||d==null||!Mo(u)&&!Mo(d)?u!=u&&d!=d:lt(u,d,p,y,c,m))},bn=function(c,u,d,p){var y=d.length,m=y;if(c==null)return!m;for(c=Object(c);y--;){var _=d[y];if(_[2]?_[1]!==c[_[0]]:!(_[0]in c))return!1}for(;++y<m;){var A=(_=d[y])[0],N=c[A],U=_[1];if(_[2]){if(N===void 0&&!(A in c))return!1}else{var H=new lr,oe;if(!(oe===void 0?It(U,N,3,p,H):oe))return!1}}return!0},Jn=function(c){return c==c&&!In(c)},no=function(c){for(var u=sc(c),d=u.length;d--;){var p=u[d],y=c[p];u[d]=[p,y,Jn(y)]}return u},$n=function(c,u){return function(d){return d!=null&&d[c]===u&&(u!==void 0||c in Object(d))}},Do=function(c){var u=no(c);return u.length==1&&u[0][2]?$n(u[0][0],u[0][1]):function(d){return d===c||bn(d,c,u)}},Kr=function(c){return typeof c=="symbol"||Mo(c)&&vn(c)=="[object Symbol]"},So=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ul=/^\w*$/,wi=function(c,u){if(qo(c))return!1;var d=typeof c;return!(d!="number"&&d!="symbol"&&d!="boolean"&&c!=null&&!Kr(c))||ul.test(c)||!So.test(c)||u!=null&&c in Object(u)};function el(c,u){if(typeof c!="function"||u!=null&&typeof u!="function")throw new TypeError("Expected a function");var d=function(){var p=arguments,y=u?u.apply(this,p):p[0],m=d.cache;if(m.has(y))return m.get(y);var _=c.apply(this,p);return d.cache=m.set(y,_)||m,_};return d.cache=new(el.Cache||nr),d}el.Cache=nr;var ks=el,Ps=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zs=/\\(\\)?/g,Eu=(function(c){var u=ks(c,(function(p){return d.size===500&&d.clear(),p})),d=u.cache;return u})((function(c){var u=[];return c.charCodeAt(0)===46&&u.push(""),c.replace(Ps,(function(d,p,y,m){u.push(y?m.replace(Zs,"$1"):p||d)})),u})),is=Zn?Zn.prototype:void 0,xu=is?is.toString:void 0,Zi=function c(u){if(typeof u=="string")return u;if(qo(u))return je(u,c)+"";if(Kr(u))return xu?xu.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d},Js=function(c){return c==null?"":Zi(c)},Rs=function(c,u){return qo(c)?c:wi(c,u)?[c]:Eu(Js(c))},as=function(c){if(typeof c=="string"||Kr(c))return c;var u=c+"";return u=="0"&&1/c==-1/0?"-0":u},ls=function(c,u){for(var d=0,p=(u=Rs(u,c)).length;c!=null&&d<p;)c=c[as(u[d++])];return d&&d==p?c:void 0},uc=function(c,u,d){var p=c==null?void 0:ls(c,u);return p===void 0?d:p},fm=function(c,u){return c!=null&&u in Object(c)},pm=function(c,u,d){for(var p=-1,y=(u=Rs(u,c)).length,m=!1;++p<y;){var _=as(u[p]);if(!(m=c!=null&&d(c,_)))break;c=c[_]}return m||++p!=y?m:!!(y=c==null?0:c.length)&&El(y)&&Ja(_,y)&&(qo(c)||ns(c))},Wh=function(c,u){return c!=null&&pm(c,u,fm)},uf=function(c,u){return wi(c)&&Jn(u)?$n(as(c),u):function(d){var p=uc(d,c);return p===void 0&&p===u?Wh(d,c):It(u,p,3)}},cc=function(c){return c},bp=function(c){return function(u){return u==null?void 0:u[c]}},hm=function(c){return function(u){return ls(u,c)}},dc=function(c){return wi(c)?bp(as(c)):hm(c)},cf=function(c){return typeof c=="function"?c:c==null?cc:typeof c=="object"?qo(c)?uf(c[0],c[1]):Do(c):dc(c)},wp=(function(c){return function(u,d,p){for(var y=-1,m=Object(u),_=p(u),A=_.length;A--;){var N=_[++y];if(d(m[N],N,m)===!1)break}return u}})(),ji=(function(c,u){return function(d,p){if(d==null)return d;if(!Wi(d))return c(d,p);for(var y=d.length,m=-1,_=Object(d);++m<y&&p(_[m],m,_)!==!1;);return d}})((function(c,u){return c&&wp(c,u,sc)})),Wa=function(c,u){var d=-1,p=Wi(c)?Array(c.length):[];return ji(c,(function(y,m,_){p[++d]=u(y,m,_)})),p},Ep=function(c,u){return(qo(c)?je:Wa)(c,cf(u))};Object(a.n)({isolateGlobalState:!0});var xp=(function(){try{var c=pa(Object,"defineProperty");return c({},"",{}),c}catch{}})(),ud=function(c,u,d){u=="__proto__"&&xp?xp(c,u,{configurable:!0,enumerable:!0,value:d,writable:!0}):c[u]=d},dy=Object.prototype.hasOwnProperty,cd=function(c,u,d){var p=c[u];dy.call(c,u)&&q(p,d)&&(d!==void 0||u in c)||ud(c,u,d)},dd=function(c,u,d,p){var y=!d;d||(d={});for(var m=-1,_=u.length;++m<_;){var A=u[m],N=void 0;N===void 0&&(N=c[A]),y?ud(d,A,N):cd(d,A,N)}return d},df=function(c,u,d){switch(d.length){case 0:return c.call(u);case 1:return c.call(u,d[0]);case 2:return c.call(u,d[0],d[1]);case 3:return c.call(u,d[0],d[1],d[2])}return c.apply(u,d)},fc=Math.max,Ou=function(c,u,d){return u=fc(u===void 0?c.length-1:u,0),function(){for(var p=arguments,y=-1,m=fc(p.length-u,0),_=Array(m);++y<m;)_[y]=p[u+y];y=-1;for(var A=Array(u+1);++y<u;)A[y]=p[y];return A[u]=d(_),df(c,this,A)}},fd=function(c){return function(){return c}},ff=xp?function(c,u){return xp(c,"toString",{configurable:!0,enumerable:!1,value:fd(u),writable:!0})}:cc,Su=Date.now,fy=function(c){var u=0,d=0;return function(){var p=Su(),y=16-(p-d);if(d=p,y>0){if(++u>=800)return arguments[0]}else u=0;return c.apply(void 0,arguments)}},pf=fy(ff),py=function(c,u){return pf(Ou(c,u,cc),c+"")},hy=function(c,u,d){if(!In(d))return!1;var p=typeof u;return!!(p=="number"?Wi(d)&&Ja(u,d.length):p=="string"&&u in d)&&q(d[u],c)},vm=function(c){return py((function(u,d){var p=-1,y=d.length,m=y>1?d[y-1]:void 0,_=y>2?d[2]:void 0;for(m=c.length>3&&typeof m=="function"?(y--,m):void 0,_&&hy(d[0],d[1],_)&&(m=y<3?void 0:m,y=1),u=Object(u);++p<y;){var A=d[p];A&&c(u,A,p,m)}return u}))},Op=Object.prototype.hasOwnProperty,Pa=vm((function(c,u){if(rs(u)||Wi(u))dd(u,sc(u),c);else for(var d in u)Op.call(u,d)&&cd(c,d,u[d])})),mm=function(c,u,d,p){if(!In(c))return c;for(var y=-1,m=(u=Rs(u,c)).length,_=m-1,A=c;A!=null&&++y<m;){var N=as(u[y]),U=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return c;if(y!=_){var H=A[N];(U=void 0)==void 0&&(U=In(H)?H:Ja(u[y+1])?[]:{})}cd(A,N,U),A=A[N]}return c},he=function(c,u,d){for(var p=-1,y=u.length,m={};++p<y;){var _=u[p],A=ls(c,_);d(A,_)&&mm(m,Rs(_,c),A)}return m},pc=function(c,u){return he(c,u,(function(d,p){return Wh(c,p)}))},Qs=Zn?Zn.isConcatSpreadable:void 0,Ul=function(c){return qo(c)||ns(c)||!!(Qs&&c&&c[Qs])},go=function(u,d,p,y,m){var _=-1,A=u.length;for(p||(p=Ul),m||(m=[]);++_<A;){var N=u[_];p(N)?wl(m,N):m[m.length]=N}return m},ba=function(c){return c!=null&&c.length?go(c):[]},To,ss,eu,Sl,Sp,Ap,Gh,gm,tu,Li,pd,zh,nu,us,hf,Au,Al,Hh,Xh,cs=(function(c){return pf(Ou(c,void 0,ba),c+"")})((function(c,u){return c==null?{}:pc(c,u)}));function mi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function ym(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Yh(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ii(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Io,Ji,lo,ei,ur,ti,vf={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotation:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Ds=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotation","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],Mp=(ss=Ii((To=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),mi(this,"isSilentMode",ss,this),mi(this,"stopZoomGraph",eu,this),mi(this,"stopScrollGraph",Sl,this),mi(this,"stopMoveGraph",Sp,this),mi(this,"adjustEdge",Ap,this),mi(this,"adjustEdgeMiddle",Gh,this),mi(this,"adjustEdgeStartAndEnd",gm,this),mi(this,"adjustNodePosition",tu,this),mi(this,"hideAnchors",Li,this),mi(this,"allowRotation",pd,this),mi(this,"hoverOutline",zh,this),mi(this,"nodeSelectedOutline",nu,this),mi(this,"edgeSelectedOutline",us,this),mi(this,"nodeTextEdit",hf,this),mi(this,"edgeTextEdit",Au,this),mi(this,"nodeTextDraggable",Al,this),mi(this,"edgeTextDraggable",Hh,this),mi(this,"autoExpand",Xh,this),Yh(this,"multipleSelectKey",""),Yh(this,"defaultConfig",{}),Pa(this,this.getConfigDetail(p))}var u,d;return u=c,(d=[{key:"updateEditConfig",value:function(p){var y=this.getConfigDetail(p);Pa(this,y)}},{key:"getConfigDetail",value:function(p){var y=p.isSilentMode,m=p.textEdit,_={};if(y===!1&&Pa(_,this.defaultConfig),y===!0&&y!==this.isSilentMode){var A=cs(vf,Ds);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotation:this.allowRotation,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},Pa(_,A)}m===!1&&Pa(_,{nodeTextEdit:!1,edgeTextEdit:!1});var N=cs(p,Ds);return Pa(_,N)}},{key:"getConfig",value:function(){return cs(this,Ds)}}])&&ym(u.prototype,d),c})()).prototype,"isSilentMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),eu=Ii(To.prototype,"stopZoomGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sl=Ii(To.prototype,"stopScrollGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sp=Ii(To.prototype,"stopMoveGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ap=Ii(To.prototype,"adjustEdge",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Gh=Ii(To.prototype,"adjustEdgeMiddle",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),gm=Ii(To.prototype,"adjustEdgeStartAndEnd",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),tu=Ii(To.prototype,"adjustNodePosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Li=Ii(To.prototype,"hideAnchors",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pd=Ii(To.prototype,"allowRotation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zh=Ii(To.prototype,"hoverOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),nu=Ii(To.prototype,"nodeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),us=Ii(To.prototype,"edgeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),hf=Ii(To.prototype,"nodeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Au=Ii(To.prototype,"edgeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Al=Ii(To.prototype,"nodeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Hh=Ii(To.prototype,"edgeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xh=Ii(To.prototype,"autoExpand",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ii(To.prototype,"updateEditConfig",[a.k],Object.getOwnPropertyDescriptor(To.prototype,"updateEditConfig"),To.prototype),To);r(65),r(66),(function(c){c[c.DEFAULT=1]="DEFAULT",c[c.TEXT_EDIT=2]="TEXT_EDIT",c[c.SHOW_MENU=3]="SHOW_MENU",c[c.ALLOW_CONNECT=4]="ALLOW_CONNECT",c[c.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Io||(Io={})),(function(c){c.KEY="logic-flow",c.NODE_NAME="lf-node",c.EDGE_NAME="lf-edge"})(Ji||(Ji={})),(function(c){c.NODE="node",c.CIRCLE_NODE="circle-node",c.POLYGON_NODE="polygon-node",c.RECT_NODE="rect-node",c.TEXT_NODE="text-node",c.ELLIPSE_NODE="ellipse-node",c.DIAMOND_NODE="diamond-node",c.HTML_NODE="html-node",c.EDGE="edge",c.LINE_EDGE="line-edge",c.POLYLINE_EDGE="polyline-edge",c.BEZIER_EDGE="bezier-edge",c.GRAPH="graph"})(lo||(lo={})),(function(c){c.NODE="node",c.EDGE="edge",c.GRAPH="graph"})(ei||(ei={})),(function(c){c.ELEMENT_CLICK="element:click",c.NODE_CLICK="node:click",c.NODE_DBCLICK="node:dbclick",c.NODE_DELETE="node:delete",c.NODE_ADD="node:add",c.NODE_GROUP_COPY="node:group-copy-add",c.NODE_DND_ADD="node:dnd-add",c.NODE_DND_DRAG="node:dnd-drag",c.NODE_MOUSEDOWN="node:mousedown",c.NODE_DRAGSTART="node:dragstart",c.NODE_DRAG="node:drag",c.NODE_DROP="node:drop",c.NODE_MOUSEUP="node:mouseup",c.NODE_MOUSEMOVE="node:mousemove",c.NODE_MOUSEENTER="node:mouseenter",c.NODE_MOUSELEAVE="node:mouseleave",c.NODE_CONTEXTMENU="node:contextmenu",c.NODE_ROTATE="node:rotate",c.EDGE_DELETE="edge:delete",c.EDGE_ADD="edge:add",c.EDGE_CLICK="edge:click",c.EDGE_DBCLICK="edge:dbclick",c.EDGE_MOUSEENTER="edge:mouseenter",c.EDGE_MOUSELEAVE="edge:mouseleave",c.EDGE_CONTEXTMENU="edge:contextmenu",c.EDGE_ADJUST="edge:adjust",c.EDGE_EXCHANGE_NODE="edge:exchange-node",c.ANCHOR_DRAGSTART="anchor:dragstart",c.ANCHOR_DRAG="anchor:drag",c.ANCHOR_DROP="anchor:drop",c.ANCHOR_DRAGEND="anchor:dragend",c.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",c.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",c.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",c.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",c.ADJUST_POINT_DRAG="adjustPoint:drag",c.ADJUST_POINT_DROP="adjustPoint:drop",c.ADJUST_POINT_DRAGEND="adjustPoint:dragend",c.BLANK_MOUSEDOWN="blank:mousedown",c.BLANK_DRAGSTART="blank:dragstart",c.BLANK_DRAG="blank:drag",c.BLANK_DROP="blank:drop",c.BLANK_MOUSEMOVE="blank:mousemove",c.BLANK_MOUSEUP="blank:mouseup",c.BLANK_CLICK="blank:click",c.BLANK_CONTEXTMENU="blank:contextmenu",c.SELECTION_MOUSEDOWN="selection:mousedown",c.SELECTION_DRAGSTART="selection:dragstart",c.SELECTION_DRAG="selection:drag",c.SELECTION_DROP="selection:drop",c.SELECTION_MOUSEMOVE="selection:mousemove",c.SELECTION_MOUSEUP="selection:mouseup",c.SELECTION_CONTEXTMENU="selection:contextmenu",c.CONNECTION_NOT_ALLOWED="connection:not-allowed",c.HISTORY_CHANGE="history:change",c.TEXT_UPDATE="text:update",c.GRAPH_TRANSFORM="graph:transform",c.GRAPH_RENDERED="graph:rendered"})(ur||(ur={})),(function(c){c.HORIZONTAL="horizontal",c.VERTICAL="vertical"})(ti||(ti={}));var Ei,Mi,qh,Kh,mf,Ga,Tp,hd,Vl;function Mu(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ru(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ru(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ru(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Wl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function _m(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function js(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ml(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}(function(c){c[c.DEFAULT=0]="DEFAULT",c[c.INCREASE=1]="INCREASE"})(Ei||(Ei={}));var Zh={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Jh=(Mi=(function(){function c(p,y){(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,c),js(this,"MINI_SCALE_SIZE",.2),js(this,"MAX_SCALE_SIZE",16),Wl(this,"SCALE_X",qh,this),Wl(this,"SKEW_Y",Kh,this),Wl(this,"SKEW_X",mf,this),Wl(this,"SCALE_Y",Ga,this),Wl(this,"TRANSLATE_X",Tp,this),Wl(this,"TRANSLATE_Y",hd,this),Wl(this,"ZOOM_SIZE",Vl,this),js(this,"eventCenter",void 0),js(this,"translateLimitMinX",void 0),js(this,"translateLimitMinY",void 0),js(this,"translateLimitMaxX",void 0),js(this,"translateLimitMaxY",void 0),this.eventCenter=p;var m=y.stopMoveGraph,_=m!==void 0&&m;this.updateTranslateLimits(_)}var u,d;return u=c,d=[{key:"setZoomMiniSize",value:function(p){this.MINI_SCALE_SIZE=p}},{key:"setZoomMaxSize",value:function(p){this.MAX_SCALE_SIZE=p}},{key:"HtmlPointToCanvasPoint",value:function(p){var y=Mu(p,2),m=y[0],_=y[1];return[(m-this.TRANSLATE_X)/this.SCALE_X,(_-this.TRANSLATE_Y)/this.SCALE_Y]}},{key:"CanvasPointToHtmlPoint",value:function(p){var y=Mu(p,2),m=y[0],_=y[1];return[m*this.SCALE_X+this.TRANSLATE_X,_*this.SCALE_Y+this.TRANSLATE_Y]}},{key:"moveCanvasPointByHtml",value:function(p,y,m){var _=Mu(p,2),A=_[0],N=_[1];return[A+y/this.SCALE_X,N+m/this.SCALE_Y]}},{key:"fixDeltaXY",value:function(p,y){return[p/this.SCALE_X,y/this.SCALE_Y]}},{key:"getTransformStyle",value:function(){var p=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(p,")")}}},{key:"zoom",value:function(){var p=arguments.length>0&&arguments[0]!==void 0&&arguments[0],y=arguments.length>1?arguments[1]:void 0,m=this.SCALE_X,_=this.SCALE_Y;return p===!0?(m+=this.ZOOM_SIZE,_+=this.ZOOM_SIZE):p===!1?(m-=this.ZOOM_SIZE,_-=this.ZOOM_SIZE):typeof p=="number"&&(m=p,_=p),m<this.MINI_SCALE_SIZE||m>this.MAX_SCALE_SIZE||(y&&(this.TRANSLATE_X-=(m-this.SCALE_X)*y[0],this.TRANSLATE_Y-=(_-this.SCALE_Y)*y[1]),this.SCALE_X=m,this.SCALE_Y=_,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")}},{key:"emitGraphTransform",value:function(p){this.eventCenter.emit(ur.GRAPH_TRANSFORM,{type:p,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})}},{key:"resetZoom",value:function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")}},{key:"translate",value:function(p,y){this.TRANSLATE_X+p<=this.translateLimitMaxX&&this.TRANSLATE_X+p>=this.translateLimitMinX&&(this.TRANSLATE_X+=p),this.TRANSLATE_Y+y<=this.translateLimitMaxY&&this.TRANSLATE_Y+y>=this.translateLimitMinY&&(this.TRANSLATE_Y+=y),this.emitGraphTransform("translate")}},{key:"focusOn",value:function(p,y,m,_){var A=Mu(this.CanvasPointToHtmlPoint([p,y]),2),N=m/2-A[0],U=_/2-A[1];this.TRANSLATE_X+=N,this.TRANSLATE_Y+=U,this.emitGraphTransform("focusOn")}},{key:"updateTranslateLimits",value:function(p){var y=Mu(Array.isArray(p)&&p.length===4?p:Zh[p.toString()],4);this.translateLimitMinX=y[0],this.translateLimitMinY=y[1],this.translateLimitMaxX=y[2],this.translateLimitMaxY=y[3]}}],d&&_m(u.prototype,d),c})(),qh=Ml(Mi.prototype,"SCALE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Kh=Ml(Mi.prototype,"SKEW_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),mf=Ml(Mi.prototype,"SKEW_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ga=Ml(Mi.prototype,"SCALE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Tp=Ml(Mi.prototype,"TRANSLATE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),hd=Ml(Mi.prototype,"TRANSLATE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Vl=Ml(Mi.prototype,"ZOOM_SIZE",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),Ml(Mi.prototype,"zoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"zoom"),Mi.prototype),Ml(Mi.prototype,"resetZoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"resetZoom"),Mi.prototype),Ml(Mi.prototype,"translate",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"translate"),Mi.prototype),Ml(Mi.prototype,"focusOn",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"focusOn"),Mi.prototype),Mi),Cp=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p&&u(c[d],d,c)!==!1;);return c},bm=function(c){var u=[];if(c!=null)for(var d in Object(c))u.push(d);return u},wm=Object.prototype.hasOwnProperty,Em=function(c){if(!In(c))return bm(c);var u=rs(c),d=[];for(var p in c)(p!="constructor"||!u&&wm.call(c,p))&&d.push(p);return d},Np=function(c){return Wi(c)?ui(c,!0):Em(c)},Qh=r(107),ev=function(c,u){var d=-1,p=c.length;for(u||(u=Array(p));++d<p;)u[d]=c[d];return u},gf=xl(Object.getPrototypeOf,Object),uo=Object.prototype.hasOwnProperty,vy=function(c){var u=c.length,d=new c.constructor(u);return u&&typeof c[0]=="string"&&uo.call(c,"index")&&(d.index=c.index,d.input=c.input),d},tv=function(c){var u=new c.constructor(c.byteLength);return new Ro(u).set(new Ro(c)),u},hc=function(c,u){var d=tv(c.buffer);return new c.constructor(d,c.byteOffset,c.byteLength)},yf=/\w*$/,my=function(c){var u=new c.constructor(c.source,yf.exec(c));return u.lastIndex=c.lastIndex,u},xm=Zn?Zn.prototype:void 0,Tl=xm?xm.valueOf:void 0,gy=function(c){return Tl?Object(Tl.call(c)):{}},_f=function(c,u){var d=u?tv(c.buffer):c.buffer;return new c.constructor(d,c.byteOffset,c.length)},kp=function(c,u,d){var p=c.constructor;switch(u){case"[object ArrayBuffer]":return tv(c);case"[object Boolean]":case"[object Date]":return new p(+c);case"[object DataView]":return hc(c);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _f(c,d);case"[object Map]":case"[object Set]":return new p;case"[object Number]":case"[object String]":return new p(c);case"[object RegExp]":return my(c);case"[object Symbol]":return gy(c)}},nv=Object.create,Om=(function(){function c(){}return function(u){if(!In(u))return{};if(nv)return nv(u);c.prototype=u;var d=new c;return c.prototype=void 0,d}})(),cl=function(c){return typeof c.constructor!="function"||rs(c)?{}:Om(gf(c))},Tu=function(c){return Mo(c)&&R(c)=="[object Map]"},Pp=ha.a&&ha.a.isMap,vc=Pp?Bl(Pp):Tu,Rp=function(c){return Mo(c)&&R(c)=="[object Set]"},rv=ha.a&&ha.a.isSet,Dp=rv?Bl(rv):Rp,bf="[object Arguments]",jp="[object Function]",Lp="[object Object]",jo={};jo[bf]=jo["[object Array]"]=jo["[object ArrayBuffer]"]=jo["[object DataView]"]=jo["[object Boolean]"]=jo["[object Date]"]=jo["[object Float32Array]"]=jo["[object Float64Array]"]=jo["[object Int8Array]"]=jo["[object Int16Array]"]=jo["[object Int32Array]"]=jo["[object Map]"]=jo["[object Number]"]=jo["[object Object]"]=jo["[object RegExp]"]=jo["[object Set]"]=jo["[object String]"]=jo["[object Symbol]"]=jo["[object Uint8Array]"]=jo["[object Uint8ClampedArray]"]=jo["[object Uint16Array]"]=jo["[object Uint32Array]"]=!0,jo["[object Error]"]=jo[jp]=jo["[object WeakMap]"]=!1;var yy=function c(u,d,p,y,m,_){var A,N=1&d;if(A!==void 0)return A;if(!In(u))return u;var U=qo(u);if(U)A=vy(u);else{var H=R(u),oe=H==jp||H=="[object GeneratorFunction]";if(Object($a.a)(u))return Object(Qh.a)(u,N);if(H==Lp||H==bf||oe&&!m)A=oe?{}:cl(u);else{if(!jo[H])return m?u:{};A=kp(u,H,N)}}_||(_=new lr);var ue=_.get(u);if(ue)return ue;_.set(u,A),Dp(u)?u.forEach((function(Ve){A.add(c(Ve,d,p,Ve,u,_))})):vc(u)&&u.forEach((function(Ve,qe){A.set(qe,c(Ve,d,p,qe,u,_))}));var Ce=U?void 0:os(u);return Cp(Ce||u,(function(Ve,qe){Ce&&(Ve=u[qe=Ve]),cd(A,qe,c(Ve,d,p,qe,u,_))})),A},Uo=function(c){return yy(c,5)},Ip=function(c,u,d){(d!==void 0&&!q(c[u],d)||d===void 0&&!(u in c))&&ud(c,u,d)},Sm=function(c){return Mo(c)&&Wi(c)},mc=Function.prototype,Am=Object.prototype,vd=mc.toString,Mm=Am.hasOwnProperty,gc=vd.call(Object),va=function(c){if(!Mo(c)||vn(c)!="[object Object]")return!1;var u=gf(c);if(u===null)return!0;var d=Mm.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&vd.call(d)==gc},ds=function(c,u){if((u!=="constructor"||typeof c[u]!="function")&&u!="__proto__")return c[u]},ou=function(c){return dd(c,Np(c))},yc=function(c,u,d,p,y,m,_){var A=ds(c,d),N=ds(u,d),U=_.get(N);if(U)Ip(c,d,U);else{var H=void 0,oe=H===void 0;if(oe){var ue=qo(N),Ce=!ue&&Object($a.a)(N),Ve=!ue&&!Ce&&Ks(N);H=N,ue||Ce||Ve?qo(A)?H=A:Sm(A)?H=ev(A):Ce?(oe=!1,H=Object(Qh.a)(N,!0)):Ve?(oe=!1,H=_f(N,!0)):H=[]:va(N)||ns(N)?(H=A,ns(A)?H=ou(A):In(A)&&!wo(A)||(H=cl(N))):oe=!1}oe&&(_.set(N,H),y(H,N,p,m,_),_.delete(N)),Ip(c,d,H)}},_c=function c(u,d,p,y,m){u!==d&&wp(d,(function(_,A){if(m||(m=new lr),In(_))yc(u,d,A,p,c,y,m);else{var N=void 0;N===void 0&&(N=_),Ip(u,A,N)}}),Np)},bc=vm((function(c,u,d){_c(c,u,d)})),Fp={baseNode:{fill:"#FFFFFF",stroke:"#000000",strokeWidth:2},baseEdge:{stroke:"#000000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000000",fill:"#FFFFFF",r:4,hover:{fill:"#949494",fillOpacity:.5,stroke:"#949494",r:10}},nodeText:{color:"#000000",overflowMode:"default",lineHeight:1.2,fontSize:12},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#FFFFFF"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",stroke:"#949494",fillOpacity:1}},arrow:{offset:10,verticalLength:5},anchorLine:{stroke:"#000000",strokeWidth:2,strokeDasharray:"3,2"},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#FFFFFF",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10 10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5}},iu=function(c){var u=Uo(Fp);return c&&(u=bc(u,c)),u};r(82),r(166);function wc(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}var Bp=(function(){function c(){var p,y,m;(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),m={},(y="_events")in(p=this)?Object.defineProperty(p,y,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[y]=m}var u,d;return u=c,(d=[{key:"on",value:function(p,y,m){var _=this;return p==null||p.split(",").forEach((function(A){A=A.trim(),_._events[A]||(_._events[A]=[]),_._events[A].push({callback:y,once:!!m})})),this}},{key:"once",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){return _=_.trim(),m.on(_,y,!0)}))}},{key:"emit",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){var A=m._events[_]||[],N=m._events["*"]||[],U=function(H){for(var oe=H.length,ue=0;ue<oe;ue++)if(H[ue]){var Ce=H[ue],Ve=Ce.callback;Ce.once&&(H.splice(ue,1),H.length===0&&delete m._events[_],oe--,ue--),Ve.apply(m,[y])}};U(A),U(N)}))}},{key:"off",value:function(p,y){var m=this;return p||(this._events={}),p.split(",").forEach((function(_){if(y){for(var A=m._events[_]||[],N=A.length,U=0;U<N;U++)A[U].callback===y&&(A.splice(U,1),N--,U--);A.length===0&&delete m._events[_]}else delete m._events[_]})),this}},{key:"getEvents",value:function(){return this._events}}])&&wc(u.prototype,d),c})();function fs(c,u){return u*Math.round(c/u)||c}function wf(c,u){return c%u}function Ef(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return md(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return md(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function md(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var gd=function(c,u,d){var p=Ef(c,2),y=p[0],m=p[1],_=Ef(u,2),A=_[0],N=_[1],U=Ef(d,2),H=U[0],oe=U[1];return y>A&&y<H&&m>N&&m<oe},yd=function(c,u){var d=!1;switch(u.multipleSelectKey){case"meta":d=c.metaKey;break;case"alt":d=c.altKey;break;case"shift":d=c.shiftKey;break;case"ctrl":d=c.ctrlKey;break;default:d=!1}return d};r(167),r(126),r(83),r(29),r(12),r(13),r(14),r(47);var $p=function(c){return function(u,d,p){var y=Object(u);if(!Wi(u)){var m=cf(d);u=sc(u),d=function(A){return m(y[A],A,y)}}var _=c(u,d,p);return _>-1?y[m?u[_]:_]:void 0}},_d=function(c,u,d,p){for(var y=c.length,m=d+-1;++m<y;)if(u(c[m],m,c))return m;return-1},ov=/\s/,Up=function(c){for(var u=c.length;u--&&ov.test(c.charAt(u)););return u},Tm=/^\s+/,iv=function(c){return c&&c.slice(0,Up(c)+1).replace(Tm,"")},ps=/^[-+]0x[0-9a-f]+$/i,av=/^0b[01]+$/i,lv=/^0o[0-7]+$/i,sv=parseInt,bd=function(c){if(typeof c=="number")return c;if(Kr(c))return NaN;if(In(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=In(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=iv(c);var d=av.test(c);return d||lv.test(c)?sv(c.slice(2),d?2:8):ps.test(c)?NaN:+c},Ls=1/0,xf=function(c){return c?(c=bd(c))===Ls||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0},Vp=function(c){var u=xf(c),d=u%1;return u==u?d?u-d:u:0},Wp=Math.max,Cu,Nu=$p((function(c,u,d){var p=c==null?0:c.length;if(!p)return-1;var y=d==null?0:Vp(d);return y<0&&(y=Wp(p+y,0)),_d(c,cf(u),y)})),Rr=new Uint8Array(16);function wd(){if(!Cu&&!(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(Rr)}for(var Of=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,hs=function(c){return typeof c=="string"&&Of.test(c)},aa=[],Ec=0;Ec<256;++Ec)aa.push((Ec+256).toString(16).substr(1));var Ti=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=(aa[c[u+0]]+aa[c[u+1]]+aa[c[u+2]]+aa[c[u+3]]+"-"+aa[c[u+4]]+aa[c[u+5]]+"-"+aa[c[u+6]]+aa[c[u+7]]+"-"+aa[c[u+8]]+aa[c[u+9]]+"-"+aa[c[u+10]]+aa[c[u+11]]+aa[c[u+12]]+aa[c[u+13]]+aa[c[u+14]]+aa[c[u+15]]).toLowerCase();if(!hs(d))throw TypeError("Stringified UUID is invalid");return d},ku=function(c,u,d){var p=(c=c||{}).random||(c.rng||wd)();return p[6]=15&p[6]|64,p[8]=63&p[8]|128,Ti(p)},tl=function(){return ku()},Sf=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",d=c.nodes.reduce((function(p,y){return p[y.id]=u+ku(),y.id=p[y.id],p}),{});return c.edges.forEach((function(p){p.id=u+ku(),p.sourceNodeId=d[p.sourceNodeId],p.targetNodeId=d[p.targetNodeId]})),c},Ra=(r(105),r(127),r(207),function(c,u,d){var p=c.x,y=c.y,m=u.x,_=u.y,A=d.x,N=d.y,U=(N-_)/(A-m),H=_-U*m;return p>=m&&p<=A&&y>=_&&y<=N&&Math.abs(y-U*p+H)<Number.EPSILON});function Fi(c){return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Fi(c)}function Is(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Fs(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?Is(Object(d),!0).forEach((function(p){Gp(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Is(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Gp(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Qt,xc,Af,Mf,Pu,Oc,zp,uv,Sc,Tf,Hp,cv,Bs,dv,vs,Ru,Xp,Cm,Nm,km,fv,Yp=function(c){return c.anchors},Cf=function(c,u){for(var d,p=u.nodes,y=p.length-1;y>=0;y--){var m=p[y];if(_y(c,m)){var _=m.getTargetAnchor(c);if(_){var A={node:m,anchorIndex:_.index,anchor:_.anchor};d&&!Pm(m,d.node,u)||(d=A)}}}return d},Pm=function(c,u,d){return c.zIndex>u.zIndex||d.nodesMap[c.id].index>d.nodesMap[u.id].index},ms=function(c,u,d,p){return Math.hypot(c-d,u-p)},Du=function(c,u){var d=!1,p=gi(u);return c.x>=p.minX-0&&c.x<=p.maxX+0&&c.y>=p.minY-0&&c.y<=p.maxY+0&&(d=!0),d},_y=function(c,u){var d=!1,p=gi(u);return c.x>=p.minX-5&&c.x<=p.maxX+5&&c.y>=p.minY-5&&c.y<=p.maxY+5&&(d=!0),d},gi=function(c){var u=c.x,d=c.y,p=c.width,y=c.height;return{minX:u-p/2,minY:d-y/2,maxX:u+p/2,maxY:d+y/2,x:u,y:d,width:p,height:y,centerX:u,centerY:d}},Nf=function(c,u,d){var p,y=(function(_){var A=_,N=A.x,U=A.y,H=A.width,oe=A.height,ue=A.radius;return[{x:N-H/2+ue,y:U-oe/2+ue,r:ue},{x:N+H/2-ue,y:U-oe/2+ue,r:ue},{x:N-H/2+ue,y:U+oe/2-ue,r:ue},{x:N+H/2-ue,y:U+oe/2-ue,r:ue}]})(d),m=Number.MAX_SAFE_INTEGER;return y.forEach((function(_){var A=ms(c.x,c.y,_.x,_.y);A<m&&(m=A,p=_)})),Ac(c,u,p)},Ac=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.r;if(u===ti.HORIZONTAL){var N=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)),U=m+Math.sqrt(A*A-(c.y-_)*(c.y-_));p={x:Math.abs(N-c.x)<Math.abs(U-c.x)?N:U,y:c.y}}else if(u===ti.VERTICAL){var H=_-Math.sqrt(A*A-(c.x-m)*(c.x-m)),oe=_+Math.sqrt(A*A-(c.x-m)*(c.x-m)),ue=Math.abs(H-c.y)<Math.abs(oe-c.y)?H:oe;p={x:c.x,y:ue}}return p},kf=function(c,u){var d=u,p=!1,y=d.x-d.width/2+d.radius,m=d.x+d.width/2-d.radius,_=d.y-d.height/2+d.radius,A=d.y+d.height/2-d.radius,N=d.x,U=d.y,H=d.width,oe=d.height;return c.y===U+oe/2||c.y===U-oe/2?p=c.x>y&&c.x<m:c.x!==N+H/2&&c.x!==N-H/2||(p=c.y>_&&c.y<A),p},Ed=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.rx,N=y.ry;if(u===ti.HORIZONTAL){var U=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N)),H=m+Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N));p={x:Math.abs(U-c.x)<Math.abs(H-c.x)?U:H,y:c.y}}else if(u===ti.VERTICAL){var oe=_-Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),ue=_+Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),Ce=Math.abs(oe-c.y)<Math.abs(ue-c.y)?oe:ue;p={x:c.x,y:Ce}}return p},Pf=function(c,u,d){for(var p,y=d.pointsPosition,m=Number.MAX_SAFE_INTEGER,_=[],A=0;A<y.length;A++)_.push({start:y[A],end:y[(A+1)%y.length]});return _.forEach((function(N){var U=N.start,H=N.end,oe=U,ue=H;U.x>H.x&&(oe=H,ue=U);var Ce={x:c.x,y:c.y};if(oe.x===ue.x&&u===ti.HORIZONTAL&&(Ce={x:oe.x,y:c.y}),oe.y===ue.y&&u===ti.VERTICAL&&(Ce={x:c.x,y:oe.y}),oe.x!==ue.x&&oe.y!==ue.y){var Ve=(ue.y-oe.y)/(ue.x-oe.x),qe=(oe.x*ue.y-ue.x*oe.y)/(oe.x-ue.x);u===ti.HORIZONTAL?Ce={x:(c.y-qe)/Ve,y:c.y}:u===ti.VERTICAL&&(Ce={x:c.x,y:Ve*c.x+qe})}if(Ra(Ce,U,H)){var Ot=ms(Ce.x,Ce.y,c.x,c.y);Ot<m&&(m=Ot,p=Ce)}})),p},Rf=function(c,u,d,p){var y=c.x,m=c.y;return u.x>c.x?y=c.x+d/2:u.x<c.x&&(y=c.x-d/2),u.y>c.y?m=c.y+p/2:u.y<c.y&&(m=c.y-p/2),{x:y,y:m}},Df=function(c){var u=c.rows,d=c.style,p=c.rowsLength,y=c.className,m=document.createElement("div");m.style.fontSize=d.fontSize,m.style.width=d.width,m.className=y,m.style.lineHeight=d.lineHeight,m.style.padding=d.padding,d.fontFamily&&(m.style.fontFamily=d.fontFamily),p>1?u.forEach((function(A){var N=document.createElement("div");N.textContent=A,m.appendChild(N)})):m.textContent=u,document.body.appendChild(m);var _=m.clientHeight;return document.body.removeChild(m),_},Mc=function(c){var u=c.rows,d=c.rowsLength,p=c.fontSize,y=0;return u&&u.forEach((function(m){var _=Pi(m);y=_>y?_:y})),{width:Math.ceil(y/2)*p+p/4,height:d*(p+2)+p/4}},au=function(c){return Fi(c)!=="object"?{isAllPass:!!c,msg:c?"":"不允许连接"}:c},ma=function(c){try{return JSON.parse(JSON.stringify(c))}catch{return c}},qp=1e3,jf=999,Tc=function(){return++qp};function xd(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function wa(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?xd(Object(d),!0).forEach((function(p){za(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xd(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function xi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function Lf(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function za(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wr(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Kp=(Qt=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),za(this,"id",""),xi(this,"type",xc,this),xi(this,"sourceNodeId",Af,this),xi(this,"targetNodeId",Mf,this),xi(this,"startPoint",Pu,this),xi(this,"endPoint",Oc,this),xi(this,"text",zp,this),xi(this,"properties",uv,this),xi(this,"points",Sc,this),xi(this,"pointsList",Tf,this),xi(this,"isSelected",Hp,this),xi(this,"isHovered",cv,this),xi(this,"isHitable",Bs,this),xi(this,"draggable",dv,this),xi(this,"visible",vs,this),za(this,"virtual",!1),xi(this,"isAnimation",Ru,this),xi(this,"isShowAdjustPoint",Xp,this),za(this,"graphModel",void 0),xi(this,"zIndex",Cm,this),za(this,"BaseType",ei.EDGE),za(this,"modelType",lo.EDGE),xi(this,"state",Nm,this),za(this,"additionStateData",void 0),za(this,"sourceAnchorId",""),za(this,"targetAnchorId",""),za(this,"menu",void 0),za(this,"customTextPosition",!1),xi(this,"style",km,this),xi(this,"arrowConfig",fv,this),this.graphModel=y,this.initEdgeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"initEdgeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,m=y&&y(p.type),_=this.createId();p.id=_||m||tl()}this.arrowConfig.markerEnd="url(#marker-end-".concat(p.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(p.id,")");var A=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=A,Pa(this,cr(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc()),this.setAnchors(),this.initPoints(),this.formatText(p)}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"getEdgeStyle",value:function(){return wa(wa({},this.graphModel.theme.baseEdge),this.style)}},{key:"getAdjustPointStyle",value:function(){return wa({},this.graphModel.theme.edgeAdjust)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.edgeText;return Uo(p)}},{key:"getEdgeAnimationStyle",value:function(){var p=this.graphModel.theme.edgeAnimation;return Uo(p)}},{key:"getArrowStyle",value:function(){var p=this.getEdgeStyle(),y=this.getEdgeAnimationStyle(),m=this.graphModel.theme.arrow,_=this.isAnimation?y.stroke:p.stroke;return wa(wa({},p),{},{fill:_,stroke:_},m)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"getTextPosition",value:function(){return{x:0,y:0}}},{key:"sourceNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.sourceNodeId])===null||y===void 0?void 0:y.model}},{key:"targetNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.targetNodeId])===null||y===void 0?void 0:y.model}},{key:"textPosition",get:function(){return this.getTextPosition()}},{key:"getBeginAnchor",value:function(p,y,m){var _,A,N=Yp(p);return m&&(_=Nu(N,(function(U){return U.id===m})))||N.forEach((function(U){var H=Xr(U,y);(A===void 0||H<A)&&(A=H,_=U)})),_}},{key:"getEndAnchor",value:function(p,y){var m,_,A=this,N=Yp(p);return y&&(m=Nu(N,(function(U){return U.id===y})))||N.forEach((function(U){var H=Xr(U,A.startPoint);(_===void 0||H<_)&&(_=H,m=U)})),m}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getData",value:function(){var p=this.text,y=p.x,m=p.y,_=p.value,A={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Object.assign({},this.startPoint),endPoint:Object.assign({},this.endPoint),properties:Object(a.I)(this.properties)};return _&&(A.text={x:y,y:m,value:_}),this.graphModel.overlapMode===Ei.INCREASE&&(A.zIndex=this.zIndex),A}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"setProperty",value:function(p,y){this.properties[p]=ma(y),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=wa(wa({},Object(a.I)(this.properties)),ma(p)),this.setAttributes()}},{key:"changeEdgeId",value:function(p){var y=this.arrowConfig,m=y.markerEnd,_=y.markerStart;_&&_==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(p,")")),m&&m==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(p,")")),this.id=p}},{key:"setStyle",value:function(p,y){this.style=wa(wa({},this.style),{},za({},p,ma(y)))}},{key:"setStyles",value:function(p){this.style=wa(wa({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=wa({},ma(p))}},{key:"formatText",value:function(p){var y=this.textPosition,m=y.x,_=y.y;p.text&&typeof p.text!="string"?Object.prototype.toString.call(p.text)==="[object Object]"&&(this.text={x:p.text.x||m,y:p.text.y||_,value:p.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:p.text||"",x:m,y:_,draggable:this.text.draggable,editable:this.text.editable}}},{key:"resetTextPosition",value:function(){var p=this.textPosition,y=p.x,m=p.y;this.text.x=y,this.text.y=m}},{key:"moveText",value:function(p,y){if(this.text){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,draggable:U,x:_+p,y:A+y,editable:H}}}},{key:"setText",value:function(p){p&&Pa(this.text,p)}},{key:"updateText",value:function(p){this.text=wa(wa({},Object(a.I)(this.text)),{},{value:p})}},{key:"setAnchors",value:function(){if(!this.sourceAnchorId||!this.startPoint){var p=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!p)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:p.x,y:p.y}),this.sourceAnchorId||(this.sourceAnchorId=p.id)}if(!this.targetAnchorId||!this.endPoint){var y=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!y)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:y.x,y:y.y}),this.targetAnchorId||(this.targetAnchorId=y.id)}}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"openEdgeAnimation",value:function(){this.isAnimation=!0}},{key:"closeEdgeAnimation",value:function(){this.isAnimation=!1}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"updateStartPoint",value:function(p){this.startPoint=p}},{key:"moveStartPoint",value:function(p,y){this.startPoint.x+=p,this.startPoint.y+=y}},{key:"updateEndPoint",value:function(p){this.endPoint=p}},{key:"moveEndPoint",value:function(p,y){this.endPoint.x+=p,this.endPoint.y+=y}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.zIndex=p}},{key:"initPoints",value:function(){}},{key:"updateAttributes",value:function(p){Pa(this,p)}},{key:"getAdjustStart",value:function(){return this.startPoint}},{key:"getAdjustEnd",value:function(){return this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(p){var y=p.startPoint,m=p.endPoint;this.updateStartPoint({x:y.x,y:y.y}),this.updateEndPoint({x:m.x,y:m.y})}}],d&&Lf(u.prototype,d),c})(),xc=wr(Qt.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Af=wr(Qt.prototype,"sourceNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Mf=wr(Qt.prototype,"targetNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Pu=wr(Qt.prototype,"startPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Oc=wr(Qt.prototype,"endPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),zp=wr(Qt.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),uv=wr(Qt.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Sc=wr(Qt.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Tf=wr(Qt.prototype,"pointsList",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hp=wr(Qt.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cv=wr(Qt.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Bs=wr(Qt.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),dv=wr(Qt.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),vs=wr(Qt.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Ru=wr(Qt.prototype,"isAnimation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xp=wr(Qt.prototype,"isShowAdjustPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Cm=wr(Qt.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Nm=wr(Qt.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),km=wr(Qt.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),fv=wr(Qt.prototype,"arrowConfig",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")}}}),wr(Qt.prototype,"sourceNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"sourceNode"),Qt.prototype),wr(Qt.prototype,"targetNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"targetNode"),Qt.prototype),wr(Qt.prototype,"textPosition",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"textPosition"),Qt.prototype),wr(Qt.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperty"),Qt.prototype),wr(Qt.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"deleteProperty"),Qt.prototype),wr(Qt.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperties"),Qt.prototype),wr(Qt.prototype,"changeEdgeId",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"changeEdgeId"),Qt.prototype),wr(Qt.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyle"),Qt.prototype),wr(Qt.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyles"),Qt.prototype),wr(Qt.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStyles"),Qt.prototype),wr(Qt.prototype,"formatText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"formatText"),Qt.prototype),wr(Qt.prototype,"resetTextPosition",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"resetTextPosition"),Qt.prototype),wr(Qt.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveText"),Qt.prototype),wr(Qt.prototype,"setText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setText"),Qt.prototype),wr(Qt.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateText"),Qt.prototype),wr(Qt.prototype,"setAnchors",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setAnchors"),Qt.prototype),wr(Qt.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setSelected"),Qt.prototype),wr(Qt.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHovered"),Qt.prototype),wr(Qt.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHitable"),Qt.prototype),wr(Qt.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"openEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"closeEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setElementState"),Qt.prototype),wr(Qt.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStartPoint"),Qt.prototype),wr(Qt.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveStartPoint"),Qt.prototype),wr(Qt.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateEndPoint"),Qt.prototype),wr(Qt.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveEndPoint"),Qt.prototype),wr(Qt.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setZIndex"),Qt.prototype),wr(Qt.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"initPoints"),Qt.prototype),wr(Qt.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAttributes"),Qt.prototype),wr(Qt.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustStart"),Qt.prototype),wr(Qt.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustEnd"),Qt.prototype),wr(Qt.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAfterAdjustStartAndEnd"),Qt.prototype),Qt),If=Kp;function Zp(c){return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Zp(c)}function pv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Rm(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?pv(Object(d),!0).forEach((function(p){Lu(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):pv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ju(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Dm(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cc(){return Cc=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=jm(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Cc.apply(this,arguments)}function jm(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=lu(c))!==null;);return c}function hv(c,u){return hv=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hv(c,u)}function Ff(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=lu(c);if(u){var y=lu(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Lm(this,d)}}function Lm(c,u){if(u&&(Zp(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gl(c)}function Gl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function lu(c){return lu=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},lu(c)}function Lu(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Er,vv,Od=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hv(m,_)})(y,c);var u,d,p=Ff(y);function y(){var m;ju(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Lu(Gl(m=p.call.apply(p,[this].concat(A))),"modelType",lo.LINE_EDGE),m}return u=y,(d=[{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.line;return Rm(Rm({},Cc(lu(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}])&&Dm(u.prototype,d),y})(If);function su(c){return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},su(c)}function Bf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return Ha(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return Ha(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ha(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function gs(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ci(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gs(Object(d),!0).forEach((function(p){mv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gs(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function dl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function zl(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function by(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $f(){return $f=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=Nc(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},$f.apply(this,arguments)}function Nc(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=nl(c))!==null;);return c}function Jr(c,u){return Jr=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Jr(c,u)}function Im(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=nl(c);if(u){var y=nl(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return fl(this,d)}}function fl(c,u){if(u&&(su(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oi(c)}function Oi(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function nl(c){return nl=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nl(c)}function mv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ea(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Cl=(Er=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Jr(m,_)})(y,c);var u,d,p=Im(y);function y(){var m;zl(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return mv(Oi(m=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYLINE_EDGE),mv(Oi(m),"draggingPointList",void 0),dl(Oi(m),"dbClickPosition",vv,Oi(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=30,$f(nl(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.polyline;return Ci(Ci({},$f(nl(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){var m,_=(m=this.text)===null||m===void 0?void 0:m.value;if(this.dbClickPosition&&!_){var A=this.dbClickPosition;return{x:A.x,y:A.y}}var N=jr(this.points),U=Bf(Or(N),2),H=U[0],oe=U[1];return{x:(H.x+oe.x)/2,y:(H.y+oe.y)/2}}},{key:"getAfterAnchor",value:function(m,_,A){var N,U;return A.forEach((function(H){var oe;m===ti.HORIZONTAL?oe=Math.abs(_.y-H.y):m===ti.VERTICAL&&(oe=Math.abs(_.x-H.x)),(!U||U>oe)&&(U=oe,N=H)})),N}},{key:"getCrossPoint",value:function(m,_,A){var N;return m===ti.HORIZONTAL?N={x:A.x,y:_.y}:m===ti.VERTICAL&&(N={x:_.x,y:A.y}),N}},{key:"removeCrossPoints",value:function(m,_,A){var N=A.map((function(xt){return xt}));if(m===1){var U=N[m],H=N[_],oe=N[m-1];if(Fr(oe,U,this.sourceNode)){if(Qr(U,H,this.sourceNode)){var ue=ki(U,H,this.sourceNode);ue&&(N[m]=ue,N.splice(m-1,1),m--,_--)}}else this.sourceNode.anchors.forEach((function(xt){(xt.x===oe.x&&xt.x===U.x||xt.y===oe.y&&xt.y===U.y)&&ms(xt.x,xt.y,U.x,U.y)<ms(oe.x,oe.y,U.x,U.y)&&(N[m-1]=xt)}))}if(_===A.length-2){var Ce=N[m],Ve=N[_],qe=N[_+1];if(Fr(Ve,qe,this.targetNode)){if(Qr(Ce,Ve,this.targetNode)){var Ot=ki(Ce,Ve,this.targetNode);Ot&&(N[_]=Ot,N.splice(_+1,1))}}else this.targetNode.anchors.forEach((function(xt){(xt.x===qe.x&&xt.x===Ve.x||xt.y===qe.y&&xt.y===Ve.y)&&ms(xt.x,xt.y,Ve.x,Ve.y)<ms(qe.x,qe.y,Ve.x,Ve.y)&&(N[_+1]=xt)}))}return N}},{key:"getDraggingPoints",value:function(m,_,A,N,U){var H=U.map((function(Ce){return Ce})),oe=this.getAfterAnchor(m,A,N),ue=this.getCrossPoint(m,A,oe);return _==="start"?(H.unshift(ue),H.unshift(oe)):(H.push(ue),H.push(oe)),H}},{key:"updateCrossPoints",value:function(m){var _=m.map((function(hn){return hn})),A=m[0],N=m[1],U=m[_.length-2],H=m[_.length-1],oe=this.sourceNode,ue=this.targetNode,Ce=oe.modelType,Ve=ue.modelType,qe=Si(A,N),Ot=_[0];switch(Ce){case lo.RECT_NODE:oe.radius!==0&&(kf(A,oe)||(Ot=Nf(A,qe,oe)));break;case lo.CIRCLE_NODE:Ot=Ac(A,qe,oe);break;case lo.ELLIPSE_NODE:Ot=Ed(A,qe,oe);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ot=Pf(A,qe,oe)}Ot&&(_[0]=Ot);var xt=Si(U,H),Ft=_[_.length-1];switch(Ve){case lo.RECT_NODE:ue.radius!==0&&(kf(H,ue)||(Ft=Nf(H,xt,ue)));break;case lo.CIRCLE_NODE:Ft=Ac(H,xt,ue);break;case lo.ELLIPSE_NODE:Ft=Ed(H,xt,ue);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ft=Pf(H,xt,ue)}return Ft&&(_[_.length-1]=Ft),_}},{key:"getData",value:function(){var m=$f(nl(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Object.assign({},m,{pointsList:_})}},{key:"initPoints",value:function(){this.pointsList.length>0?this.points=this.pointsList.map((function(m){return"".concat(m.x,",").concat(m.y)})).join(" "):this.updatePoints()}},{key:"updatePoints",value:function(){var m=$r({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=m,this.points=m.map((function(_){return"".concat(_.x,",").concat(_.y)})).join(" ")}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_,this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_,this.updatePoints()}},{key:"updatePointsList",value:function(m,_){this.pointsList.forEach((function(U){U.x+=m,U.y+=_}));var A=this.pointsList[0];this.startPoint=Object.assign({},A);var N=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},N),this.initPoints()}},{key:"dragAppendStart",value:function(){this.draggingPointList=this.pointsList.map((function(m){return m}))}},{key:"dragAppendSimple",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList,Ce=ue;return oe===ti.HORIZONTAL?(ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y},Ce=this.pointsList.map((function(Ve){return Ve}))):oe===ti.VERTICAL&&(ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y},Ce=this.pointsList.map((function(Ve){return Ve}))),this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppend",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList;if(oe===ti.HORIZONTAL){ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y};var Ce=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ce=this.removeCrossPoints(U,H,Ce)),U===0){var Ve={x:A.x,y:A.y+_.y};if(!Du(Ve,this.sourceNode)){var qe=this.sourceNode.anchors;Ce=this.getDraggingPoints(oe,"start",Ve,qe,Ce)}}if(H===this.pointsList.length-1){var Ot={x:N.x,y:N.y+_.y};if(!Du(Ot,this.targetNode)){var xt=this.targetNode.anchors;Ce=this.getDraggingPoints(oe,"end",Ot,xt,Ce)}}this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce}else if(oe===ti.VERTICAL){ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y};var Ft=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ft=this.removeCrossPoints(U,H,Ft)),U===0){var hn={x:A.x+_.x,y:A.y};if(!Du(hn,this.sourceNode)){var Hn=this.sourceNode.anchors;Ft=this.getDraggingPoints(oe,"start",hn,Hn,Ft)}}if(H===this.pointsList.length-1){var zn={x:N.x+_.x,y:N.y};if(!Du(zn,this.targetNode)){var Ar=this.targetNode.anchors;Ft=this.getDraggingPoints(oe,"end",zn,Ar,Ft)}}this.updatePointsAfterDrag(Ft),this.draggingPointList=Ft}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppendEnd",value:function(){if(this.draggingPointList){var m=Un(jr(this.points));this.pointsList=m.map((function(N){return N})),this.draggingPointList=[];var _=m[0];this.startPoint=Object.assign({},_);var A=m[m.length-1];this.endPoint=Object.assign({},A)}this.isDragging=!1}},{key:"updatePointsAfterDrag",value:function(m){var _=this.updateCrossPoints(m);this.points=_.map((function(A){return"".concat(A.x,",").concat(A.y)})).join(" ")}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=$r({x:_.x,y:_.y},{x:A.x,y:A.y},N,U,this.offset||0);this.pointsList=H,this.initPoints()}}])&&by(u.prototype,d),y})(If),vv=Ea(Er.prototype,"dbClickPosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ea(Er.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"initPoints"),Er.prototype),Ea(Er.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePoints"),Er.prototype),Ea(Er.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateStartPoint"),Er.prototype),Ea(Er.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveStartPoint"),Er.prototype),Ea(Er.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateEndPoint"),Er.prototype),Ea(Er.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveEndPoint"),Er.prototype),Ea(Er.prototype,"updatePointsList",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsList"),Er.prototype),Ea(Er.prototype,"dragAppendStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendStart"),Er.prototype),Ea(Er.prototype,"dragAppendSimple",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendSimple"),Er.prototype),Ea(Er.prototype,"dragAppend",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppend"),Er.prototype),Ea(Er.prototype,"dragAppendEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendEnd"),Er.prototype),Ea(Er.prototype,"updatePointsAfterDrag",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsAfterDrag"),Er.prototype),Ea(Er.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustStart"),Er.prototype),Ea(Er.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustEnd"),Er.prototype),Ea(Er.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateAfterAdjustStartAndEnd"),Er.prototype),Er),kc=function(c){var u=c.start,d=c.end,p=c.offset,y=c.verticalLength,m=c.type,_={leftX:0,leftY:0,rightX:0,rightY:0},A=Math.atan((d.y-u.y)/(d.x-u.x)),N=Math.atan(p/y),U=Math.sqrt(y*y+p*p);return m==="start"?d.x>=u.x?(_.leftX=u.x+U*Math.sin(A+N),_.leftY=u.y-U*Math.cos(A+N),_.rightX=u.x-U*Math.sin(A-N),_.rightY=u.y+U*Math.cos(A-N)):(_.leftX=u.x-U*Math.sin(A+N),_.leftY=u.y+U*Math.cos(A+N),_.rightX=u.x+U*Math.sin(A-N),_.rightY=u.y-U*Math.cos(A-N)):m==="end"&&(d.x>=u.x?(_.leftX=d.x+U*Math.sin(A-N),_.leftY=d.y-U*Math.cos(A-N),_.rightX=d.x-U*Math.sin(A+N),_.rightY=d.y+U*Math.cos(A+N)):(_.leftX=d.x-U*Math.sin(A-N),_.leftY=d.y+U*Math.cos(A-N),_.rightX=d.x+U*Math.sin(A+N),_.rightY=d.y-U*Math.cos(A+N))),_},Uf={x:1,y:0,z:0};function Ni(c,u,d,p,y){for(var m=function(Ve){if(Ve<0||Ve>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:c.x*Math.pow(1-Ve,3)+3*u.x*Ve*Math.pow(1-Ve,2)+3*d.x*Math.pow(Ve,2)*(1-Ve)+p.x*Math.pow(Ve,3),y:c.y*Math.pow(1-Ve,3)+3*u.y*Ve*Math.pow(1-Ve,2)+3*d.y*Math.pow(Ve,2)*(1-Ve)+p.y*Math.pow(Ve,3)}},_=0,A=2,N=p.x,U=p.y,H=p;_<y&&A<50;){var oe=H=m(1-A/100),ue=oe.x,Ce=oe.y;_=ms(N,U,ue,Ce),A++}return H}function Bi(c){var u=Math.hypot(c.x,c.y);return{x:c.x/u,y:c.y/u,z:0}}function Jp(c){return p=(function(m,_){return m.x*_.y-m.y*_.x})(u=Uf,d=c),y=Math.acos((function(m,_){var A=[m.x,m.y,m.z];return[_.x,_.y,_.z].reduce((function(N,U,H){return N+U*A[H]}))})(Bi(u),Bi(d))),p>=0?y:-y;var u,d,p,y}function gv(c){return c*(180/Math.PI)}function K(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function me(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?K(Object(d),!0).forEach((function(p){Ie(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):K(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Ie(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wt(c){return(function(u){if(Array.isArray(u))return tn(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||Nt(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dt(c){return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Dt(c)}function yt(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||Nt(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Nt(c,u){if(c){if(typeof c=="string")return tn(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?tn(c,u):void 0}}function tn(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var sn=function(c,u){var d;switch(c.type){case"line":default:d=new Od(c,u);break;case"polyline":d=new Cl(c,u)}return d},nn=function(c,u){return 2*Math.abs(c.centerX-u.centerX)<c.width+u.width&&2*Math.abs(c.centerY-u.centerY)<c.height+u.height},Mt=function(c){var u=[],d={};return c.forEach((function(p){var y="".concat(p.x,"-").concat(p.y);p.id=y,d[y]=p})),Object.keys(d).forEach((function(p){u.push(d[p])})),u},wn=function(c,u){var d=[c,{x:c.x,y:u.y},u];return Mt(d)},pn=function(c,u){return c.width===0&&c.height===0?c:{centerX:c.centerX,centerY:c.centerY,minX:c.minX-u,minY:c.minY-u,maxX:c.maxX+u,maxY:c.maxY+u,height:c.height+2*u,width:c.width+2*u}},rn=function(c,u){var d=Math.abs(c.x-u.centerX),p=Math.abs(c.y-u.centerY);return d/u.width>p/u.height?ti.HORIZONTAL:ti.VERTICAL},Wt=function(c,u,d){return rn(d,u)===ti.HORIZONTAL?{x:d.x>c.centerX?c.maxX:c.minX,y:d.y}:{x:d.x,y:d.y>c.centerY?c.maxY:c.minY}},st=function(c,u){var d=Math.min(c.minX,u.minX),p=Math.min(c.minY,u.minY),y=Math.max(c.maxX,u.maxX),m=Math.max(c.maxY,u.maxY);return{centerX:(d+y)/2,centerY:(p+m)/2,minX:d,minY:p,maxX:y,maxY:m,height:m-p,width:y-d}},St=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1?arguments[1]:void 0,d=[],p=[];c.forEach((function(H){d.push(H.x),p.push(H.y)}));var y=Math.min.apply(Math,d),m=Math.max.apply(Math,d),_=Math.min.apply(Math,p),A=Math.max.apply(Math,p),N=m-y,U=A-_;return u&&(N+=u,U+=u),{centerX:(y+m)/2,centerY:(_+A)/2,maxX:m,maxY:A,minX:y,minY:_,x:(y+m)/2,y:(_+A)/2,height:U,width:N}},ln=function(c){var u=c.minX,d=c.minY,p=c.maxX,y=c.maxY;return[{x:u,y:d},{x:p,y:d},{x:p,y},{x:u,y}]},An=function(c,u){var d=c.x,p=c.y;return d<u.minX||d>u.maxX||p<u.minY||p>u.maxY},Xt=function(c,u){return u<c.minX||u>c.maxX?[]:[{x:u,y:c.minY},{x:u,y:c.maxY}]},kn=function(c,u){return u<c.minY||u>c.maxY?[]:[{x:c.minX,y:u},{x:c.maxX,y:u}]},Kt=function(c,u){return Xt(c,u.x).concat(kn(c,u.y))},_n=function(c,u){return Math.abs(c.x-u.x)+Math.abs(c.y-u.y)},Yt=function(c,u){var d=0;return u.forEach((function(p){p&&(c.x===p.x&&(d+=-2),c.y===p.y&&(d+=-2))})),d},xn=function(c,u,d,p,y){return _n(c,u)+_n(c,d)+Yt(c,[u,d,p,y])},ar=function c(u,d,p,y,m){m||(m=0),u.unshift(d[y]),p[y]&&p[y]!==y&&m<=100&&c(u,d,p,p[y],m+1)},xr=function(c,u){var d=c.indexOf(u);d>-1&&c.splice(d,1)},on=function(c,u,d,p){var y=u.x-c.x,m=u.y-c.y,_=p.x-d.x,A=p.y-d.y,N=(-m*(c.x-d.x)+y*(c.y-d.y))/(-_*m+y*A),U=(_*(c.y-d.y)-A*(c.x-d.x))/(-_*m+y*A);return N>=0&&N<=1&&U>=0&&U<=1},Zt=function(c,u,d){if(d.width===0&&d.height===0)return!1;var p=yt(ln(d),4),y=p[0],m=p[1],_=p[2],A=p[3];return on(c,u,y,m)||on(c,u,y,A)||on(c,u,m,_)||on(c,u,_,A)},Ht=function(c,u,d,p){var y=[];return c.forEach((function(m){m!==u&&(m.x!==u.x&&m.y!==u.y||Zt(m,u,d)||Zt(m,u,p)||y.push(m))})),Mt(y)},fr=function(c,u,d,p,y,m,_){var A=[],N=[u],U={},H={},oe={};H[u.id]=0,oe[u.id]=xn(u,d,u);var ue={};c.forEach((function(qe){ue[qe.id]=qe}));for(var Ce=function(){var qe=void 0,Ot=1/0;if(N.forEach((function(Ft){oe[Ft.id]<Ot&&(Ot=oe[Ft.id],qe=Ft)})),qe===d){var xt=[];return ar(xt,ue,U,d.id),{v:xt}}xr(N,qe),A.push(qe),Ht(c,qe,p,y).forEach((function(Ft){if(A.indexOf(Ft)===-1){N.indexOf(Ft)===-1&&N.push(Ft);var hn=oe[qe.id]+_n(qe,Ft);H[Ft.id]&&hn>=H[Ft.id]||(U[Ft.id]=qe.id,H[Ft.id]=hn,oe[Ft.id]=H[Ft.id]+xn(Ft,d,u,m,_))}}))};N.length;){var Ve=Ce();if(Dt(Ve)==="object")return Ve.v}return[u,d]},Dr=function(c){return gi(c)},Un=function(c){for(var u=1;u<c.length-1;){var d=c[u-1],p=c[u],y=c[u+1];d.x===p.x&&p.x===y.x||d.y===p.y&&p.y===y.y?c.splice(u,1):u++}return c},$r=function(c,u,d,p,y){var m=Dr(d),_=Dr(p),A=pn(m,y),N=pn(_,y),U=Wt(A,m,c),H=Wt(N,_,u);if(nn(A,N)){var oe=Gi(c,u,U,H);return[c,U].concat(wt(oe),[H,u])}var ue=St([U,H]),Ce=st(A,ue),Ve=st(N,ue),qe=[];qe=(qe=qe.concat(ln(Ce))).concat(ln(Ve));var Ot={x:(c.x+u.x)/2,y:(c.y+u.y)/2};[ue,Ce,Ve].forEach((function(Ft){qe=qe.concat(Kt(Ft,Ot).filter((function(hn){return An(hn,A)&&An(hn,N)})))})),[{x:U.x,y:H.y},{x:H.x,y:U.y}].forEach((function(Ft){An(Ft,A)&&An(Ft,N)&&qe.push(Ft)})),qe.unshift(U),qe.push(H),qe=Mt(qe);var xt=fr(qe,U,H,m,_,c,u);return xt.unshift(c),xt.push(u),xt.length>2&&(xt=Un(xt)),Mt(xt)},Or=function(c){var u;if(c.length===1)u=[c[0],c[0]];else if(c.length>=2){for(var d=c[0],p=c[1],y=ms(d.x,d.y,p.x,p.y),m=1;m<c.length-1;m++){var _=c[m],A=c[m+1],N=ms(_.x,_.y,A.x,A.y);N>y&&(y=N,d=_,p=A)}u=[d,p]}return u},Fr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return p&&y},Qr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return!(p&&y)&&(p||y)},ki=function(c,u,d){for(var p,y,m=gi(d),_=ln(m),A=0;A<_.length;A++)on(c,u,_[A],_[(A+1)%_.length])&&(y=[_[A],_[(A+1)%_.length]]);return y&&(p=(function(N,U,H,oe){var ue=(U.y-N.y)*(oe.x-H.x)-(N.x-U.x)*(H.y-oe.y);if(ue===0)return!1;var Ce=((U.x-N.x)*(oe.x-H.x)*(H.y-N.y)+(U.y-N.y)*(oe.x-H.x)*N.x-(oe.y-H.y)*(U.x-N.x)*H.x)/ue,Ve=-((U.y-N.y)*(oe.y-H.y)*(H.x-N.x)+(U.x-N.x)*(oe.y-H.y)*N.y-(oe.x-H.x)*(U.y-N.y)*H.y)/ue;return(Ce-N.x)*(Ce-U.x)<=0&&(Ve-N.y)*(Ve-U.y)<=0&&(Ce-H.x)*(Ce-oe.x)<=0&&(Ve-H.y)*(Ve-oe.y)<=0&&{x:Ce,y:Ve}})(c,u,y[0],y[1])),p},Si=function(c,u){var d;return c.x===u.x?d=ti.VERTICAL:c.y===u.y&&(d=ti.HORIZONTAL),d},jr=function(c){var u=c.split(" "),d=[];return u&&u.forEach((function(p){var y=yt(p.split(","),2),m=y[0],_=y[1];d.push({x:Number(m),y:Number(_)})})),d},Gi=function(c,u,d,p){var y=[];if(Si(c,d)===Si(u,p))c.y===d.y?(y.push({x:d.x,y:(d.y+p.y)/2}),y.push({x:p.x,y:(d.y+p.y)/2})):(y.push({x:(d.x+p.x)/2,y:d.y}),y.push({x:(d.x+p.x)/2,y:p.y}));else{var m={x:d.x,y:p.y},_=Ra(m,c,d),A=Ra(m,u,p);if(_||A)m={x:p.x,y:d.y};else{var N=Ko(m,c,d),U=Ko(m,u,p);N&&U&&(m={x:p.x,y:d.y})}y.push(m)}return y},Ko=function(c,u,d){return c.x===u.x&&c.x===d.x||c.y===u.y&&c.y===d.y},Pi=function(c){if(!c)return 0;for(var u=0,d=0;d<c.length;d++){var p=c.charCodeAt(d);c.match(/[A-Z]/)?u+=1.5:u+=p>=1&&p<=126||p>=65376&&p<=65439?1:2}return u},$i=null,Qi=function(c,u){$i||($i=document.createElement("canvas"));var d=$i.getContext("2d");return d.font=u,d.measureText(c).width},la=function(c){var u,d=c.start,p=c.end;if(d.x===p.x&&d.y===p.y)u="";else{var y={start:d,end:p,offset:10,verticalLength:5},m=kc(me(me({},y),{},{type:"start"})),_=kc(me(me({},y),{},{type:"end"}));u="M".concat(m.leftX," ").concat(m.leftY,`
|
||
L`).concat(m.rightX," ").concat(m.rightY,`
|
||
L`).concat(_.rightX," ").concat(_.rightY,`
|
||
L`).concat(_.leftX," ").concat(_.leftY," z")}return{d:u,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},zi=function(c){var u=c.start,d=c.end,p=c.sourceNode,y=c.targetNode,m=c.offset,_=gi(p),A=gi(y),N=pn(_,m),U=pn(A,m);return{sNext:Wt(N,_,u),ePre:Wt(U,A,d)}},di=function(c){var u=c.replace(/M/g,"").replace(/C/g,",").split(",");return[Cr(u[0]),Cr(u[1]),Cr(u[2]),Cr(u[3])]},Cr=function(c){var u=yt(c.replace(/(^\s*)/g,"").split(" "),2);return{x:+u[0],y:+u[1]}},sa=function(c,u){var d=yt(c,4);return[Ni(d[0],d[1],d[2],d[3],u),c[3]]},co=function(c,u){for(var d,p=c.x,y=c.y,m=jr(u),_=Number.MAX_SAFE_INTEGER,A=[],N=0;N<m.length;N++)A.push({start:m[N],end:m[(N+1)%m.length]});if(A.forEach((function(ue){var Ce=ue.start,Ve=ue.end;if(Ce.x===Ve.x){var qe={x:Ce.x,y};if(Ra(qe,Ce,Ve)){var Ot=Math.abs(Ce.x-p);Ot<_&&(_=Ot,d=qe)}}else if(Ce.y===Ve.y){var xt={x:p,y:Ce.y};if(Ra(xt,Ce,Ve)){var Ft=Math.abs(Ce.y-y);Ft<_&&(_=Ft,d=xt)}}})),!d){var U=A[0],H=U.start,oe=U.end;d={x:H.x+(oe.x-H.x)/2,y:H.y+(oe.y-H.y)/2}}return d},cr=function(c){return cs(c,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Xr=function(c,u){return Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2))};function Nr(c,u){return typeof u!="function"?function(d,p,y){return Object.assign({type:c.edgeType},y)}:function(d,p,y){var m=u(d,p,y);return m?typeof m=="string"?Object.assign({},y,{type:m}):Object.assign({type:m},y):{type:c.edgeType}}}r(208);var fi=function(){};function $s(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yi(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Te=(function(){function c(p){var y=this,m=p.onDragStart,_=m===void 0?fi:m,A=p.onDragging,N=A===void 0?fi:A,U=p.onDragEnd,H=U===void 0?fi:U,oe=p.eventType,ue=oe===void 0?"":oe,Ce=p.eventCenter,Ve=Ce===void 0?null:Ce,qe=p.step,Ot=qe===void 0?1:qe,xt=p.isStopPropagation,Ft=xt===void 0||xt,hn=p.model,Hn=hn===void 0?null:hn,zn=p.data,Ar=zn===void 0?null:zn;(function(Vn,vr){if(!(Vn instanceof vr))throw new TypeError("Cannot call a class as a function")})(this,c),yi(this,"onDragStart",void 0),yi(this,"onDragging",void 0),yi(this,"onDragEnd",void 0),yi(this,"step",void 0),yi(this,"isStopPropagation",void 0),yi(this,"isDragging",!1),yi(this,"isStartDragging",!1),yi(this,"startX",0),yi(this,"startY",0),yi(this,"sumDeltaX",0),yi(this,"sumDeltaY",0),yi(this,"eventType",void 0),yi(this,"eventCenter",void 0),yi(this,"model",void 0),yi(this,"data",void 0),yi(this,"startTime",void 0),yi(this,"handleMouseDown",(function(Vn){var vr,er,Eo,Co=(vr=window)===null||vr===void 0?void 0:vr.document;if(Vn.button===0){y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging=!0,y.startX=Vn.clientX,y.startY=Vn.clientY,Co.addEventListener("mousemove",y.handleMouseMove,!1),Co.addEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEDOWN")],{e:Vn,data:y.data||zr}),y.startTime=new Date().getTime()}})),yi(this,"handleMouseMove",(function(Vn){if(y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging&&(y.sumDeltaX+=Vn.clientX-y.startX,y.sumDeltaY+=Vn.clientY-y.startY,y.startX=Vn.clientX,y.startY=Vn.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var vr,er=y.sumDeltaX%y.step,Eo=y.sumDeltaY%y.step,Co=y.sumDeltaX-er,zr=y.sumDeltaY-Eo;y.sumDeltaX=er,y.sumDeltaY=Eo;var Fo,ga=(vr=y.model)===null||vr===void 0?void 0:vr.getData();y.isDragging||((Fo=y.eventCenter)===null||Fo===void 0||Fo.emit(ur["".concat(y.eventType,"_DRAGSTART")],{e:Vn,data:y.data||ga}),y.onDragStart({event:Vn})),y.isDragging=!0,Promise.resolve().then((function(){var ya,Nl;y.onDragging({deltaX:Co,deltaY:zr,event:Vn}),(ya=y.eventCenter)===null||ya===void 0||ya.emit(ur["".concat(y.eventType,"_MOUSEMOVE")],{e:Vn,data:y.data||ga}),(Nl=y.eventCenter)===null||Nl===void 0||Nl.emit(ur["".concat(y.eventType,"_DRAG")],{e:Vn,data:y.data||ga})}))}})),yi(this,"handleMouseUp",(function(Vn){var vr=window.document;y.isStartDragging=!1,y.isStopPropagation&&Vn.stopPropagation(),Promise.resolve().then((function(){var er,Eo,Co;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEUP")],{e:Vn,data:y.data||zr}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:Vn}),(Co=y.eventCenter)===null||Co===void 0||Co.emit(ur["".concat(y.eventType,"_DROP")],{e:Vn,data:y.data||zr}))}))})),yi(this,"cancelDrag",(function(){var Vn,vr=(Vn=window)===null||Vn===void 0?void 0:Vn.document;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:null}),y.isDragging=!1})),this.onDragStart=_,this.onDragging=N,this.onDragEnd=H,this.step=Ot,this.isStopPropagation=Ft,this.eventType=ue,this.eventCenter=Ve,this.model=Hn,this.data=Ar}var u,d;return u=c,(d=[{key:"setStep",value:function(p){this.step=p}},{key:"setModel",value:function(p){this.model=p}}])&&$s(u.prototype,d),c})();function Et(c){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Et(c)}function _t(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Ln(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Gr(c,u,d){return u&&Ln(c.prototype,u),c}function xe(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Qe(c,u)}function de(c){var u=Ge();return function(){var d,p=Ee(c);if(u){var y=Ee(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return We(this,d)}}function We(c,u){if(u&&(Et(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(c)}function tt(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function ct(c){var u=typeof Map=="function"?new Map:void 0;return ct=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Xe(d,arguments,Ee(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Qe(y,d)},ct(c)}function Xe(c,u,d){return Xe=Ge()?Reflect.construct:function(p,y,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Qe(A,m.prototype),A},Xe.apply(null,arguments)}function Ge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Qe(c,u){return Qe=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Qe(c,u)}function Ee(c){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ee(c)}function Ue(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function be(c,u){return c instanceof ot&&u instanceof ot}var nt=(function(c){xe(d,c);var u=de(d);function d(p,y,m){var _;return _t(this,d),Ue(tt(_=u.call(this,3)),"x",void 0),Ue(tt(_),"y",void 0),Ue(tt(_),"z",void 0),_[0]=p,_[1]=y,_[2]=m,_.x=p,_.y=y,_.z=m,Object.setPrototypeOf(tt(_),d.prototype),_}return Gr(d,[{key:"add",value:function(p){if(be(this,p))return new ot(this.x+p.x,this.y+p.y);var y=this.z+p.z;return new g((this.x+p.x)/y,(this.y+p.y)/y)}},{key:"subtract",value:function(p){if(be(this,p))return new ot(this.x-p.x,this.y-p.y);var y=this.z-p.z;return y===0?new ot(this.x-p.x,this.y-p.y):new g((this.x-p.x)/y,(this.y-p.y)/y)}}]),d})(ct(Array)),ot=(function(c){xe(d,c);var u=de(d);function d(p,y,m){var _;return _t(this,d),_=u.call(this,p,y,m??0),Object.setPrototypeOf(tt(_),d.prototype),_}return Gr(d,[{key:"toString",value:function(){return"Vector"}},{key:"dot",value:function(p){var y=this;return p.reduce((function(m,_,A){return m+_*y[A]}))}},{key:"cross",value:function(p){return new d(this.y*p.z-this.z*p.y,this.z*p.x-this.x*p.z,this.x*p.y-this.y*p.x)}},{key:"getLength",value:function(){return Math.hypot(this.x,this.y)}},{key:"normalize",value:function(){var p=this.getLength();return new d(this.x/p,this.y/p)}},{key:"crossZ",value:function(p){return this.x*p.y-this.y*p.x}},{key:"angle",value:function(p){var y=this.crossZ(p),m=Math.acos(this.normalize().dot(p.normalize()));return y>=0?m:-m}}]),d})(nt),g=(function(c){xe(d,c);var u=de(d);function d(p,y){var m;return _t(this,d),m=u.call(this,p,y,1),Object.setPrototypeOf(tt(m),d.prototype),m}return Gr(d,[{key:"toString",value:function(){return"Point"}}]),d})(nt);r(67),r(218);function x(c){return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},x(c)}function C(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||te(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function G(c){return(function(u){if(Array.isArray(u))return ce(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||te(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function te(c,u){if(c){if(typeof c=="string")return ce(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?ce(c,u):void 0}}function ce(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Oe(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Fe(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function et(c,u,d){return u&&Fe(c.prototype,u),c}function jt(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Tn(c,u)}function Vt(c){var u=an();return function(){var d,p=Br(c);if(u){var y=Br(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return yn(this,d)}}function yn(c,u){if(u&&(x(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(c)}function Yn(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Qn(c){var u=typeof Map=="function"?new Map:void 0;return Qn=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Sr(d,arguments,Br(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Tn(y,d)},Qn(c)}function Sr(c,u,d){return Sr=an()?Reflect.construct:function(p,y,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Tn(A,m.prototype),A},Sr.apply(null,arguments)}function an(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Tn(c,u){return Tn=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Tn(c,u)}function Br(c){return Br=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Br(c)}function ir(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var at,Yr,Ao,Mr,Ur,xa,Hl,uu,Oa,Iu,Pc,Qp,yv,Fu=(function(c){jt(d,c);var u=Vt(d);function d(){var p;Oe(this,d);for(var y=arguments.length,m=new Array(y),_=0;_<y;_++)m[_]=arguments[_];return ir(Yn(p=u.call(this,m.length)),"rows",void 0),ir(Yn(p),"columns",void 0),p.fill(new Array(3)),m.forEach((function(A,N){p[N]=A})),p.columns=m[0].length,p.rows=m.length,Object.setPrototypeOf(Yn(p),d.prototype),p}return et(d,[{key:"getRow",value:function(p){return this[p]}},{key:"getColumn",value:function(p){return G(this.map((function(y){return y[p]})))}},{key:"transpose",value:function(){for(var p=[],y=0;y<this.columns;y++)p.push(this.getColumn(y));return Sr(d,p)}},{key:"cross",value:function(p){var y=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===p.rows)for(var m=0;m<this.rows;m++)for(var _=this.getRow(m),A=function(U){var H=p.getColumn(U);y[m][U]=_.reduce((function(oe,ue,Ce){return oe+ue*H[Ce]}),0)},N=0;N<p.columns;N++)A(N);return Sr(d,G(y))}},{key:"to2D",value:function(){return this.map((function(p){return[p[0],p[1]]}))}},{key:"toPoints",value:function(){return this.map((function(p){return new g(p[0],p[1])}))}},{key:"toString",value:function(){var p=C(this[0],2),y=p[0],m=p[1],_=C(this[1],2),A=_[0],N=_[1],U=C(this[2],2),H=U[0],oe=U[1];return"matrix(".concat(y," ").concat(m," ").concat(A," ").concat(N," ").concat(H," ").concat(oe,")")}},{key:"translate",value:function(p,y){return this.cross(new eh(p,y))}},{key:"rotate",value:function(p){return this.cross(new Sd(p))}},{key:"scale",value:function(p,y){return this.cross(new wy(p,y))}}]),d})(Qn(Array)),Sd=(function(c){jt(d,c);var u=Vt(d);function d(p){var y;return Oe(this,d),y=u.call(this,new ot(+Math.cos(p).toFixed(2),+Math.sin(p).toFixed(2),0),new ot(-Math.sin(p).toFixed(2),+Math.cos(p).toFixed(2),0),new ot(0,0,1)),Object.setPrototypeOf(Yn(y),d.prototype),y}return et(d,[{key:"inverse",value:function(){return this.transpose()}}]),d})(Fu),wy=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(p,0,0),new ot(0,y,0),new ot(0,0,1))),"sx",void 0),ir(Yn(m),"sy",void 0),m.sx=p,m.sy=y,Object.setPrototypeOf(Yn(m),d.prototype),m}return et(d,[{key:"inverse",value:function(){return new d(1/this.sx,1/this.sy)}}]),d})(Fu),eh=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(1,0,0),new ot(0,1,0),new ot(p,y,1))),"tx",void 0),ir(Yn(m),"ty",void 0),m.tx=p,m.ty=y,Object.setPrototypeOf(Yn(m),d.prototype),m}return et(d,[{key:"inverse",value:function(){return new d(-this.tx,-this.ty)}}]),d})(Fu),_v={node:!1,edge:!1},Ey={node:!0,edge:!0};function bv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Vf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bv(Object(d),!0).forEach((function(p){Dc(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Wf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||wv(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Rc(c){return(function(u){if(Array.isArray(u))return mE(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||wv(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wv(c,u){if(c){if(typeof c=="string")return mE(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?mE(c,u):void 0}}function mE(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function pb(c){return pb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},pb(c)}function Bu(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function h5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dc(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Tr(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var iT,aT=200,lT=(at=(function(){function c(p){(function(Ce,Ve){if(!(Ce instanceof Ve))throw new TypeError("Cannot call a class as a function")})(this,c),Dc(this,"rootEl",void 0),Bu(this,"width",Yr,this),Bu(this,"height",Ao,this),Dc(this,"theme",void 0),Dc(this,"eventCenter",void 0),Dc(this,"modelMap",new Map),Dc(this,"topElement",void 0),Dc(this,"animation",void 0),Dc(this,"idGenerator",void 0),Dc(this,"edgeGenerator",void 0),Dc(this,"nodeMoveRules",[]),Dc(this,"customTrajectory",void 0),Bu(this,"edgeType",Mr,this),Bu(this,"nodes",Ur,this),Bu(this,"edges",xa,this),Bu(this,"overlapMode",Hl,this),Bu(this,"background",uu,this),Bu(this,"transformModel",Oa,this),Bu(this,"editConfigModel",Iu,this),Bu(this,"gridSize",Pc,this),Bu(this,"partial",Qp,this),Bu(this,"fakerNode",yv,this);var y,m=p.container,_=p.background,A=_===void 0?{}:_,N=p.grid,U=p.idGenerator,H=p.edgeGenerator,oe=p.animation,ue=p.customTrajectory;this.background=A,pb(N)==="object"&&(this.gridSize=N.size),this.rootEl=m,this.editConfigModel=new Mp(p),this.eventCenter=new Bp,this.transformModel=new Jh(this.eventCenter,p),this.theme=iu(p.style),this.edgeType=p.edgeType||"polyline",this.width=p.width,this.height=p.height,this.animation=(y=oe)&&typeof y!="boolean"?bc(Uo(_v),y):Uo(y===!0?Ey:_v),this.partial=p.partial,this.overlapMode=p.overlapMode||0,this.idGenerator=U,this.customTrajectory=ue,this.edgeGenerator=Nr(this,H),this.width=p.width||this.rootEl.getBoundingClientRect().width,this.height=p.height||this.rootEl.getBoundingClientRect().height,this.flowId=tl()}var u,d;return u=c,d=[{key:"nodesMap",get:function(){return this.nodes.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"edgesMap",get:function(){return this.edges.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"modelsMap",get:function(){return[].concat(Rc(this.nodes),Rc(this.edges)).reduce((function(p,y){return p[y.id]=y,p}),{})}},{key:"sortElements",get:function(){var p=[];this.nodes.forEach((function(U){return p.push(U)})),this.edges.forEach((function(U){return p.push(U)})),p=p.sort((function(U,H){return U.zIndex-H.zIndex}));for(var y=[],m=[-200,-200],_=[this.width+aT,this.height+aT],A=0;A<p.length;A++){var N=p[A];N.visible&&(!this.partial||N.isSelected||this.isElementInArea(N,m,_,!1,!1))&&y.push(N)}return y}},{key:"textEditElement",get:function(){var p=this.nodes.find((function(m){return m.state===Io.TEXT_EDIT})),y=this.edges.find((function(m){return m.state===Io.TEXT_EDIT}));return p||y}},{key:"selectElements",get:function(){var p=new Map;return this.nodes.forEach((function(y){y.isSelected&&p.set(y.id,y)})),this.edges.forEach((function(y){y.isSelected&&p.set(y.id,y)})),p}},{key:"selectNodes",get:function(){var p=[];return this.nodes.forEach((function(y){y.isSelected&&p.push(y)})),p}},{key:"getAreaElement",value:function(p,y){var m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=arguments.length>4&&arguments[4]!==void 0&&arguments[4],N=[],U=[];this.nodes.forEach((function(ue){return U.push(ue)})),this.edges.forEach((function(ue){return U.push(ue)}));for(var H=0;H<U.length;H++){var oe=U[H];A&&!oe.visible||!this.isElementInArea(oe,p,y,m,_)||N.push(oe)}return N}},{key:"getModel",value:function(p){return this.modelMap.get(p)}},{key:"getNodeModelById",value:function(p){var y;return this.fakerNode&&p===this.fakerNode.id?this.fakerNode:(y=this.nodesMap[p])===null||y===void 0?void 0:y.model}},{key:"getPointByClient",value:function(p){var y=p.x,m=p.y,_=this.rootEl.getBoundingClientRect(),A={x:y-_.left,y:m-_.top},N=Wf(this.transformModel.HtmlPointToCanvasPoint([A.x,A.y]),2);return{domOverlayPosition:A,canvasOverlayPosition:{x:N[0],y:N[1]}}}},{key:"isElementInArea",value:function(p,y,m){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(p.BaseType===ei.NODE){for(var N=gi(p=p),U=N.minX,H=N.minY,oe=N.maxX,ue=N.maxY,Ce=[{x:U,y:H},{x:oe,y:H},{x:oe,y:ue},{x:U,y:ue}],Ve=A,qe=0;qe<Ce.length;qe++){var Ot=Ce[qe],xt=Ot.x,Ft=Ot.y,hn=this.transformModel.CanvasPointToHtmlPoint([xt,Ft]),Hn=Wf(hn,2);if(xt=Hn[0],Ft=Hn[1],gd([xt,Ft],y,m)!==A){Ve=!A;break}}return Ve}if(p.BaseType===ei.EDGE){var zn=p=p,Ar=zn.startPoint,Vn=zn.endPoint,vr=this.transformModel.CanvasPointToHtmlPoint([Ar.x,Ar.y]),er=this.transformModel.CanvasPointToHtmlPoint([Vn.x,Vn.y]),Eo=gd(vr,y,m),Co=gd(er,y,m);return _?Eo&&Co:Eo||Co}return!1}},{key:"graphDataToModel",value:function(p){var y=this;if(this.width&&this.height||this.resize(),!p)return this.nodes=[],void(this.edges=[]);p.nodes?this.nodes=Ep(p.nodes,(function(m){return y.getModelAfterSnapToGrid(m)})):this.nodes=[],p.edges?this.edges=Ep(p.edges,(function(m){var _=y.getModel(m.type);if(!_)throw new Error("找不到".concat(m.type,"对应的边。"));return new _(m,y)})):this.edges=[]}},{key:"modelToGraphData",value:function(){var p=[];this.edges.forEach((function(m){var _=m.getData();_&&!m.virtual&&p.push(_)}));var y=[];return this.nodes.forEach((function(m){var _=m.getData();_&&!m.virtual&&y.push(_)})),{nodes:y,edges:p}}},{key:"modelToHistoryData",value:function(){for(var p=!1,y=[],m=0;m<this.nodes.length;m++){var _=this.nodes[m];if(_.isDragging){p=!0;break}y.push(_.getHistoryData())}if(p)return!1;for(var A=!1,N=[],U=0;U<this.edges.length;U++){var H=this.edges[U];if(H.isDragging){A=!0;break}N.push(H.getHistoryData())}return!A&&{nodes:y,edges:N}}},{key:"getEdgeModelById",value:function(p){var y;return(y=this.edgesMap[p])===null||y===void 0?void 0:y.model}},{key:"getElement",value:function(p){return this.modelsMap[p]}},{key:"getNodeEdges",value:function(p){for(var y=[],m=0;m<this.edges.length;m++){var _=this.edges[m],A=this.edges[m].sourceNodeId===p,N=this.edges[m].targetNodeId===p;(A||N)&&y.push(_)}return y}},{key:"getSelectElements",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=this.selectElements,m={nodes:[],edges:[]};return y.forEach((function(_){if(_.BaseType===ei.NODE&&m.nodes.push(_.getData()),_.BaseType===ei.EDGE){var A=_.getData(),N=y.get(A.sourceNodeId)&&y.get(A.targetNodeId);(p||N)&&m.edges.push(A)}})),m}},{key:"updateAttributes",value:function(p,y){this.getElement(p).updateAttributes(y)}},{key:"changeNodeId",value:function(p,y){return y||(y=tl()),this.nodesMap[y]?"":this.nodesMap[p]?(this.edges.forEach((function(m){m.sourceNodeId===p&&(m.sourceNodeId=y),m.targetNodeId===p&&(m.targetNodeId=y)})),this.nodesMap[p].model.id=y,this.nodesMap[y]=this.nodesMap[p],y):""}},{key:"changeEdgeId",value:function(p,y){return y||(y=tl()),this.edgesMap[y]?"":this.edgesMap[p]?(this.edges.forEach((function(m){m.id===p&&m.changeEdgeId(y)})),y):""}},{key:"setFakerNode",value:function(p){this.fakerNode=p}},{key:"removeFakerNode",value:function(){this.fakerNode=null}},{key:"setModel",value:function(p,y){return this.modelMap.set(p,y)}},{key:"toFront",value:function(p){var y,m,_,A=((y=this.nodesMap[p])===null||y===void 0?void 0:y.model)||((m=this.edgesMap[p])===null||m===void 0?void 0:m.model);A&&(this.overlapMode===Ei.DEFAULT&&((_=this.topElement)===null||_===void 0||_.setZIndex(),A.setZIndex(9999),this.topElement=A),this.overlapMode===Ei.INCREASE&&this.setElementZIndex(p,"top"))}},{key:"setElementZIndex",value:function(p,y){var m,_,A,N=((m=this.nodesMap[p])===null||m===void 0?void 0:m.model)||((_=this.edgesMap[p])===null||_===void 0?void 0:_.model);N&&(typeof y=="number"&&(A=y),y==="top"&&(A=Tc()),y==="bottom"&&(A=--jf),N.setZIndex(A))}},{key:"deleteNode",value:function(p){var y=this.nodesMap[p].model.getData();this.deleteEdgeBySource(p),this.deleteEdgeByTarget(p),this.nodes.splice(this.nodesMap[p].index,1),this.eventCenter.emit(ur.NODE_DELETE,{data:y})}},{key:"addNode",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,m=arguments.length>2?arguments[2]:void 0,_=ma(p);_.id&&this.nodesMap[p.id]&&delete _.id;var A=this.getModelAfterSnapToGrid(_);this.nodes.push(A);var N=A.getData(),U={data:N};return m&&(U.e=m),this.eventCenter.emit(y,U),A}},{key:"getModelAfterSnapToGrid",value:function(p){var y=this.getModel(p.type);if(!y)throw new Error("找不到".concat(p.type,"对应的节点,请确认是否已注册此类型节点。"));var m=p.x,_=p.y;return m&&_&&(p.x=fs(m,this.gridSize),p.y=fs(_,this.gridSize),pb(p.text)==="object"&&(p.text.x+=p.x-m,p.text.y+=p.y-_)),new y(p,this)}},{key:"cloneNode",value:function(p){var y=this.getNodeModelById(p),m=y.getData();m.x+=30,m.y+=30,delete m.id,m.text&&(m.text.x+=30,m.text.y+=30);var _=this.addNode(m);return _.setSelected(!0),y.setSelected(!1),_.getData()}},{key:"moveNode",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.getMoveDistance(y,m,_),H=Wf(U,2);y=H[0],m=H[1],this.moveEdge(p,y,m)}}},{key:"moveNode2Coordinate",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.x,H=N.y,oe=y-U,ue=m-H;this.moveNode(p,oe,ue,_)}}},{key:"editText",value:function(p){this.setElementStateById(p,Io.TEXT_EDIT)}},{key:"addEdge",value:function(p){var y=ma(p),m=y.type;m||(m=this.edgeType),y.id&&this.edgesMap[y.id]&&delete y.id;var _=this.getModel(m);if(!_)throw new Error("找不到".concat(m,"对应的边,请确认是否已注册此类型边。"));var A=new _(Vf(Vf({},y),{},{type:m}),this),N=A.getData();return this.edges.push(A),this.eventCenter.emit(ur.EDGE_ADD,{data:N}),A}},{key:"moveEdge",value:function(p,y,m){for(var _=0;_<this.edges.length;_++){var A=this.edges[_],N=A.textPosition,U=N.x,H=N.y,oe=this.edges[_].sourceNodeId===p,ue=this.edges[_].targetNodeId===p;oe&&A.moveStartPoint(y,m),ue&&A.moveEndPoint(y,m),(oe||ue)&&this.handleEdgeTextMove(A,U,H)}}},{key:"handleEdgeTextMove",value:function(p,y,m){var _;if(p.customTextPosition===!0)p.resetTextPosition();else if(p.modelType===lo.POLYLINE_EDGE&&(_=p.text)!==null&&_!==void 0&&_.value){var A=p.text,N=co(A,p.points);p.moveText(N.x-A.x,N.y-A.y)}else{var U=p.textPosition,H=U.x,oe=U.y;p.moveText(H-y,oe-m)}}},{key:"deleteEdgeBySourceAndTarget",value:function(p,y){for(var m=0;m<this.edges.length;m++)if(this.edges[m].sourceNodeId===p&&this.edges[m].targetNodeId===y){var _=this.edges[m].getData();this.edges.splice(m,1),m--,this.eventCenter.emit(ur.EDGE_DELETE,{data:_})}}},{key:"deleteEdgeById",value:function(p){if(this.edgesMap[p]){var y=this.edgesMap[p].index,m=this.edgesMap[p].model.getData();this.edges.splice(y,1),this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeBySource",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].sourceNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeByTarget",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].targetNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"setElementStateById",value:function(p,y,m){this.nodes.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)})),this.edges.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)}))}},{key:"updateText",value:function(p,y){this.nodes.forEach((function(m){m.id===p&&m.updateText(y)})),this.edges.forEach((function(m){m.id===p&&m.updateText(y)}))}},{key:"selectNodeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.nodesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectEdgeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.edgesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectElementById",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0&&arguments[1];y||this.clearSelectElements();var m=this.getElement(p);m==null||m.setSelected(!0)}},{key:"clearSelectElements",value:function(){var p;this.selectElements.forEach((function(y){y==null||y.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Ei.DEFAULT&&((p=this.topElement)===null||p===void 0||p.setZIndex())}},{key:"moveNodes",value:function(p,y,m){for(var _=this,A=arguments.length>3&&arguments[3]!==void 0&&arguments[3],N=p.reduce((function(zn,Ar){var Vn=_.nodesMap[Ar].model.getMoveDistance(y,m,A);return zn[Ar]=Vn,zn}),{}),U=0;U<this.edges.length;U++){var H=this.edges[U],oe=H.textPosition,ue=oe.x,Ce=oe.y,Ve=N[H.sourceNodeId],qe=N[H.targetNodeId],Ot=void 0,xt=void 0;if(Ve&&qe&&H.modelType===lo.POLYLINE_EDGE){var Ft=Wf(Ve,2);Ot=Ft[0],xt=Ft[1],H.updatePointsList(Ot,xt)}else{if(Ve){var hn=Wf(Ve,2);Ot=hn[0],xt=hn[1],H.moveStartPoint(Ot,xt)}if(qe){var Hn=Wf(qe,2);Ot=Hn[0],xt=Hn[1],H.moveEndPoint(Ot,xt)}}(Ve||qe)&&this.handleEdgeTextMove(H,ue,Ce)}}},{key:"addNodeMoveRules",value:function(p){this.nodeMoveRules.includes(p)||this.nodeMoveRules.push(p)}},{key:"setDefaultEdgeType",value:function(p){this.edgeType=p}},{key:"changeNodeType",value:function(p,y){var m=this.getNodeModelById(p);if(m){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));var N=new A(_,this);this.nodes.splice(this.nodesMap[p].index,1,N),this.getNodeEdges(p).forEach((function(U){if(U.sourceNodeId===p){var H=Rf(N,U.startPoint,N.width,N.height);U.updateStartPoint(H)}if(U.targetNodeId===p){var oe=Rf(N,U.endPoint,N.width,N.height);U.updateEndPoint(oe)}}))}}},{key:"changeEdgeType",value:function(p,y){var m=this.getEdgeModelById(p);if(m&&m.type!==y){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));delete _.pointsList;var N=new A(_,this);this.edges.splice(this.edgesMap[p].index,1,N)}}},{key:"getNodeIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetNodeId===p&&y.push(m)})),y}},{key:"getNodeOutgoingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceNodeId===p&&y.push(m)})),y}},{key:"getAnchorIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetAnchorId===p&&y.push(m)})),y}},{key:"getAnchorOutcomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceAnchorId===p&&y.push(m)})),y}},{key:"getNodeIncomingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.targetNodeId===p&&m.push(y.nodesMap[_.sourceNodeId].model)})),m}},{key:"getNodeOutgoingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.sourceNodeId===p&&m.push(y.nodesMap[_.targetNodeId].model)})),m}},{key:"setTheme",value:function(p){this.theme=iu(Vf(Vf({},this.theme),p))}},{key:"resize",value:function(p,y){this.width=p||this.rootEl.getBoundingClientRect().width,this.height=y||this.rootEl.getBoundingClientRect().height,!this.width||this.height}},{key:"clearData",value:function(){this.nodes=[],this.edges=[]}},{key:"getVirtualRectSize",value:function(){var p=this.nodes,y=[],m=[];p.forEach((function(oe){var ue=oe.x,Ce=oe.y,Ve=oe.width,qe=oe.height,Ot=oe.getNodeStyle().strokeWidth,xt=Ot===void 0?0:Ot,Ft=ue+Ve/2+xt,hn=ue-Ve/2-xt,Hn=Ce+qe/2+xt,zn=Ce-qe/2-xt;y=y.concat([Ft,hn].filter((function(Ar){return!Number.isNaN(Ar)}))),m=m.concat([Hn,zn].filter((function(Ar){return!Number.isNaN(Ar)})))}));var _=Math.min.apply(Math,Rc(y)),A=Math.max.apply(Math,Rc(y)),N=Math.min.apply(Math,Rc(m)),U=A-_||0,H=Math.max.apply(Math,Rc(m))-N||0;return{virtualRectWidth:U,virtualRectHeight:H,virtualRectCenterPositionX:_+U/2,virtualRectCenterPositionY:N+H/2}}},{key:"translateCenter",value:function(){var p=this.nodes,y=this.width,m=this.height,_=this.rootEl,A=this.transformModel;if(p.length){var N=y||_.clientWidth,U=m||_.clientHeight,H=this.getVirtualRectSize(),oe=H.virtualRectCenterPositionX,ue=H.virtualRectCenterPositionY;A.focusOn(oe,ue,N,U)}}},{key:"fitView",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,m=this.nodes,_=this.width,A=this.height,N=this.rootEl,U=this.transformModel;if(m.length){var H=_||N.clientWidth,oe=A||N.clientHeight,ue=this.getVirtualRectSize(),Ce=ue.virtualRectWidth,Ve=ue.virtualRectHeight,qe=ue.virtualRectCenterPositionX,Ot=ue.virtualRectCenterPositionY,xt=(Ce+y)/H,Ft=(Ve+p)/oe,hn=0;hn=1/Math.max(xt,Ft);var Hn=[H/2,oe/2];U.zoom(hn,Hn),U.focusOn(qe,Ot,H,oe)}}},{key:"openEdgeAnimation",value:function(p){this.getEdgeModelById(p).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(p){this.getEdgeModelById(p).closeEdgeAnimation()}}],d&&h5(u.prototype,d),c})(),Yr=Tr(at.prototype,"width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ao=Tr(at.prototype,"height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mr=Tr(at.prototype,"edgeType",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ur=Tr(at.prototype,"nodes",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),xa=Tr(at.prototype,"edges",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hl=Tr(at.prototype,"overlapMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Ei.DEFAULT}}),uu=Tr(at.prototype,"background",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oa=Tr(at.prototype,"transformModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Iu=Tr(at.prototype,"editConfigModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pc=Tr(at.prototype,"gridSize",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Qp=Tr(at.prototype,"partial",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yv=Tr(at.prototype,"fakerNode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr(at.prototype,"nodesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"nodesMap"),at.prototype),Tr(at.prototype,"edgesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"edgesMap"),at.prototype),Tr(at.prototype,"modelsMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"modelsMap"),at.prototype),Tr(at.prototype,"sortElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"sortElements"),at.prototype),Tr(at.prototype,"textEditElement",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"textEditElement"),at.prototype),Tr(at.prototype,"selectElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectElements"),at.prototype),Tr(at.prototype,"selectNodes",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectNodes"),at.prototype),Tr(at.prototype,"setFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setFakerNode"),at.prototype),Tr(at.prototype,"removeFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"removeFakerNode"),at.prototype),Tr(at.prototype,"setModel",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setModel"),at.prototype),Tr(at.prototype,"toFront",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"toFront"),at.prototype),Tr(at.prototype,"setElementZIndex",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementZIndex"),at.prototype),Tr(at.prototype,"deleteNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteNode"),at.prototype),Tr(at.prototype,"addNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addNode"),at.prototype),Tr(at.prototype,"cloneNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"cloneNode"),at.prototype),Tr(at.prototype,"moveNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode"),at.prototype),Tr(at.prototype,"moveNode2Coordinate",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode2Coordinate"),at.prototype),Tr(at.prototype,"editText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"editText"),at.prototype),Tr(at.prototype,"addEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addEdge"),at.prototype),Tr(at.prototype,"moveEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveEdge"),at.prototype),Tr(at.prototype,"deleteEdgeBySourceAndTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySourceAndTarget"),at.prototype),Tr(at.prototype,"deleteEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeById"),at.prototype),Tr(at.prototype,"deleteEdgeBySource",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySource"),at.prototype),Tr(at.prototype,"deleteEdgeByTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeByTarget"),at.prototype),Tr(at.prototype,"setElementStateById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementStateById"),at.prototype),Tr(at.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"updateText"),at.prototype),Tr(at.prototype,"selectNodeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectNodeById"),at.prototype),Tr(at.prototype,"selectEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectEdgeById"),at.prototype),Tr(at.prototype,"selectElementById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectElementById"),at.prototype),Tr(at.prototype,"clearSelectElements",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearSelectElements"),at.prototype),Tr(at.prototype,"moveNodes",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNodes"),at.prototype),Tr(at.prototype,"setDefaultEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setDefaultEdgeType"),at.prototype),Tr(at.prototype,"changeNodeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeNodeType"),at.prototype),Tr(at.prototype,"changeEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeEdgeType"),at.prototype),Tr(at.prototype,"getNodeIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingEdge"),at.prototype),Tr(at.prototype,"getNodeOutgoingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingEdge"),at.prototype),Tr(at.prototype,"getAnchorIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorIncomingEdge"),at.prototype),Tr(at.prototype,"getAnchorOutcomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorOutcomingEdge"),at.prototype),Tr(at.prototype,"getNodeIncomingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingNode"),at.prototype),Tr(at.prototype,"getNodeOutgoingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingNode"),at.prototype),Tr(at.prototype,"setTheme",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setTheme"),at.prototype),Tr(at.prototype,"resize",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"resize"),at.prototype),Tr(at.prototype,"clearData",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearData"),at.prototype),Tr(at.prototype,"translateCenter",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"translateCenter"),at.prototype),Tr(at.prototype,"fitView",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"fitView"),at.prototype),Tr(at.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"openEdgeAnimation"),at.prototype),Tr(at.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"closeEdgeAnimation"),at.prototype),at),v5=lT;function gE(c){return gE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},gE(c)}function yE(){return yE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},yE.apply(this,arguments)}function m5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function _E(c,u){return _E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},_E(c,u)}function g5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=hb(c);if(u){var y=hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return y5(this,d)}}function y5(c,u){if(u&&(gE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ad(c)}function Ad(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function hb(c){return hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},hb(c)}function Gf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var sT,_5=Fc(iT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&_E(m,_)})(y,c);var u,d,p=g5(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Gf(Ad(_=p.call(this)),"stepDrag",void 0),Gf(Ad(_),"stepScrollX",0),Gf(Ad(_),"stepScrollY",0),Gf(Ad(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY;_.setState({isDragging:!0});var Ce=_.props.graphModel,Ve=Ce.transformModel;Ce.editConfigModel.stopMoveGraph!==!0&&Ve.translate(oe,ue)})),Gf(Ad(_),"onDragEnd",(function(){_.setState({isDragging:!1})})),Gf(Ad(_),"zoomHandler",(function(H){var oe=_.props,ue=oe.graphModel,Ce=ue.editConfigModel,Ve=ue.transformModel,qe=ue.gridSize,Ot=oe.graphModel,xt=H.deltaX,Ft=H.deltaY;if(Ce.stopScrollGraph||H.ctrlKey===!0){if(!Ce.stopZoomGraph){H.preventDefault();var hn=Ot.getPointByClient({x:H.clientX,y:H.clientY}).canvasOverlayPosition,Hn=hn.x,zn=hn.y;Ve.zoom(H.deltaY<0,[Hn,zn])}}else{if(H.preventDefault(),_.stepScrollX+=xt,_.stepScrollY+=Ft,Math.abs(_.stepScrollX)>=qe){var Ar=_.stepScrollX%qe,Vn=_.stepScrollX-Ar;Ve.translate(-Vn*Ve.SCALE_X,0),_.stepScrollX=Ar}if(Math.abs(_.stepScrollY)>=qe){var vr=_.stepScrollY%qe,er=_.stepScrollY-vr;Ve.translate(0,-er*Ve.SCALE_Y),_.stepScrollY=vr}}})),Gf(Ad(_),"clickHandler",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){var oe=_.props.graphModel;oe.selectElements.size>0&&oe.clearSelectElements(),oe.eventCenter.emit(ur.BLANK_CLICK,{e:H})}})),Gf(Ad(_),"handleContextMenu",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){H.preventDefault();var oe=_.props.graphModel,ue=oe.getPointByClient({x:H.clientX,y:H.clientY});oe.eventCenter.emit(ur.BLANK_CONTEXTMENU,{e:H,position:ue})}})),Gf(Ad(_),"mouseDownHandler",(function(H){var oe=_.props.graphModel,ue=oe.eventCenter,Ce=oe.editConfigModel,Ve=oe.transformModel.SCALE_X,qe=oe.gridSize,Ot=H.target,xt=!Ce.adjustEdge&&!Ce.adjustNodePosition;(Ot.getAttribute("name")==="canvas-overlay"||xt)&&(Ce.stopMoveGraph!==!0?(_.stepDrag.setStep(qe*Ve),_.stepDrag.handleMouseDown(H)):ue.emit(ur.BLANK_MOUSEDOWN,{e:H}),_.clickHandler(H))}));var A=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,onDragEnd:_.onDragEnd,step:N,eventType:"BLANK",isStopPropagation:!1,eventCenter:U,model:null}),_.state={isDragging:!1},_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=this.props,A=_.children,N=_.dnd,U=this.state.isDragging;return Object(re.g)("svg",yE({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:U?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},N.eventMap()),Object(re.g)("g",{transform:m},A))}}])&&m5(u.prototype,d),y})(re.a))||iT;function bE(c){return bE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bE(c)}function b5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function w5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wE(c,u){return wE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wE(c,u)}function E5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=vb(c);if(u){var y=vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return x5(this,d)}}function x5(c,u){if(u&&(bE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function vb(c){return vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},vb(c)}var O5=Fc(sT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&wE(m,_)})(y,c);var u,d,p=E5(y);function y(){return b5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"componentDidMount",value:function(){this.triggerToolRender()}},{key:"componentDidUpdate",value:function(){this.triggerToolRender()}},{key:"getTools",value:function(){var m=this.props,_=m.tool,A=m.graphModel,N=_.getTools().map((function(U){return Object(re.g)(U,{graphModel:A,logicFlow:_.instance})}));return _.components=N,N}},{key:"triggerToolRender",value:function(){var m=this.props,_=m.tool,A=m.graphModel,N=document.querySelector("#ToolOverlay_".concat(A.flowId)),U=_.getInstance();U.components.forEach((function(H){return H(U,N)})),U.components=[]}},{key:"render",value:function(){var m=this.props.graphModel;return Object(re.g)("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(m.flowId)},this.getTools())}}])&&w5(u.prototype,d),y})(re.a))||sT;function EE(c){return EE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},EE(c)}function S5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function A5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function xE(c,u){return xE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},xE(c,u)}function M5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=mb(c);if(u){var y=mb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return T5(this,d)}}function T5(c,u){if(u&&(EE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function mb(c){return mb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},mb(c)}var uT,C5=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&xE(m,_)})(y,c);var u,d,p=M5(y);function y(){return S5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.background;return Object(re.g)("div",{className:"lf-background"},Object(re.g)("div",{style:m,className:"lf-background-area"}))}}])&&A5(u.prototype,d),y})(re.a);function OE(c){return OE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OE(c)}function N5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function k5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function SE(c,u){return SE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},SE(c,u)}function P5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=gb(c);if(u){var y=gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return R5(this,d)}}function R5(c,u){if(u&&(OE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cT(c)}function cT(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function gb(c){return gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},gb(c)}function D5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dT=Fc(uT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&SE(m,_)})(y,c);var u,d,p=P5(y);function y(){var m;N5(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return D5(cT(m=p.call.apply(p,[this].concat(A))),"id",tl()),m}return u=y,(d=[{key:"renderDot",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?2:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(2,U),H/2),Ce=1;return oe||(Ce=0),Object(re.g)("rect",{width:ue,height:ue,rx:ue/2,ry:ue/2,fill:A,opacity:Ce})}},{key:"renderMesh",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?1:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(1,U),H/2),Ce="M ".concat(H," 0 H0 M0 0 V0 ").concat(H),Ve=1;return oe||(Ve=0),Object(re.g)("path",{d:Ce,stroke:A,strokeWidth:ue,opacity:Ve})}},{key:"render",value:function(){var m=this.props,_=m.type,A=m.size,N=m.graphModel.transformModel,U=[N.SCALE_X,N.SKEW_Y,N.SKEW_X,N.SCALE_Y,N.TRANSLATE_X,N.TRANSLATE_Y].join(","),H="matrix(".concat(U,")");return Object(re.g)("div",{className:"lf-grid"},Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%"},Object(re.g)("defs",null,Object(re.g)("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:H,x:"0",y:"0",width:A,height:A},_==="dot"&&this.renderDot(),_==="mesh"&&this.renderMesh())),Object(re.g)("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})))}}])&&k5(u.prototype,d),y})(re.a))||uT;dT.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);function AE(c){return AE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},AE(c)}function j5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return fT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function fT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var pT,Fm=function(c){var u={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(c).forEach((function(d){var p=j5(d,2),y=p[0],m=p[1];(y==="style"||AE(m)!=="object")&&(u[y]=m)})),Object(re.g)("line",u)};function ME(c){return ME=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ME(c)}function hT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function yb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hT(Object(d),!0).forEach((function(p){L5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function L5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function I5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function F5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function TE(c,u){return TE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},TE(c,u)}function B5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=_b(c);if(u){var y=_b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return $5(this,d)}}function $5(c,u){if(u&&(ME(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function _b(c){return _b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},_b(c)}var vT,U5=Fc(pT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&TE(m,_)})(y,c);var u,d,p=B5(y);function y(){return I5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.snaplineModel,_=m.position,A=m.isShowHorizontal,N=m.isShowVertical,U=m.getStyle(),H=_.x,oe=H===void 0?0:H,ue=_.y,Ce=ue===void 0?0:ue,Ve=yb(yb({x1:-1e5,y1:Ce,x2:1e5,y2:Ce},U),{},{stroke:A?U.stroke:"none"}),qe=yb(yb({x1:oe,y1:-1e5,x2:oe,y2:1e5},U),{},{stroke:N?U.stroke:"none"});return Object(re.g)("g",{className:"lf-snapline"},Object(re.g)(Fm,Ve),Object(re.g)(Fm,qe))}}])&&F5(u.prototype,d),y})(re.a))||pT;function CE(c){return CE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CE(c)}function V5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return mT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function mT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function th(c){var u=c.x,d=c.y,p=c.width,y=c.height,m=c.className,_=c.radius,A=u-p/2,N=d-y/2,U={};return Object.entries(c).forEach((function(H){var oe=V5(H,2),ue=oe[0],Ce=oe[1];CE(Ce)!=="object"&&(U[ue]=Ce)})),U.className=m?"lf-basic-shape ".concat(m):"lf-basic-shape",_&&(U.rx=_,U.ry=_),U.x=A,U.y=N,Object(re.g)("rect",U)}function NE(c){return NE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},NE(c)}function Bm(){return Bm=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Bm.apply(this,arguments)}function gT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function yT(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gT(Object(d),!0).forEach((function(p){W5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function W5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function G5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function z5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kE(c,u){return kE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kE(c,u)}function H5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=bb(c);if(u){var y=bb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return X5(this,d)}}function X5(c,u){if(u&&(NE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function bb(c){return bb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},bb(c)}th.defaultProps={className:"",radius:""};var _T,Y5=Fc(vT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&kE(m,_)})(y,c);var u,d,p=H5(y);function y(){return G5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getNodesOutline",value:function(){var m=this.props.graphModel,_=m.nodes,A=m.editConfigModel,N=A.hoverOutline,U=A.nodeSelectedOutline,H=[];return _.forEach((function(oe){if(oe.isHovered||oe.isSelected){var ue=oe.isHovered,Ce=oe.isSelected,Ve=oe.x,qe=oe.y,Ot=oe.width,xt=oe.height;if(U&&Ce||N&&ue){var Ft=oe.getOutlineStyle(),hn={};if(Object.keys(Ft).forEach((function(zn){zn!=="hover"&&(hn[zn]=Ft[zn])})),ue){var Hn=Ft.hover;hn=yT(yT({},hn),Hn)}H.push(Object(re.g)(th,Bm({transform:oe.transform,className:"lf-outline-node",x:Ve,y:qe,width:Ot+10,height:xt+10},hn)))}}})),H}},{key:"getEdgeOutline",value:function(){for(var m=this.props.graphModel,_=m.edges,A=m.editConfigModel,N=A.edgeSelectedOutline,U=A.hoverOutline,H=[],oe=0;oe<_.length;oe++){var ue=_[oe];(N&&ue.isSelected||U&&ue.isHovered)&&(ue.modelType===lo.LINE_EDGE?H.push(this.getLineOutline(ue)):ue.modelType===lo.POLYLINE_EDGE?H.push(this.getPolylineOutline(ue)):ue.modelType===lo.BEZIER_EDGE&&H.push(this.getBezierOutline(ue)))}return H}},{key:"getLineOutline",value:function(m){var _=m.startPoint,A=m.endPoint,N=(_.x+A.x)/2,U=(_.y+A.y)/2,H=Math.abs(_.x-A.x)+10,oe=Math.abs(_.y-A.y)+10,ue=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline-edge",x:N,y:U,width:H,height:oe},ue))}},{key:"getPolylineOutline",value:function(m){var _=m.points,A=jr(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"getBezierOutline",value:function(m){var _=m.path,A=di(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&z5(u.prototype,d),y})(re.a))||vT;function PE(c){return PE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},PE(c)}function q5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return bT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return bT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function bT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function $m(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.r,_=m===void 0?4:m,A=c.className,N={cx:d,cy:y,r:_,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(U){var H=q5(U,2),oe=H[0],ue=H[1];PE(ue)!=="object"&&(N[oe]=ue)})),N.className=A?"lf-basic-shape ".concat(A):"lf-basic-shape",Object(re.g)("circle",N)}function RE(c){return RE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RE(c)}function K5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return wT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return wT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function xy(){return xy=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},xy.apply(this,arguments)}function ET(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function xT(c,u,d){return u&&Z5(c.prototype,u),c}function OT(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&DE(c,u)}function DE(c,u){return DE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DE(c,u)}function ST(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Eb(c);if(u){var y=Eb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return J5(this,d)}}function J5(c,u){if(u&&(RE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wb(c)}function wb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Eb(c){return Eb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Eb(c)}function jE(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var AT,MT=(function(c){OT(d,c);var u=ST(d);function d(){var p;return ET(this,d),jE(wb(p=u.call(this)),"dragHandler",void 0),jE(wb(p),"onDragging",(function(y){var m=y.event,_=p.props,A=_.graphModel,N=_.bezierModel,U=_.type,H=A.getPointByClient({x:m.clientX,y:m.clientY}).canvasOverlayPosition,oe=H.x,ue=H.y;N.updateAdjustAnchor({x:oe,y:ue},U),A.eventCenter.emit(ur.EDGE_ADJUST,{data:N.getData()})})),jE(wb(p),"onDragEnd",(function(){p.props.bezierModel.isDragging=!1})),p.dragHandler=new Te({onDragging:p.onDragging,onDragEnd:p.onDragEnd}),p}return xT(d,[{key:"render",value:function(){var p=this,y=this.props.position,m=y.x,_=y.y,A=this.props.bezierModel.getEdgeStyle().adjustAnchor;return Object(re.g)($m,xy({className:"lf-bezier-adjust-anchor",x:m,y:_},A,{onMouseDown:function(N){p.dragHandler.handleMouseDown(N)}}))}}]),d})(re.a),Q5=Fc(_T=(function(c){OT(d,c);var u=ST(d);function d(){return ET(this,d),u.apply(this,arguments)}return xT(d,[{key:"getBezierAdjust",value:function(p,y){var m=p.path,_=p.id,A=K5(di(m),4),N=A[0],U=A[1],H=A[2],oe=A[3],ue=p.getEdgeStyle().adjustLine,Ce=[];return Ce.push(Object(re.g)(Fm,xy({x1:N.x,y1:N.y,x2:U.x,y2:U.y},ue))),Ce.push(Object(re.g)(MT,{position:U,bezierModel:p,graphModel:y,key:"".concat(_,"_ePre"),type:"sNext"})),Ce.push(Object(re.g)(Fm,xy({x1:oe.x,y1:oe.y,x2:H.x,y2:H.y},ue))),Ce.push(Object(re.g)(MT,{position:H,bezierModel:p,graphModel:y,key:"".concat(_,"_sNext"),type:"ePre"})),Ce}},{key:"selectedBezierEdge",value:function(){for(var p=this.props.graphModel,y=p.edges,m=[],_=0;_<y.length;_++){var A=y[_];A.isSelected&&A.modelType===lo.BEZIER_EDGE&&A.draggable&&m.push(this.getBezierAdjust(A,p))}return m}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-bezier-adjust"},this.selectedBezierEdge())}}]),d})(re.a))||_T;function LE(c){return LE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LE(c)}function e6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function t6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IE(c,u){return IE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IE(c,u)}function n6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=xb(c);if(u){var y=xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return r6(this,d)}}function r6(c,u){if(u&&(LE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function xb(c){return xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},xb(c)}var TT,o6=Fc(AT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&IE(m,_)})(y,c);var u,d,p=n6(y);function y(){return e6(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=this.props.children;return Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay"},Object(re.g)("g",{transform:m},_))}}])&&t6(u.prototype,d),y})(re.a))||AT;function FE(c){return FE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},FE(c)}function BE(){return BE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},BE.apply(this,arguments)}function i6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function a6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $E(c,u){return $E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},$E(c,u)}function l6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ob(c);if(u){var y=Ob(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return s6(this,d)}}function s6(c,u){if(u&&(FE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ob(c){return Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ob(c)}var u6=Fc(TT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&$E(m,_)})(y,c);var u,d,p=l6(y);function y(){return i6(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getComponent",value:function(m,_){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"canvas-overlay",N=this.props.getView,U=N(m.type);return Object(re.g)(U,{key:m.id,model:m,graphModel:_,overlay:A})}},{key:"render",value:function(){var m=this,_=this.props,A=_.graphModel,N=_.tool,U=_.options,H=_.dnd,oe=_.snaplineModel,ue={};U.width&&(ue.width="".concat(A.width,"px")),U.height&&(ue.height="".concat(A.height,"px"));var Ce=U.grid,Ve=A.fakerNode,qe=A.editConfigModel.adjustEdge;return Object(re.g)("div",{className:"lf-graph","flow-id":A.flowId,style:ue},Object(re.g)(_5,{graphModel:A,dnd:H},Object(re.g)("g",{className:"lf-base"},Ep(A.sortElements,(function(Ot){return m.getComponent(Ot,A)}))),Ve?this.getComponent(Ve,A):""),Object(re.g)(o6,{graphModel:A},Object(re.g)(Y5,{graphModel:A}),qe?Object(re.g)(Q5,{graphModel:A}):"",U.snapline!==!1?Object(re.g)(U5,{snaplineModel:oe}):""),Object(re.g)(O5,{graphModel:A,tool:N}),U.background&&Object(re.g)(C5,{background:U.background}),U.grid&&Object(re.g)(dT,BE({},Ce,{graphModel:A})))}}],d&&a6(u.prototype,d),y})(re.a))||TT,c6=u6;function CT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Sb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?CT(Object(d),!0).forEach((function(p){zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):CT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function d6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var f6=(function(){function c(p){var y=this;(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),zf(this,"nodeConfig",void 0),zf(this,"lf",void 0),zf(this,"fakerNode",void 0),zf(this,"stopDrag",(function(){y.nodeConfig=null,window.document.removeEventListener("mouseup",y.stopDrag)})),zf(this,"dragEnter",(function(_){y.nodeConfig&&!y.fakerNode&&(y.fakerNode=y.lf.createFakerNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY}))))})),zf(this,"onDragOver",(function(_){if(_.preventDefault(),y.fakerNode){var A=y.clientToLocalPoint({x:_.clientX,y:_.clientY}),N=A.x,U=A.y;y.fakerNode.moveTo(N,U);var H=y.fakerNode.getData();y.lf.setNodeSnapLine(H),y.lf.graphModel.eventCenter.emit(ur.NODE_DND_DRAG,{data:H})}return!1})),zf(this,"onDragLeave",(function(){y.fakerNode&&(y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)})),zf(this,"onDrop",(function(_){y.lf.graphModel&&_&&y.nodeConfig&&(y.lf.addNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY})),ur.NODE_DND_ADD,_),_.preventDefault(),_.stopPropagation(),y.nodeConfig=null,y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)}));var m=p.lf;this.lf=m}var u,d;return u=c,(d=[{key:"clientToLocalPoint",value:function(p){var y=p.x,m=p.y,_=uc(this.lf.options,["grid","size"]),A=this.lf.graphModel.getPointByClient({x:y,y:m}).canvasOverlayPosition,N=A.x,U=A.y;return{x:fs(N,_),y:fs(U,_)}}},{key:"startDrag",value:function(p){var y=this.lf.graphModel.editConfigModel;y!=null&&y.isSilentMode||(this.nodeConfig=p,window.document.addEventListener("mouseup",this.stopDrag))}},{key:"eventMap",value:function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}}}])&&d6(u.prototype,d),c})();function NT(c){var u=c.container,d=c.grid,p=c.width,y=c.height;if(!u)throw new Error("请检查 container 参数是否有效");if(typeof p=="string"||typeof y=="string")throw new Error("width或height不支持传入字符串,请传数字");return d&&(c.grid=bc({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},d)),bc({},PT,c)}var Zo,kT,PT={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function UE(c){return UE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},UE(c)}function VE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return RT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return RT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function RT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function DT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ab(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?DT(Object(d),!0).forEach((function(p){jT(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):DT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function p6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function h6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function v6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Oy(){return Oy=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=m6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Oy.apply(this,arguments)}function m6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=nh(c))!==null;);return c}function WE(c,u){return WE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},WE(c,u)}function g6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=nh(c);if(u){var y=nh(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return y6(this,d)}}function y6(c,u){if(u&&(UE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mb(c)}function Mb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function nh(c){return nh=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nh(c)}function jT(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function jc(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var GE=(Zo=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&WE(m,_)})(y,c);var u,d,p=g6(y);function y(){var m;h6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return jT(Mb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.BEZIER_EDGE),p6(Mb(m),"path",kT,Mb(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=100,Oy(nh(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.bezier;return Ab(Ab({},Oy(nh(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){if(this.pointsList&&this.pointsList.length>0){var m=0,_=0;return this.pointsList.forEach((function(A){var N=A.x,U=A.y;m+=N,_+=U})),{x:m/this.pointsList.length,y:_/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}},{key:"getData",value:function(){var m=Oy(nh(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Ab(Ab({},m),{},{pointsList:_})}},{key:"getControls",value:function(){var m=this.startPoint,_=this.endPoint;return zi({start:m,end:_,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})}},{key:"getPath",value:function(m){var _=VE(m,4),A=_[0],N=_[1],U=_[2],H=_[3];return"M ".concat(A.x," ").concat(A.y,`
|
||
C `).concat(N.x," ").concat(N.y,`,
|
||
`).concat(U.x," ").concat(U.y,`,
|
||
`).concat(H.x," ").concat(H.y)}},{key:"initPoints",value:function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()}},{key:"updatePoints",value:function(){var m=this.getControls(),_=m.sNext,A=m.ePre;this.updatePath(_,A)}},{key:"updatePath",value:function(m,_){m=Uo(m),_=Uo(_);var A={x:this.startPoint.x,y:this.startPoint.y},N={x:this.endPoint.x,y:this.endPoint.y};if(!m||!_){var U=this.getControls();m=U.sNext,_=U.ePre}this.pointsList=[A,m,_,N],this.path=this.getPath(this.pointsList)}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_;var A=VE(this.pointsList,3),N=A[1],U=A[2];N.x+=m,N.y+=_,this.updatePath(N,U)}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_;var A=VE(this.pointsList,3),N=A[1],U=A[2];U.x+=m,U.y+=_,this.updatePath(N,U)}},{key:"updateAdjustAnchor",value:function(m,_){_==="sNext"?this.pointsList[1]=m:_==="ePre"&&(this.pointsList[2]=m),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=zi({start:_,end:A,sourceNode:N,targetNode:U,offset:this.offset}),oe=H.sNext,ue=H.ePre;this.pointsList=[_,oe,ue,A],this.initPoints()}}])&&v6(u.prototype,d),y})(If),kT=jc(Zo.prototype,"path",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),jc(Zo.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"initPoints"),Zo.prototype),jc(Zo.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updatePoints"),Zo.prototype),jc(Zo.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateStartPoint"),Zo.prototype),jc(Zo.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateEndPoint"),Zo.prototype),jc(Zo.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveStartPoint"),Zo.prototype),jc(Zo.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveEndPoint"),Zo.prototype),jc(Zo.prototype,"updateAdjustAnchor",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAdjustAnchor"),Zo.prototype),jc(Zo.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustStart"),Zo.prototype),jc(Zo.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustEnd"),Zo.prototype),jc(Zo.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAfterAdjustStartAndEnd"),Zo.prototype),Zo),Dn,LT,IT,FT,BT,$T,UT,VT,WT,GT,zT,HT,XT,YT,qT,KT,ZT,JT,QT,eC,tC,nC,rC,_6=function(c){return c==null};function b6(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||oC(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function zE(c){return zE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zE(c)}function oC(c,u){if(c){if(typeof c=="string")return iC(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?iC(c,u):void 0}}function iC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function aC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function ys(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?aC(Object(d),!0).forEach((function(p){Us(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):aC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Sa(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function w6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Us(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function fo(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Hf,lC,Xf=(Dn=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),Us(this,"id",""),Sa(this,"type",LT,this),Sa(this,"x",IT,this),Sa(this,"y",FT,this),Sa(this,"text",BT,this),Sa(this,"properties",$T,this),Sa(this,"_width",UT,this),Sa(this,"_height",VT,this),Sa(this,"anchorsOffset",WT,this),Sa(this,"isSelected",GT,this),Sa(this,"isHovered",zT,this),Sa(this,"isShowAnchor",HT,this),Sa(this,"isDragging",XT,this),Sa(this,"isHitable",YT,this),Sa(this,"draggable",qT,this),Sa(this,"visible",KT,this),Sa(this,"enableRotate",ZT,this),Us(this,"virtual",!1),Us(this,"graphModel",void 0),Sa(this,"zIndex",JT,this),Sa(this,"state",QT,this),Sa(this,"autoToFront",eC,this),Sa(this,"style",tC,this),Sa(this,"transform",nC,this),Sa(this,"_rotate",rC,this),Us(this,"BaseType",ei.NODE),Us(this,"modelType",lo.NODE),Us(this,"additionStateData",void 0),Us(this,"targetRules",[]),Us(this,"sourceRules",[]),Us(this,"moveRules",[]),Us(this,"hasSetTargetRules",!1),Us(this,"hasSetSourceRules",!1),this.graphModel=y,this.initNodeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"width",get:function(){return this._width},set:function(p){this._width=p}},{key:"height",get:function(){return this._height},set:function(p){this._height=p}},{key:"rotate",get:function(){return this._rotate},set:function(p){this._rotate=p;var y=this.x,m=y===void 0?0:y,_=this.y,A=_===void 0?0:_;this.transform=new eh(-m,-A).rotate(p).translate(m,A).toString()}},{key:"incoming",get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}}},{key:"outgoing",get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}}},{key:"initNodeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,m=y&&y(p.type),_=this.createId();p.id=_||m||tl()}this.formatText(p),Pa(this,(function(A){return cs(A,["id","type","x","y","text","properties","virtual","rotate"])})(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc())}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"formatText",value:function(p){p.text||(p.text={value:"",x:p.x,y:p.y,draggable:!1,editable:!0}),p.text&&typeof p.text=="string"?p.text={value:p.text,x:p.x,y:p.y,draggable:!1,editable:!0}:p.text&&p.text.editable===void 0&&(p.text.editable=!0)}},{key:"getData",value:function(){var p=this.text,y=p.x,m=p.y,_=p.value,A=this.properties;Object(a.x)(A)&&(A=Object(a.I)(A));var N={id:this.id,type:this.type,x:this.x,y:this.y,properties:A};return this.rotate&&(N.rotate=this.rotate),this.graphModel.overlapMode===Ei.INCREASE&&(N.zIndex=this.zIndex),_&&(N.text={x:y,y:m,value:_}),N}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getOuterGAttributes",value:function(){return{className:""}}},{key:"getNodeStyle",value:function(){return ys(ys({},this.graphModel.theme.baseNode),this.style)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.nodeText;return Uo(p)}},{key:"getRotateControlStyle",value:function(){var p=this.graphModel.theme.rotateControl;return Uo(p)}},{key:"getAnchorStyle",value:function(p){var y=this.graphModel.theme.anchor;return Uo(y)}},{key:"getAnchorLineStyle",value:function(p){var y=this.graphModel.theme.anchorLine;return Uo(y)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"isAllowConnectedAsSource",value:function(p,y,m,_){var A=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,this,p,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"getConnectedSourceRules",value:function(){return this.sourceRules}},{key:"isAllowConnectedAsTarget",value:function(p,y,m,_){var A=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,p,this,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"isAllowMoveNode",value:function(p,y){var m,_=!0,A=!0,N=(function(oe,ue){var Ce=typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(!Ce){if(Array.isArray(oe)||(Ce=oC(oe))||ue){Ce&&(oe=Ce);var Ve=0,qe=function(){};return{s:qe,n:function(){return Ve>=oe.length?{done:!0}:{done:!1,value:oe[Ve++]}},e:function(hn){throw hn},f:qe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ot,xt=!0,Ft=!1;return{s:function(){Ce=Ce.call(oe)},n:function(){var hn=Ce.next();return xt=hn.done,hn},e:function(hn){Ft=!0,Ot=hn},f:function(){try{xt||Ce.return==null||Ce.return()}finally{if(Ft)throw Ot}}}})(this.moveRules.concat(this.graphModel.nodeMoveRules));try{for(N.s();!(m=N.n()).done;){var U=(0,m.value)(this,p,y);if(!U)return!1;if(zE(U)==="object"){var H=U;if(H.x===!1&&H.y===!1)return!1;_=_&&H.x,A=A&&H.y}}}catch(oe){N.e(oe)}finally{N.f()}return{x:_,y:A}}},{key:"getConnectedTargetRules",value:function(){return this.targetRules}},{key:"getAnchorsByOffset",value:function(){var p=this.anchorsOffset,y=this.id,m=this.x,_=this.y;return p&&p.length>0?p.map((function(A,N){return A.length?(A=A,{id:"".concat(y,"_").concat(N),x:m+A[0],y:_+A[1]}):ys(ys({},A=A),{},{x:m+A.x,y:_+A.y,id:A.id||"".concat(y,"_").concat(N)})})):this.getDefaultAnchor()}},{key:"getDefaultAnchor",value:function(){return[]}},{key:"getTargetAnchor",value:function(p){return(function(y,m){for(var _,A=Yp(m),N=Number.MAX_SAFE_INTEGER,U=0;U<A.length;U++){var H=ms(y.x,y.y,A[U].x,A[U].y);H<N&&(N=H,_={index:U,anchor:Fs(Fs({},A[U]),{},{x:A[U].x,y:A[U].y,id:A[U].id})})}return _})(p,this)}},{key:"getBounds",value:function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}}},{key:"anchors",get:function(){var p=this.getAnchorsByOffset(),y=this.x,m=this.y,_=this.rotate;return p.forEach((function(A){var N=A.x,U=A.y,H=b6(new Fu([N,U,1]).translate(-y,-m).rotate(_).translate(y,m)[0],2),oe=H[0],ue=H[1];A.x=oe,A.y=ue})),p}},{key:"getAnchorInfo",value:function(p){if(!_6(p))for(var y=0;y<this.anchors.length;y++){var m=this.anchors[y];if(m.id===p)return m}}},{key:"addNodeMoveRules",value:function(p){this.moveRules.includes(p)||this.moveRules.push(p)}},{key:"move",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1;if(m)_=!0,A=!0;else{var N=this.isAllowMoveNode(p,y);typeof N=="boolean"?(_=N,A=N):(_=N.x,A=N.y)}if(_){var U=this.x+p;this.x=U,this.text&&this.moveText(p,0)}if(A){var H=this.y+y;this.y=H,this.text&&this.moveText(0,y)}return _||A}},{key:"getMoveDistance",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1,N=0,U=0;if(m)_=!0,A=!0;else{var H=this.isAllowMoveNode(p,y);typeof H=="boolean"?(_=H,A=H):(_=H.x,A=H.y)}if(_&&p){var oe=this.x+p;this.x=oe,this.text&&this.moveText(p,0),N=p}if(A&&y){var ue=this.y+y;this.y=ue,this.text&&this.moveText(0,y),U=y}return[N,U]}},{key:"moveTo",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=p-this.x,A=y-this.y;return!(!m&&!this.isAllowMoveNode(_,A)||(this.text&&this.text&&this.moveText(_,A),this.x=p,this.y=y,0))}},{key:"moveText",value:function(p,y){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,editable:H,draggable:U,x:_+p,y:A+y}}},{key:"updateText",value:function(p){this.text=ys(ys({},Object(a.I)(this.text)),{},{value:p})}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p,this.setIsShowAnchor(p)}},{key:"setIsShowAnchor",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isShowAnchor=p}},{key:"setEnableRotate",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.enableRotate=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"setProperty",value:function(p,y){this.properties=ys(ys({},Object(a.I)(this.properties)),{},Us({},p,ma(y))),this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=ys(ys({},Object(a.I)(this.properties)),ma(p)),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setStyle",value:function(p,y){this.style=ys(ys({},this.style),{},Us({},p,ma(y)))}},{key:"setStyles",value:function(p){this.style=ys(ys({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=ys({},ma(p))}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.zIndex=p}},{key:"updateAttributes",value:function(p){Pa(this,p)}}],d&&w6(u.prototype,d),c})(),LT=fo(Dn.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IT=fo(Dn.prototype,"x",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),FT=fo(Dn.prototype,"y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),BT=fo(Dn.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),$T=fo(Dn.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),UT=fo(Dn.prototype,"_width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),VT=fo(Dn.prototype,"_height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),WT=fo(Dn.prototype,"anchorsOffset",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),GT=fo(Dn.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zT=fo(Dn.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),HT=fo(Dn.prototype,"isShowAnchor",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),XT=fo(Dn.prototype,"isDragging",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),YT=fo(Dn.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),qT=fo(Dn.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),KT=fo(Dn.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),ZT=fo(Dn.prototype,"enableRotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),JT=fo(Dn.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),QT=fo(Dn.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),eC=fo(Dn.prototype,"autoToFront",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),tC=fo(Dn.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),nC=fo(Dn.prototype,"transform",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rC=fo(Dn.prototype,"_rotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),fo(Dn.prototype,"incoming",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"incoming"),Dn.prototype),fo(Dn.prototype,"outgoing",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"outgoing"),Dn.prototype),fo(Dn.prototype,"addNodeMoveRules",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"addNodeMoveRules"),Dn.prototype),fo(Dn.prototype,"move",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"move"),Dn.prototype),fo(Dn.prototype,"getMoveDistance",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"getMoveDistance"),Dn.prototype),fo(Dn.prototype,"moveTo",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveTo"),Dn.prototype),fo(Dn.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveText"),Dn.prototype),fo(Dn.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateText"),Dn.prototype),fo(Dn.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setSelected"),Dn.prototype),fo(Dn.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHovered"),Dn.prototype),fo(Dn.prototype,"setIsShowAnchor",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setIsShowAnchor"),Dn.prototype),fo(Dn.prototype,"setEnableRotate",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setEnableRotate"),Dn.prototype),fo(Dn.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHitable"),Dn.prototype),fo(Dn.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setElementState"),Dn.prototype),fo(Dn.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperty"),Dn.prototype),fo(Dn.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperties"),Dn.prototype),fo(Dn.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"deleteProperty"),Dn.prototype),fo(Dn.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyle"),Dn.prototype),fo(Dn.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyles"),Dn.prototype),fo(Dn.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateStyles"),Dn.prototype),fo(Dn.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setZIndex"),Dn.prototype),fo(Dn.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateAttributes"),Dn.prototype),Dn);function HE(c){return HE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},HE(c)}function sC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function uC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?sC(Object(d),!0).forEach((function(p){cC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):sC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function E6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function x6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function O6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function XE(){return XE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=S6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},XE.apply(this,arguments)}function S6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Um(c))!==null;);return c}function YE(c,u){return YE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},YE(c,u)}function A6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Um(c);if(u){var y=Um(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return M6(this,d)}}function M6(c,u){if(u&&(HE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tb(c)}function Tb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Um(c){return Um=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Um(c)}function cC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function qE(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Xl,dC,fC,KE=(Hf=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&YE(m,_)})(y,c);var u,d,p=A6(y);function y(){var m;x6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return cC(Tb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.CIRCLE_NODE),E6(Tb(m),"r",lC,Tb(m)),m}return u=y,(d=[{key:"width",get:function(){return 2*this.r}},{key:"height",get:function(){return 2*this.r}},{key:"getNodeStyle",value:function(){var m=XE(Um(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.circle;return uC(uC({},m),Uo(_))}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.r;return[{x:m,y:_-A,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+A,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&O6(u.prototype,d),y})(Xf),lC=qE(Hf.prototype,"r",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),qE(Hf.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"width"),Hf.prototype),qE(Hf.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"height"),Hf.prototype),Hf);r(129);function ZE(c){return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ZE(c)}function JE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return pC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function hC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function vC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hC(Object(d),!0).forEach((function(p){gC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function mC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function T6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function C6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function QE(){return QE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=N6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},QE.apply(this,arguments)}function N6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Wm(c))!==null;);return c}function ex(c,u){return ex=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ex(c,u)}function k6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Wm(c);if(u){var y=Wm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return P6(this,d)}}function P6(c,u){if(u&&(ZE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vm(c)}function Vm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Wm(c){return Wm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wm(c)}function gC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Gm(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Md,yC,_C,tx=(Xl=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ex(m,_)})(y,c);var u,d,p=k6(y);function y(){var m;T6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return gC(Vm(m=p.call.apply(p,[this].concat(A))),"modelType",lo.DIAMOND_NODE),mC(Vm(m),"rx",dC,Vm(m)),mC(Vm(m),"ry",fC,Vm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=QE(Wm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.diamond;return vC(vC({},m),Uo(_))}},{key:"points",get:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[[m,_-N],[m+A,_],[m,_+N],[m-A,_]]}},{key:"pointsPosition",get:function(){return this.points.map((function(m){return{x:m[0],y:m[1]}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this;return this.points.map((function(_,A){var N=JE(_,2);return{x:N[0],y:N[1],id:"".concat(m.id,"_").concat(A)}}))}}])&&C6(u.prototype,d),y})(Xf),dC=Gm(Xl.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),fC=Gm(Xl.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Gm(Xl.prototype,"points",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"points"),Xl.prototype),Gm(Xl.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"pointsPosition"),Xl.prototype),Gm(Xl.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"width"),Xl.prototype),Gm(Xl.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"height"),Xl.prototype),Xl);function nx(c){return nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},nx(c)}function bC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function wC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bC(Object(d),!0).forEach((function(p){xC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function EC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function R6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function D6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function rx(){return rx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=j6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},rx.apply(this,arguments)}function j6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Hm(c))!==null;);return c}function ox(c,u){return ox=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ox(c,u)}function L6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hm(c);if(u){var y=Hm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return I6(this,d)}}function I6(c,u){if(u&&(nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zm(c)}function zm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Hm(c){return Hm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hm(c)}function xC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Cb(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var $u,OC,ix=(Md=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ox(m,_)})(y,c);var u,d,p=L6(y);function y(){var m;R6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return xC(zm(m=p.call.apply(p,[this].concat(A))),"modelType",lo.ELLIPSE_NODE),EC(zm(m),"rx",yC,zm(m)),EC(zm(m),"ry",_C,zm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=rx(Hm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.ellipse;return wC(wC({},m),Uo(_))}},{key:"width",get:function(){return 2*this.rx}},{key:"height",get:function(){return 2*this.ry}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[{x:m,y:_-N,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&D6(u.prototype,d),y})(Xf),yC=Cb(Md.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),_C=Cb(Md.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),Cb(Md.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"width"),Md.prototype),Cb(Md.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"height"),Md.prototype),Md);function ax(c){return ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ax(c)}function lx(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return SC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return SC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function SC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function AC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function MC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?AC(Object(d),!0).forEach((function(p){TC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):AC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function F6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function B6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function $6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sx(){return sx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=U6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},sx.apply(this,arguments)}function U6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Xm(c))!==null;);return c}function ux(c,u){return ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ux(c,u)}function V6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xm(c);if(u){var y=Xm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return W6(this,d)}}function W6(c,u){if(u&&(ax(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nb(c)}function Nb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xm(c){return Xm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xm(c)}function TC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function kb(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var cx,CC,dx=($u=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ux(m,_)})(y,c);var u,d,p=V6(y);function y(){var m;B6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return TC(Nb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYGON_NODE),F6(Nb(m),"points",OC,Nb(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=sx(Xm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.polygon;return MC(MC({},m),Uo(_))}},{key:"pointsPosition",get:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return this.points.map((function(U){return{x:U[0]+m-A/2,y:U[1]+_-N/2}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this,_=this.x,A=this.y,N=this.width,U=this.height;return this.points.map((function(H,oe){var ue=lx(H,2),Ce=ue[0],Ve=ue[1];return{x:_+Ce-N/2,y:A+Ve-U/2,id:"".concat(m.id,"_").concat(oe)}}))}}])&&$6(u.prototype,d),y})(Xf),OC=kb($u.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),kb($u.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"pointsPosition"),$u.prototype),kb($u.prototype,"width",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"width"),$u.prototype),kb($u.prototype,"height",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"height"),$u.prototype),$u);function fx(c){return fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},fx(c)}function NC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function kC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?NC(Object(d),!0).forEach((function(p){PC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):NC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function G6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function z6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function H6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function px(){return px=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=X6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},px.apply(this,arguments)}function X6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Ym(c))!==null;);return c}function hx(c,u){return hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hx(c,u)}function Y6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ym(c);if(u){var y=Ym(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return q6(this,d)}}function q6(c,u){if(u&&(fx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pb(c)}function Pb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ym(c){return Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ym(c)}function PC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var rh,vx=(cx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hx(m,_)})(y,c);var u,d,p=Y6(y);function y(){var m;z6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return PC(Pb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.RECT_NODE),G6(Pb(m),"radius",CC,Pb(m)),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}},{key:"getNodeStyle",value:function(){var m=px(Ym(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.rect;return kC(kC({},m),Uo(_))}}])&&H6(u.prototype,d),y})(Xf),CC=(function(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m})(cx.prototype,"radius",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),cx);function mx(c){return mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},mx(c)}function RC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function DC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?RC(Object(d),!0).forEach((function(p){LC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function K6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function gx(){return gx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=J6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},gx.apply(this,arguments)}function J6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=qm(c))!==null;);return c}function yx(c,u){return yx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yx(c,u)}function Q6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qm(c);if(u){var y=qm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return eF(this,d)}}function eF(c,u){if(u&&(mx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jC(c)}function jC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qm(c){return qm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qm(c)}function LC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function IC(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var _x=(rh=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yx(m,_)})(y,c);var u,d,p=Q6(y);function y(){var m;K6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return LC(jC(m=p.call.apply(p,[this].concat(A))),"modelType",lo.TEXT_NODE),m}return u=y,(d=[{key:"getTextStyle",value:function(){var m=gx(qm(y.prototype),"getTextStyle",this).call(this),_=this.graphModel.theme.text;return DC(DC({},m),Uo(_))}},{key:"width",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Mc({rows:m,fontSize:_,rowsLength:m.length}).width}},{key:"height",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Mc({rows:m,fontSize:_,rowsLength:m.length}).height}}])&&Z6(u.prototype,d),y})(Xf),IC(rh.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"width"),rh.prototype),IC(rh.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"height"),rh.prototype),rh);function bx(c){return bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bx(c)}function tF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function nF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wx(c,u){return wx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wx(c,u)}function rF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Rb(c);if(u){var y=Rb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return oF(this,d)}}function oF(c,u){if(u&&(bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FC(c)}function FC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Rb(c){return Rb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Rb(c)}function iF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Lc,BC,$C,UC,Ex=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&wx(m,_)})(y,c);var u,d,p=rF(y);function y(){var m;tF(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return iF(FC(m=p.call.apply(p,[this].concat(A))),"modelType",lo.HTML_NODE),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}}])&&nF(u.prototype,d),y})(Xf);function VC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xx(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function aF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function WC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Sy(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var GC=(Lc=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),WC(this,"graphModel",void 0),xx(this,"isShowHorizontal",BC,this),xx(this,"isShowVertical",$C,this),xx(this,"position",UC,this),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=p}var u,d;return u=c,d=[{key:"getStyle",value:function(){return(function(p){for(var y=1;y<arguments.length;y++){var m=arguments[y]!=null?arguments[y]:{};y%2?VC(Object(m),!0).forEach((function(_){WC(p,_,m[_])})):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):VC(Object(m)).forEach((function(_){Object.defineProperty(p,_,Object.getOwnPropertyDescriptor(m,_))}))}return p})({},this.graphModel.theme.snapline)}},{key:"getCenterSnapLine",value:function(p,y){for(var m=p.x,_=p.y,A=!1,N=!1,U=0;U<y.length;U++){var H=y[U];if(H.id!==p.id&&(m===H.x&&(A=!0),_===H.y&&(N=!0),A&&N))break}return{isShowVertical:A,isShowHorizontal:N,position:{x:m,y:_}}}},{key:"getHorizontalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minY===_.minY||Ce.maxY===_.minY){A=!0,m=_.minY;break}if(Ce.minY===_.maxY||Ce.maxY===_.maxY){A=!0,m=_.maxY;break}}}return Pa({isShowHorizontal:A,position:{y:m}})}},{key:"getVerticalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minX===_.minX||Ce.maxX===_.minX){A=!0,m=_.minX;break}if(Ce.minX===_.maxX||Ce.maxX===_.maxX){A=!0,m=_.maxX;break}}}return Pa({isShowVertical:A,position:{x:m}})}},{key:"getSnapLinePosition",value:function(p,y){var m=this.getCenterSnapLine(p,y),_=m.isShowHorizontal,A=m.isShowVertical;if(!_){var N=this.getHorizontalSnapline(p,y);N.isShowHorizontal&&(m.isShowHorizontal=N.isShowHorizontal,m.position.y=N.position.y)}if(!A){var U=this.getVerticalSnapline(p,y);U.isShowVertical&&(m.isShowVertical=U.isShowVertical,m.position.x=U.position.x)}return m}},{key:"setSnaplineInfo",value:function(p){var y=p.isShowHorizontal,m=p.isShowVertical,_=p.position;this.position=_,this.isShowHorizontal=y,this.isShowVertical=m}},{key:"clearSnapline",value:function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1}},{key:"setNodeSnapLine",value:function(p){var y=this.graphModel.nodes,m=this.getSnapLinePosition(p,y);this.setSnaplineInfo(m)}}],d&&aF(u.prototype,d),c})(),BC=Sy(Lc.prototype,"isShowHorizontal",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$C=Sy(Lc.prototype,"isShowVertical",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),UC=Sy(Lc.prototype,"position",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sy(Lc.prototype,"clearSnapline",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"clearSnapline"),Lc.prototype),Sy(Lc.prototype,"setNodeSnapLine",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"setNodeSnapLine"),Lc.prototype),Lc),Ay=new Map,zC=function(c){var u=tl(),d=window.requestAnimationFrame((function p(){if(c(),Ay.get(u)){var y=window.requestAnimationFrame(p);Ay.set(u,y)}}));return Ay.set(u,d),u},Db=function(c){var u=Ay.get(c);u&&(window.cancelAnimationFrame(u),Ay.delete(c))};function Ox(c){return Ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ox(c)}function My(){return My=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},My.apply(this,arguments)}function HC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ty(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?HC(Object(d),!0).forEach((function(p){Cd(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):HC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function lF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return XC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return XC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function XC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function sF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Sx(c,u){return Sx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Sx(c,u)}function uF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=jb(c);if(u){var y=jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return cF(this,d)}}function cF(c,u){if(u&&(Ox(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Td(c)}function Td(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function jb(c){return jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},jb(c)}function Cd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Sx(m,_)})(y,c);var u,d,p=uF(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Cd(Td(m=p.call(this)),"preTargetNode",void 0),Cd(Td(m),"sourceRuleResults",void 0),Cd(Td(m),"targetRuleResults",void 0),Cd(Td(m),"dragHandler",void 0),Cd(Td(m),"t",void 0),Cd(Td(m),"onDragStart",(function(_){var A=_.event,N=m.props,U=N.anchorData,H=N.nodeModel,oe=N.graphModel;oe.overlapMode,oe.selectNodeById(H.id),H.autoToFront&&oe.toFront(H.id),oe.eventCenter.emit(ur.ANCHOR_DRAGSTART,{data:U,e:A,nodeModel:H}),m.setState({startX:U.x,startY:U.y,endX:U.x,endY:U.y})})),Cd(Td(m),"onDragging",(function(_){var A=_.event,N=m.props,U=N.graphModel,H=N.nodeModel,oe=N.anchorData,ue=U.transformModel,Ce=U.eventCenter,Ve=U.width,qe=U.height,Ot=U.editConfigModel,xt=Ot.autoExpand,Ft=Ot.stopMoveGraph,hn=A.clientX,Hn=A.clientY,zn=U.getPointByClient({x:hn,y:Hn}),Ar=zn.domOverlayPosition,Vn=Ar.x,vr=Ar.y,er=zn.canvasOverlayPosition,Eo=er.x,Co=er.y;m.t&&Db(m.t);var zr=[];Vn<10?zr=[10,0]:Vn+10>Ve?zr=[-10,0]:vr<10?zr=[0,10]:vr+10>qe&&(zr=[0,-10]),m.setState({endX:Eo,endY:Co,dragging:!0}),m.moveAnchorEnd(Eo,Co),zr.length>0&&!Ft&&xt&&(m.t=zC((function(){var Fo=lF(zr,2),ga=Fo[0],ya=Fo[1];ue.translate(ga,ya);var Nl=m.state,fu=Nl.endX,pu=Nl.endY;m.setState({endX:fu-ga,endY:pu-ya}),m.moveAnchorEnd(fu-ga,pu-ya)}))),Ce.emit(ur.ANCHOR_DRAG,{data:oe,e:A,nodeModel:H})})),Cd(Td(m),"onDragEnd",(function(_){var A=_.event;m.t&&Db(m.t);var N=m.checkEnd(A);m.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),m.sourceRuleResults.clear(),m.targetRuleResults.clear();var U=m.props,H=U.graphModel,oe=U.nodeModel,ue=U.anchorData;H.eventCenter.emit(ur.ANCHOR_DRAGEND,{data:ue,e:A,nodeModel:oe,edgeModel:N})})),Cd(Td(m),"checkEnd",(function(_){var A=m.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=H.x,ue=H.y,Ce=H.id,Ve=(N.edgeType,m.state),qe=Ve.endX,Ot=Ve.endY,xt=Ve.dragging,Ft=Cf({x:qe,y:Ot},N);if(m.preTargetNode&&m.preTargetNode.state!==Io.DEFAULT&&m.preTargetNode.setElementState(Io.DEFAULT),xt&&Ft&&Ft.node){var hn=Ft.node,Hn=Ft.anchor.id,zn="".concat(U.id,"_").concat(hn.id,"_").concat(Hn,"_").concat(Ce),Ar=m.sourceRuleResults.get(zn)||{},Vn=Ar.isAllPass,vr=Ar.msg,er=m.targetRuleResults.get(zn)||{},Eo=er.isAllPass,Co=er.msg;if(Vn&&Eo){hn.setElementState(Io.DEFAULT);var zr=N.edgeGenerator(U.getData(),N.getNodeModelById(Ft.node.id).getData()),Fo=N.addEdge(Ty(Ty({},zr),{},{sourceNodeId:U.id,sourceAnchorId:Ce,startPoint:{x:oe,y:ue},targetNodeId:Ft.node.id,targetAnchorId:Ft.anchor.id,endPoint:{x:Ft.anchor.x,y:Ft.anchor.y}})),ga=m.props.anchorData;return N.eventCenter.emit(ur.ANCHOR_DROP,{data:ga,e:_,nodeModel:U,edgeModel:Fo}),Fo}var ya=hn.getData();return N.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:ya,msg:Co||vr||"不允许添加连线"}),null}})),m.sourceRuleResults=new Map,m.targetRuleResults=new Map,m.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},m.dragHandler=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd}),m}return u=y,(d=[{key:"getAnchorShape",value:function(){var m=this.props,_=m.anchorData,A=m.style,N=m.node.getAnchorShape(_);if(N)return N;var U=_.x,H=_.y,oe=Ty(Ty({},A),A.hover);return Object(re.g)("g",null,Object(re.g)($m,My({className:"lf-node-anchor-hover"},oe,{x:U,y:H})),Object(re.g)($m,My({className:"lf-node-anchor"},A,{x:U,y:H})))}},{key:"customTrajectory",get:function(){return this.props.graphModel.customTrajectory}},{key:"relateEdges",get:function(){var m=this.props,_=m.graphModel,A=_.getAnchorIncomingEdge,N=_.getAnchorOutcomingEdge,U=m.anchorData.id;return{incomingEdgeList:A(U),outcomingEdgeList:N(U)}}},{key:"moveAnchorEnd",value:function(m,_){var A=this.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=Cf({x:m,y:_},N);if(oe){var ue=oe.node,Ce=oe.anchor.id;if(this.preTargetNode&&this.preTargetNode!==oe.node&&this.preTargetNode.setElementState(Io.DEFAULT),H.id===Ce)return;this.preTargetNode=ue;var Ve="".concat(U.id,"_").concat(ue.id,"_").concat(Ce,"_").concat(H.id);if(!this.targetRuleResults.has(Ve)){var qe=oe.anchor,Ot=U.isAllowConnectedAsSource(ue,H,qe),xt=ue.isAllowConnectedAsTarget(U,H,qe);this.sourceRuleResults.set(Ve,au(Ot)),this.targetRuleResults.set(Ve,au(xt))}var Ft=this.sourceRuleResults.get(Ve).isAllPass,hn=this.targetRuleResults.get(Ve).isAllPass;Ft&&hn?ue.setElementState(Io.ALLOW_CONNECT):ue.setElementState(Io.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Io.DEFAULT&&this.preTargetNode.setElementState(Io.DEFAULT)}},{key:"isShowLine",value:function(){var m=this.state,_=m.startX,A=m.startY,N=m.endX,U=m.endY;return ms(_,A,N,U)>10}},{key:"render",value:function(){var m=this,_=this.state,A=_.startX,N=_.startY,U=_.endX,H=_.endY,oe=this.props,ue=oe.anchorData.edgeAddable,Ce=oe.edgeStyle;return Object(re.g)("g",{className:"lf-anchor"},Object(re.g)("g",{onMouseDown:function(Ve){ue!==!1&&m.dragHandler.handleMouseDown(Ve)}},this.getAnchorShape()),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Ty({sourcePoint:{x:A,y:N},targetPoint:{x:U,y:H}},Ce)):Object(re.g)(Fm,My({x1:A,y1:N,x2:U,y2:H},Ce,{"pointer-events":"none"}))))}}])&&sF(u.prototype,d),y})(re.a);function YC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function fF(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?YC(Object(d),!0).forEach((function(p){pF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):YC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function pF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ax(c){return Ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ax(c)}function hF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return qC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return qC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function qC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function KC(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.value,_=c.fontSize,A=c.fill,N=A===void 0?"currentColor":A,U=c.overflowMode,H=U===void 0?"default":U,oe=c.textWidth,ue=oe===void 0?"":oe,Ce=c.model,Ve={textAnchor:"middle","dominant-baseline":"middle",x:d,y,fill:N};if(Object.entries(c).forEach((function(Hn){var zn=hF(Hn,2),Ar=zn[0],Vn=zn[1];Ax(Vn)!=="object"&&(Ve[Ar]=Vn)})),m){var qe=String(m).split(/[\r\n]/g),Ot=qe.length;if(H!=="default"){var xt=Ce.BaseType,Ft=Ce.modelType;if(xt===ei.NODE&&Ft!==lo.TEXT_NODE||xt===ei.EDGE&&ue)return(function(Hn){var zn=Hn.value,Ar=Hn.fontSize,Vn=Hn.model,vr=Hn.fontFamily,er=vr===void 0?"":vr,Eo=Hn.lineHeight,Co=Hn.wrapPadding,zr=Co===void 0?"0, 0":Co,Fo=Hn.overflowMode,ga=Hn.x,ya=Hn.y,Nl=Vn.width,fu=Vn.textHeight,pu=Hn.textWidth||Nl,Pd=String(zn).split(/[\r\n]/g),Av=Pd.length,a0=Df({rows:Pd,style:{fontSize:"".concat(Ar,"px"),width:"".concat(pu,"px"),fontFamily:er,lineHeight:Eo,padding:zr},rowsLength:Av,className:"lf-get-text-height"}),Mv=Vn.height>a0?Vn.height:a0;fu&&(Mv=fu);var ah=Fo==="ellipsis";return ah&&(Mv=Ar+2),Object(re.g)("g",null,Object(re.g)("foreignObject",{width:pu,height:Mv,x:ga-pu/2,y:ya-Mv/2},Object(re.g)("div",{className:"lf-node-text-auto-wrap",style:{minHeight:Mv,width:pu,padding:zr}},Object(re.g)("div",{className:ah?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:ah?Pd.join(""):"",style:fF({},Hn)},Pd.map((function(lh){return Object(re.g)("div",{className:"lf-node-text--auto-wrap-inner"},lh)}))))))})(c)}if(Ot>1){var hn=qe.map((function(Hn,zn){var Ar=(zn-(Ot-1)/2)*(_+2);return Object(re.g)("tspan",{className:"lf-text-tspan",x:d,y:y+Ar},Hn)}));return Object(re.g)("text",Ve,hn)}return Object(re.g)("text",Ve,m)}}function Mx(c){return Mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Mx(c)}function Tx(){return Tx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Tx.apply(this,arguments)}function vF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ZC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ZC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ZC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function mF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cx(c,u){return Cx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Cx(c,u)}function gF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Lb(c);if(u){var y=Lb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return yF(this,d)}}function yF(c,u){if(u&&(Mx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oh(c)}function oh(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Lb(c){return Lb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Lb(c)}function Ev(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var JC=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Cx(m,_)})(y,c);var u,d,p=gF(y);function y(m){var _;(function(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")})(this,y),Ev(oh(_=p.call(this)),"dragHandler",void 0),Ev(oh(_),"sumDeltaX",0),Ev(oh(_),"sumDeltaY",0),Ev(oh(_),"stepDrag",void 0),Ev(oh(_),"onDragging",(function(N){var U=N.deltaX,H=N.deltaY,oe=_.props,ue=oe.model,Ce=vF(oe.graphModel.transformModel.fixDeltaXY(U,H),2),Ve=Ce[0],qe=Ce[1];ue.moveText(Ve,qe)})),Ev(oh(_),"dblClickHandler",(function(){_.props.editable&&_.props.model.setElementState(Io.TEXT_EDIT)})),Ev(oh(_),"mouseDownHandle",(function(N){var U=_.props,H=U.draggable,oe=U.model,ue=U.graphModel.editConfigModel.nodeTextDraggable;(H||ue)&&(_.stepDrag.model=oe,_.stepDrag.handleMouseDown(N))})),m.model;var A=m.draggable;return _.stepDrag=new Te({onDragging:_.onDragging,step:1,isStopPropagation:A}),_}return u=y,(d=[{key:"getShape",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.text,U=A.editConfigModel,H=N.value,oe=N.x,ue=N.y,Ce=N.editable,Ve=N.draggable,qe={x:oe,y:ue,className:"",value:H};Ce?qe.className="lf-element-text":Ve||U.nodeTextDraggable?qe.className="lf-text-draggable":qe.className="lf-text-disabled";var Ot=_.getTextStyle();return Object(re.g)(KC,Tx({},qe,Ot,{model:_}))}},{key:"render",value:function(){if(this.props.model.text)return Object(re.g)("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler},this.getShape())}}])&&mF(u.prototype,d),y})(re.a),_F=uc(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,QC=r(130);function Nx(c){return Nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Nx(c)}function kx(){return kx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},kx.apply(this,arguments)}function bF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Px(c,u){return Px=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Px(c,u)}function wF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ib(c);if(u){var y=Ib(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return EF(this,d)}}function EF(c,u){if(u&&(Nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Km(c)}function Km(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ib(c){return Ib=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ib(c)}function Cy(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var xF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Px(m,_)})(y,c);var u,d,p=wF(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),Cy(Km(_=p.call(this,m)),"style",{}),Cy(Km(_),"defaultAngle",void 0),Cy(Km(_),"normal",void 0),Cy(Km(_),"stepperDrag",void 0),Cy(Km(_),"onDragging",(function(A){var N,U=A.event,H=_.props,oe=H.graphModel,ue=H.nodeModel,Ce=H.eventCenter,Ve=oe.selectNodes,qe=ue.x,Ot=ue.y,xt=U.clientX,Ft=U.clientY,hn=oe.getPointByClient({x:xt,y:Ft}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=new ot(Hn-qe,zn-Ot),Vn=((N=_.normal)===null||N===void 0?void 0:N.angle(Ar))-_.defaultAngle,vr=new eh(-qe,-Ot).rotate(Vn).translate(qe,Ot).toString();ue.transform=vr,ue.rotate=Vn;var er=Object(QC.map)(Ve,(function(Co){return Co.id}));er.indexOf(ue.id)===-1&&(er=[ue.id]);var Eo=Object(QC.reduce)(er,(function(Co,zr){var Fo=oe.getNodeModelById(zr);return Co[zr]=Fo==null?void 0:Fo.getMoveDistance(0,0,!1),Co}),{});er.forEach((function(Co){oe.getNodeEdges(Co).forEach((function(zr){if(Eo[zr.sourceNodeId]){var Fo=oe.getNodeModelById(zr.sourceNodeId).anchors.find((function(ya){return ya.id===zr.sourceAnchorId}));zr.updateStartPoint(Fo)}if(Eo[zr.targetNodeId]){var ga=oe.getNodeModelById(zr.targetNodeId).anchors.find((function(ya){return ya.id===zr.targetAnchorId}));zr.updateEndPoint(ga)}}))})),Ce.emit(ur.NODE_ROTATE,{e:U,nodeModel:ue})})),_.style=m.style,_.stepperDrag=new Te({onDragging:_.onDragging}),_}return u=y,(d=[{key:"render",value:function(){var m=this,_=this.props.nodeModel,A=_.x,N=_.y,U=A+_.width/2+20,H=N-_.height/2-20;return this.normal=new ot(1,0),this.defaultAngle=this.normal.angle(new ot(U-A,H-N)),_.defaultAngle=this.defaultAngle,Object(re.g)("g",{className:"lf-rotate-control"},Object(re.g)("g",{onMouseDown:function(oe){m.stepperDrag.handleMouseDown(oe)}},Object(re.g)($m,kx({},this.style,{cx:U,cy:H}))))}}])&&bF(u.prototype,d),y})(re.a);function Rx(c){return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Rx(c)}var OF=["className"];function Fb(){return Fb=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Fb.apply(this,arguments)}function SF(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function Bb(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return eN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return eN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function eN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function tN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dx(c,u){return Dx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Dx(c,u)}function AF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=$b(c);if(u){var y=$b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return MF(this,d)}}function MF(c,u){if(u&&(Rx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rl(c)}function rl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function $b(c){return $b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},$b(c)}function pl(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Yf=(function(c){(function(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&Dx(_,A)})(m,c);var u,d,p,y=AF(m);function m(_){var A;(function(ue,Ce){if(!(ue instanceof Ce))throw new TypeError("Cannot call a class as a function")})(this,m),pl(rl(A=y.call(this)),"t",void 0),pl(rl(A),"moveOffset",void 0),pl(rl(A),"stepDrag",void 0),pl(rl(A),"contextMenuTime",void 0),pl(rl(A),"mouseUpDrag",void 0),pl(rl(A),"startTime",void 0),pl(rl(A),"clickTimer",void 0),pl(rl(A),"modelDisposer",void 0),pl(rl(A),"onDragStart",(function(ue){var Ce=ue.event,Ve=Ce.clientX,qe=Ce.clientY,Ot=A.props,xt=Ot.model,Ft=Ot.graphModel.getPointByClient({x:Ve,y:qe}).canvasOverlayPosition,hn=Ft.x,Hn=Ft.y;A.moveOffset={x:xt.x-hn,y:xt.y-Hn}})),pl(rl(A),"onDragging",(function(ue){var Ce=ue.event,Ve=A.props,qe=Ve.model,Ot=Ve.graphModel,xt=Ot.editConfigModel,Ft=xt.stopMoveGraph,hn=xt.autoExpand,Hn=Ot.transformModel,zn=Ot.selectNodes,Ar=Ot.width,Vn=Ot.height,vr=Ot.gridSize;qe.isDragging=!0;var er=Ce.clientX,Eo=Ce.clientY,Co=Ot.getPointByClient({x:er,y:Eo}).canvasOverlayPosition,zr=Co.x,Fo=Co.y,ga=Bb(Hn.CanvasPointToHtmlPoint([zr,Fo]),2),ya=ga[0],Nl=ga[1];if(zr+=A.moveOffset.x,Fo+=A.moveOffset.y,zr=fs(zr,vr),Fo=fs(Fo,vr),Ar&&Vn){if(!hn||Ft||!(ya<0||Nl<0||ya>Ar||Nl>Vn)){var fu=Bb(Hn.CanvasPointToHtmlPoint([zr-qe.width/2,Fo-qe.height/2]),2),pu=fu[0],Pd=fu[1],Av=Bb(Hn.CanvasPointToHtmlPoint([zr+qe.width/2,Fo+qe.height/2]),2),a0=Av[0],Mv=Av[1],ah=Math.max(vr,20),lh=[];pu<0?lh=[ah,0]:a0>Ot.width?lh=[-ah,0]:Pd<0?lh=[0,ah]:Mv>Ot.height&&(lh=[0,-ah]),A.t&&Db(A.t);var c$=new eh(-zr,-Fo).rotate(qe.rotate).translate(zr,Fo).toString();qe.transform=c$;var l0=zn.map((function(s0){return s0.id}));l0.indexOf(qe.id)===-1&&(l0=[qe.id]),lh.length>0&&!Ft&&hn?A.t=zC((function(){var s0=Bb(lh,2),jN=s0[0],LN=s0[1];Hn.translate(jN,LN);var d$=-jN/Hn.SCALE_X,f$=-LN/Hn.SCALE_X;Ot.moveNodes(l0,d$,f$)})):Ot.moveNodes(l0,zr-qe.x,Fo-qe.y)}}else Ot.moveNode2Coordinate(qe.id,zr,Fo)})),pl(rl(A),"onDragEnd",(function(){A.t&&Db(A.t),A.props.model.isDragging=!1})),pl(rl(A),"handleMouseUp",(function(){var ue=A.props.model;A.mouseUpDrag=ue.isDragging})),pl(rl(A),"handleClick",(function(ue){var Ce=A.mouseUpDrag===!1;if(A.startTime){var Ve=A.props,qe=Ve.model,Ot=Ve.graphModel;if(Ce){var xt={data:qe.getData(),e:ue,position:Ot.getPointByClient({x:ue.clientX,y:ue.clientY}),isSelected:!1,isMultiple:!1},Ft=ue.button===2,hn=ue.detail===2;if(!Ft){var Hn=Ot.editConfigModel,zn=yd(ue,Hn);xt.isMultiple=zn,qe.isSelected&&!hn&&zn?(xt.isSelected=!1,qe.setSelected(!1)):(Ot.selectNodeById(qe.id,zn),xt.isSelected=!0,A.toFront()),hn?(Hn.nodeTextEdit&&qe.text.editable&&(qe.setSelected(!1),Ot.setElementStateById(qe.id,Io.TEXT_EDIT)),Ot.eventCenter.emit(ur.NODE_DBCLICK,xt)):(Ot.eventCenter.emit(ur.ELEMENT_CLICK,xt),Ot.eventCenter.emit(ur.NODE_CLICK,xt))}}}})),pl(rl(A),"handleContextMenu",(function(ue){ue.preventDefault();var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel,Ot=Ve.getData(),xt=qe.getPointByClient({x:ue.clientX,y:ue.clientY});qe.setElementStateById(Ve.id,Io.SHOW_MENU,xt.domOverlayPosition),Ve.isSelected||qe.selectNodeById(Ve.id),qe.eventCenter.emit(ur.NODE_CONTEXTMENU,{data:Ot,e:ue,position:xt}),A.toFront()})),pl(rl(A),"handleMouseDown",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;A.startTime=new Date().getTime(),qe.editConfigModel.adjustNodePosition&&Ve.draggable&&A.stepDrag&&A.stepDrag.handleMouseDown(ue)})),pl(rl(A),"setHoverON",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;if(!Ve.isHovered){var Ot=Ve.getData();Ve.setHovered(!0),qe.eventCenter.emit(ur.NODE_MOUSEENTER,{data:Ot,e:ue})}})),pl(rl(A),"setHoverOFF",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel,Ot=Ve.getData();Ve.isHovered&&(Ve.setHovered(!1),qe.eventCenter.emit(ur.NODE_MOUSELEAVE,{data:Ot,e:ue}))})),pl(rl(A),"onMouseOut",(function(ue){_F&&A.setHoverOFF(ue)}));var N=_.graphModel,U=N.gridSize,H=N.eventCenter,oe=_.model;return A.stepDrag=new Te({onDragStart:A.onDragStart,onDragging:A.onDragging,onDragEnd:A.onDragEnd,step:U,eventType:"NODE",isStopPropagation:!1,eventCenter:H,model:oe}),A.modelDisposer=Object(a.F)((function(){return A.props}),(function(ue){ue&&ue.model&&A.stepDrag.setModel(ue.model)})),A}return u=m,p=[{key:"getModel",value:function(_){return _}}],(d=[{key:"componentWillUnmount",value:function(){this.modelDisposer&&this.modelDisposer()}},{key:"getAnchorShape",value:function(_){return null}},{key:"getAnchors",value:function(){var _=this,A=this.props,N=A.model,U=A.graphModel,H=N.isSelected,oe=N.isHitable,ue=N.isDragging,Ce=N.isShowAnchor;return oe&&(H||Ce)&&!ue?Ep(N.anchors,(function(Ve,qe){var Ot=N.getAnchorLineStyle(Ve),xt=N.getAnchorStyle(Ve);return Object(re.g)(dF,{anchorData:Ve,node:_,style:xt,edgeStyle:Ot,anchorIndex:qe,nodeModel:N,graphModel:U,setHoverOFF:_.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var _=this.props,A=_.model,N=_.graphModel,U=A.isSelected,H=A.isHitable,oe=A.enableRotate,ue=A.isHovered,Ce=A.getRotateControlStyle().style;if(H&&(U||ue)&&oe)return Object(re.g)(xF,{graphModel:N,nodeModel:A,eventCenter:N.eventCenter,style:Ce})}},{key:"getText",value:function(){var _=this.props,A=_.model,N=_.graphModel;if(A.state===Io.TEXT_EDIT)return"";if(A.text){var U=N.editConfigModel,H=!1;return(A.text.draggable||U.nodeTextDraggable)&&(H=!0),Object(re.g)(JC,{editable:U.nodeTextEdit&&A.text.editable,model:A,graphModel:N,draggable:H})}}},{key:"getStateClassName",value:function(){var _=this.props.model,A=_.state,N=_.isDragging,U=_.isSelected,H="lf-node";switch(A){case Io.ALLOW_CONNECT:H+=" lf-node-allow";break;case Io.NOT_ALLOW_CONNECT:H+=" lf-node-not-allow";break;default:H+=" lf-node-default"}return N&&(H+=" lf-isDragging"),U&&(H+=" lf-node-selected"),H}},{key:"toFront",value:function(){var _=this.props,A=_.model,N=_.graphModel;A.autoToFront&&N.toFront(A.id)}},{key:"render",value:function(){var _,A=this.props,N=A.model,U=A.graphModel,H=U.editConfigModel,oe=H.hideAnchors,ue=H.adjustNodePosition,Ce=H.allowRotation,Ve=U.gridSize,qe=U.transformModel.SCALE_X,Ot=N.isHitable,xt=N.draggable,Ft=N.transform,hn=N.getOuterGAttributes(),Hn=hn.className,zn=Hn===void 0?"":Hn,Ar=SF(hn,OF),Vn=Object(re.g)("g",{className:"lf-node-content"},Object(re.g)("g",{transform:Ft},this.getShape(),this.getText(),Ce&&this.getRotateControl()),!oe&&this.getAnchors());return Ot?(ue&&xt&&this.stepDrag.setStep(Ve*qe),_=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},Ar),Vn)):_=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn)},Ar),Vn),_}}])&&tN(u.prototype,d),p&&tN(u,p),m})(re.a);function jx(c){return jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},jx(c)}function Lx(){return Lx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Lx.apply(this,arguments)}function TF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function CF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ix(c,u){return Ix=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ix(c,u)}function NF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ub(c);if(u){var y=Ub(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return kF(this,d)}}function kF(c,u){if(u&&(jx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ub(c){return Ub=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ub(c)}var Fx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ix(m,_)})(y,c);var u,d,p=NF(y);function y(){return TF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(th,Lx({},_,{x:m.x,y:m.y,width:m.width,height:m.height,radius:m.radius}))}}])&&CF(u.prototype,d),y})(Yf);function Bx(c){return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Bx(c)}function $x(){return $x=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},$x.apply(this,arguments)}function PF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function RF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ux(c,u){return Ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ux(c,u)}function DF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Vb(c);if(u){var y=Vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return jF(this,d)}}function jF(c,u){if(u&&(Bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Vb(c){return Vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Vb(c)}var Vx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ux(m,_)})(y,c);var u,d,p=DF(y);function y(){return PF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.r,U=m.getNodeStyle();return Object(re.g)($m,$x({},U,{x:_,y:A,r:N}))}}])&&RF(u.prototype,d),y})(Yf);function Wx(c){return Wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Wx(c)}function LF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return nN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return nN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function nN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function rN(c){var u=c.points,d=c.className,p={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(c).forEach((function(y){var m=LF(y,2),_=m[0],A=m[1];Wx(A)!=="object"&&(p[_]=A)})),p.className=d?"lf-basic-shape ".concat(d):"lf-basic-shape",p.points=u.map((function(y){return y.join(",")})).join(" "),Object(re.g)("polygon",p)}function Gx(c){return Gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Gx(c)}function zx(){return zx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},zx.apply(this,arguments)}function IF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function FF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Hx(c,u){return Hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Hx(c,u)}function BF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Wb(c);if(u){var y=Wb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return $F(this,d)}}function $F(c,u){if(u&&(Gx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Wb(c){return Wb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wb(c)}var Xx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Hx(m,_)})(y,c);var u,d,p=BF(y);function y(){return IF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.width,U=m.height,H=m.points,oe=m.getNodeStyle(),ue={transform:"matrix(1 0 0 1 ".concat(_-N/2," ").concat(A-U/2,")")};return Object(re.g)("g",ue,Object(re.g)(rN,zx({},oe,{points:H,x:_,y:A})))}}])&&FF(u.prototype,d),y})(Yf);function Yx(c){return Yx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Yx(c)}function qx(){return qx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},qx.apply(this,arguments)}function UF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function VF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Kx(c,u){return Kx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Kx(c,u)}function WF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Gb(c);if(u){var y=Gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return GF(this,d)}}function GF(c,u){if(u&&(Yx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Gb(c){return Gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Gb(c)}var Zx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Kx(m,_)})(y,c);var u,d,p=WF(y);function y(){return UF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)("g",null,Object(re.g)(rN,qx({},_,{points:m.points,x:m.x,y:m.y})))}}])&&VF(u.prototype,d),y})(Yf);function Jx(c){return Jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Jx(c)}function zF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return oN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return oN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function oN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function HF(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.rx,_=m===void 0?4:m,A=c.ry,N=A===void 0?4:A,U=c.className,H={cx:d,cy:y,rx:_,ry:N,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(oe){var ue=zF(oe,2),Ce=ue[0],Ve=ue[1];Jx(Ve)!=="object"&&(H[Ce]=Ve)})),H.className=U?"lf-basic-shape ".concat(U):"lf-basic-shape",Object(re.g)("ellipse",H)}function Qx(c){return Qx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Qx(c)}function eO(){return eO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},eO.apply(this,arguments)}function XF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function YF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function tO(c,u){return tO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},tO(c,u)}function qF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=zb(c);if(u){var y=zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return KF(this,d)}}function KF(c,u){if(u&&(Qx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function zb(c){return zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},zb(c)}var nO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&tO(m,_)})(y,c);var u,d,p=qF(y);function y(){return XF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(HF,eO({},_,{x:m.x,y:m.y,rx:m.rx,ry:m.ry}))}}])&&YF(u.prototype,d),y})(Yf);function rO(c){return rO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},rO(c)}function iN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function aN(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?iN(Object(d),!0).forEach((function(p){ZF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):iN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ZF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function JF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function QF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function oO(c,u){return oO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},oO(c,u)}function eB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hb(c);if(u){var y=Hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return tB(this,d)}}function tB(c,u){if(u&&(rO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Hb(c){return Hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hb(c)}var iO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&oO(m,_)})(y,c);var u,d,p=eB(y);function y(){return JF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.width,N=m.height,U=m.x,H=m.y,oe=aN(aN({},_.background),{},{x:U,y:H-1,width:A,height:N});return Object(re.g)(th,oe)}},{key:"getShape",value:function(){return Object(re.g)("g",null,this.getBackground())}}])&&QF(u.prototype,d),y})(Yf);function aO(c){return aO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},aO(c)}function lO(){return lO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},lO.apply(this,arguments)}function nB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function rB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sO(c,u){return sO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},sO(c,u)}function oB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xb(c);if(u){var y=Xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return iB(this,d)}}function iB(c,u){if(u&&(aO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ny(c)}function Ny(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xb(c){return Xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xb(c)}function Yb(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var uO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&sO(m,_)})(y,c);var u,d,p=oB(y);function y(){var m;nB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Yb(Ny(m=p.call.apply(p,[this].concat(A))),"ref",void 0),Yb(Ny(m),"currentProperties",void 0),Yb(Ny(m),"preProperties",void 0),Yb(Ny(m),"setRef",(function(U){m.ref=U})),m}return u=y,(d=[{key:"rootEl",get:function(){return this.ref}},{key:"setHtml",value:function(m){m.appendChild(document.createElement("div"))}},{key:"shouldUpdate",value:function(){if(!this.preProperties||this.preProperties!==this.currentProperties)return this.preProperties=this.currentProperties,!0}},{key:"componentDidMount",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"componentDidUpdate",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.height,U=m.width,H=m.getNodeStyle();return this.currentProperties=JSON.stringify(m.properties),Object(re.g)("foreignObject",lO({},H,{x:_-U/2,y:A-N/2,width:U,height:N,ref:this.setRef}))}}])&&rB(u.prototype,d),y})(Yf);function cO(c){return cO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},cO(c)}function dO(){return dO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},dO.apply(this,arguments)}function lN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xv(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?lN(Object(d),!0).forEach((function(p){hO(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):lN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function aB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function fO(c,u){return fO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},fO(c,u)}function lB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qb(c);if(u){var y=qb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return sB(this,d)}}function sB(c,u){if(u&&(cO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pO(c)}function pO(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qb(c){return qb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qb(c)}function hO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var uB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&fO(m,_)})(y,c);var u,d,p=lB(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),hO(pO(_=p.call(this,m)),"setHoverON",(function(){_.setState({isHovered:!0})})),hO(pO(_),"setHoverOFF",(function(){_.setState({isHovered:!1})})),_.state={isHovered:!1},_}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.text,N=m.width,U=_.background||{};if(this.state.isHovered&&_.hover&&_.hover.background&&(U=xv(xv({},U),_.hover.background)),A&&A.value&&U.fill!=="transparent"){var H,oe=_.fontSize,ue=_.overflowMode,Ce=_.lineHeight,Ve=_.wrapPadding,qe=_.textWidth,Ot=A.value,xt=A.x,Ft=A.y,hn=String(Ot).split(/[\r\n]/g),Hn=hn.length;if(ue==="autoWrap"&&qe){var zn=Df({rows:hn,style:{fontSize:"".concat(oe,"px"),width:"".concat(qe,"px"),lineHeight:Ce,padding:Ve},rowsLength:Hn,className:"lf-get-text-height"});H=xv(xv({},U),{},{x:xt-1,y:Ft-1,width:qe,height:zn})}else{hn&&hn.forEach((function(Eo){Pi(Eo)}));var Ar=Mc({rows:hn,fontSize:oe,rowsLength:Hn}),Vn=Ar.width,vr=Ar.height;if(ue==="ellipsis"&&(Vn=qe||N,vr=oe+2),typeof U.wrapPadding=="string"){var er=U.wrapPadding.split(",").filter((function(Eo){return Eo.trim()})).map((function(Eo){return parseFloat(Eo.trim())}));er.length>0&&er.length<=4&&(er.length===1?er=[er[0],er[0],er[0],er[0]]:er.length===2?er=[er[0],er[1],er[0],er[1]]:er.length===3&&(er=[er[0],er[1],er[2],er[1]]),Vn+=er[1]+er[3],vr+=er[0]+er[2],xt+=(er[1]-er[3])/2,Ft+=(er[2]-er[0])/2)}H=xv(xv({},U),{},{x:xt-1,y:Ft-1,width:Vn,height:vr})}return Object(re.g)(th,H)}}},{key:"getShape",value:function(){var m=this.props.model,_=m.text,A=_.value,N=_.x,U=_.y;if(A){var H=xv({x:N,y:U,className:"lf-element-text",value:A},m.getTextStyle());return Object(re.g)("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getBackground(),Object(re.g)(KC,dO({},H,{model:m})))}}}])&&aB(u.prototype,d),y})(JC);function vO(c){return vO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},vO(c)}var Nd,cB=["text","sourceAnchorId","targetAnchorId"];function sN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function qf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?sN(Object(d),!0).forEach((function(p){du(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):sN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function dB(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function fB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return uN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return uN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function uN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function pB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function mO(c,u){return mO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},mO(c,u)}function hB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Kb(c);if(u){var y=Kb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return vB(this,d)}}function vB(c,u){if(u&&(vO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cu(c)}function cu(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Kb(c){return Kb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Kb(c)}function du(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}(function(c){c.SOURCE="SOURCE",c.TARGET="TARGET"})(Nd||(Nd={}));var cN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&mO(m,_)})(y,c);var u,d,p=hB(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),du(cu(_=p.call(this)),"stepDragData",void 0),du(cu(_),"stepDrag",void 0),du(cu(_),"oldEdge",void 0),du(cu(_),"preTargetNode",void 0),du(cu(_),"targetRuleResults",void 0),du(cu(_),"sourceRuleResults",void 0),du(cu(_),"handleMouseDown",(function(H){_.stepDrag&&_.stepDrag.handleMouseDown(H)})),du(cu(_),"onDragStart",(function(){var H=_.props,oe=H.x,ue=H.y,Ce=H.edgeModel,Ve=Ce.startPoint,qe=Ce.endPoint,Ot=Ce.pointsList;_.oldEdge={startPoint:Ve,endPoint:qe,pointsList:Ot},_.setState({endX:oe,endY:ue,dragging:!0})})),du(cu(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.state,Ve=Ce.endX,qe=Ce.endY,Ot=_.props,xt=Ot.graphModel,Ft=Ot.type,hn=xt.transformModel,Hn=xt.editConfigModel,zn=fB(hn.moveCanvasPointByHtml([Ve,qe],oe,ue),2),Ar=zn[0],Vn=zn[1];_.setState({endX:Ar,endY:Vn,dragging:!0});var vr=_.props.edgeModel,er=Cf({x:Ve,y:qe},xt);if(er&&er.node&&_.isAllowAdjust(er).pass){var Eo,Co=vr.startPoint,zr=vr.endPoint,Fo=vr.sourceNode,ga=vr.targetNode;Ft===Nd.SOURCE?Eo={startPoint:{x:er.anchor.x,y:er.anchor.y},endPoint:{x:zr.x,y:zr.y},sourceNode:er.node,targetNode:ga}:Ft===Nd.TARGET&&(Eo={startPoint:{x:Co.x,y:Co.y},endPoint:{x:er.anchor.x,y:er.anchor.y},sourceNode:Fo,targetNode:er.node}),vr.updateAfterAdjustStartAndEnd(Eo)}else Ft===Nd.SOURCE?vr.updateStartPoint({x:Ar,y:Vn}):Ft===Nd.TARGET&&vr.updateEndPoint({x:Ar,y:Vn});vr.text.value&&Hn.adjustEdge&&vr.setText(Object.assign({},vr.text,vr.textPosition))})),du(cu(_),"onDragEnd",(function(H){var oe=H.event;try{var ue;_.setState({dragging:!1});var Ce=_.props,Ve=Ce.graphModel,qe=Ce.edgeModel,Ot=Ce.type,xt=_.state,Ft=xt.endX,hn=xt.endY,Hn=xt.dragging,zn=Cf({x:Ft,y:hn},Ve);if(!Hn)return;var Ar,Vn=!1;if(zn&&zn.node){var vr=_.isAllowAdjust(zn),er=vr.pass,Eo=vr.msg,Co=vr.newTargetNode;if(er){var zr=qe.getData(),Fo=zr.text,ga=zr.sourceAnchorId,ya=ga===void 0?"":ga,Nl=zr.targetAnchorId;Ar=qf(qf({sourceAnchorId:ya,targetAnchorId:Nl===void 0?"":Nl},dB(zr,cB)),{},{text:(Fo==null?void 0:Fo.value)||""}),Ot===Nd.SOURCE?(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(zn.node.id).getData(),Ve.getNodeModelById(qe.targetNodeId).getData(),Ar)),{},{sourceNodeId:zn.node.id,sourceAnchorId:zn.anchor.id,startPoint:{x:zn.anchor.x,y:zn.anchor.y},targetNodeId:qe.targetNodeId,endPoint:qf({},qe.endPoint)}),qe.sourceNodeId===zn.node.id&&qe.sourceAnchorId===zn.anchor.id&&(Vn=!0)):Ot===Nd.TARGET&&(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(qe.sourceNodeId).getData(),Ve.getNodeModelById(zn.node.id).getData(),Ar)),{},{sourceNodeId:qe.sourceNodeId,startPoint:qf({},qe.startPoint),targetNodeId:zn.node.id,targetAnchorId:zn.anchor.id,endPoint:{x:zn.anchor.x,y:zn.anchor.y}}),qe.targetNodeId===zn.node.id&&qe.targetAnchorId===zn.anchor.id&&(Vn=!0))}else{Vn=!0;var fu=Co.getData();Ve.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:fu,msg:Eo})}}else Vn=!0;if(Vn)_.recoveryEdge();else{var pu=qe.getData();Ve.deleteEdgeById(qe.id);var Pd=Ve.addEdge(qf({},Ar));Ve.eventCenter.emit(ur.EDGE_EXCHANGE_NODE,{data:{newEdge:Pd.getData(),oldEdge:pu}})}(ue=_.preTargetNode)===null||ue===void 0||ue.setElementState(Io.DEFAULT)}finally{_.props.graphModel.eventCenter.emit(ur.ADJUST_POINT_DRAGEND,{e:oe,data:_.stepDragData})}})),du(cu(_),"recoveryEdge",(function(){var H=_.props.edgeModel,oe=_.oldEdge,ue=oe.startPoint,Ce=oe.endPoint,Ve=oe.pointsList;H.updateStartPoint(ue),H.updateEndPoint(Ce),H.modelType!==lo.LINE_EDGE&&(H.pointsList=Ve,H.initPoints())})),du(cu(_),"getAdjustPointStyle",(function(){var H=_.props,oe=H.graphModel.theme;return H.edgeModel,oe.edgeAdjust})),_.state={dragging:!1,endX:0,endY:0},_.targetRuleResults=new Map,_.sourceRuleResults=new Map;var A=m.type,N=m.edgeModel,U=m.graphModel.eventCenter;return _.stepDragData={type:A,edgeData:N.getData()},_.stepDrag=new Te({onDragStart:_.onDragStart,onDragging:_.onDragging,onDragEnd:_.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:U,data:_.stepDragData}),_}return u=y,(d=[{key:"isAllowAdjust",value:function(m){var _=this.props,A=_.edgeModel,N=A.id,U=A.sourceNode,H=A.targetNode,oe=A.sourceAnchorId,ue=A.targetAnchorId,Ce=_.type,Ve=null,qe=null,Ot=null,xt=null;if(Ce===Nd.SOURCE?(Ve=m.node,qe=H,Ot=m.anchor,xt=H.getAnchorInfo(ue)):(Ve=U,qe=m.node,xt=m.anchor,Ot=U.getAnchorInfo(oe)),this.preTargetNode&&this.preTargetNode!==m.node&&this.preTargetNode.setElementState(Io.DEFAULT),this.preTargetNode=m.node,xt.id===Ot.id)return{pass:!1,msg:"",newTargetNode:qe};var Ft="".concat(Ve.id,"_").concat(qe.id,"_").concat(Ot.id,"_").concat(xt.id);if(!this.targetRuleResults.has(Ft)){var hn=Ve.isAllowConnectedAsSource(qe,Ot,xt,N),Hn=qe.isAllowConnectedAsTarget(Ve,Ot,xt,N);this.sourceRuleResults.set(Ft,au(hn)),this.targetRuleResults.set(Ft,au(Hn))}var zn=this.sourceRuleResults.get(Ft),Ar=zn.isAllPass,Vn=zn.msg,vr=this.targetRuleResults.get(Ft),er=vr.isAllPass,Eo=vr.msg,Co=Ar&&er?Io.ALLOW_CONNECT:Io.NOT_ALLOW_CONNECT;return Ce===Nd.SOURCE?Ve.setElementState(Co):qe.setElementState(Co),{pass:Ar&&er,msg:Eo||Vn,newTargetNode:qe}}},{key:"render",value:function(){var m=this.props,_=m.x,A=m.y,N=m.getAdjustPointShape,U=m.edgeModel,H=this.state.dragging;return Object(re.g)("g",{pointerEvents:H?"none":"",onMouseDown:this.handleMouseDown},H?"":N(_,A,U))}}])&&pB(u.prototype,d),y})(re.a);function gO(c){return gO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},gO(c)}function ky(){return ky=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},ky.apply(this,arguments)}function mB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return dN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return dN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function dN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function gB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function yB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yO(c,u){return yO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yO(c,u)}function _B(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Zb(c);if(u){var y=Zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return bB(this,d)}}function bB(c,u){if(u&&(gO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ic(c)}function Ic(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Zb(c){return Zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Zb(c)}function kd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Py=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yO(m,_)})(y,c);var u,d,p=_B(y);function y(){var m;gB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return kd(Ic(m=p.call.apply(p,[this].concat(A))),"startTime",void 0),kd(Ic(m),"contextMenuTime",void 0),kd(Ic(m),"clickTimer",void 0),kd(Ic(m),"textRef",Object(re.f)()),kd(Ic(m),"handleHover",(function(U,H){var oe=m.props,ue=oe.model,Ce=oe.graphModel.eventCenter;ue.setHovered(U);var Ve=U?ur.EDGE_MOUSEENTER:ur.EDGE_MOUSELEAVE,qe=ue.getData();Ce.emit(Ve,{data:qe,e:H})})),kd(Ic(m),"setHoverON",(function(U){m.props.model.isHovered||(m.textRef&&m.textRef.current&&m.textRef.current.setHoverON(),m.handleHover(!0,U))})),kd(Ic(m),"setHoverOFF",(function(U){m.props.model.isHovered&&(m.textRef&&m.textRef.current&&m.textRef.current.setHoverOFF(),m.handleHover(!1,U))})),kd(Ic(m),"handleContextMenu",(function(U){U.preventDefault(),m.contextMenuTime=new Date().getTime(),m.clickTimer&&clearTimeout(m.clickTimer);var H=m.props,oe=H.model,ue=H.graphModel,Ce=ue.getPointByClient({x:U.clientX,y:U.clientY});ue.setElementStateById(oe.id,Io.SHOW_MENU,Ce.domOverlayPosition),m.toFront(),oe.isSelected||ue.selectEdgeById(oe.id);var Ve=oe==null?void 0:oe.getData();ue.eventCenter.emit(ur.EDGE_CONTEXTMENU,{data:Ve,e:U,position:Ce})})),kd(Ic(m),"handleMouseDown",(function(U){U.stopPropagation(),m.startTime=new Date().getTime()})),kd(Ic(m),"handleMouseUp",(function(U){if(m.startTime&&!(new Date().getTime()-m.startTime>200||U.button===2)){var H=U.detail===2,oe=m.props,ue=oe.model,Ce=oe.graphModel,Ve=ue==null?void 0:ue.getData(),qe=Ce.getPointByClient({x:U.clientX,y:U.clientY});if(H){var Ot=Ce.editConfigModel,xt=Ce.textEditElement;if(xt&&xt.id===ue.id&&Ce.setElementStateById(ue.id,Io.DEFAULT),Ot.edgeTextEdit&&ue.text.editable&&Ce.setElementStateById(ue.id,Io.TEXT_EDIT),ue.modelType===lo.POLYLINE_EDGE){var Ft=ue,hn=Ce.getPointByClient({x:U.x,y:U.y}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=co({x:Hn,y:zn},Ft.points);Ft.dbClickPosition=Ar}Ce.eventCenter.emit(ur.EDGE_DBCLICK,{data:Ve,e:U,position:qe})}else Ce.eventCenter.emit(ur.ELEMENT_CLICK,{data:Ve,e:U,position:qe}),Ce.eventCenter.emit(ur.EDGE_CLICK,{data:Ve,e:U,position:qe});var Vn=Ce.editConfigModel;Ce.selectEdgeById(ue.id,yd(U,Vn)),m.toFront()}})),m}return u=y,(d=[{key:"getShape",value:function(){return Object(re.g)("g",null,this.getEdge())}},{key:"getTextStyle",value:function(){}},{key:"getText",value:function(){var m=this.props,_=m.model,A=m.graphModel;if(_.state===Io.TEXT_EDIT)return null;var N=!1,U=A.editConfigModel;return(_.text.draggable||U.edgeTextDraggable)&&(N=!0),Object(re.g)(uB,{ref:this.textRef,editable:U.edgeTextEdit&&_.text.editable,model:_,graphModel:A,draggable:N})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isSelected;return{start:_,end:A,hover:this.state.hover,isSelected:N}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model;return[m.startPoint,m.endPoint]}},{key:"getArrowStyle",value:function(){return null}},{key:"getArrow",value:function(){var m=this.props.model,_=m.id,A=m.getArrowStyle(),N=A.refY,U=N===void 0?0:N,H=A.refX,oe=H===void 0?2:H,ue=mB(this.getLastTwoPoints(),2),Ce=ue[0],Ve=ue[1],qe="auto";return Ce!==null&&Ve!==null&&(qe=gv(Jp({x:Ve.x-Ce.x,y:Ve.y-Ce.y,z:0}))),Object(re.g)("g",null,Object(re.g)("defs",null,Object(re.g)("marker",{id:"marker-start-".concat(_),refX:-oe,refY:U,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse"},this.getStartArrow()),Object(re.g)("marker",{id:"marker-end-".concat(_),refX:oe,refY:U,overflow:"visible",orient:qe,markerUnits:"userSpaceOnUse"},this.getEndArrow())))}},{key:"getStartArrow",value:function(){var m=this.props.model.getArrowStyle();return m.stroke,m.strokeWidth,m.offset,m.verticalLength,Object(re.g)("path",null)}},{key:"getEndArrow",value:function(){var m=this.props.model.getArrowStyle(),_=m.stroke,A=m.strokeWidth,N=m.offset,U=m.verticalLength;return Object(re.g)("path",{stroke:_,fill:_,strokeWidth:A,transform:"rotate(180)",d:"M 0 0 L ".concat(N," -").concat(U," L ").concat(N," ").concat(U," Z")})}},{key:"getAdjustPointShape",value:function(m,_,A){var N=A.getAdjustPointStyle();return Object(re.g)($m,ky({className:"lf-edge-adjust-point"},N,{x:m,y:_}))}},{key:"getAdjustPoints",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.getAdjustStart(),U=_.getAdjustEnd();return Object(re.g)("g",null,Object(re.g)(cN,ky({type:"SOURCE"},N,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,graphModel:A})),Object(re.g)(cN,ky({type:"TARGET"},U,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,graphModel:A})))}},{key:"getAnimation",value:function(){}},{key:"getAppendWidth",value:function(){return Object(re.g)("g",null)}},{key:"getAppend",value:function(){return Object(re.g)("g",{className:"lf-edge-append"},this.getAppendWidth())}},{key:"getEdge",value:function(){return null}},{key:"toFront",value:function(){var m=this.props,_=m.graphModel,A=m.model;_.toFront(A.id)}},{key:"render",value:function(){var m=this.props,_=m.model,A=_.isSelected,N=_.isHitable,U=_.isShowAdjustPoint;return m.graphModel.animation,Object(re.g)("g",null,Object(re.g)("g",{className:["lf-edge",!N&&"pointer-none",A&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverON,onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getShape(),this.getAppend(),this.getText(),this.getArrow()),U&&A?this.getAdjustPoints():"")}}])&&yB(u.prototype,d),y})(re.a);function _O(c){return _O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},_O(c)}function wB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return fN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function fN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var Ry=function(c){var u={d:""};return Object.entries(c).forEach((function(d){var p=wB(d,2),y=p[0],m=p[1],_=_O(m);y!=="style"&&_==="object"||(u[y]=m)})),Object(re.g)("path",u)};function bO(c){return bO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bO(c)}function wO(){return wO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},wO.apply(this,arguments)}function EB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function xB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function EO(c,u){return EO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},EO(c,u)}function OB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Jb(c);if(u){var y=Jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return SB(this,d)}}function SB(c,u){if(u&&(bO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Jb(c){return Jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Jb(c)}var xO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&EO(m,_)})(y,c);var u,d,p=OB(y);function y(){return EB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeStyle(),oe=m.getEdgeAnimationStyle(),ue=oe.strokeDasharray,Ce=oe.stroke,Ve=oe.strokeDashoffset,qe=oe.animationName,Ot=oe.animationDuration,xt=oe.animationIterationCount,Ft=oe.animationTimingFunction,hn=oe.animationDirection;return Object(re.g)(Fm,wO({},H,{x1:_.x,y1:_.y,x2:A.x,y2:A.y},U,N?{strokeDasharray:ue,stroke:Ce,style:{strokeDashoffset:Ve,animationName:qe,animationDuration:Ot,animationIterationCount:xt,animationTimingFunction:Ft,animationDirection:hn}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=la({start:_,end:A}),U=N.d,H=N.strokeWidth,oe=N.fill,ue=N.strokeDasharray,Ce=N.stroke;return Object(re.g)(Ry,{d:U,fill:oe,strokeWidth:H,stroke:Ce,strokeDasharray:ue})}}])&&xB(u.prototype,d),y})(Py);function OO(c){return OO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OO(c)}function AB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return pN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var MB=function(c){var u={points:"",fill:"none"};return Object.entries(c).forEach((function(d){var p=AB(d,2),y=p[0],m=p[1];(y==="style"||OO(m)!=="object")&&(u[y]=m)})),Object(re.g)("polyline",u)};function SO(c){return SO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},SO(c)}function hN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Qb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hN(Object(d),!0).forEach((function(p){Zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function AO(){return AO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},AO.apply(this,arguments)}function TB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return vN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return vN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function vN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function CB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function MO(c,u){return MO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},MO(c,u)}function NB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=e0(c);if(u){var y=e0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return kB(this,d)}}function kB(c,u){if(u&&(SO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kf(c)}function Kf(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function e0(c){return e0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},e0(c)}function Zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var TO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&MO(m,_)})(y,c);var u,d,p=NB(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Zf(Kf(m=p.call(this)),"drag",void 0),Zf(Kf(m),"isDragging",void 0),Zf(Kf(m),"isShowAdjustPointTemp",void 0),Zf(Kf(m),"appendInfo",void 0),Zf(Kf(m),"onDragStart",(function(){var _=m.props.model;_.dragAppendStart(),m.isShowAdjustPointTemp=_.isShowAdjustPoint,_.isShowAdjustPoint=!1})),Zf(Kf(m),"onDragging",(function(_){var A=_.deltaX,N=_.deltaY,U=m.props,H=U.model,oe=U.graphModel;m.isDragging=!0;var ue=oe.transformModel,Ce=oe.editConfigModel,Ve=TB(ue.fixDeltaXY(A,N),2),qe=Ve[0],Ot=Ve[1],xt=H,Ft=Ce.adjustEdgeMiddle;m.appendInfo=Ft?xt.dragAppendSimple(m.appendInfo,{x:qe,y:Ot}):xt.dragAppend(m.appendInfo,{x:qe,y:Ot})})),Zf(Kf(m),"onDragEnd",(function(){var _=m.props,A=_.model,N=_.graphModel.eventCenter,U=A;U.dragAppendEnd(),m.isDragging=!1,U.isShowAdjustPoint=m.isShowAdjustPointTemp,m.appendInfo=void 0,N.emit(ur.EDGE_ADJUST,{data:U.getData()})})),Zf(Kf(m),"beforeDragStart",(function(_,A){A.dragAble&&m.drag.handleMouseDown(_),m.appendInfo=A})),m.drag=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd,isStopPropagation:!1}),m}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.points,A=m.isAnimation,N=m.arrowConfig,U=m.getEdgeStyle(),H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(MB,AO({points:_},U,N,A?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.points,A=m.isSelected,N={start:null,end:null,hover:this.state.hover,isSelected:A},U=jr(_);return U.length>=2&&(N.start=U[U.length-2],N.end=U[U.length-1]),N}},{key:"getLastTwoPoints",value:function(){var m=this.props.model.points,_=jr(m);return _.length>=2?[_[_.length-2],_[_.length-1]]:[null,null]}},{key:"getAppendAttributes",value:function(m){var _,A=m.start,N=m.end;if(A.x===N.x&&A.y===N.y)_="";else{var U={start:A,end:N,offset:10,verticalLength:5},H=kc(Qb(Qb({},U),{},{type:"start"})),oe=kc(Qb(Qb({},U),{},{type:"end"}));_="M".concat(H.leftX," ").concat(H.leftY,`
|
||
L`).concat(H.rightX," ").concat(H.rightY,`
|
||
L`).concat(oe.rightX," ").concat(oe.rightY,`
|
||
L`).concat(oe.leftX," ").concat(oe.leftY," z")}return{d:_,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}},{key:"getAppendShape",value:function(m){var _=this.getAppendAttributes(m),A=_.d,N=_.strokeWidth,U=_.fill,H=_.strokeDasharray,oe=_.stroke;return Object(re.g)(Ry,{d:A,fill:U,strokeWidth:N,stroke:oe,strokeDasharray:H})}},{key:"getAppendWidth",value:function(){for(var m=this,_=this.props,A=_.model,N=_.graphModel,U=A.pointsList,H=A.draggable,oe=[],ue=U.length,Ce=function(qe){var Ot="lf-polyline-append",xt={start:{x:U[qe].x,y:U[qe].y},end:{x:U[qe+1].x,y:U[qe+1].y},startIndex:qe,endIndex:qe+1,direction:"",dragAble:!0},Ft=Object(re.g)("g",{className:Ot},m.getAppendShape(xt)),hn=N.editConfigModel,Hn=hn.adjustEdge,zn=hn.adjustEdgeMiddle;if(Hn&&H){var Ar=xt.startIndex,Vn=xt.endIndex,vr=zn&&(Ar===0||Vn===ue-1);xt.dragAble=!vr,xt.start.x===xt.end.x?(xt.dragAble&&(Ot+="-ew-resize"),xt.direction=ti.VERTICAL):xt.start.y===xt.end.y&&(xt.dragAble&&(Ot+="-ns-resize"),xt.direction=ti.HORIZONTAL),Ft=Object(re.g)("g",{className:m.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(er){return m.beforeDragStart(er,xt)}},Object(re.g)("g",{className:Ot},m.getAppendShape(xt)))}oe.push(Ft)},Ve=0;Ve<ue-1;Ve++)Ce(Ve);return Object(re.g)("g",null,oe)}}])&&CB(u.prototype,d),y})(Py);function CO(c){return CO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CO(c)}function PB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return mN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function mN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function NO(){return NO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},NO.apply(this,arguments)}function RB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function DB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kO(c,u){return kO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kO(c,u)}function jB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=t0(c);if(u){var y=t0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return LB(this,d)}}function LB(c,u){if(u&&(CO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function t0(c){return t0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},t0(c)}var PO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&kO(m,_)})(y,c);var u,d,p=jB(y);function y(){return RB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.getEdgeStyle(),A=m.path,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(Ry,NO({d:A},_,U,N?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model.path;return Object(re.g)(Ry,{d:m,strokeWidth:10,stroke:"transparent",fill:"none"})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=this.state.hover,A=m.isSelected,N=m.getArrowStyle().offset,U=m.pointsList.map((function(oe){return{x:oe.x,y:oe.y}})),H=PB(sa(U,N),2);return{start:H[0],end:H[1],hover:_,isSelected:A}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model,_=m.getArrowStyle().offset,A=m.pointsList.map((function(N){return{x:N.x,y:N.y}}));return sa(A,_)}}])&&DB(u.prototype,d),y})(Py);function RO(c){return RO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RO(c)}function gN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function IB(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function FB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function BB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function DO(c,u){return DO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DO(c,u)}function $B(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=n0(c);if(u){var y=n0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return UB(this,d)}}function UB(c,u){if(u&&(RO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function n0(c){return n0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},n0(c)}var VB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&DO(m,_)})(y,c);var u,d,p=$B(y);function y(){return FB(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getArrowAttributes",value:function(){var m=this.props,_=m.arrowInfo,A=m.style,N=_.start,U=_.end,H={start:N,end:U,offset:A.offset,verticalLength:A.verticalLength,type:"end"},oe=kc(H),ue=oe.leftX,Ce=oe.leftY,Ve=oe.rightX,qe=oe.rightY;return(function(Ot){for(var xt=1;xt<arguments.length;xt++){var Ft=arguments[xt]!=null?arguments[xt]:{};xt%2?gN(Object(Ft),!0).forEach((function(hn){IB(Ot,hn,Ft[hn])})):Object.getOwnPropertyDescriptors?Object.defineProperties(Ot,Object.getOwnPropertyDescriptors(Ft)):gN(Object(Ft)).forEach((function(hn){Object.defineProperty(Ot,hn,Object.getOwnPropertyDescriptor(Ft,hn))}))}return Ot})({d:"M".concat(ue," ").concat(Ce," L").concat(U.x," ").concat(U.y," L").concat(Ve," ").concat(qe," z")},A)}},{key:"getShape",value:function(){var m=this.getArrowAttributes(),_=m.d,A=m.strokeWidth,N=m.stroke,U=m.fill;return Object(re.g)(Ry,{d:_,fill:U,strokeWidth:A,stroke:N})}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-arrow"},this.getShape())}}],d&&BB(u.prototype,d),y})(re.a),yN=function(c,u){return It(c,u)},WB=function(c){var u=c==null?0:c.length;return u?c[u-1]:void 0},jO=function(){return En.a.Date.now()},GB=Math.max,zB=Math.min,HB=function(c,u,d){var p,y,m,_,A,N,U=0,H=!1,oe=!1,ue=!0;if(typeof c!="function")throw new TypeError("Expected a function");function Ce(hn){var Hn=p,zn=y;return p=y=void 0,U=hn,_=c.apply(zn,Hn)}function Ve(hn){return U=hn,A=setTimeout(Ot,u),H?Ce(hn):_}function qe(hn){var Hn=hn-N;return N===void 0||Hn>=u||Hn<0||oe&&hn-U>=m}function Ot(){var hn=jO();if(qe(hn))return xt(hn);A=setTimeout(Ot,(function(Hn){var zn=u-(Hn-N);return oe?zB(zn,m-(Hn-U)):zn})(hn))}function xt(hn){return A=void 0,ue&&p?Ce(hn):(p=y=void 0,_)}function Ft(){var hn=jO(),Hn=qe(hn);if(p=arguments,y=this,N=hn,Hn){if(A===void 0)return Ve(N);if(oe)return clearTimeout(A),A=setTimeout(Ot,u),Ce(N)}return A===void 0&&(A=setTimeout(Ot,u)),_}return u=bd(u)||0,In(d)&&(H=!!d.leading,m=(oe="maxWait"in d)?GB(bd(d.maxWait)||0,u):m,ue="trailing"in d?!!d.trailing:ue),Ft.cancel=function(){A!==void 0&&clearTimeout(A),U=0,p=N=y=A=void 0},Ft.flush=function(){return A===void 0?_:xt(jO())},Ft},XB=r(172);function YB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ih(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var _N,bN,wN,qB=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),ih(this,"undos",[]),ih(this,"redos",[]),ih(this,"callbacks",[]),ih(this,"stopWatch",null),ih(this,"curData",null),ih(this,"maxSize",50),ih(this,"waitTime",100),ih(this,"eventCenter",void 0),this.eventCenter=p}var u,d;return u=c,(d=[{key:"add",value:function(p){yN(WB(this.undos),p)||(this.undos.push(p),yN(this.curData,p)||(this.redos=[]),this.eventCenter.emit(ur.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undos.length>1,redoAble:this.redos.length>0}}),this.undos.length>this.maxSize&&this.undos.shift())}},{key:"undoAble",value:function(){return this.undos.length>1}},{key:"undo",value:function(){if(this.undoAble()){var p=this.undos.pop();this.redos.push(p);var y=this.undos.pop();return this.curData=Uo(y),y}}},{key:"redoAble",value:function(){return this.redos.length>0}},{key:"redo",value:function(){if(this.redoAble()){var p=this.redos.pop();return this.curData=Uo(p),p}}},{key:"watch",value:function(p){var y=this;this.stopWatch&&this.stopWatch(),this.undos.push(p.modelToGraphData()),this.stopWatch=Object(XB.a)(p,HB((function(){var m=p.modelToHistoryData();m&&y.add(m)}),this.waitTime))}}])&&YB(u.prototype,d),c})();function LO(c){return LO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LO(c)}function KB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return EN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return EN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function EN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function xN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ov(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?xN(Object(d),!0).forEach((function(p){Sv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ON(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IO(c,u){return IO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IO(c,u)}function ZB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=r0(c);if(u){var y=r0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return JB(this,d)}}function JB(c,u){if(u&&(LO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zm(c)}function Zm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function r0(c){return r0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},r0(c)}function Sv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var SN,AN,MN,FO=Fc((wN=bN=(function(c){(function(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&IO(_,A)})(m,c);var u,d,p,y=ZB(m);function m(){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,m),Sv(Zm(_=y.call(this)),"ref",Object(re.f)()),Sv(Zm(_),"__prevText",{type:"",text:"",id:""}),Sv(Zm(_),"keyupHandler",(function(A){var N=_.props.graphModel.textEditElement;A.key==="Enter"&&A.altKey&&N.setElementState(0)})),Sv(Zm(_),"inputHandler",(function(A){var N=A.target.innerText,U=_.props.graphModel.textEditElement;_.__prevText={type:U.type,text:N.replace(/(\r\n)+$|(\n)+$/,""),id:U.id}})),Sv(Zm(_),"keydownHandler",(function(A){A.stopPropagation()})),_.state={style:{left:0,top:0}},_}return u=m,p=[{key:"getDerivedStateFromProps",value:function(_){var A,N=_.graphModel,U=N.transformModel,H=N.theme,oe=H.inputText,ue=N.textEditElement;if(ue){var Ce;if((Ce=ue.text)===null||Ce===void 0||!Ce.value)if(ue.BaseType===ei.EDGE){var Ve=(ue=ue).text,qe=ue.textPosition,Ot=qe.x,xt=qe.y;Ve.x=Ot,Ve.y=xt,ue.setText(Ve)}else ue=ue;var Ft={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(ue.BaseType===ei.EDGE){var hn=H.edgeText,Hn=hn.overflowMode,zn=hn.lineHeight,Ar=hn.wrapPadding,Vn=hn.textWidth;Vn&&Hn==="autoWrap"&&(A=Ov(Ov({},Ft),{},{width:Vn,minWidth:Vn,lineHeight:zn,padding:Ar}))}else if(ue.BaseType===ei.NODE){var vr=H.nodeText,er=vr.overflowMode,Eo=vr.lineHeight,Co=vr.wrapPadding,zr=vr.textWidth,Fo=ue,ga=Fo.width,ya=Fo.modelType,Nl=Fo.textWidth||zr||ga;(ya!==lo.TEXT_NODE&&er==="autoWrap"||ya===lo.TEXT_NODE&&zr)&&(A=Ov(Ov({},Ft),{},{width:Nl,minWidth:Nl,lineHeight:Eo,padding:Co}))}var fu=ue.text,pu=fu.x,Pd=fu.y,Av=KB(U.CanvasPointToHtmlPoint([pu,Pd]),2);return{style:Ov(Ov({left:Av[0],top:Av[1]},A),oe)}}}}],(d=[{key:"componentDidUpdate",value:function(){var _=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var A=this.__prevText,N=A.text,U=A.id;_.updateText(U,N),_.eventCenter.emit(ur.TEXT_UPDATE,Ov({},this.__prevText)),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}}},{key:"placeCaretAtEnd",value:function(_){if(window.getSelection!==void 0&&document.createRange!==void 0){var A=document.createRange();A.selectNodeContents(_),A.collapse(!1);var N=window.getSelection();N.removeAllRanges(),N.addRange(A)}}},{key:"render",value:function(){var _,A=this.props.graphModel.textEditElement,N=this.state.style;return A?Object(re.g)("div",{contentEditable:!0,className:"lf-text-input",style:N,ref:this.ref,key:A.id,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler},(_=A.text)===null||_===void 0?void 0:_.value):null}}])&&ON(u.prototype,d),p&&ON(u,p),m})(re.a),Sv(bN,"toolName","textEdit"),_N=wN))||_N,QB=function(c){return c.modelType===lo.LINE_EDGE?(function(u){var d=u.startPoint,p=u.endPoint,y=(d.x+p.x)/2,m=(d.y+p.y)/2,_=Math.abs(d.x-p.x)+10,A=Math.abs(d.y-p.y)+10;return{x:y-_/2,y:m-A/2,x1:y+_/2,y1:m+A/2}})(c):c.modelType===lo.POLYLINE_EDGE?(function(u){var d=u.points,p=jr(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+N/2}})(c):c.modelType===lo.BEZIER_EDGE?(function(u){var d=u.path,p=di(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+N/2}})(c):void 0};function BO(c){return BO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},BO(c)}function TN(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||CN(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function e$(c){return(function(u){if(Array.isArray(u))return $O(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||CN(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function CN(c,u){if(c){if(typeof c=="string")return $O(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?$O(c,u):void 0}}function $O(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function t$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function UO(c,u){return UO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},UO(c,u)}function n$(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=o0(c);if(u){var y=o0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return r$(this,d)}}function r$(c,u){if(u&&(BO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jm(c)}function Jm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function o0(c){return o0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},o0(c)}function Qm(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var VO=Fc((MN=AN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&UO(m,_)})(y,c);var u,d,p=n$(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Qm(Jm(_=p.call(this)),"stepDrag",void 0),Qm(Jm(_),"handleMouseDown",(function(H){_.stepDrag.handleMouseDown(H)})),Qm(Jm(_),"handleWheelEvent",(function(H){var oe,ue;H.preventDefault();var Ce=H.deltaX,Ve=H.deltaY,qe=H.clientX,Ot=H.clientY,xt=H.ctrlKey,Ft=new WheelEvent("wheel",{deltaX:Ce,deltaY:Ve,clientX:qe,clientY:Ot,ctrlKey:xt});(oe=_.props.logicFlow.container)===null||oe===void 0||(ue=oe.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||ue===void 0||ue.dispatchEvent(Ft)})),Qm(Jm(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.props.graphModel,Ve=Ce.getSelectElements(!0);Ce.moveNodes(Ve.nodes.map((function(qe){return qe.id})),oe,ue)})),Qm(Jm(_),"handleContextMenu",(function(H){H.preventDefault();var oe=_.props,ue=oe.graphModel,Ce=oe.graphModel,Ve=Ce.eventCenter,qe=Ce.selectElements,Ot=ue.getPointByClient({x:H.clientX,y:H.clientY}),xt={nodes:[],edges:[]};e$(qe.values()).forEach((function(Ft){Ft.BaseType===ei.NODE&&xt.nodes.push(Ft.getData()),Ft.BaseType===ei.EDGE&&xt.edges.push(Ft.getData())})),Ve.emit(ur.SELECTION_CONTEXTMENU,{data:xt,e:H,position:Ot})}));var A=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,step:N,eventType:"SELECTION",eventCenter:U}),_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel,_=m.selectElements,A=m.transformModel;if(!(_.size<=1)){var N=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER,H=Number.MIN_SAFE_INTEGER,oe=Number.MIN_SAFE_INTEGER;_.forEach((function(qe){var Ot={x:0,y:0,x1:0,y1:0};qe.BaseType===ei.NODE&&(Ot=(function(xt){var Ft=xt.x,hn=xt.y,Hn=xt.width,zn=xt.height;return{x:Ft-Hn/2,y:hn-zn/2,x1:Ft+Hn/2,y1:hn+zn/2}})(qe)),qe.BaseType===ei.EDGE&&(Ot=QB(qe)),N=Math.min(N,Ot.x),U=Math.min(U,Ot.y),H=Math.max(H,Ot.x1),oe=Math.max(oe,Ot.y1)}));var ue=TN(A.CanvasPointToHtmlPoint([N,U]),2);N=ue[0],U=ue[1];var Ce=TN(A.CanvasPointToHtmlPoint([H,oe]),2);H=Ce[0],oe=Ce[1];var Ve={left:"".concat(N-10,"px"),top:"".concat(U-10,"px"),width:"".concat(H-N+20,"px"),height:"".concat(oe-U+20,"px")};return Object(re.g)("div",{className:"lf-multiple-select",style:Ve,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}}}])&&t$(u.prototype,d),y})(re.a),Qm(AN,"toolName","multipleSelect"),SN=MN))||SN;function o$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function i0(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var i$=(function(){function c(p){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),i0(this,"tools",void 0),i0(this,"components",void 0),i0(this,"toolMap",new Map),i0(this,"instance",void 0),this.instance=p,this.isDisabledTool(FO.toolName)||this.registerTool(FO.toolName,FO),this.isDisabledTool(VO.toolName)||this.registerTool(VO.toolName,VO);var y=p.graphModel;y.eventCenter.on("".concat(ur.GRAPH_TRANSFORM,",").concat(ur.NODE_CLICK,",").concat(ur.BLANK_CLICK," "),(function(){var m=y.textEditElement,_=y.editConfigModel,A=_.edgeTextEdit,N=_.nodeTextEdit;(A||N)&&m&&y.textEditElement.setElementState(Io.DEFAULT)}))}var u,d;return u=c,(d=[{key:"isDisabledTool",value:function(p){return this.instance.options.disabledTools.indexOf(p)!==-1}},{key:"registerTool",value:function(p,y){this.toolMap.set(p,y)}},{key:"getTools",value:function(){return Array.from(this.toolMap.values())}},{key:"getInstance",value:function(){return this.instance}}])&&o$(u.prototype,d),c})(),a$=r(173),l$=r.n(a$);function s$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function WO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var NN=(function(){function c(p){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),WO(this,"mousetrap",void 0),WO(this,"options",void 0),WO(this,"target",void 0),p.keyboard||(p.keyboard={enabled:!1}),this.options=p;var y=p.lf;this.target=y.container,this.mousetrap=new l$.a(this.target),p.keyboard.enabled&&!y.options.isSilentMode&&this.enable(!0)}var u,d;return u=c,(d=[{key:"initShortcuts",value:function(){var p=this,y=this.options.keyboard.shortcuts;if(y)if(qo(y))y.forEach((function(N){var U=N.keys,H=N.callback,oe=N.action;return p.on(U,H,oe)}));else{var m=y.keys,_=y.callback,A=y.action;this.on(m,_,A)}}},{key:"on",value:function(p,y,m){this.mousetrap.bind(this.getKeys(p),y,m)}},{key:"disabled",get:function(){return this.options.keyboard.enabled!==!0}},{key:"off",value:function(p,y){this.mousetrap.unbind(this.getKeys(p),y)}},{key:"enable",value:function(p){(this.disabled||p)&&(this.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))}},{key:"disable",value:function(){this.disabled||(this.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}},{key:"getKeys",value:function(p){var y=this;return(Array.isArray(p)?p:[p]).map((function(m){return y.formatKey(m)}))}},{key:"formatKey",value:function(p){return p.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")}}])&&s$(u.prototype,d),c})(),u$=NN,Jf=null;function kN(c,u){return c.x+=u,c.y+=u,c.text&&(c.text.x+=u,c.text.y+=u),c}function PN(c,u){return c.startPoint&&(c.startPoint.x+=u,c.startPoint.y+=u),c.endPoint&&(c.endPoint.x+=u,c.endPoint.y+=u),c.pointsList&&c.pointsList.length>0&&c.pointsList.forEach((function(d){d.x+=u,d.y+=u})),c.text&&(c.text.x+=u,c.text.y+=u),c}var eg=40,GO=40;function zO(c){return zO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zO(c)}function RN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Dy(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?RN(Object(d),!0).forEach((function(p){ua(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function DN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ua(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var HO=Symbol("plugin register by Logicflow.use"),XO=(function(){function c(y){var m,_,A=this;(function(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")})(this,c),ua(this,"container",void 0),ua(this,"width",void 0),ua(this,"height",void 0),ua(this,"graphModel",void 0),ua(this,"history",void 0),ua(this,"viewMap",new Map),ua(this,"tool",void 0),ua(this,"keyboard",void 0),ua(this,"dnd",void 0),ua(this,"options",void 0),ua(this,"snaplineModel",void 0),ua(this,"components",[]),ua(this,"plugins",void 0),ua(this,"extension",{}),ua(this,"adapterIn",void 0),ua(this,"adapterOut",void 0),ua(this,"getView",(function(N){return A.viewMap.get(N)})),y=NT(y),this.options=y,this.container=this.initContainer(y.container),this.plugins=y.plugins,this.graphModel=new v5(Dy({},y)),this.tool=new i$(this),this.history=new qB(this.graphModel.eventCenter),this.dnd=new f6({lf:this}),this.keyboard=new u$({lf:this,keyboard:y.keyboard}),y.snapline!==!1&&(this.snaplineModel=new GC(this.graphModel),m=this.graphModel.eventCenter,_=this.snaplineModel,m.on("node:mousemove",(function(N){var U=N.data;_.setNodeSnapLine(U)})),m.on("node:mouseup",(function(){_.clearSnapline()}))),(function(N,U){var H=N.keyboard,oe=H.options.keyboard;H.on(["cmd + c","ctrl + c"],(function(){if(GO=eg,!oe.enabled||U.textEditElement)return!0;var ue=N.options.guards,Ce=U.getSelectElements(!1);return ue&&ue.beforeClone&&!ue.beforeClone(Ce)||Ce.nodes.length===0&&Ce.edges.length===0?(Jf=null,!0):((Jf=Ce).nodes.forEach((function(Ve){return kN(Ve,eg)})),Jf.edges.forEach((function(Ve){return PN(Ve,eg)})),!1)})),H.on(["cmd + v","ctrl + v"],(function(){if(!oe.enabled||U.textEditElement)return!0;if(Jf&&(Jf.nodes||Jf.edges)){N.clearSelectElements();var ue=N.addElements(Jf,GO);if(!ue)return!0;ue.nodes.forEach((function(Ce){return N.selectElementById(Ce.id,!0)})),ue.edges.forEach((function(Ce){return N.selectElementById(Ce.id,!0)})),Jf.nodes.forEach((function(Ce){return kN(Ce,eg)})),Jf.edges.forEach((function(Ce){return PN(Ce,eg)})),GO+=eg}return!1})),H.on(["cmd + z","ctrl + z"],(function(){return!oe.enabled||!!U.textEditElement||(N.undo(),!1)})),H.on(["cmd + y","ctrl + y"],(function(){return!oe.enabled||!!U.textEditElement||(N.redo(),!1)})),H.on(["backspace"],(function(){if(!oe.enabled||U.textEditElement)return!0;var ue=U.getSelectElements(!0);return N.clearSelectElements(),ue.edges.forEach((function(Ce){return N.deleteEdge(Ce.id)})),ue.nodes.forEach((function(Ce){return N.deleteNode(Ce.id)})),!1}))})(this,this.graphModel),this.keyboard.initShortcuts(),this.defaultRegister(),this.installPlugins(y.disabledPlugins)}var u,d,p;return u=c,d=[{key:"register",value:function(y,m){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(typeof y=="string"){var A={BaseEdge:Py,BaseEdgeModel:Kp,BaseNode:Yf,BaseNodeModel:Xf,RectNode:Fx,RectNodeModel:vx,CircleNode:Vx,CircleNodeModel:KE,PolygonNode:Xx,PolygonNodeModel:dx,TextNode:iO,TextNodeModel:_x,LineEdge:xO,LineEdgeModel:Od,DiamondNode:Zx,DiamondNodeModel:tx,PolylineEdge:TO,PolylineEdgeModel:Cl,BezierEdge:PO,BezierEdgeModel:GE,EllipseNode:nO,EllipseNodeModel:ix,HtmlNode:uO,HtmlNodeModel:Ex,h:re.g,type:y};this.viewMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)})),this.graphModel.modelMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)}));var N=m(A),U=N.view,H=N.model,oe=U;_&&!oe.isObervered&&(oe.isObervered=!0,oe=ae(oe)),this.setView(y,oe),this.graphModel.setModel(y,H)}else this.registerElement(y)}},{key:"registerElement",value:function(y){var m=y.view;y.isObserverView===!1||m.isObervered||(m.isObervered=!0,m=ae(m)),this.setView(y.type,m),this.graphModel.setModel(y.type,y.model)}},{key:"batchRegister",value:function(){var y=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach((function(_){y.registerElement(_)}))}},{key:"defaultRegister",value:function(){this.registerElement({view:Fx,model:vx,type:"rect"}),this.registerElement({type:"circle",view:Vx,model:KE}),this.registerElement({type:"polygon",view:Xx,model:dx}),this.registerElement({type:"line",view:xO,model:Od}),this.registerElement({type:"polyline",view:TO,model:Cl}),this.registerElement({type:"bezier",view:PO,model:GE}),this.registerElement({type:"text",view:iO,model:_x}),this.registerElement({type:"ellipse",view:nO,model:ix}),this.registerElement({type:"diamond",view:Zx,model:tx}),this.registerElement({type:"html",view:uO,model:Ex})}},{key:"selectElementById",value:function(y){var m=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.graphModel.selectElementById(y,m),!m&&_&&this.graphModel.toFront(y)}},{key:"focusOn",value:function(y){var m=this.graphModel.transformModel,_=y.coordinate,A=y.id;if(!_){var N=this.getNodeModelById(A);N&&(_=N.getData());var U=this.getEdgeModelById(A);U&&(_=U.textPosition)}var H=_,oe=H.x,ue=H.y;m.focusOn(oe,ue,this.graphModel.width,this.graphModel.height)}},{key:"setTheme",value:function(y){this.graphModel.setTheme(y)}},{key:"resize",value:function(y,m){this.graphModel.resize(y,m),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height}},{key:"setDefaultEdgeType",value:function(y){this.graphModel.setDefaultEdgeType(y)}},{key:"updateText",value:function(y,m){this.graphModel.updateText(y,m)}},{key:"deleteElement",value:function(y){var m,_,A,N=this.getModelById(y);return!!N&&(_=(A=(ua(m={},ei.NODE,this.deleteNode),ua(m,ei.EDGE,this.deleteEdge),m)[N.BaseType])===null||A===void 0?void 0:A.call(this,y))!==null&&_!==void 0&&_}},{key:"getModelById",value:function(y){return this.graphModel.getElement(y)}},{key:"getDataById",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getData()}},{key:"changeNodeType",value:function(y,m){this.graphModel.changeNodeType(y,m)}},{key:"changeEdgeType",value:function(y,m){this.graphModel.changeEdgeType(y,m)}},{key:"getNodeEdges",value:function(y){return this.graphModel.getNodeEdges(y)}},{key:"addNode",value:function(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,_=arguments.length>2?arguments[2]:void 0;return this.graphModel.addNode(y,m,_)}},{key:"deleteNode",value:function(y){var m=this.graphModel.getNodeModelById(y);if(!m)return!1;var _=m.getData(),A=this.options.guards,N=!A||!A.beforeDelete||A.beforeDelete(_);return N&&this.graphModel.deleteNode(y),N}},{key:"cloneNode",value:function(y){var m=this.graphModel.getNodeModelById(y).getData(),_=this.options.guards;if(!_||!_.beforeClone||_.beforeClone(m))return this.graphModel.cloneNode(y)}},{key:"changeNodeId",value:function(y,m){return this.graphModel.changeNodeId(y,m)}},{key:"getNodeModelById",value:function(y){return this.graphModel.getNodeModelById(y)}},{key:"getNodeDataById",value:function(y){var m;return(m=this.graphModel.getNodeModelById(y))===null||m===void 0?void 0:m.getData()}},{key:"addEdge",value:function(y){return this.graphModel.addEdge(y)}},{key:"deleteEdge",value:function(y){var m=this.options.guards,_=this.graphModel.edgesMap[y];if(!_)return!1;var A=_.model.getData(),N=!m||!m.beforeDelete||m.beforeDelete(A);return N&&this.graphModel.deleteEdgeById(y),N}},{key:"deleteEdgeByNodeId",value:function(y){var m=y.sourceNodeId,_=y.targetNodeId;m&&_?this.graphModel.deleteEdgeBySourceAndTarget(m,_):m?this.graphModel.deleteEdgeBySource(m):_&&this.graphModel.deleteEdgeByTarget(_)}},{key:"changeEdgeId",value:function(y,m){return this.graphModel.changeEdgeId(y,m)}},{key:"getEdgeModelById",value:function(y){var m;return(m=this.graphModel.edgesMap[y])===null||m===void 0?void 0:m.model}},{key:"getEdgeModels",value:function(y){var m=this.graphModel.edges,_=y.sourceNodeId,A=y.targetNodeId;if(_&&A){var N=[];return m.forEach((function(oe){oe.sourceNodeId===_&&oe.targetNodeId===A&&N.push(oe)})),N}if(_){var U=[];return m.forEach((function(oe){oe.sourceNodeId===_&&U.push(oe)})),U}if(A){var H=[];return m.forEach((function(oe){oe.targetNodeId===A&&H.push(oe)})),H}return[]}},{key:"getEdgeDataById",value:function(y){var m;return(m=this.getEdgeModelById(y))===null||m===void 0?void 0:m.getData()}},{key:"getNodeIncomingEdge",value:function(y){return this.graphModel.getNodeIncomingEdge(y)}},{key:"getNodeOutgoingEdge",value:function(y){return this.graphModel.getNodeOutgoingEdge(y)}},{key:"getNodeIncomingNode",value:function(y){return this.graphModel.getNodeIncomingNode(y)}},{key:"getNodeOutgoingNode",value:function(y){return this.graphModel.getNodeOutgoingNode(y)}},{key:"editText",value:function(y){this.graphModel.editText(y)}},{key:"setProperties",value:function(y,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.setProperties(ma(m))}},{key:"deleteProperty",value:function(y,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.deleteProperty(m)}},{key:"getProperties",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getProperties()}},{key:"toFront",value:function(y){this.graphModel.toFront(y)}},{key:"setElementZIndex",value:function(y,m){return this.graphModel.setElementZIndex(y,m)}},{key:"addElements",value:function(y){for(var m=this,_=y.nodes,A=y.edges,N={},U={nodes:[],edges:[]},H=0;H<_.length;H++){var oe=_[H],ue=oe.id,Ce=this.addNode(oe);if(!Ce)return;ue&&(N[ue]=Ce.id),U.nodes.push(Ce)}return A.forEach((function(Ve){var qe=Ve.sourceNodeId,Ot=Ve.targetNodeId;N[qe]&&(qe=N[qe]),N[Ot]&&(Ot=N[Ot]);var xt=m.graphModel.addEdge(Dy(Dy({},Ve),{},{sourceNodeId:qe,targetNodeId:Ot}));U.edges.push(xt)})),U}},{key:"getAreaElement",value:function(y,m){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],A=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],N=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return this.graphModel.getAreaElement(y,m,_,A,N).map((function(U){return U.getData()}))}},{key:"getSelectElements",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this.graphModel.getSelectElements(y)}},{key:"clearSelectElements",value:function(){this.graphModel.clearSelectElements()}},{key:"getGraphData",value:function(){var y=this.graphModel.modelToGraphData();if(this.adapterOut){for(var m=arguments.length,_=new Array(m),A=0;A<m;A++)_[A]=arguments[A];return this.adapterOut.apply(this,[y].concat(_))}return y}},{key:"getGraphRawData",value:function(){return this.graphModel.modelToGraphData()}},{key:"clearData",value:function(){this.graphModel.clearData()}},{key:"updateEditConfig",value:function(y){var m=this.graphModel,_=m.editConfigModel,A=m.transformModel;_.updateEditConfig(y),(y==null?void 0:y.stopMoveGraph)!==void 0&&A.updateTranslateLimits(y.stopMoveGraph),y!=null&&y.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0)}},{key:"getEditConfig",value:function(){return this.graphModel.editConfigModel.getConfig()}},{key:"getPointByClient",value:function(y,m){return this.graphModel.getPointByClient({x:y,y:m})}},{key:"undo",value:function(){if(this.history.undoAble()){var y=ma(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"redo",value:function(){if(this.history.redoAble()){var y=ma(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"zoom",value:function(y,m){return this.graphModel.transformModel.zoom(y,m)}},{key:"resetZoom",value:function(){this.graphModel.transformModel.resetZoom()}},{key:"setZoomMiniSize",value:function(y){this.graphModel.transformModel.setZoomMiniSize(y)}},{key:"setZoomMaxSize",value:function(y){this.graphModel.transformModel.setZoomMaxSize(y)}},{key:"getTransform",value:function(){var y=this.graphModel.transformModel;return{SCALE_X:y.SCALE_X,SCALE_Y:y.SCALE_Y,TRANSLATE_X:y.TRANSLATE_X,TRANSLATE_Y:y.TRANSLATE_Y}}},{key:"translate",value:function(y,m){this.graphModel.transformModel.translate(y,m)}},{key:"resetTranslate",value:function(){var y=this.graphModel.transformModel,m=y.TRANSLATE_X,_=y.TRANSLATE_Y;this.translate(-m,-_)}},{key:"translateCenter",value:function(){this.graphModel.translateCenter()}},{key:"fitView",value:function(y,m){m===void 0&&(m=y),this.graphModel.fitView(y,m)}},{key:"openEdgeAnimation",value:function(y){this.graphModel.openEdgeAnimation(y)}},{key:"closeEdgeAnimation",value:function(y){this.graphModel.closeEdgeAnimation(y)}},{key:"on",value:function(y,m){this.graphModel.eventCenter.on(y,m)}},{key:"off",value:function(y,m){this.graphModel.eventCenter.off(y,m)}},{key:"once",value:function(y,m){this.graphModel.eventCenter.once(y,m)}},{key:"emit",value:function(y,m){this.graphModel.eventCenter.emit(y,m)}},{key:"initContainer",value:function(y){var m=document.createElement("div");return m.style.position="relative",m.style.width="100%",m.style.height="100%",y.innerHTML="",y.appendChild(m),m}},{key:"installPlugins",value:function(){var y,m=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=(y=this.plugins)!==null&&y!==void 0?y:c.extensions;A.forEach((function(N){var U=null,H=null;N[HO]?(U=N.extension,H=N.props):U=N;var oe=U.pluginName||U.name;_.indexOf(oe)===-1&&m.installPlugin(U,H)}))}},{key:"installPlugin",value:function(y,m){if(zO(y)==="object"){var _=y.install,A=y.render;return _&&_.call(y,this,c),A&&this.components.push(A.bind(y)),void(this.extension[y.pluginName]=y)}var N=y,U=new N({lf:this,LogicFlow:c,options:this.options.pluginsOptions,props:m});U.render&&this.components.push(U.render.bind(U)),this.extension[N.pluginName]=U}},{key:"updateAttributes",value:function(y,m){this.graphModel.updateAttributes(y,m)}},{key:"createFakerNode",value:function(y){var m=this.graphModel.modelMap.get(y.type);if(m){var _=new m(Dy(Dy({},y),{},{virtual:!0}),this.graphModel);return this.graphModel.setFakerNode(_),_}}},{key:"removeFakerNode",value:function(){this.graphModel.removeFakerNode()}},{key:"setNodeSnapLine",value:function(y){this.snaplineModel&&this.snaplineModel.setNodeSnapLine(y)}},{key:"removeNodeSnapLine",value:function(){this.snaplineModel&&this.snaplineModel.clearSnapline()}},{key:"setView",value:function(y,m){this.viewMap.set(y,m)}},{key:"renderRawData",value:function(y){this.graphModel.graphDataToModel(ma(y)),this.options.history!==!1&&this.history.watch(this.graphModel),Object(re.j)(Object(re.g)(c6,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(ur.GRAPH_RENDERED,this.graphModel.modelToGraphData())}},{key:"render",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.adapterIn&&(y=this.adapterIn(y)),this.renderRawData(y)}}],p=[{key:"use",value:function(y,m){var _,A,N=y.pluginName;N||(N=y.name);var U=(_=this.extensions.get(N))===null||_===void 0?void 0:_.extension;U&&U.destroy&&U.destroy(),this.extensions.set(N,(ua(A={},HO,HO),ua(A,"extension",y),ua(A,"props",m),A))}}],d&&DN(u.prototype,d),p&&DN(u,p),c})();function Fc(c){return ae(c)}ua(XO,"extensions",new Map),o.default=XO}])}))})(I0,I0.exports)),I0.exports}var Hu=Fne();const e8=Z_(Hu);let eE=!1;const Th=Rh({});function t8(t,e,n,o,r,i,a){i||(i=(s,l)=>({nodeModel:s,graph:l})),a||(a=(s,l)=>({getNode:()=>s,getGraph:()=>l})),eE&&(Th[t]=o9(_r({render:()=>Dg(i9,{to:n},[Dg(e,i(o,r))]),provide:()=>a(o,r)})))}function n8(t){eE&&delete Th[t]}function Bne(t){Object.keys(Th).forEach(e=>{e.startsWith(t)&&delete Th[e]})}function $ne(){Object.keys(Th).forEach(t=>{delete Th[t]})}function d1(){return eE}function Une(){return eE=!0,_r({props:{flowId:{type:String,required:!0}},setup(t){return()=>{const e=[];return Object.keys(Th).forEach(n=>{e.push(Th[n])}),Dg(Ir,{},e.map(n=>Dg(n)))}}})}class ai extends WI.view{constructor(n,o){super(n);hl(this,"isMounted");hl(this,"r");hl(this,"component");hl(this,"app");hl(this,"root");hl(this,"VueNode");hl(this,"up_node_field_dict");this.component=o,this.isMounted=!1,n.model.clear_next_node_field=this.clear_next_node_field.bind(this),n.model.get_up_node_field_dict=this.get_up_node_field_dict.bind(this),n.model.get_node_field_list=this.get_node_field_list.bind(this),n.model.get_up_node_field_list=this.get_up_node_field_list.bind(this),n.model.properties.noRender?delete n.model.properties.noRender:n.model.properties.stepName=this.getNodeName(n.graphModel.nodes.filter(r=>r.id!==n.model.id),n.model.properties.stepName),n.model.properties.config=this.getConfig(n),n.model.properties.height&&(n.model.height=n.model.properties.height)}getConfig(n){return w9[n.model.type].properties.config}getNodeName(n,o){let r=0,i=o;for(;;){if(r>0&&(i=o+r),!n.some(a=>a.properties.stepName===i.trim()))return i;r++}}get_node_field_list(){var o,r,i,a,s,l,f,h;const n=[];return this.props.model.type&&this.props.model.type==="start-node"&&(n.push({value:"global",label:Pt("views.applicationWorkflow.variable.global"),type:"global",children:((r=(o=this.props.model.properties)==null?void 0:o.config)==null?void 0:r.globalFields)||[]}),n.push({value:"chat",label:Pt("views.applicationWorkflow.variable.chat"),type:"chat",children:((a=(i=this.props.model.properties)==null?void 0:i.config)==null?void 0:a.chatFields)||[]})),n.push({value:this.props.model.id,icon:(l=(s=this.props.model.properties)==null?void 0:s.node_data)==null?void 0:l.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((h=(f=this.props.model.properties)==null?void 0:f.config)==null?void 0:h.fields)||[]}),n}get_up_node_field_dict(n,o){if(!this.up_node_field_dict||!o){const r=this.props.graphModel.getNodeIncomingNode(this.props.model.id);this.up_node_field_dict=r.filter(i=>i.id!="start-node"&&i.id!="loop-start-node").map(i=>i.get_up_node_field_dict(!0,o)).reduce((i,a)=>({...i,...a}),{})}return n?{...this.up_node_field_dict,[this.props.model.id]:this.get_node_field_list()}:this.up_node_field_dict?this.up_node_field_dict:{}}get_up_node_field_list(n,o){const r=Object.values(this.get_up_node_field_dict(n,o)).reduce((s,l)=>[...s,...l],[]),i=this.props.graphModel.getNodeModelById("start-node")||this.props.graphModel.getNodeModelById("loop-start-node");return[...i?i.get_node_field_list():[],...r]}clear_next_node_field(n){this.props.graphModel.getNodeOutgoingNode(this.props.model.id).forEach(r=>{r.clear_next_node_field(!0)}),n&&(this.up_node_field_dict=void 0)}getAnchorShape(n){const{x:o,y:r,type:i}=n;let a=!1;return i=="left"?a=this.props.graphModel.edges.some(s=>s.targetAnchorId==n.id):a=this.props.graphModel.edges.some(s=>s.sourceAnchorId==n.id),Hu.h("foreignObject",{...n,x:o-10,y:r-12,width:30,height:30},[Hu.h("div",{style:{zindex:0},onClick:()=>{i=="right"&&this.props.model.openNodeMenu(n)},dangerouslySetInnerHTML:{__html:a?`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5119_232585)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="white"/>
|
||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9998 27.5C26.7988 27.5 31.4998 22.799 31.4998 17C31.4998 11.201 26.7988 6.49996 20.9998 6.49996C15.2008 6.49996 10.4998 11.201 10.4998 17C10.4998 22.799 15.2008 27.5 20.9998 27.5ZM33.8332 17C33.8332 24.0876 28.0875 29.8333 20.9998 29.8333C13.9122 29.8333 8.1665 24.0876 8.1665 17C8.1665 9.91231 13.9122 4.16663 20.9998 4.16663C28.0875 4.16663 33.8332 9.91231 33.8332 17Z" fill="#3370FF"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5119_232585" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5119_232585"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5119_232585" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>
|
||
`:`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5199_166905)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="#3370FF"/>
|
||
<path d="M19.8332 11.75C19.8332 11.4278 20.0943 11.1666 20.4165 11.1666H21.5832C21.9053 11.1666 22.1665 11.4278 22.1665 11.75V15.8333H26.2498C26.572 15.8333 26.8332 16.0945 26.8332 16.4166V17.5833C26.8332 17.9055 26.572 18.1666 26.2498 18.1666H22.1665V22.25C22.1665 22.5721 21.9053 22.8333 21.5832 22.8333H20.4165C20.0943 22.8333 19.8332 22.5721 19.8332 22.25V18.1666H15.7498C15.4277 18.1666 15.1665 17.9055 15.1665 17.5833V16.4166C15.1665 16.0945 15.4277 15.8333 15.7498 15.8333H19.8332V11.75Z" fill="white"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5199_166905" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5199_166905"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5199_166905" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>`}})])}setHtml(n){if(this.isMounted)this.r&&this.r.component&&(this.r.component.props.properties=this.props.model.getProperties());else{this.isMounted=!0;const o=document.createElement("div");n.appendChild(o),this.renderVueComponent(o)}}componentWillUnmount(){super.componentWillUnmount(),this.unmount()}getComponentContainer(){return this.root}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}renderVueComponent(n){var i;this.unmountVueComponent(),this.root=n;const{model:o,graphModel:r}=this.props;if(n)if(d1())t8(this.targetId(),this.component,n,o,r,void 0,this.props.graphModel.get_provide);else{this.r=Dg(this.component,{properties:this.props.model.properties,nodeModel:this.props.model}),this.app=Lj({render(){return this.r},provide(){return{getNode:()=>o,getGraph:()=>r,workflowMode:nc.Application}}}),this.app.use(a9,{locale:l9}),this.app.use(s9),this.app.use(u9),this.app.use(jj);for(const[a,s]of Object.entries(c9))this.app.component(a,s);(i=this.app)==null||i.mount(n)}}unmountVueComponent(){return this.app&&(this.app.unmount(),this.app=null),this.root&&(this.root.innerHTML=""),this.root}unmount(){d1()&&n8(this.targetId()),this.unmountVueComponent()}}class li extends WI.model{refreshDeges(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}set_position(e){const{x:n,y:o}=e;n&&(this.x=n),o&&(this.y=o),this.refreshDeges()}getResizeOutlineStyle(){const e=super.getResizeOutlineStyle();return e.stroke="none",e}getControlPointStyle(){const e=super.getControlPointStyle();return e.stroke="none",e.fill="none",e}getNodeStyle(){return{overflow:"visible"}}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="#e0e0e0",e.strokeWidth=1,e.hover&&(e.hover.stroke="#3370FF",e.hover.strokeWidth=2),e}getAnchorStyle(e){return super.getAnchorStyle(e)}setHeight(e){const n=this.height,o=e+100;this.height=o,this.properties.height=o,this.move(0,(o-n)/2),this.outgoing.edges.forEach(r=>{r.updatePathByAnchor()}),this.incoming.edges.forEach(r=>{r.updatePathByAnchor()})}get_width(){var e;return((e=this.properties)==null?void 0:e.width)||340}setAttributes(){const{t:e}=jj.global;this.width=this.get_width();const n=(r,i)=>{const a=this.graphModel.getNodeIncomingNode(r);for(const s in a){const l=a[s];if(l.id===i)return!0;if(n(l.id,i))return!0}return!1},o={message:e("views.applicationWorkflow.tip.onlyRight"),validate:(r,i,a)=>a.type==="right"};this.sourceRules.push({message:e("views.applicationWorkflow.tip.notRecyclable"),validate:(r,i,a,s)=>i.id==r.id?!1:!this.graphModel.getNodeIncomingEdge(i.id).find(h=>h.targetAnchorId==s.id&&h.sourceAnchorId==a.id)&&!n(r.id,i.id)}),this.sourceRules.push(o),this.targetRules.push({message:e("views.applicationWorkflow.tip.onlyLeft"),validate:(r,i,a,s)=>s.type==="left"})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r}=this,i=this.properties.showNode===void 0?!0:this.properties.showNode,a=[];return this.type&&this.type!==kr.Base.toString()&&([kr.Start.toString(),kr.LoopStartNode.toString()].includes(this.type)||a.push({x:n-r/2+10,y:i?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"}),a.push({x:n+r/2-10,y:i?o:o-15,id:`${e}_right`,type:"right"})),a}}let Vne=class extends ai{constructor(e){super(e,Uq)}};const Wne={type:"ai-chat-node",model:li,view:Vne},r8=Object.freeze(Object.defineProperty({__proto__:null,default:Wne},Symbol.toStringTag,{value:"Module"})),Gne={class:"title-decoration-1 mb-8"},zne={class:"flex align-center"},Hne={class:"mr-4"},Xne=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=hr(()=>e.path.includes("resource-management")?"systemManage":"workspace"),o={question_reference_address:["start-node","question"],api_input_field_list:[],user_input_field_list:[],document_list:["start-node","document"],image_list:["start-node","image"],audio_list:["start-node","audio"],video_list:["start-node","video"]},r=He(),i=hr({get:()=>(l.nodeModel.properties.node_data||Me.set(l.nodeModel.properties,"node_data",o),l.nodeModel.properties.node_data),set:h=>{Me.set(l.nodeModel.properties,"node_data",h)}});function a(h,v){const b=`${h}_list`;v?l.nodeModel.properties.node_data[b]||Me.set(l.nodeModel.properties.node_data,b,[]):delete l.nodeModel.properties.node_data[b]}const s=()=>{if(!l.nodeModel.properties.node_data.application_id){Me.set(l.nodeModel.properties,"status",500);return}oi({type:"application",systemType:n.value}).getApplicationDetail(l.nodeModel.properties.node_data.application_id).then(h=>{const v=Me.cloneDeep(l.nodeModel.properties.node_data.api_input_field_list),b=Me.cloneDeep(l.nodeModel.properties.node_data.user_input_field_list);if(j2(h.data.type)){const E=h.data.work_flow.nodes[0].properties.node_data,O=Me.cloneDeep(h.data.work_flow.nodes[0].properties.api_input_field_list),w=Me.cloneDeep(h.data.work_flow.nodes[0].properties.user_input_field_list),S=(O||[]).map(D=>{const P=v==null?void 0:v.find(B=>B.variable==D.variable);return P?{...D,value:P.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(l.nodeModel.properties.node_data,"api_input_field_list",S);const M=(w||[]).map(D=>{const P=b==null?void 0:b.find(B=>B.field==D.field);return P?{...D,value:P.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(l.nodeModel.properties.node_data,"user_input_field_list",M);const T=E.file_upload_enable,$=E.file_upload_setting;T?(a("document",$.document),a("image",$.image),a("audio",$.audio),a("video",$.video)):["document_list","image_list","audio_list","video_list"].forEach(D=>{delete l.nodeModel.properties.node_data[D]}),Me.set(l.nodeModel.properties,"status",h.data.id?200:500)}}).catch(h=>{console.log(h),Me.set(l.nodeModel.properties,"status",500)})},l=t,f=()=>{var h;return(h=r.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:l.nodeModel,errMessage:v}))};return bo(()=>{s(),Me.set(l.nodeModel,"validate",f)}),(h,v)=>{const b=ne("el-form-item"),E=ne("AppIcon"),O=ne("el-tooltip"),w=ne("el-switch"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Gne,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),k(M,{shadow:"never",class:"card-never"},{default:j(()=>[k(S,{onSubmit:v[7]||(v[7]=gn(()=>{},["prevent"])),model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:j(()=>[k(b,{label:h.$t("views.applicationWorkflow.nodes.startNode.question"),prop:"question_reference_address",rules:{message:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Go,{ref_key:"applicationNodeFormRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.question_reference_address,"onUpdate:modelValue":v[0]||(v[0]=T=>i.value.question_reference_address=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),i.value.hasOwnProperty("document_list")||"document_list"in i.value?(Ne(),bt(b,{key:0,label:h.$t("views.problem.relateParagraph.selectDocument"),prop:"document_list",rules:{message:h.$t("views.chatLog.documentPlaceholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.chatLog.documentPlaceholder"),modelValue:i.value.document_list,"onUpdate:modelValue":v[1]||(v[1]=T=>i.value.document_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("image_list")||"image_list"in i.value?(Ne(),bt(b,{key:1,label:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),prop:"image_list",rules:{message:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:i.value.image_list,"onUpdate:modelValue":v[2]||(v[2]=T=>i.value.image_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("audio_list")||"audio_list"in i.value?(Ne(),bt(b,{key:2,label:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:i.value.audio_list,"onUpdate:modelValue":v[3]||(v[3]=T=>i.value.audio_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("video_list")||"video_list"in i.value?(Ne(),bt(b,{key:3,label:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.label"),prop:"video_list",rules:{message:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),modelValue:i.value.video_list,"onUpdate:modelValue":v[4]||(v[4]=T=>i.value.video_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),(Ne(!0),mn(Ir,null,No(i.value.api_input_field_list,(T,$)=>(Ne(),mn("div",{key:"api-input-"+$},[k(b,{label:T.variable,prop:"api_input_field_list."+$+".value",rules:[{required:T.is_required,message:`${h.$t("common.inputPlaceholder")}${T.variable}`,trigger:"blur"}]},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.api_input_field_list[$].value,"onUpdate:modelValue":D=>i.value.api_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(Ne(!0),mn(Ir,null,No(i.value.user_input_field_list,(T,$)=>(Ne(),mn("div",{key:"user-input-"+$},[k(b,{label:T.label,prop:"user_input_field_list."+$+".value",rules:[{required:T.required,message:`${h.$t("common.inputPlaceholder")}${T.label}`,trigger:"blur"}]},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.user_input_field_list[$].value,"onUpdate:modelValue":D=>i.value.user_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),k(b,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[6]||(v[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",zne,[ee("div",Hne,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(w,{size:"small",modelValue:i.value.is_result,"onUpdate:modelValue":v[5]||(v[5]=T=>i.value.is_result=T)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Yne extends ai{constructor(e){super(e,Xne)}}const qne={type:"application-node",model:li,view:Yne},o8=Object.freeze(Object.defineProperty({__proto__:null,default:qne},Symbol.toStringTag,{value:"Module"}));/**!
|
||
* Sortable 1.15.6
|
||
* @author RubaXa <trash@rubaxa.org>
|
||
* @author owenm <owen23355@gmail.com>
|
||
* @license MIT
|
||
*/function NR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Yd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?NR(Object(n),!0).forEach(function(o){Kne(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function tw(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tw=function(e){return typeof e}:tw=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tw(t)}function Kne(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function up(){return up=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},up.apply(this,arguments)}function Zne(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function Jne(t,e){if(t==null)return{};var n=Zne(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Qne="1.15.6";function ap(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var hp=ap(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ab=ap(/Edge/i),kR=ap(/firefox/i),m_=ap(/safari/i)&&!ap(/chrome/i)&&!ap(/android/i),LM=ap(/iP(ad|od|hone)/i),i8=ap(/chrome/i)&&ap(/android/i),a8={capture:!1,passive:!1};function Vo(t,e,n){t.addEventListener(e,n,!hp&&a8)}function Bo(t,e,n){t.removeEventListener(e,n,!hp&&a8)}function f1(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function l8(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function zc(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&f1(t,e):f1(t,e))||o&&t===n)return t;if(t===n)break}while(t=l8(t))}return null}var PR=/\s+/g;function vu(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(PR," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(PR," ")}}function ro(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function Ag(t,e){var n="";if(typeof t=="string")n=t;else do{var o=ro(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function s8(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function Hd(){var t=document.scrollingElement;return t||document.documentElement}function Ya(t,e,n,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,s,l,f,h,v;if(t!==window&&t.parentNode&&t!==Hd()?(i=t.getBoundingClientRect(),a=i.top,s=i.left,l=i.bottom,f=i.right,h=i.height,v=i.width):(a=0,s=0,l=window.innerHeight,f=window.innerWidth,h=window.innerHeight,v=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!hp))do if(r&&r.getBoundingClientRect&&(ro(r,"transform")!=="none"||n&&ro(r,"position")!=="static")){var b=r.getBoundingClientRect();a-=b.top+parseInt(ro(r,"border-top-width")),s-=b.left+parseInt(ro(r,"border-left-width")),l=a+i.height,f=s+i.width;break}while(r=r.parentNode);if(o&&t!==window){var E=Ag(r||t),O=E&&E.a,w=E&&E.d;E&&(a/=w,s/=O,v/=O,h/=w,l=a+h,f=s+v)}return{top:a,left:s,bottom:l,right:f,width:v,height:h}}}function RR(t,e,n){for(var o=_h(t,!0),r=Ya(t)[e];o;){var i=Ya(o)[n],a=void 0;if(a=r>=i,!a)return o;if(o===Hd())break;o=_h(o,!1)}return!1}function Xg(t,e,n,o){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==Zr.ghost&&(o||a[i]!==Zr.dragged)&&zc(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function IM(t,e){for(var n=t.lastElementChild;n&&(n===Zr.ghost||ro(n,"display")==="none"||e&&!f1(n,e));)n=n.previousElementSibling;return n||null}function zu(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Zr.clone&&(!e||f1(t,e))&&n++;return n}function DR(t){var e=0,n=0,o=Hd();if(t)do{var r=Ag(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function ere(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function _h(t,e){if(!t||!t.getBoundingClientRect)return Hd();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=ro(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Hd();if(o||e)return n;o=!0}}while(n=n.parentNode);return Hd()}function tre(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function ES(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var g_;function u8(t,e){return function(){if(!g_){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),g_=setTimeout(function(){g_=void 0},e)}}}function nre(){clearTimeout(g_),g_=void 0}function c8(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function d8(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function f8(t,e,n){var o={};return Array.from(t.children).forEach(function(r){var i,a,s,l;if(!(!zc(r,e.draggable,t,!1)||r.animated||r===n)){var f=Ya(r);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,f.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,f.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,f.right),o.bottom=Math.max((l=o.bottom)!==null&&l!==void 0?l:-1/0,f.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var zs="Sortable"+new Date().getTime();function rre(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(ro(r,"display")==="none"||r===Zr.ghost)){t.push({target:r,rect:Ya(r)});var i=Yd({},t[t.length-1].rect);if(r.thisAnimationDuration){var a=Ag(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(ere(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,a=0;t.forEach(function(s){var l=0,f=s.target,h=f.fromRect,v=Ya(f),b=f.prevFromRect,E=f.prevToRect,O=s.rect,w=Ag(f,!0);w&&(v.top-=w.f,v.left-=w.e),f.toRect=v,f.thisAnimationDuration&&ES(b,v)&&!ES(h,v)&&(O.top-v.top)/(O.left-v.left)===(h.top-v.top)/(h.left-v.left)&&(l=ire(O,b,E,r.options)),ES(v,h)||(f.prevFromRect=h,f.prevToRect=v,l||(l=r.options.animation),r.animate(f,O,v,l)),l&&(i=!0,a=Math.max(a,l),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},l),f.thisAnimationDuration=l)}),clearTimeout(e),i?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,r,i,a){if(a){ro(o,"transition",""),ro(o,"transform","");var s=Ag(this.el),l=s&&s.a,f=s&&s.d,h=(r.left-i.left)/(l||1),v=(r.top-i.top)/(f||1);o.animatingX=!!h,o.animatingY=!!v,ro(o,"transform","translate3d("+h+"px,"+v+"px,0)"),this.forRepaintDummy=ore(o),ro(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ro(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){ro(o,"transition",""),ro(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function ore(t){return t.offsetWidth}function ire(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var sg=[],xS={initializeByDefault:!0},lb={mount:function(e){for(var n in xS)xS.hasOwnProperty(n)&&!(n in e)&&(e[n]=xS[n]);sg.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),sg.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";sg.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][i]&&n[a.pluginName][i](Yd({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](Yd({sortable:n},o)))})},initializePlugins:function(e,n,o,r){sg.forEach(function(s){var l=s.pluginName;if(!(!e.options[l]&&!s.initializeByDefault)){var f=new s(e,n,e.options);f.sortable=e,f.options=e.options,e[l]=f,up(o,f.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a<"u"&&(e.options[i]=a)}},getEventProperties:function(e,n){var o={};return sg.forEach(function(r){typeof r.eventProperties=="function"&&up(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return sg.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(e[i.pluginName],o))}),r}};function are(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,f=t.newIndex,h=t.oldDraggableIndex,v=t.newDraggableIndex,b=t.originalEvent,E=t.putSortable,O=t.extraEventProperties;if(e=e||n&&n[zs],!!e){var w,S=e.options,M="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!hp&&!ab?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=s||n,w.item=r||n,w.clone=i,w.oldIndex=l,w.newIndex=f,w.oldDraggableIndex=h,w.newDraggableIndex=v,w.originalEvent=b,w.pullMode=E?E.lastPutMode:void 0;var T=Yd(Yd({},O),lb.getEventProperties(o,e));for(var $ in T)w[$]=T[$];n&&n.dispatchEvent(w),S[M]&&S[M].call(e,w)}}var lre=["evt"],Ws=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=Jne(o,lre);lb.pluginEvent.bind(Zr)(e,n,Yd({dragEl:Xn,parentEl:Aa,ghostEl:po,rootEl:ca,nextEl:Dv,lastDownEl:nw,cloneEl:_a,cloneHidden:vh,dragStarted:Yy,putSortable:Dl,activeSortable:Zr.active,originalEvent:r,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh,hideGhostForTarget:m8,unhideGhostForTarget:g8,cloneNowHidden:function(){vh=!0},cloneNowShown:function(){vh=!1},dispatchSortableEvent:function(s){_s({sortable:n,name:s,originalEvent:r})}},i))};function _s(t){are(Yd({putSortable:Dl,cloneEl:_a,targetEl:Xn,rootEl:ca,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh},t))}var Xn,Aa,po,ca,Dv,nw,_a,vh,xg,mu,y_,hh,F0,Dl,hg=!1,p1=!1,h1=[],kv,Vc,OS,SS,jR,LR,Yy,ug,__,b_=!1,B0=!1,rw,ql,AS=[],m2=!1,v1=[],tE=typeof document<"u",$0=LM,IR=ab||hp?"cssFloat":"float",sre=tE&&!i8&&!LM&&"draggable"in document.createElement("div"),p8=(function(){if(tE){if(hp)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),h8=function(e,n){var o=ro(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=Xg(e,0,n),a=Xg(e,1,n),s=i&&ro(i),l=a&&ro(a),f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ya(i).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ya(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var v=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===v)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||f>=r&&o[IR]==="none"||a&&o[IR]==="none"&&f+h>r)?"vertical":"horizontal"},ure=function(e,n,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,s=o?n.left:n.top,l=o?n.right:n.bottom,f=o?n.width:n.height;return r===s||i===l||r+a/2===s+f/2},cre=function(e,n){var o;return h1.some(function(r){var i=r[zs].options.emptyInsertThreshold;if(!(!i||IM(r))){var a=Ya(r),s=e>=a.left-i&&e<=a.right+i,l=n>=a.top-i&&n<=a.bottom+i;if(s&&l)return o=r}}),o},v8=function(e){function n(i,a){return function(s,l,f,h){var v=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(i==null&&(a||v))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(s,l,f,h),a)(s,l,f,h);var b=(a?s:l).options.group.name;return i===!0||typeof i=="string"&&i===b||i.join&&i.indexOf(b)>-1}}var o={},r=e.group;(!r||tw(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,e.group=o},m8=function(){!p8&&po&&ro(po,"display","none")},g8=function(){!p8&&po&&ro(po,"display","")};tE&&!i8&&document.addEventListener("click",function(t){if(p1)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),p1=!1,!1},!0);var Pv=function(e){if(Xn){e=e.touches?e.touches[0]:e;var n=cre(e.clientX,e.clientY);if(n){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[zs]._onDragOver(o)}}},dre=function(e){Xn&&Xn.parentNode[zs]._isOutsideThisEl(e.target)};function Zr(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=up({},e),t[zs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return h8(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Zr.supportPointer!==!1&&"PointerEvent"in window&&(!m_||LM),emptyInsertThreshold:5};lb.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);v8(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:sre,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Vo(t,"pointerdown",this._onTapStart):(Vo(t,"mousedown",this._onTapStart),Vo(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Vo(t,"dragover",this),Vo(t,"dragenter",this)),h1.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),up(this,rre())}Zr.prototype={constructor:Zr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ug=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,Xn):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,r=this.options,i=r.preventOnFilter,a=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,h=r.filter;if(_re(o),!Xn&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&m_&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=zc(l,r.draggable,o,!1),!(l&&l.animated)&&nw!==l)){if(xg=zu(l),y_=zu(l,r.draggable),typeof h=="function"){if(h.call(this,e,l,this)){_s({sortable:n,rootEl:f,name:"filter",targetEl:l,toEl:o,fromEl:o}),Ws("filter",n,{evt:e}),i&&e.preventDefault();return}}else if(h&&(h=h.split(",").some(function(v){if(v=zc(f,v.trim(),o,!1),v)return _s({sortable:n,rootEl:v,name:"filter",targetEl:l,fromEl:o,toEl:o}),Ws("filter",n,{evt:e}),!0}),h)){i&&e.preventDefault();return}r.handle&&!zc(f,r.handle,o,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,s=i.ownerDocument,l;if(o&&!Xn&&o.parentNode===i){var f=Ya(o);if(ca=i,Xn=o,Aa=Xn.parentNode,Dv=Xn.nextSibling,nw=o,F0=a.group,Zr.dragged=Xn,kv={target:Xn,clientX:(n||e).clientX,clientY:(n||e).clientY},jR=kv.clientX-f.left,LR=kv.clientY-f.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,Xn.style["will-change"]="all",l=function(){if(Ws("delayEnded",r,{evt:e}),Zr.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!kR&&r.nativeDraggable&&(Xn.draggable=!0),r._triggerDragStart(e,n),_s({sortable:r,name:"choose",originalEvent:e}),vu(Xn,a.chosenClass,!0)},a.ignore.split(",").forEach(function(h){s8(Xn,h.trim(),MS)}),Vo(s,"dragover",Pv),Vo(s,"mousemove",Pv),Vo(s,"touchmove",Pv),a.supportPointer?(Vo(s,"pointerup",r._onDrop),!this.nativeDraggable&&Vo(s,"pointercancel",r._onDrop)):(Vo(s,"mouseup",r._onDrop),Vo(s,"touchend",r._onDrop),Vo(s,"touchcancel",r._onDrop)),kR&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xn.draggable=!0),Ws("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ab||hp))){if(Zr.eventCanceled){this._onDrop();return}a.supportPointer?(Vo(s,"pointerup",r._disableDelayedDrag),Vo(s,"pointercancel",r._disableDelayedDrag)):(Vo(s,"mouseup",r._disableDelayedDrag),Vo(s,"touchend",r._disableDelayedDrag),Vo(s,"touchcancel",r._disableDelayedDrag)),Vo(s,"mousemove",r._delayedDragTouchMoveHandler),Vo(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&Vo(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Xn&&MS(Xn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Bo(e,"mouseup",this._disableDelayedDrag),Bo(e,"touchend",this._disableDelayedDrag),Bo(e,"touchcancel",this._disableDelayedDrag),Bo(e,"pointerup",this._disableDelayedDrag),Bo(e,"pointercancel",this._disableDelayedDrag),Bo(e,"mousemove",this._delayedDragTouchMoveHandler),Bo(e,"touchmove",this._delayedDragTouchMoveHandler),Bo(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?Vo(document,"pointermove",this._onTouchMove):n?Vo(document,"touchmove",this._onTouchMove):Vo(document,"mousemove",this._onTouchMove):(Vo(Xn,"dragend",this),Vo(ca,"dragstart",this._onDragStart));try{document.selection?ow(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(hg=!1,ca&&Xn){Ws("dragStarted",this,{evt:n}),this.nativeDraggable&&Vo(document,"dragover",dre);var o=this.options;!e&&vu(Xn,o.dragClass,!1),vu(Xn,o.ghostClass,!0),Zr.active=this,e&&this._appendGhost(),_s({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Vc){this._lastX=Vc.clientX,this._lastY=Vc.clientY,m8();for(var e=document.elementFromPoint(Vc.clientX,Vc.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Vc.clientX,Vc.clientY),e!==n);)n=e;if(Xn.parentNode[zs]._isOutsideThisEl(e),n)do{if(n[zs]){var o=void 0;if(o=n[zs]._onDragOver({clientX:Vc.clientX,clientY:Vc.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=l8(n));g8()}},_onTouchMove:function(e){if(kv){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=po&&Ag(po,!0),s=po&&a&&a.a,l=po&&a&&a.d,f=$0&&ql&&DR(ql),h=(i.clientX-kv.clientX+r.x)/(s||1)+(f?f[0]-AS[0]:0)/(s||1),v=(i.clientY-kv.clientY+r.y)/(l||1)+(f?f[1]-AS[1]:0)/(l||1);if(!Zr.active&&!hg){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(po){a?(a.e+=h-(OS||0),a.f+=v-(SS||0)):a={a:1,b:0,c:0,d:1,e:h,f:v};var b="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ro(po,"webkitTransform",b),ro(po,"mozTransform",b),ro(po,"msTransform",b),ro(po,"transform",b),OS=h,SS=v,Vc=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!po){var e=this.options.fallbackOnBody?document.body:ca,n=Ya(Xn,!0,$0,!0,e),o=this.options;if($0){for(ql=e;ro(ql,"position")==="static"&&ro(ql,"transform")==="none"&&ql!==document;)ql=ql.parentNode;ql!==document.body&&ql!==document.documentElement?(ql===document&&(ql=Hd()),n.top+=ql.scrollTop,n.left+=ql.scrollLeft):ql=Hd(),AS=DR(ql)}po=Xn.cloneNode(!0),vu(po,o.ghostClass,!1),vu(po,o.fallbackClass,!0),vu(po,o.dragClass,!0),ro(po,"transition",""),ro(po,"transform",""),ro(po,"box-sizing","border-box"),ro(po,"margin",0),ro(po,"top",n.top),ro(po,"left",n.left),ro(po,"width",n.width),ro(po,"height",n.height),ro(po,"opacity","0.8"),ro(po,"position",$0?"absolute":"fixed"),ro(po,"zIndex","100000"),ro(po,"pointerEvents","none"),Zr.ghost=po,e.appendChild(po),ro(po,"transform-origin",jR/parseInt(po.style.width)*100+"% "+LR/parseInt(po.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(Ws("dragStart",this,{evt:e}),Zr.eventCanceled){this._onDrop();return}Ws("setupClone",this),Zr.eventCanceled||(_a=d8(Xn),_a.removeAttribute("id"),_a.draggable=!1,_a.style["will-change"]="",this._hideClone(),vu(_a,this.options.chosenClass,!1),Zr.clone=_a),o.cloneId=ow(function(){Ws("clone",o),!Zr.eventCanceled&&(o.options.removeCloneOnHide||ca.insertBefore(_a,Xn),o._hideClone(),_s({sortable:o,name:"clone"}))}),!n&&vu(Xn,i.dragClass,!0),n?(p1=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Bo(document,"mouseup",o._onDrop),Bo(document,"touchend",o._onDrop),Bo(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,Xn)),Vo(document,"drop",o),ro(Xn,"transform","translateZ(0)")),hg=!0,o._dragStartId=ow(o._dragStarted.bind(o,n,e)),Vo(document,"selectstart",o),Yy=!0,window.getSelection().removeAllRanges(),m_&&ro(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,s=this.options,l=s.group,f=Zr.active,h=F0===l,v=s.sort,b=Dl||f,E,O=this,w=!1;if(m2)return;function S(Ae,Pe){Ws(Ae,O,Yd({evt:e,isOwner:h,axis:E?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:v,fromSortable:b,target:o,completed:T,onMove:function(ze,Ye){return U0(ca,n,Xn,r,ze,Ya(ze),e,Ye)},changed:$},Pe))}function M(){S("dragOverAnimationCapture"),O.captureAnimationState(),O!==b&&b.captureAnimationState()}function T(Ae){return S("dragOverCompleted",{insertion:Ae}),Ae&&(h?f._hideClone():f._showClone(O),O!==b&&(vu(Xn,Dl?Dl.options.ghostClass:f.options.ghostClass,!1),vu(Xn,s.ghostClass,!0)),Dl!==O&&O!==Zr.active?Dl=O:O===Zr.active&&Dl&&(Dl=null),b===O&&(O._ignoreWhileAnimating=o),O.animateAll(function(){S("dragOverAnimationComplete"),O._ignoreWhileAnimating=null}),O!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===Xn&&!Xn.animated||o===n&&!o.animated)&&(ug=null),!s.dragoverBubble&&!e.rootEl&&o!==document&&(Xn.parentNode[zs]._isOutsideThisEl(e.target),!Ae&&Pv(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),w=!0}function $(){mu=zu(Xn),hh=zu(Xn,s.draggable),_s({sortable:O,name:"change",toEl:n,newIndex:mu,newDraggableIndex:hh,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=zc(o,s.draggable,n,!0),S("dragOver"),Zr.eventCanceled)return w;if(Xn.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||O._ignoreWhileAnimating===o)return T(!1);if(p1=!1,f&&!s.disabled&&(h?v||(a=Aa!==ca):Dl===this||(this.lastPutMode=F0.checkPull(this,f,Xn,e))&&l.checkPut(this,f,Xn,e))){if(E=this._getDirection(e,o)==="vertical",r=Ya(Xn),S("dragOverValid"),Zr.eventCanceled)return w;if(a)return Aa=ca,M(),this._hideClone(),S("revert"),Zr.eventCanceled||(Dv?ca.insertBefore(Xn,Dv):ca.appendChild(Xn)),T(!0);var D=IM(n,s.draggable);if(!D||vre(e,E,this)&&!D.animated){if(D===Xn)return T(!1);if(D&&n===e.target&&(o=D),o&&(i=Ya(o)),U0(ca,n,Xn,r,o,i,e,!!o)!==!1)return M(),D&&D.nextSibling?n.insertBefore(Xn,D.nextSibling):n.appendChild(Xn),Aa=n,$(),T(!0)}else if(D&&hre(e,E,this)){var P=Xg(n,0,s,!0);if(P===Xn)return T(!1);if(o=P,i=Ya(o),U0(ca,n,Xn,r,o,i,e,!1)!==!1)return M(),n.insertBefore(Xn,P),Aa=n,$(),T(!0)}else if(o.parentNode===n){i=Ya(o);var B=0,F,I=Xn.parentNode!==n,V=!ure(Xn.animated&&Xn.toRect||r,o.animated&&o.toRect||i,E),z=E?"top":"left",X=RR(o,"top","top")||RR(Xn,"top","top"),Y=X?X.scrollTop:void 0;ug!==o&&(F=i[z],b_=!1,B0=!V&&s.invertSwap||I),B=mre(e,o,i,E,V?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,B0,ug===o);var W;if(B!==0){var Q=zu(Xn);do Q-=B,W=Aa.children[Q];while(W&&(ro(W,"display")==="none"||W===po))}if(B===0||W===o)return T(!1);ug=o,__=B;var J=o.nextElementSibling,ie=!1;ie=B===1;var Se=U0(ca,n,Xn,r,o,i,e,ie);if(Se!==!1)return(Se===1||Se===-1)&&(ie=Se===1),m2=!0,setTimeout(pre,30),M(),ie&&!J?n.appendChild(Xn):o.parentNode.insertBefore(Xn,ie?J:o),X&&c8(X,0,Y-X.scrollTop),Aa=Xn.parentNode,F!==void 0&&!B0&&(rw=Math.abs(F-Ya(o)[z])),$(),T(!0)}if(n.contains(Xn))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Bo(document,"mousemove",this._onTouchMove),Bo(document,"touchmove",this._onTouchMove),Bo(document,"pointermove",this._onTouchMove),Bo(document,"dragover",Pv),Bo(document,"mousemove",Pv),Bo(document,"touchmove",Pv)},_offUpEvents:function(){var e=this.el.ownerDocument;Bo(e,"mouseup",this._onDrop),Bo(e,"touchend",this._onDrop),Bo(e,"pointerup",this._onDrop),Bo(e,"pointercancel",this._onDrop),Bo(e,"touchcancel",this._onDrop),Bo(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(mu=zu(Xn),hh=zu(Xn,o.draggable),Ws("drop",this,{evt:e}),Aa=Xn&&Xn.parentNode,mu=zu(Xn),hh=zu(Xn,o.draggable),Zr.eventCanceled){this._nulling();return}hg=!1,B0=!1,b_=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),g2(this.cloneId),g2(this._dragStartId),this.nativeDraggable&&(Bo(document,"drop",this),Bo(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),m_&&ro(document.body,"user-select",""),ro(Xn,"transform",""),e&&(Yy&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),po&&po.parentNode&&po.parentNode.removeChild(po),(ca===Aa||Dl&&Dl.lastPutMode!=="clone")&&_a&&_a.parentNode&&_a.parentNode.removeChild(_a),Xn&&(this.nativeDraggable&&Bo(Xn,"dragend",this),MS(Xn),Xn.style["will-change"]="",Yy&&!hg&&vu(Xn,Dl?Dl.options.ghostClass:this.options.ghostClass,!1),vu(Xn,this.options.chosenClass,!1),_s({sortable:this,name:"unchoose",toEl:Aa,newIndex:null,newDraggableIndex:null,originalEvent:e}),ca!==Aa?(mu>=0&&(_s({rootEl:Aa,name:"add",toEl:Aa,fromEl:ca,originalEvent:e}),_s({sortable:this,name:"remove",toEl:Aa,originalEvent:e}),_s({rootEl:Aa,name:"sort",toEl:Aa,fromEl:ca,originalEvent:e}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Dl&&Dl.save()):mu!==xg&&mu>=0&&(_s({sortable:this,name:"update",toEl:Aa,originalEvent:e}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Zr.active&&((mu==null||mu===-1)&&(mu=xg,hh=y_),_s({sortable:this,name:"end",toEl:Aa,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ws("nulling",this),ca=Xn=Aa=po=Dv=_a=nw=vh=kv=Vc=Yy=mu=hh=xg=y_=ug=__=Dl=F0=Zr.dragged=Zr.ghost=Zr.clone=Zr.active=null,v1.forEach(function(e){e.checked=!0}),v1.length=OS=SS=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Xn&&(this._onDragOver(e),fre(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],zc(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||yre(n));return e},sort:function(e,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var s=r.children[a];zc(s,this.options.draggable,r,!1)&&(o[i]=s)},this),n&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return zc(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var r=lb.modifyOption(this,e,n);typeof r<"u"?o[e]=r:o[e]=n,e==="group"&&v8(o)},destroy:function(){Ws("destroy",this);var e=this.el;e[zs]=null,Bo(e,"mousedown",this._onTapStart),Bo(e,"touchstart",this._onTapStart),Bo(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Bo(e,"dragover",this),Bo(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),h1.splice(h1.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!vh){if(Ws("hideClone",this),Zr.eventCanceled)return;ro(_a,"display","none"),this.options.removeCloneOnHide&&_a.parentNode&&_a.parentNode.removeChild(_a),vh=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(vh){if(Ws("showClone",this),Zr.eventCanceled)return;Xn.parentNode==ca&&!this.options.group.revertClone?ca.insertBefore(_a,Xn):Dv?ca.insertBefore(_a,Dv):ca.appendChild(_a),this.options.group.revertClone&&this.animate(Xn,_a),ro(_a,"display",""),vh=!1}}};function fre(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function U0(t,e,n,o,r,i,a,s){var l,f=t[zs],h=f.options.onMove,v;return window.CustomEvent&&!hp&&!ab?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=r||e,l.relatedRect=i||Ya(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),h&&(v=h.call(f,l,a)),v}function MS(t){t.draggable=!1}function pre(){m2=!1}function hre(t,e,n){var o=Ya(Xg(n.el,0,n.options,!0)),r=f8(n.el,n.options,po),i=10;return e?t.clientX<r.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<r.top-i||t.clientY<o.bottom&&t.clientX<o.left}function vre(t,e,n){var o=Ya(IM(n.el,n.options.draggable)),r=f8(n.el,n.options,po),i=10;return e?t.clientX>r.right+i||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>r.bottom+i||t.clientX>o.right&&t.clientY>o.top}function mre(t,e,n,o,r,i,a,s){var l=o?t.clientY:t.clientX,f=o?n.height:n.width,h=o?n.top:n.left,v=o?n.bottom:n.right,b=!1;if(!a){if(s&&rw<f*r){if(!b_&&(__===1?l>h+f*i/2:l<v-f*i/2)&&(b_=!0),b_)b=!0;else if(__===1?l<h+rw:l>v-rw)return-__}else if(l>h+f*(1-r)/2&&l<v-f*(1-r)/2)return gre(e)}return b=b||a,b&&(l<h+f*i/2||l>v-f*i/2)?l>h+f/2?1:-1:0}function gre(t){return zu(Xn)<zu(t)?1:-1}function yre(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _re(t){v1.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&v1.push(o)}}function ow(t){return setTimeout(t,0)}function g2(t){return clearTimeout(t)}tE&&Vo(document,"touchmove",function(t){(Zr.active||hg)&&t.cancelable&&t.preventDefault()});Zr.utils={on:Vo,off:Bo,css:ro,find:s8,is:function(e,n){return!!zc(e,n,e,!1)},extend:tre,throttle:u8,closest:zc,toggleClass:vu,clone:d8,index:zu,nextTick:ow,cancelNextTick:g2,detectDirection:h8,getChild:Xg,expando:zs};Zr.get=function(t){return t[zs]};Zr.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(Zr.utils=Yd(Yd({},Zr.utils),o.utils)),lb.mount(o)})};Zr.create=function(t,e){return new Zr(t,e)};Zr.version=Qne;var Xa=[],qy,y2,_2=!1,TS,CS,m1,Ky;function bre(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Vo(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Vo(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Vo(document,"touchmove",this._handleFallbackAutoScroll):Vo(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Bo(document,"dragover",this._handleAutoScroll):(Bo(document,"pointermove",this._handleFallbackAutoScroll),Bo(document,"touchmove",this._handleFallbackAutoScroll),Bo(document,"mousemove",this._handleFallbackAutoScroll)),FR(),iw(),nre()},nulling:function(){m1=y2=qy=_2=Ky=TS=CS=null,Xa.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,s=document.elementFromPoint(i,a);if(m1=n,o||this.options.forceAutoScrollFallback||ab||hp||m_){NS(n,this.options,s,o);var l=_h(s,!0);_2&&(!Ky||i!==TS||a!==CS)&&(Ky&&FR(),Ky=setInterval(function(){var f=_h(document.elementFromPoint(i,a),!0);f!==l&&(l=f,iw()),NS(n,r.options,f,o)},10),TS=i,CS=a)}else{if(!this.options.bubbleScroll||_h(s,!0)===Hd()){iw();return}NS(n,this.options,_h(s,!1),!1)}}},up(t,{pluginName:"scroll",initializeByDefault:!0})}function iw(){Xa.forEach(function(t){clearInterval(t.pid)}),Xa=[]}function FR(){clearInterval(Ky)}var NS=u8(function(t,e,n,o){if(e.scroll){var r=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,s=e.scrollSpeed,l=Hd(),f=!1,h;y2!==n&&(y2=n,iw(),qy=e.scroll,h=e.scrollFn,qy===!0&&(qy=_h(n,!0)));var v=0,b=qy;do{var E=b,O=Ya(E),w=O.top,S=O.bottom,M=O.left,T=O.right,$=O.width,D=O.height,P=void 0,B=void 0,F=E.scrollWidth,I=E.scrollHeight,V=ro(E),z=E.scrollLeft,X=E.scrollTop;E===l?(P=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(P=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"));var Y=P&&(Math.abs(T-r)<=a&&z+$<F)-(Math.abs(M-r)<=a&&!!z),W=B&&(Math.abs(S-i)<=a&&X+D<I)-(Math.abs(w-i)<=a&&!!X);if(!Xa[v])for(var Q=0;Q<=v;Q++)Xa[Q]||(Xa[Q]={});(Xa[v].vx!=Y||Xa[v].vy!=W||Xa[v].el!==E)&&(Xa[v].el=E,Xa[v].vx=Y,Xa[v].vy=W,clearInterval(Xa[v].pid),(Y!=0||W!=0)&&(f=!0,Xa[v].pid=setInterval((function(){o&&this.layer===0&&Zr.active._onTouchMove(m1);var J=Xa[this.layer].vy?Xa[this.layer].vy*s:0,ie=Xa[this.layer].vx?Xa[this.layer].vx*s:0;typeof h=="function"&&h.call(Zr.dragged.parentNode[zs],ie,J,t,m1,Xa[this.layer].el)!=="continue"||c8(Xa[this.layer].el,ie,J)}).bind({layer:v}),24))),v++}while(e.bubbleScroll&&b!==l&&(b=_h(b,!1)));_2=f}},30),y8=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(n){var f=o||i;s();var h=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,v=document.elementFromPoint(h.clientX,h.clientY);l(),f&&!f.el.contains(v)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function FM(){}FM.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=Xg(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:y8};up(FM,{pluginName:"revertOnSpill"});function BM(){}BM.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:y8};up(BM,{pluginName:"removeOnSpill"});Zr.mount(new bre);Zr.mount(BM,FM);const wre={class:"dialog-footer"},Ere=_r({__name:"ApiFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He({name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""}),l=Rh({name:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],variable:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),f=He(!1);K_(f,E=>{E||(s.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},a.value=!1)});const h=E=>{E&&(s.value=Me.cloneDeep(E),a.value=!0),f.value=!0},v=()=>{f.value=!1,a.value=!1},b=async E=>{E&&await E.validate(O=>{O&&o("refresh",s.value)})};return e({open:h,close:v}),(E,O)=>{const w=ne("el-input"),S=ne("el-form-item"),M=ne("el-switch"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?E.$t("common.param.editParam"):E.$t("common.param.addParam"),modelValue:f.value,"onUpdate:modelValue":O[10]||(O[10]=P=>f.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":v,"append-to-body":""},{footer:j(()=>[ee("span",wre,[k($,{onClick:O[8]||(O[8]=gn(P=>f.value=!1,["prevent"]))},{default:j(()=>[ft(_e(E.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:O[9]||(O[9]=P=>b(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?E.$t("common.save"):E.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:l,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[k(S,{label:E.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:j(()=>[k(w,{modelValue:s.value.variable,"onUpdate:modelValue":O[0]||(O[0]=P=>s.value.variable=P),placeholder:E.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:O[1]||(O[1]=P=>s.value.variable=s.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("common.desc")},{default:j(()=>[k(w,{modelValue:s.value.desc,"onUpdate:modelValue":O[2]||(O[2]=P=>s.value.desc=P),placeholder:E.$t("common.descPlaceholder"),onBlur:O[3]||(O[3]=P=>s.value.name=s.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.paramForm.required.label"),onClick:O[5]||(O[5]=gn(()=>{},["prevent"]))},{default:j(()=>[k(M,{size:"small",modelValue:s.value.is_required,"onUpdate:modelValue":O[4]||(O[4]=P=>s.value.is_required=P)},null,8,["modelValue"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:s.value.is_required,message:E.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:s.value.default_value,"onUpdate:modelValue":O[6]||(O[6]=P=>s.value.default_value=P),placeholder:E.$t("dynamicsForm.default.placeholder"),onBlur:O[7]||(O[7]=P=>s.value.name=s.value.name.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),xre={class:"flex-between mb-16"},Ore={class:"lighter"},Sre=["title"],Are=["title"],Mre=["title"],Tre={class:"mr-4"},Cre=_r({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(null),r=He(),i=He([]);function a(h,v){typeof v<"u"&&(o.value=v),r.value.open(h)}function s(h){i.value.splice(h,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function l(h){for(let b=0;b<i.value.length;b++)if(i.value[b].variable===h.variable&&o.value!==b){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}const v=e.nodeModel.properties.user_input_field_list;for(let b=0;b<v.length;b++)if(v[b].field===h.variable){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}o.value!==null?i.value.splice(o.value,1,h):i.value.push(h),o.value=null,r.value.close(),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function f(){if(!n.value)return;const v=n.value.$el.querySelector(".api-input-field-table .el-table__body-wrapper tbody");v&&Zr.create(v,{animation:150,ghostClass:"ghost-row",onEnd:b=>{if(b.oldIndex===void 0||b.newIndex===void 0)return;const E=Me.cloneDeep([...i.value]),[O]=E.splice(b.oldIndex,1);E.splice(b.newIndex,0,O),i.value=E,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{e.nodeModel.properties.api_input_field_list?i.value.push(...e.nodeModel.properties.api_input_field_list):e.nodeModel.properties.input_field_list&&e.nodeModel.properties.input_field_list.filter(h=>h.assignment_method==="api_input").forEach(h=>{i.value.push(h)}),Me.set(e.nodeModel.properties,"api_input_field_list",i),f()}),(h,v)=>{var T;const b=ne("AppIcon"),E=ne("el-button"),O=ne("el-table-column"),w=ne("el-switch"),S=ne("el-tooltip"),M=ne("el-table");return Ne(),mn(Ir,null,[ee("div",xre,[ee("h5",Ore,_e(h.$t("views.model.modelForm.title.apiParamPassing")),1),k(E,{link:"",type:"primary",onClick:v[0]||(v[0]=$=>a())},{default:j(()=>[k(b,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(h.$t("common.add")),1)]),_:1})]),((T=e.nodeModel.properties.api_input_field_list)==null?void 0:T.length)>0?(Ne(),bt(M,{key:0,data:e.nodeModel.properties.api_input_field_list,class:"mb-16 api-input-field-table",ref_key:"tableRef",ref:n,"row-key":"variable"},{default:j(()=>[k(O,{prop:"variable",label:h.$t("dynamicsForm.paramForm.field.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.variable},_e($.variable),9,Sre)]),_:1},8,["label"]),k(O,{prop:"desc",label:h.$t("common.desc")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.desc},_e($.desc),9,Are)]),_:1},8,["label"]),k(O,{prop:"default_value",label:h.$t("dynamicsForm.default.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.default_value},_e($.default_value),9,Mre)]),_:1},8,["label"]),k(O,{label:h.$t("common.required")},{default:j(({row:$})=>[ee("div",{onClick:v[1]||(v[1]=gn(()=>{},["stop"]))},[k(w,{disabled:"",size:"small",modelValue:$.is_required,"onUpdate:modelValue":D=>$.is_required=D},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(O,{label:h.$t("common.operation"),align:"left",width:"90"},{default:j(({row:$,$index:D})=>[ee("span",Tre,[k(S,{effect:"dark",content:h.$t("common.modify"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:gn(P=>a($,D),["stop"])},{default:j(()=>[k(b,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:h.$t("common.delete"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:P=>s(D)},{default:j(()=>[k(b,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(Ere,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:l},null,512)],64)}}}),Nre={class:"dialog-footer"},kre=_r({__name:"UserFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(),l=(S,M)=>S.every(T=>d9.get(M,T,void 0)!==void 0),f=hr(()=>{if(s.value){const S=s.value;switch(S.type){case"input":return l(["field","input_type","label","required","attrs"],s.value)?s.value:{attrs:S.attrs||{maxlength:200,minlength:0},field:S.field||S.variable,input_type:"TextInput",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required};case"select":return l(["field","input_type","label","required","option_list"],s.value)?s.value:{attrs:S.attrs||{},field:S.field||S.variable,input_type:"SingleSelect",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,option_list:S.option_list?S.option_list:S.optionList.map(M=>({key:M,value:M}))};case"date":return l(["field","input_type","label","required","attrs.format","attrs.value-format","attrs.type"],s.value)?s.value:{field:S.field||S.variable,input_type:"DatePicker",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,attrs:{format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",type:"datetime"}};default:return s.value}}else return{input_type:"TextInput",required:!1,attrs:{maxlength:200,minlength:0},show_default_value:!0}}),h=He(null),v=He([{label:Pt("dynamicsForm.input_type_list.TextInput"),value:"TextInputConstructor"},{label:Pt("dynamicsForm.input_type_list.PasswordInput"),value:"PasswordInputConstructor"},{label:Pt("dynamicsForm.input_type_list.SingleSelect"),value:"SingleSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.MultiSelect"),value:"MultiSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.RadioCard"),value:"RadioCardConstructor"},{label:Pt("dynamicsForm.input_type_list.DatePicker"),value:"DatePickerConstructor"},{label:Pt("dynamicsForm.input_type_list.SwitchInput"),value:"SwitchInputConstructor"}]),b=He(!1),E=(S,M)=>{b.value=!0,S?(a.value=!0,s.value=Me.cloneDeep(S),h.value=M):s.value=null},O=()=>{b.value=!1,a.value=!1,h.value=null,s.value=null},w=async()=>{const S=r.value;S&&await S.validate().then(()=>{o("refresh",S==null?void 0:S.getData(),h.value),a.value=!1,s.value=null,h.value=null})};return e({open:E,close:O}),(S,M)=>{const T=ne("el-button"),$=ne("el-dialog");return Ne(),bt($,{title:a.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:b.value,"onUpdate:modelValue":M[2]||(M[2]=D=>b.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":O,"append-to-body":""},{footer:j(()=>[ee("span",Nre,[k(T,{onClick:gn(O,["prevent"])},{default:j(()=>[ft(_e(S.$t("common.cancel")),1)]),_:1}),k(T,{type:"primary",onClick:M[1]||(M[1]=D=>w()),loading:i.value},{default:j(()=>[ft(_e(a.value?S.$t("common.save"):S.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(I2,{modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=D=>f.value=D),"label-position":"top","require-asterisk-position":"right",input_type_list:v.value,ref_key:"DynamicsFormConstructorRef",ref:r},null,8,["modelValue","input_type_list"])]),_:1},8,["title","modelValue"])}}}),Pre={class:"dialog-footer"},Rre=_r({__name:"UserInputTitleDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He({title:Pt("chat.userInput")}),s=Rh({title:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),l=He(!1),f=b=>{b&&(a.value=Me.cloneDeep(b)),l.value=!0},h=()=>{l.value=!1},v=async b=>{b&&await b.validate(E=>{E&&o("refresh",a.value)})};return e({open:f,close:h}),(b,E)=>{const O=ne("el-input"),w=ne("el-form-item"),S=ne("el-form"),M=ne("el-button"),T=ne("el-dialog");return Ne(),bt(T,{title:b.$t("common.setting"),modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=$=>l.value=$),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",Pre,[k(M,{onClick:E[3]||(E[3]=gn($=>l.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:E[4]||(E[4]=$=>v(r.value)),loading:i.value},{default:j(()=>[ft(_e(b.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(S,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:s,model:a.value,"require-asterisk-position":"right",onSubmit:E[2]||(E[2]=gn(()=>{},["prevent"]))},{default:j(()=>[k(w,{label:b.$t("common.title"),prop:"title"},{default:j(()=>[k(O,{modelValue:a.value.title,"onUpdate:modelValue":E[0]||(E[0]=$=>a.value.title=$),maxlength:"64","show-word-limit":"",onBlur:E[1]||(E[1]=$=>a.value.title=a.value.title.trim())},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Dre={class:"flex-between mb-16"},jre=["title"],Lre={class:"ml-4"},Ire=["title"],Fre={key:0},Bre=["title"],$re={key:1},Ure=["title"],Vre=["title"],Wre={class:"mr-4"},Gre=_r({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He(),i=He([]),a=He({title:Pt("chat.userInput")});function s(O,w){o.value.open(O,w)}function l(){r.value.open(a.value)}function f(O){i.value.splice(O,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function h(O,w){for(let M=0;M<i.value.length;M++)if(i.value[M].field===O.field&&w!==M){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}const S=e.nodeModel.properties.api_input_field_list;for(let M=0;M<S.length;M++)if(S[M].variable===O.field){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}w!==null?i.value.splice(w,1,O):i.value.push(O),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function v(O){a.value=O,r.value.close()}const b=O=>{var w;if(O.input_type==="PasswordInput")return"******";if(O.default_value){const S=(w=O.option_list)==null?void 0:w.filter(M=>O.default_value.indexOf(M.value)>-1).map(M=>M.label).join(",");return S||O.default_value}if(O.default_value!==void 0)return O.default_value};function E(){if(!n.value)return;const w=n.value.$el.querySelector(".el-table__body-wrapper tbody");w&&Zr.create(w,{animation:150,ghostClass:"ghost-row",onEnd:S=>{if(S.oldIndex===void 0||S.newIndex===void 0)return;const M=Me.cloneDeep([...i.value]),[T]=M.splice(S.oldIndex,1);M.splice(S.newIndex,0,T),i.value=M,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{e.nodeModel.properties.user_input_field_list?i.value.push(...e.nodeModel.properties.user_input_field_list):e.nodeModel.properties.input_field_list&&e.nodeModel.properties.input_field_list.filter(O=>O.assignment_method==="user_input").forEach(O=>{i.value.push(O)}),i.value.forEach((O,w)=>{switch(O.label=O.label||O.name,O.field=O.field||O.variable,O.required=O.required||O.is_required,O.type){case"input":O.input_type="TextInput";break;case"select":O.input_type="SingleSelect";break;case"date":O.input_type="DatePicker";break}}),Me.set(e.nodeModel.properties,"user_input_field_list",i),e.nodeModel.properties.user_input_config&&(a.value=e.nodeModel.properties.user_input_config),Me.set(e.nodeModel.properties,"user_input_config",a),E()}),(O,w)=>{var F;const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-table-column"),$=ne("el-tag"),D=ne("el-switch"),P=ne("el-tooltip"),B=ne("el-table");return Ne(),mn(Ir,null,[ee("div",Dre,[ee("h5",{class:"break-all ellipsis lighter",style:{"max-width":"80%"},title:a.value.title},_e(a.value.title),9,jre),ee("div",null,[k(M,{type:"primary",link:"",onClick:l},{default:j(()=>[k(S,{iconName:"app-setting"})]),_:1}),ee("span",Lre,[k(M,{link:"",type:"primary",onClick:w[0]||(w[0]=I=>s())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})])])]),((F=e.nodeModel.properties.user_input_field_list)==null?void 0:F.length)>0?(Ne(),bt(B,{key:0,data:e.nodeModel.properties.user_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(T,{prop:"field",label:O.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:I})=>[ee("span",{title:I.field,class:"ellipsis-1"},_e(I.field),9,Ire)]),_:1},8,["label"]),k(T,{prop:"label",label:O.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:I})=>[I.label&&I.label.input_type==="TooltipLabel"?(Ne(),mn("span",Fre,[ee("span",{title:I.label.label,class:"ellipsis-1"},_e(I.label.label),9,Bre)])):(Ne(),mn("span",$re,[ee("span",{title:I.label,class:"ellipsis-1"},_e(I.label),9,Ure)]))]),_:1},8,["label"]),k(T,{label:O.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:j(({row:I})=>[I.input_type==="TextInput"?(Ne(),bt($,{key:0,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):Bn("",!0),I.input_type==="PasswordInput"?(Ne(),bt($,{key:1,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):Bn("",!0),I.input_type==="Slider"?(Ne(),bt($,{key:2,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):Bn("",!0),I.input_type==="SwitchInput"?(Ne(),bt($,{key:3,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):Bn("",!0),I.input_type==="SingleSelect"?(Ne(),bt($,{key:4,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):Bn("",!0),I.input_type==="MultiSelect"?(Ne(),bt($,{key:5,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):Bn("",!0),I.input_type==="RadioCard"?(Ne(),bt($,{key:6,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):Bn("",!0),I.input_type==="DatePicker"?(Ne(),bt($,{key:7,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):Bn("",!0)]),_:1},8,["label"]),k(T,{prop:"default_value",label:O.$t("dynamicsForm.default.label")},{default:j(({row:I})=>[ee("span",{title:I.default_value,class:"ellipsis-1"},_e(b(I)),9,Vre)]),_:1},8,["label"]),k(T,{label:O.$t("common.required")},{default:j(({row:I})=>[ee("div",{onClick:w[1]||(w[1]=gn(()=>{},["stop"]))},[k(D,{disabled:"",size:"small",modelValue:I.required,"onUpdate:modelValue":V=>I.required=V},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(T,{label:O.$t("common.operation"),align:"left",width:"90"},{default:j(({row:I,$index:V})=>[ee("span",Wre,[k(P,{effect:"dark",content:O.$t("common.modify"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:gn(z=>s(I,V),["stop"])},{default:j(()=>[k(S,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:O.$t("common.delete"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:z=>f(V)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(kre,{ref_key:"UserFieldFormDialogRef",ref:o,onRefresh:h},null,512),k(Rre,{ref_key:"UserInputTitleDialogRef",ref:r,onRefresh:v},null,512)],64)}}}),zre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.8146C19.9934%202%2020.1647%202.07183%2020.29%202.19934L26.4756%208.49255C26.5982%208.61722%2026.6668%208.78505%2026.6668%208.95987V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.02637C20.1089%202.05793%2020.2089%202.11704%2020.2899%202.19936L26.4755%208.49256C26.5261%208.54408%2026.5675%208.60297%2026.5987%208.66668H21.5135C20.6776%208.66668%2020%207.98906%2020%207.15317V2.02637Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M10.7636%2013.5757H20.8727C20.9932%2013.5757%2021.0909%2013.6734%2021.0909%2013.7939V14.8121C21.0909%2014.9326%2020.9932%2015.0303%2020.8727%2015.0303H10.7636C10.6431%2015.0303%2010.5454%2014.9326%2010.5454%2014.8121V13.7939C10.5454%2013.6734%2010.6431%2013.5757%2010.7636%2013.5757ZM10.7636%2017.9394H20.8727C20.9932%2017.9394%2021.0909%2018.0371%2021.0909%2018.1576V19.1757C21.0909%2019.2962%2020.9932%2019.3939%2020.8727%2019.3939H10.7636C10.6431%2019.3939%2010.5454%2019.2962%2010.5454%2019.1757V18.1576C10.5454%2018.0371%2010.6431%2017.9394%2010.7636%2017.9394ZM10.7636%2022.303H16.1454C16.2659%2022.303%2016.3636%2022.4007%2016.3636%2022.5212V23.5394C16.3636%2023.6599%2016.2659%2023.7576%2016.1454%2023.7576H10.7636C10.6431%2023.7576%2010.5454%2023.6599%2010.5454%2023.5394V22.5212C10.5454%2022.4007%2010.6431%2022.303%2010.7636%2022.303Z'%20fill='white'/%3e%3c/svg%3e",Hre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%2314C0FF'/%3e%3cpath%20d='M20%202.05988C20.072%202.09264%2020.1383%202.13825%2020.1953%202.19526L26.4714%208.4714C26.5284%208.52841%2026.574%208.59467%2026.6068%208.66666H21.3333C20.597%208.66666%2020%208.06971%2020%207.33333V2.05988Z'%20fill='%2311A3D9'/%3e%3cpath%20d='M11.3335%2016C12.4381%2016%2013.3335%2015.1046%2013.3335%2014C13.3335%2012.8954%2012.4381%2012%2011.3335%2012C10.2289%2012%209.3335%2012.8954%209.3335%2014C9.3335%2015.1046%2010.2289%2016%2011.3335%2016Z'%20fill='white'/%3e%3cpath%20d='M22.2785%2014.9317C22.4218%2014.7884%2022.6668%2014.8899%2022.6668%2015.0925V24.0645C22.6668%2024.1901%2022.565%2024.2919%2022.4394%2024.2919H13.4674L13.4587%2024.2918H9.56142C9.35877%2024.2918%209.25728%2024.0468%209.40058%2023.9035L14.366%2018.938C14.4549%2018.8492%2014.5989%2018.8492%2014.6877%2018.938L16.48%2020.7302L22.2785%2014.9317Z'%20fill='white'/%3e%3c/svg%3e",Xre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.05994C20.072%202.0927%2020.1383%202.13831%2020.1953%202.19532L26.4714%208.47146C26.5284%208.52847%2026.574%208.59473%2026.6068%208.66672H21.3333C20.597%208.66672%2020%208.06977%2020%207.33339V2.05994Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M19.976%2012.8794C20.254%2012.9447%2020.4595%2013.1796%2020.4872%2013.4638L20.6106%2014.7297C20.6546%2015.1805%2020.2459%2015.5429%2019.8037%2015.4455L16.7344%2014.7691C16.5577%2014.7302%2016.3944%2014.8747%2016.4116%2015.0548L17.1297%2022.5884C17.1297%2022.7046%2017.1151%2022.7812%2017.0891%2022.8249C17.0254%2024.3752%2015.7484%2025.6124%2014.1825%2025.6124C12.5759%2025.6124%2011.2734%2024.31%2011.2734%2022.7033C11.2734%2021.0967%2012.5759%2019.7942%2014.1825%2019.7942C14.8467%2019.7942%2015.4589%2020.0168%2015.9485%2020.3914L15.274%2012.6749C15.2345%2012.2228%2015.6485%2011.8642%2016.0904%2011.9678L19.976%2012.8794Z'%20fill='white'/%3e%3c/svg%3e",Yre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%2334C724'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%232CA91F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%2011.5C7.5%2011.2239%207.72386%2011%208%2011H13.3971C13.6733%2011%2013.8971%2011.2239%2013.8971%2011.5V12.1723L15.8207%2011.4333C15.9744%2011.3742%2016.1474%2011.3946%2016.2831%2011.4879C16.4189%2011.5812%2016.5%2011.7353%2016.5%2011.9V16.3C16.5%2016.4647%2016.4189%2016.6188%2016.2831%2016.7121C16.1474%2016.8054%2015.9744%2016.8258%2015.8207%2016.7667L13.8971%2016.0277V16.7C13.8971%2016.9761%2013.6733%2017.2%2013.3971%2017.2H8C7.72386%2017.2%207.5%2016.9761%207.5%2016.7V11.5ZM9.25%2013.5C9.66421%2013.5%2010%2013.1642%2010%2012.75C10%2012.3358%209.66421%2012%209.25%2012C8.83579%2012%208.5%2012.3358%208.5%2012.75C8.5%2013.1642%208.83579%2013.5%209.25%2013.5Z'%20fill='white'/%3e%3c/svg%3e",qre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%238F959E'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%23646A73'/%3e%3cpath%20d='M14.288%209.86441C13.7422%209.34739%2013.026%209.09082%2012.1353%209.09082C11.1347%209.09082%2010.3505%209.41162%209.78235%2010.065C9.30108%2010.6265%209.04179%2011.1646%209.00471%2012.013C9.00384%2012.033%209.00309%2012.0697%209.00247%2012.1122C9.00043%2012.2508%209.11287%2012.3635%209.25147%2012.3635H9.84253C9.98%2012.3635%2010.0914%2012.2525%2010.0936%2012.1151C10.0943%2012.0737%2010.0951%2012.038%2010.0961%2012.0189C10.1251%2011.4328%2010.278%2011.1262%2010.5508%2010.7851C10.8953%2010.3259%2011.4006%2010.0999%2012.0943%2010.0999C12.7134%2010.0999%2013.1776%2010.2578%2013.4979%2010.5782C13.8033%2010.8963%2013.9625%2011.3294%2013.9625%2011.8726C13.9625%2012.2435%2013.8281%2012.5967%2013.5549%2012.948C13.4678%2013.0568%2013.3425%2013.1862%2012.9388%2013.5899C12.3012%2014.1474%2011.9073%2014.601%2011.6993%2015.0468C11.5282%2015.3888%2011.441%2015.7775%2011.441%2016.1954V16.4772C11.441%2016.6153%2011.5529%2016.7272%2011.691%2016.7272H12.2956C12.4336%2016.7272%2012.5456%2016.6153%2012.5456%2016.4772V16.1954C12.5456%2015.8413%2012.6327%2015.5237%2012.8133%2015.2141C12.9486%2014.9841%2013.1223%2014.8038%2013.4251%2014.5389C14.0321%2013.9897%2014.3689%2013.6625%2014.5198%2013.4705C14.8821%2012.9923%2015.0671%2012.4446%2015.0671%2011.8454C15.0671%2011.0185%2014.8075%2010.355%2014.288%209.86441ZM11.7046%2017.8181C11.5666%2017.8181%2011.4546%2017.93%2011.4546%2018.0681V18.659C11.4546%2018.7971%2011.5666%2018.909%2011.7046%2018.909H12.2956C12.4336%2018.909%2012.5456%2018.7971%2012.5456%2018.659V18.0681C12.5456%2017.93%2012.4336%2017.8181%2012.2956%2017.8181H11.7046Z'%20fill='white'/%3e%3c/svg%3e",Kre={class:"p-8"},Zre={class:"flex-between"},Jre={class:"flex align-center"},Qre={class:"line-height-22 mt-4"},eoe={class:"flex-between"},toe={class:"flex align-center"},noe={class:"line-height-22 mt-4"},roe={class:"flex-between"},ooe={class:"flex align-center"},ioe={class:"line-height-22 mt-4"},aoe={class:"flex-between"},loe={class:"flex align-center"},soe={class:"line-height-22 mt-4"},uoe={class:"flex-between"},coe={class:"flex align-center"},doe={class:"line-height-22 mt-4"},foe={class:"dialog-footer"},poe=_r({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=t,i=He(!1),a=He(!1),s=He(""),l=He(!1),f=He(),h=He(),v=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],b=["JPG","JPEG","PNG","GIF"],E=["MP3","WAV","OGG","ACC","M4A"],O=["MP4","AVI","MKV","MOV","FLV","WMV"],w=He({maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["PPT","DOC"]});function S(B){i.value=!0,xh(()=>{w.value={...w.value,...B}})}function M(){i.value=!1}const T=B=>{w.value.otherExtensions=w.value.otherExtensions.filter(F=>F!==B)},$=()=>{a.value=!0,xh(()=>{h.value.input.focus()})},D=()=>{if(s.value){if(s.value=s.value.toUpperCase(),w.value.otherExtensions.includes(s.value)||v.includes(s.value)||b.includes(s.value)||E.includes(s.value)){a.value=!1,s.value="",p9(Pt("common.fileUpload.existingExtensionsTip"));return}w.value.otherExtensions.push(s.value)}a.value=!1,s.value=""};async function P(){const B=f.value;B&&await B.validate().then(()=>{const F=Me.cloneDeep(w.value);o("refresh",F),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),i.value=!1})}return e({open:S}),(B,F)=>{const I=ne("el-slider"),V=ne("el-form-item"),z=ne("el-text"),X=ne("el-checkbox"),Y=ne("el-card"),W=ne("el-tag"),Q=ne("el-input"),J=ne("el-button"),ie=ne("el-space"),Se=ne("el-form"),Ae=ne("el-scrollbar"),Pe=ne("el-dialog");return Ne(),bt(Pe,{title:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:i.value,"onUpdate:modelValue":F[19]||(F[19]=De=>i.value=De),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":M,"append-to-body":"",width:"800","align-center":"",class:"scrollbar-dialog"},{footer:j(()=>[ee("span",foe,[k(J,{onClick:gn(M,["prevent"])},{default:j(()=>[ft(_e(B.$t("common.cancel")),1)]),_:1}),k(J,{type:"primary",onClick:F[18]||(F[18]=De=>P()),loading:l.value},{default:j(()=>[ft(_e(B.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(Ae,{"max-height":"550"},{default:j(()=>[ee("div",Kre,[k(Se,{"label-position":"top",ref_key:"fieldFormRef",ref:f,model:w.value,"require-asterisk-position":"right"},{default:j(()=>[k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:j(()=>[k(I,{modelValue:w.value.maxFiles,"onUpdate:modelValue":F[0]||(F[0]=De=>w.value.maxFiles=De),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:j(()=>[k(I,{modelValue:w.value.fileLimit,"onUpdate:modelValue":F[1]||(F[1]=De=>w.value.fileLimit=De),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:j(()=>[k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[4]||(F[4]=gn(De=>w.value.document=!w.value.document,["stop"]))},{default:j(()=>[ee("div",Zre,[ee("div",Jre,[F[20]||(F[20]=ee("img",{class:"mr-12",src:zre,alt:""},null,-1)),ee("div",null,[ee("p",Qre,[ft(_e(B.$t("common.fileUpload.document"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),ee("p",null,_e(v.join("、")),1)])]),k(X,{modelValue:w.value.document,"onUpdate:modelValue":F[2]||(F[2]=De=>w.value.document=De),onChange:F[3]||(F[3]=De=>w.value.document=!w.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[7]||(F[7]=gn(De=>w.value.image=!w.value.image,["stop"]))},{default:j(()=>[ee("div",eoe,[ee("div",toe,[F[21]||(F[21]=ee("img",{class:"mr-12",src:Hre,alt:""},null,-1)),ee("div",null,[ee("p",noe,[ft(_e(B.$t("common.fileUpload.image"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),ee("p",null,_e(b.join("、")),1)])]),k(X,{modelValue:w.value.image,"onUpdate:modelValue":F[5]||(F[5]=De=>w.value.image=De),onChange:F[6]||(F[6]=De=>w.value.image=!w.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[10]||(F[10]=gn(De=>w.value.audio=!w.value.audio,["stop"]))},{default:j(()=>[ee("div",roe,[ee("div",ooe,[F[22]||(F[22]=ee("img",{class:"mr-12",src:Xre,alt:""},null,-1)),ee("div",null,[ee("p",ioe,[ft(_e(B.$t("common.fileUpload.audio"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),ee("p",null,_e(E.join("、")),1)])]),k(X,{modelValue:w.value.audio,"onUpdate:modelValue":F[8]||(F[8]=De=>w.value.audio=De),onChange:F[9]||(F[9]=De=>w.value.audio=!w.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[13]||(F[13]=gn(De=>w.value.video=!w.value.video,["stop"]))},{default:j(()=>[ee("div",aoe,[ee("div",loe,[F[23]||(F[23]=ee("img",{class:"mr-12",width:"32",src:Yre,alt:""},null,-1)),ee("div",null,[ee("p",soe,[ft(_e(B.$t("common.fileUpload.video"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),ee("p",null,_e(O.join("、")),1)])]),k(X,{modelValue:w.value.video,"onUpdate:modelValue":F[11]||(F[11]=De=>w.value.video=De),onChange:F[12]||(F[12]=De=>w.value.video=!w.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[17]||(F[17]=gn(De=>w.value.other=!w.value.other,["stop"]))},{default:j(()=>[ee("div",uoe,[ee("div",coe,[F[24]||(F[24]=ee("img",{class:"mr-12",width:32,src:qre,alt:""},null,-1)),ee("div",null,[ee("p",doe,[ft(_e(B.$t("common.fileUpload.other"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),k(ie,{wrap:"",size:2,class:"mt-4"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(w.value.otherExtensions,De=>(Ne(),bt(W,{key:De,closable:"","disable-transitions":!1,onClose:ze=>T(De),type:"info",class:"mr-4",effect:"plain",style:{"--el-tag-border-radius":"4px","--el-tag-border-color":"var(--el-border-color)"}},{default:j(()=>[ft(_e(De),1)]),_:2},1032,["onClose"]))),128)),a.value?(Ne(),bt(Q,{key:0,ref_key:"InputRef",ref:h,modelValue:s.value,"onUpdate:modelValue":F[14]||(F[14]=De=>s.value=De),size:"small",onKeyup:f9(D,["enter"]),onBlur:D},null,8,["modelValue"])):(Ne(),bt(J,{key:1,class:"button-new-tag",size:"small",onClick:gn($,["stop"])},{default:j(()=>[ft(" + "+_e(B.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),k(X,{modelValue:w.value.other,"onUpdate:modelValue":F[15]||(F[15]=De=>w.value.other=De),onChange:F[16]||(F[16]=De=>w.value.other=!w.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),hoe={class:"dialog-footer"},voe=_r({__name:"ChatFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",hoe,[k($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),moe={class:"flex-between mb-16"},goe={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},yoe={class:"ml-4"},_oe=["title"],boe=["title"],woe={class:"mr-4"},Eoe=_r({__name:"ChatFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return bo(()=>{e.nodeModel.properties.chat_input_field_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.chat_input_field_list)),Me.set(e.nodeModel.properties,"chat_input_field_list",r)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",moe,[ee("h5",goe,_e(l.$t("views.applicationWorkflow.variable.chat")),1),ee("div",null,[ee("span",yoe,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=e.nodeModel.properties.chat_input_field_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:e.nodeModel.properties.chat_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,_oe)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,boe)])]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",woe,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:gn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(voe,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),xoe={class:"flex-between"},Ooe={class:"flex align-center"},Soe={class:"mr-4"},Aoe={class:"flex-between"},Moe={class:"mr-4"},Toe={class:"flex"},Coe={class:"flex-between"},Noe={class:"mr-4"},koe={class:"flex"},Poe={class:"w-full"},Roe={class:"flex-between w-full"},Doe=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(null),l=He(),f=He(),h=He(),v=He(),b={name:"",desc:"",prologue:Pt("views.application.form.defaultPrologue")},E=W=>W.ctrlKey===!0?(W.preventDefault(),!0):(W.stopPropagation(),!0);function O(W){Me.set(i.nodeModel.properties.node_data,"prologue",W)}const w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:W=>{Me.set(i.nodeModel.properties,"node_data",W)}}),S=He(),M=()=>{var W;return w.value.tts_model_enable&&!w.value.tts_model_id&&w.value.tts_type==="TTS"?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voicePlay.requiredMessage")}):w.value.stt_model_enable&&!w.value.stt_model_id?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voiceInput.requiredMessage")}):(W=S.value)==null?void 0:W.validate().catch(Q=>Promise.reject({node:i.nodeModel,errMessage:Q}))},T=e();function $(){var Q;const W=r.value==="systemManage"?{model_type:"STT",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList(W).then(J=>{a.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function D(){var Q;const W=r.value==="systemManage"?{model_type:"TTS",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(W).then(J=>{s.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function P(){xh(()=>{var W;w.value.tts_model_id?(W=l.value)==null||W.reset_default(w.value.tts_model_id,o):V({})})}function B(){w.value.tts_model_enable||(w.value.tts_model_id="",w.value.tts_type="BROWSER")}function F(){w.value.stt_model_enable||(w.value.stt_model_id="")}const I=()=>{var Q;const W=w.value.tts_model_id;if(!W){Oh(Pt("views.application.form.voicePlay.requiredMessage"));return}(Q=l.value)==null||Q.open(W,o,w.value.tts_model_params_setting)},V=W=>{w.value.tts_model_params_setting=W},z=()=>{const W={maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["ppt","doc"]};w.value.file_upload_enable&&(w.value.file_upload_setting=w.value.file_upload_setting||W),i.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig")},X=()=>{var W;(W=v.value)==null||W.open(w.value.file_upload_setting)},Y=W=>{w.value.file_upload_setting=W};return bo(()=>{Me.set(i.nodeModel,"validate",M),i.nodeModel.properties.node_data.tts_type||Me.set(i.nodeModel.properties.node_data,"tts_type","BROWSER"),D(),$()}),(W,Q)=>{const J=ne("el-input"),ie=ne("el-form-item"),Se=ne("MdEditorMagnify"),Ae=ne("AppIcon"),Pe=ne("el-tooltip"),De=ne("el-button"),ze=ne("el-switch"),Ye=ne("el-checkbox"),Be=ne("ModelSelect"),Je=ne("el-radio"),gt=ne("el-radio-group"),le=ne("Operation"),Ze=ne("el-icon"),pe=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(pe,{onSubmit:Q[13]||(Q[13]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right",class:"mb-24","label-width":"auto",ref_key:"baseNodeFormRef",ref:S},{default:j(()=>[k(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appName.label"),prop:"name",rules:{message:Wn(Pt)("views.application.form.appName.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(J,{modelValue:w.value.name,"onUpdate:modelValue":Q[0]||(Q[0]=se=>w.value.name=se),maxlength:"64",placeholder:Wn(Pt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:Q[1]||(Q[1]=se=>{var we;return w.value.name=(we=w.value.name)==null?void 0:we.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:j(()=>[k(J,{modelValue:w.value.desc,"onUpdate:modelValue":Q[2]||(Q[2]=se=>w.value.desc=se),placeholder:W.$t("views.application.form.appDescription.placeholder"),rows:3,type:"textarea",maxlength:"256","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(ie,{label:W.$t("views.application.form.prologue")},{default:j(()=>[k(Se,{onWheel:E,title:W.$t("views.application.form.prologue"),modelValue:w.value.prologue,"onUpdate:modelValue":Q[3]||(Q[3]=se=>w.value.prologue=se),style:{height:"150px"},onSubmitDialog:O},null,8,["title","modelValue"])]),_:1},8,["label"]),k(ie,null,{label:j(()=>[ee("div",xoe,[ee("div",Ooe,[ee("span",Soe,_e(W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),k(Pe,{effect:"dark",content:W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:j(()=>[k(Ae,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),ee("div",null,[w.value.file_upload_enable?(Ne(),bt(De,{key:0,type:"primary",link:"",onClick:X,class:"mr-4"},{default:j(()=>[k(Ae,{iconName:"app-setting",class:"mr-4"})]),_:1})):Bn("",!0),k(ze,{size:"small",modelValue:w.value.file_upload_enable,"onUpdate:modelValue":Q[4]||(Q[4]=se=>w.value.file_upload_enable=se),onChange:z},null,8,["modelValue"])])])]),_:1}),k(Gre,{ref_key:"UserInputFieldTableFef",ref:f,"node-model":t.nodeModel},null,8,["node-model"]),k(Cre,{ref_key:"ApiInputFieldTableFef",ref:h,"node-model":t.nodeModel},null,8,["node-model"]),k(Eoe,{ref:"ChatFieldTeble","node-model":t.nodeModel},null,8,["node-model"]),k(ie,null,{label:j(()=>[ee("div",Aoe,[ee("span",Moe,_e(W.$t("views.application.form.voiceInput.label")),1),ee("div",Toe,[w.value.stt_model_enable?(Ne(),bt(Ye,{key:0,modelValue:w.value.stt_autosend,"onUpdate:modelValue":Q[5]||(Q[5]=se=>w.value.stt_autosend=se)},{default:j(()=>[ft(_e(W.$t("views.application.form.voiceInput.autoSend")),1)]),_:1},8,["modelValue"])):Bn("",!0),k(ze,{class:"ml-8",size:"small",modelValue:w.value.stt_model_enable,"onUpdate:modelValue":Q[6]||(Q[6]=se=>w.value.stt_model_enable=se),onChange:F},null,8,["modelValue"])])])]),default:j(()=>[Ql(k(Be,{onWheel:E,modelValue:w.value.stt_model_id,"onUpdate:modelValue":Q[7]||(Q[7]=se=>w.value.stt_model_id=se),placeholder:W.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"]),[[Eh,w.value.stt_model_enable]])]),_:1}),k(ie,null,{label:j(()=>[ee("div",Coe,[ee("span",Noe,_e(W.$t("views.application.form.voicePlay.label")),1),ee("div",koe,[w.value.tts_model_enable?(Ne(),bt(Ye,{key:0,modelValue:w.value.tts_autoplay,"onUpdate:modelValue":Q[8]||(Q[8]=se=>w.value.tts_autoplay=se)},{default:j(()=>[ft(_e(W.$t("views.application.form.voicePlay.autoPlay")),1)]),_:1},8,["modelValue"])):Bn("",!0),k(ze,{class:"ml-8",size:"small",modelValue:w.value.tts_model_enable,"onUpdate:modelValue":Q[9]||(Q[9]=se=>w.value.tts_model_enable=se),onChange:B},null,8,["modelValue"])])])]),default:j(()=>[ee("div",Poe,[Ql(k(gt,{modelValue:w.value.tts_type,"onUpdate:modelValue":Q[10]||(Q[10]=se=>w.value.tts_type=se)},{default:j(()=>[k(Je,{label:W.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),k(Je,{label:W.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Eh,w.value.tts_model_enable]])]),ee("div",Roe,[w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Ne(),bt(Be,{key:0,onWheel:E,modelValue:w.value.tts_model_id,"onUpdate:modelValue":Q[11]||(Q[11]=se=>w.value.tts_model_id=se),placeholder:W.$t("views.application.form.voicePlay.placeholder"),options:s.value,onChange:Q[12]||(Q[12]=se=>P()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):Bn("",!0),w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Ne(),bt(De,{key:1,onClick:I,disabled:!w.value.tts_model_id,class:"ml-8"},{default:j(()=>[k(Ze,null,{default:j(()=>[k(Ze,null,{default:j(()=>[k(le)]),_:1})]),_:1})]),_:1},8,["disabled"])):Bn("",!0)])]),_:1})]),_:1},8,["model"]),k(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:l,onRefresh:V},null,512),k(poe,{ref_key:"FileUploadSettingDialogRef",ref:v,"node-model":t.nodeModel,onRefresh:Y},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),joe=Ph(Doe,[["__scopeId","data-v-940d4dcd"]]);class Loe extends ai{constructor(e){super(e,joe)}}class Ioe extends li{constructor(e,n){super(e,n)}get_width(){return 600}}const Foe={type:"base-node",model:Ioe,view:Loe},_8=Object.freeze(Object.defineProperty({__proto__:null,default:Foe},Symbol.toStringTag,{value:"Module"})),Boe={class:"handle flex-between lighter"},$oe={class:"flex align-center"},Uoe={key:0,class:"info"},Voe={key:0,class:"mt-8"},Woe=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={branch:[{conditions:[{field:[],compare:"",value:""}],id:yu(),type:"IF",condition:"and"},{conditions:[],id:yu(),type:"ELSE",condition:"and"}]},o=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),r=(w,S,M)=>{const $=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]).map(D=>D.id===S.id?{...D,height:w.height,index:M}:D);Me.set(e.nodeModel.properties,"branch_condition_list",$),v(e.nodeModel.properties.node_data.branch,!0)},i=hr({get:()=>(e.nodeModel.properties.node_data||(Me.set(e.nodeModel.properties,"node_data",n),v(n.branch,!0)),e.nodeModel.properties.node_data),set:w=>{Me.set(e.nodeModel.properties,"node_data",w)}}),a=He(),s=He(),l=()=>{var S;const w=[(S=a.value)==null?void 0:S.validate(),...s.value.map(M=>M.validate())];return Promise.all(w).catch(M=>Promise.reject({node:e.nodeModel,errMessage:M}))};function f(w){const{oldIndex:S,newIndex:M}=w;if(S===void 0||M===void 0)return;const T=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(S===T.length-1||M===T.length-1)return;const $={...T[S],type:T[M].type,id:T[M].id},D={...T[M],type:T[S].type,id:T[S].id};T[M]=$,T[S]=D,Me.set(e.nodeModel.properties.node_data,"branch",T)}function h(){const w=Me.cloneDeep(e.nodeModel.properties.node_data.branch),S={conditions:[{field:[],compare:"",value:""}],type:"ELSE IF "+(w.length-1),id:yu(),condition:"and"};w.splice(w.length-1,0,S),v(w,!0),Me.set(e.nodeModel.properties.node_data,"branch",w)}function v(w,S){const M=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]),T=w.map(($,D)=>{const P=M.find(B=>B.id===$.id);if(P)return{index:D,height:P.height,id:$.id};if(S)return{index:D,height:12,id:$.id}}).filter($=>$);Me.set(e.nodeModel.properties,"branch_condition_list",T),e.nodeModel.refreshBranch()}function b(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.branch);S[w].conditions.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"branch",S)}function E(w,S){const M=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(M[w].conditions.splice(S,1),M[w].conditions.length===0){const $=M.splice(w,1).map(D=>e.nodeModel.id+"_"+D.id+"_right");e.nodeModel.graphModel.eventCenter.emit("delete_edge",e.nodeModel.outgoing.edges.filter(D=>$.includes(D.sourceAnchorId)).map(D=>D.id)),v(M,!1),M.forEach((D,P)=>{D.type==="ELSE IF "+(P+1)&&(D.type="ELSE IF "+P)})}Me.set(e.nodeModel.properties.node_data,"branch",M)}function O(w,S,M){if(["is_null","is_not_null","is_true","is_not_true"].includes(w)){const T=Me.cloneDeep(e.nodeModel.properties.node_data.branch);T[S].conditions[M].value=1,Me.set(e.nodeModel.properties.node_data,"branch",T)}}return bo(()=>{Me.set(e.nodeModel,"validate",l)}),(w,S)=>{const M=ne("el-option"),T=ne("el-select"),$=ne("el-form-item"),D=ne("el-col"),P=ne("el-input"),B=ne("AppIcon"),F=ne("el-button"),I=ne("el-row"),V=ne("el-card"),z=ne("el-form"),X=Rg("resize");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(z,{model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:a,onSubmit:S[0]||(S[0]=gn(()=>{},["prevent"]))},{default:j(()=>[k(Wn(Xj),{ref:"el",modelValue:i.value.branch,disabled:i.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:f},{default:j(()=>[(Ne(!0),mn(Ir,null,No(i.value.branch,(Y,W)=>Ql((Ne(),bt(V,{key:Y.id,shadow:"never",class:Gs(["drag-card card-never mb-8",{"no-drag":W===i.value.branch.length-1||i.value.branch.length===2}]),style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",Boe,[ee("span",$oe,[S[1]||(S[1]=ee("img",{src:Yj,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),ft(" "+_e(Y.type),1)]),Y.conditions.length>1?(Ne(),mn("div",Uoe,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(T,{teleported:!1,modelValue:Y.condition,"onUpdate:modelValue":Q=>Y.condition=Q,size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(M,{label:w.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(M,{label:w.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"]),ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),W!==i.value.branch.length-1?(Ne(),mn("div",Voe,[(Ne(!0),mn(Ir,null,No(Y.conditions,(Q,J)=>(Ne(),bt(I,{key:J,gutter:8},{default:j(()=>[k(D,{span:11},{default:j(()=>[k($,{prop:"branch."+W+".conditions."+J+".field",rules:{type:"array",required:!0,message:w.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:s,nodeModel:t.nodeModel,class:"w-full",placeholder:w.$t("views.applicationWorkflow.variable.placeholder"),modelValue:Q.field,"onUpdate:modelValue":ie=>Q.field=ie},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:j(()=>[k($,{prop:"branch."+W+".conditions."+J+".compare",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(T,{onWheel:o,teleported:!1,modelValue:Q.compare,"onUpdate:modelValue":ie=>Q.compare=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:ie=>O(ie,W,J)},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(ie,Se)=>(Ne(),bt(M,{key:Se,label:ie.label,value:ie.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(Q.compare)?Bn("",!0):(Ne(),bt($,{key:0,prop:"branch."+W+".conditions."+J+".value",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(P,{modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(D,{span:1},{default:j(()=>[k(F,{disabled:i.value.branch.length===2&&Y.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:ie=>E(W,J)},{default:j(()=>[k(B,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):Bn("",!0),W!==i.value.branch.length-1?(Ne(),bt(F,{key:1,link:"",type:"primary",onClick:Q=>b(W)},{default:j(()=>[k(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1},8,["onClick"])):Bn("",!0)]),_:2},1032,["class"])),[[X,Q=>r(Q,Y,W)]])),128))]),_:1},8,["modelValue","disabled"]),k(F,{link:"",type:"primary",onClick:h},{default:j(()=>[k(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addBranch")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Goe extends ai{constructor(e){super(e,Woe)}}const zoe=(t,e)=>t.filter((n,o)=>o<e).map(n=>n.height+8).reduce((n,o)=>n+o,0);class Hoe extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let h=0;h<f.length;h++){const v=f[h],b=zoe(f,h);l.push({x:n+r/2-10,y:s?o-i/2+75+b+(v.height||0)/2:o-15,id:`${e}_${v.id}_right`,type:"right"})}return l}}const Xoe={type:"condition-node",model:Hoe,view:Goe},b8=Object.freeze(Object.defineProperty({__proto__:null,default:Xoe},Symbol.toStringTag,{value:"Module"})),Yoe={class:"title-decoration-1 mb-8"},qoe=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={document_list:["start-node","document"]},o=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:r=>{Me.set(e.nodeModel.properties,"node_data",r)}});return(r,i)=>{const a=ne("el-form-item"),s=ne("el-form"),l=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Yoe,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(l,{shadow:"never",class:"card-never"},{default:j(()=>[k(s,{onSubmit:i[1]||(i[1]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto"},{default:j(()=>[k(a,{label:r.$t("views.problem.relateParagraph.selectDocument"),rules:{type:"array",required:!0,message:r.$t("views.chatLog.documentPlaceholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:r.$t("views.chatLog.documentPlaceholder"),modelValue:o.value.document_list,"onUpdate:modelValue":i[0]||(i[0]=f=>o.value.document_list=f)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});let Koe=class extends ai{constructor(e){super(e,qoe)}};const Zoe={type:"document-extract-node",model:li,view:Koe},w8=Object.freeze(Object.defineProperty({__proto__:null,default:Zoe},Symbol.toStringTag,{value:"Module"})),Joe={class:"dialog-footer"},Qoe=_r({__name:"AddFormCollect",props:{title:{default:Pt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=He(!1),i=He(),a=He({}),s=He(!1),l=()=>{r.value=!0},f=()=>{r.value=!1,a.value={}},h=()=>{var v;(v=i.value)==null||v.validate().then(()=>{var b;o.addFormField((b=i.value)==null?void 0:b.getData()),f()})};return e({close:f,open:l}),(v,b)=>{const E=ne("el-button"),O=ne("el-dialog");return Ne(),bt(O,{title:t.title,modelValue:r.value,"onUpdate:modelValue":b[3]||(b[3]=w=>r.value=w),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":f,"append-to-body":""},{footer:j(()=>[ee("span",Joe,[k(E,{onClick:b[1]||(b[1]=gn(w=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(E,{type:"primary",onClick:b[2]||(b[2]=w=>h()),loading:s.value},{default:j(()=>[ft(_e(v.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[b[4]||(b[4]=ft("l ",-1)),k(I2,{modelValue:a.value,"onUpdate:modelValue":b[0]||(b[0]=w=>a.value=w),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),eie={class:"dialog-footer"},tie=_r({__name:"EditFormCollect",props:{title:{default:Pt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=He(!1),i=He(),a=He({}),s=He(0),l=He(!1),f=(b,E)=>{r.value=!0,a.value=b,s.value=E},h=()=>{r.value=!1,a.value={}},v=()=>{var b;(b=i.value)==null||b.validate().then(()=>{var E;o.editFormField((E=i.value)==null?void 0:E.getData(),s.value),h()})};return e({close:h,open:f}),(b,E)=>{const O=ne("el-button"),w=ne("el-dialog");return Ne(),bt(w,{title:t.title,modelValue:r.value,"onUpdate:modelValue":E[3]||(E[3]=S=>r.value=S),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",eie,[k(O,{onClick:E[1]||(E[1]=gn(S=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),k(O,{type:"primary",onClick:E[2]||(E[2]=S=>v()),loading:l.value},{default:j(()=>[ft(_e(b.$t("common.modify")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(I2,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=S=>a.value=S),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),nie={class:"title-decoration-1 mb-8"},rie={class:"flex align-center"},oie={class:"mr-4"},iie={class:"flex-between"},aie={class:"lighter"},lie=["title"],sie={key:0},uie=["title"],cie={key:1},die=["title"],fie=["title"],pie={class:"mr-4"},hie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t;O_("getModel",()=>e.nodeModel);const n=He(),o=He(),r=(T,$)=>{const D=E.value.form_field_list.map((P,B)=>$===B?Me.cloneDeep(T):Me.cloneDeep(P));E.value.form_field_list=D,a()},i=T=>{if(E.value.form_field_list.some($=>$.field===T.field)){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+T.field);return}E.value.form_field_list=Me.cloneDeep([...E.value.form_field_list,T]),a()},a=()=>{const T=[{label:Pt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...E.value.form_field_list.map($=>({value:$.field,label:typeof $.label=="string"?$.label:$.label.label}))];Me.set(e.nodeModel.properties.config,"fields",T),e.nodeModel.clear_next_node_field(!1),M()},s=He(),l=He(),f=()=>{var T;(T=s.value)==null||T.open()},h=(T,$)=>{var D;(D=l.value)==null||D.open(Me.cloneDeep(T),$)},v=T=>{E.value.form_field_list=E.value.form_field_list.filter($=>$.field!==T.field),a()},b=He({is_result:!0,form_content_format:`${Pt("views.applicationWorkflow.nodes.formNode.form_content_format1")}
|
||
{{form}}
|
||
${Pt("views.applicationWorkflow.nodes.formNode.form_content_format2")}`,form_field_list:[]}),E=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",b.value),e.nodeModel.properties.node_data),set:T=>{Me.set(e.nodeModel.properties,"node_data",T)}}),O=T=>{var $;if(T.default_value){const D=($=T.option_list)==null?void 0:$.filter(P=>T.default_value.indexOf(P.value)>-1).map(P=>P.label).join(",");return D||T.default_value}if(T.default_value!==void 0)return T.default_value},w=()=>{var T;return(T=n.value)==null?void 0:T.validate()};function S(T){Me.set(e.nodeModel.properties.node_data,"form_content_format",T)}function M(){if(!o.value)return;const $=o.value.$el.querySelector(".el-table__body-wrapper tbody");$&&Zr.create($,{animation:150,ghostClass:"ghost-row",onEnd:D=>{if(D.oldIndex===void 0||D.newIndex===void 0)return;const P=Me.cloneDeep([...E.value.form_field_list]),[B]=P.splice(D.oldIndex,1);P.splice(D.newIndex,0,B),E.value.form_field_list=P,a()}})}return bo(()=>{Me.set(e.nodeModel,"validate",w),a(),e.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-tooltip"),B=ne("MdEditorMagnify"),F=ne("el-form-item"),I=ne("el-button"),V=ne("el-table-column"),z=ne("el-tag"),X=ne("el-switch"),Y=ne("el-table"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",nie,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(W,{onSubmit:$[4]||($[4]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),prop:"form_content_format",rules:{required:!0,message:T.$t("views.applicationWorkflow.nodes.formNode.formContent.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",rie,[ee("div",oie,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.tooltip",{form:"{ form }"})),1)]),default:j(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(B,{title:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:E.value.form_content_format,"onUpdate:modelValue":$[0]||($[0]=J=>E.value.form_content_format=J),style:{height:"150px"},onSubmitDialog:S},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:T.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:$[3]||($[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",iie,[ee("h5",aie,_e(T.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),k(I,{link:"",type:"primary",onClick:$[1]||($[1]=J=>f())},{default:j(()=>[k(D,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(T.$t("common.add")),1)]),_:1})])]),default:j(()=>[E.value.form_field_list.length>0?(Ne(),bt(Y,{key:0,class:"border",data:E.value.form_field_list,ref_key:"tableRef",ref:o,"row-key":"field"},{default:j(()=>[k(V,{prop:"field",label:T.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:J})=>[ee("span",{title:J.field,class:"ellipsis-1"},_e(J.field),9,lie)]),_:1},8,["label"]),k(V,{prop:"label",label:T.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:J})=>[J.label&&J.label.input_type==="TooltipLabel"?(Ne(),mn("span",sie,[ee("span",{title:J.label.label,class:"ellipsis-1"},_e(J.label.label),9,uie)])):(Ne(),mn("span",cie,[ee("span",{title:J.label,class:"ellipsis-1"},_e(J.label),9,die)]))]),_:1},8,["label"]),k(V,{label:T.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:j(({row:J})=>[k(z,{type:"info",class:"info-tag"},{default:j(()=>{var ie;return[ft(_e((ie=Wn(h9).find(Se=>Se.value===J.input_type))==null?void 0:ie.label),1)]}),_:2},1024)]),_:1},8,["label"]),k(V,{prop:"default_value",label:T.$t("dynamicsForm.default.label")},{default:j(({row:J})=>[ee("span",{title:J.default_value,class:"ellipsis-1"},_e(O(J)),9,fie)]),_:1},8,["label"]),k(V,{label:T.$t("common.required"),width:"55"},{default:j(({row:J})=>[ee("div",{onClick:$[2]||($[2]=gn(()=>{},["stop"]))},[k(X,{disabled:"",size:"small",modelValue:J.required,"onUpdate:modelValue":ie=>J.required=ie},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(V,{label:T.$t("common.operation"),align:"left",width:"80"},{default:j(({row:J,$index:ie})=>[ee("span",pie,[k(P,{effect:"dark",content:T.$t("common.modify"),placement:"top"},{default:j(()=>[k(I,{type:"primary",text:"",onClick:gn(Se=>h(J,ie),["stop"])},{default:j(()=>[k(D,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:T.$t("common.delete"),placement:"top"},{default:j(()=>[k(I,{type:"primary",text:"",onClick:Se=>v(J)},{default:j(()=>[k(D,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Qoe,{ref_key:"addFormCollectRef",ref:s,addFormField:i},null,512),k(tie,{ref_key:"editFormCollectRef",ref:l,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class vie extends ai{constructor(e){super(e,hie)}getConfig(e){return e.model.properties.config}}const mie={type:"form-node",model:li,view:vie},E8=Object.freeze(Object.defineProperty({__proto__:null,default:mie},Symbol.toStringTag,{value:"Module"})),gie={class:"title-decoration-1 mb-8"},yie={class:"flex-between w-full"},_ie={class:"flex align-center"},bie={class:"mr-4"},wie={class:"flex align-center"},Eie={class:"mr-4"},xie={class:"flex align-center"},Oie={class:"mr-4"},Sie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var B;const P=r.value==="systemManage"?{model_type:"TTI",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTI"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",gie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[6]||(B[6]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",yie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),options:a.value,showFooter:"",onFocus:w,"model-type":"TTI"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",_ie,[ee("div",bie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",wie,[ee("div",Eie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",xie,[ee("div",Oie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});let Aie=class extends ai{constructor(e){super(e,Sie)}};const Mie={type:"image-generate-node",model:li,view:Aie},x8=Object.freeze(Object.defineProperty({__proto__:null,default:Mie},Symbol.toStringTag,{value:"Module"})),Tie={class:"title-decoration-1 mb-8"},Cie={class:"flex-between w-full"},Nie={class:"flex align-center"},kie={class:"mr-4"},Pie={class:"flex align-center"},Rie={class:"mr-4"},Die={class:"flex align-center"},jie={class:"mr-4"},Lie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,first_frame_url:["start-node","image"],last_frame_url:[]},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var B;const P=r.value==="systemManage"?{model_type:"ITV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"ITV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Tie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[8]||(B[8]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Cie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),onFocus:w,placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Nie,[ee("div",kie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),B[10]||(B[10]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Pie,[ee("div",Rie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),B[11]||(B[11]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:E.value.first_frame_url,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.first_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:E.value.last_frame_url,"onUpdate:modelValue":B[5]||(B[5]=ie=>E.value.last_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[7]||(B[7]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Die,[ee("div",jie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[6]||(B[6]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class Iie extends ai{constructor(e){super(e,Lie)}}const Fie={type:"image-to-video-node",model:li,view:Iie},O8=Object.freeze(Object.defineProperty({__proto__:null,default:Fie},Symbol.toStringTag,{value:"Module"})),Bie={class:"title-decoration-1 mb-8"},$ie={class:"flex-between w-full"},Uie={class:"flex-between"},Vie={class:"flex align-center"},Wie={class:"flex align-center"},Gie={class:"mr-4"},zie={class:"flex-between"},Hie={class:"flex align-center"},Xie={class:"mr-4"},Yie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=l.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},O=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),w=e();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=w.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function T(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=s.value)==null||V.open(I,o,O.value.model_params_setting))};function D(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}const P=He(),B=I=>{var V;I&&((V=P.value)==null||V.open(I,o))},F=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),X=ne("el-button"),Y=ne("ModelSelect"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),Pe=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Bie,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:V[10]||(V[10]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(W,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",$ie,[ee("div",null,[ee("span",null,[ft(_e(Wn(Pt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:D},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",Uie,[ee("div",Vie,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(X,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>B(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(W,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",Wie,[ee("div",Gie,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",zie,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(W,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:O.value.image_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.image_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(W,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Hie,[ee("div",Xie,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:D},null,512),k(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:P},null,512)]),_:1},8,["node-model"])}}});let qie=class extends ai{constructor(e){super(e,Yie)}};const Kie={type:"image-understand-node",model:li,view:qie},S8=Object.freeze(Object.defineProperty({__proto__:null,default:Kie},Symbol.toStringTag,{value:"Module"})),Zie={class:"title-decoration-1 mb-8"},Jie={class:"flex-between"},Qie={class:"flex-between"},eae={class:"flex-between"},tae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=He();function s(){const B=Me.cloneDeep(S.nodeModel.properties.node_data.branch),F={id:yu(),content:"",isOther:!1};B.splice(B.length-1,0,F),f(B,!0),Me.set(S.nodeModel.properties.node_data,"branch",B),S.nodeModel.refreshBranch()}function l(B){var W;const F=Me.cloneDeep(S.nodeModel.properties.node_data.branch),I=F.find(Q=>Q.id===B);if(!I||I.isOther||F.filter(Q=>!Q.isOther).length<=1)return;const z=`${S.nodeModel.id}_${B}_right`,X=(((W=S.nodeModel.outgoing)==null?void 0:W.edges)||[]).filter(Q=>Q.sourceAnchorId===z).map(Q=>Q.id);X.length>0&&S.nodeModel.graphModel.eventCenter.emit("delete_edge",X);const Y=F.filter(Q=>Q.id!==B);Me.set(S.nodeModel.properties.node_data,"branch",Y),f(Y,!1)}function f(B,F){const I=Me.cloneDeep(S.nodeModel.properties.branch_condition_list?S.nodeModel.properties.branch_condition_list:[]),V=B.map((z,X)=>{const Y=I.find(W=>W.id===z.id);if(Y)return{index:X,height:Y.height,id:z.id};if(F)return{index:X,height:12,id:z.id}}).filter(z=>z);Me.set(S.nodeModel.properties,"branch_condition_list",V),S.nodeModel.refreshBranch()}const h=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),v=B=>{var F;B?(F=a.value)==null||F.reset_default(B,o):E({})},b={model_id:"",branch:[{id:yu(),content:"",isOther:!1},{id:yu(),content:Pt("views.applicationWorkflow.nodes.intentNode.other"),isOther:!0}],dialogue_number:1,content_list:[]};function E(B){Me.set(S.nodeModel.properties.node_data,"model_params_setting",B)}const O=B=>{var F;B&&((F=a.value)==null||F.open(B,o,w.value.model_params_setting))},w=hr({get:()=>(S.nodeModel.properties.node_data||(Me.set(S.nodeModel.properties,"node_data",b),f(b.branch,!0)),S.nodeModel.properties.node_data),set:B=>{Me.set(S.nodeModel.properties,"node_data",B)}}),S=t,M=He(),T=He(null),$=()=>{var B;return Promise.all([i.value?i.value.validate():Promise.resolve(""),(B=M.value)==null?void 0:B.validate()]).then(()=>{if(w.value.branch.length!=new Set(w.value.branch.map(F=>F.content)).size)throw Pt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(F=>Promise.reject({node:S.nodeModel,errMessage:F}))},D=e();function P(){var F;const B=r.value==="systemManage"?{model_type:"LLM",workspace_id:(F=D.value)==null?void 0:F.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(B).then(I=>{T.value=Me.groupBy(I==null?void 0:I.data,"provider")})}return bo(()=>{var B;P(),typeof((B=S.nodeModel.properties.node_data)==null?void 0:B.is_result)>"u"&&Qd(S.nodeModel)&&Me.set(S.nodeModel.properties.node_data,"is_result",!0),Me.set(S.nodeModel,"validate",$)}),(B,F)=>{const I=ne("AppIcon"),V=ne("el-button"),z=ne("ModelSelect"),X=ne("el-form-item"),Y=ne("el-input-number"),W=ne("el-input"),Q=ne("el-col"),J=ne("el-row"),ie=ne("el-form"),Se=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Zie,_e(B.$t("views.applicationWorkflow.nodeSetting")),1),k(Se,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ie,{onSubmit:F[4]||(F[4]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"IntentClassifyNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(X,{label:B.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:B.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Jie,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.application.form.aiModel.label")),1),F[5]||(F[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(V,{type:"primary",link:"",disabled:!w.value.model_id,onClick:F[0]||(F[0]=Ae=>O(w.value.model_id)),onRefreshForm:E},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(z,{onChange:v,onWheel:h,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":F[1]||(F[1]=Ae=>w.value.model_id=Ae),placeholder:B.$t("views.application.form.aiModel.placeholder"),options:T.value,onSubmitModel:P,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(X,{prop:"content_list",label:B.$t("views.applicationWorkflow.nodes.intentNode.input.label"),rules:{message:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Qie,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),F[6]||(F[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:i,nodeModel:t.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:w.value.content_list,"onUpdate:modelValue":F[2]||(F[2]=Ae=>w.value.content_list=Ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(X,{label:B.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(Y,{modelValue:w.value.dialogue_number,"onUpdate:modelValue":F[3]||(F[3]=Ae=>w.value.dialogue_number=Ae),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(X,null,{label:j(()=>[ee("div",eae,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),F[7]||(F[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(V,{onClick:s,type:"primary",size:"large",link:""},{default:j(()=>[k(I,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[ee("div",null,[(Ne(!0),mn(Ir,null,No(w.value.branch,(Ae,Pe)=>(Ne(),mn("div",{key:Ae.id,class:"mb-8"},[k(X,{prop:`branch.${Pe}.content`,rules:{message:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:j(()=>[k(J,{gutter:12,align:"middle"},{default:j(()=>[k(Q,{span:21},{default:j(()=>[k(W,{modelValue:Ae.content,"onUpdate:modelValue":De=>Ae.content=De,style:{width:"210px"},disabled:Ae.isOther,placeholder:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])]),_:2},1024),k(Q,{span:3},{default:j(()=>[Ae.isOther?Bn("",!0):(Ne(),bt(V,{key:0,link:"",size:"large",disabled:w.value.branch.filter(De=>!De.isOther).length<=1,onClick:De=>l(Ae.id)},{default:j(()=>[k(I,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"]))]),_:2},1024)]),_:2},1024)]),_:2},1032,["prop","rules"])]))),128))])]),_:1})]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}});class nae extends ai{constructor(e){super(e,tae)}}class rae extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let v=0;v<f.length;v++){const b=f[v];l.push({x:n+r/2-10,y:s?o-i/2+397+v*41.36:o-15,id:`${e}_${b.id}_right`,type:"right"}),console.log(o-i/2+397+100/2)}return l}}const oae={type:"intent-node",model:rae,view:nae},A8=Object.freeze(Object.defineProperty({__proto__:null,default:oae},Symbol.toStringTag,{value:"Module"})),iae={class:"handle flex-between lighter mb-8"},aae={key:0,class:"info"},lae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(e.nodeModel.properties.node_data,"condition_list",h)},s=He(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return bo(()=>{Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("el-form-item"),O=ne("el-col"),w=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),T=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=gn(()=>{},["prevent"]))},{default:j(()=>[ee("div",iae,[r.value.condition_list.length>1?(Ne(),mn("div",aae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(P,B)=>(Ne(),bt(T,{key:B,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":F=>P.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(b,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":F=>P.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?Bn("",!0):(Ne(),bt(E,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":F=>P.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class sae extends ai{constructor(e){super(e,lae)}}const uae={type:"loop-break-node",model:li,view:sae},M8=Object.freeze(Object.defineProperty({__proto__:null,default:uae},Symbol.toStringTag,{value:"Module"})),cae={class:"handle flex-between lighter mb-8"},dae={key:0,class:"info"},fae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(e.nodeModel.properties.node_data,"condition_list",h)},s=He(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return bo(()=>{Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("el-form-item"),O=ne("el-col"),w=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),T=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=gn(()=>{},["prevent"]))},{default:j(()=>[ee("div",cae,[r.value.condition_list.length>1?(Ne(),mn("div",dae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(P,B)=>(Ne(),bt(T,{key:B,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":F=>P.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(b,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":F=>P.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?Bn("",!0):(Ne(),bt(E,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":F=>P.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class pae extends ai{constructor(e){super(e,fae)}}const hae={type:"loop-continue-node",model:li,view:pae},T8=Object.freeze(Object.defineProperty({__proto__:null,default:hae},Symbol.toStringTag,{value:"Module"})),vae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={loop_type:"ARRAY",array:[],number:1},o=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:h=>{Me.set(e.nodeModel.properties,"node_data",h)}}),r=hr(()=>e.nodeModel.properties.showNode!==void 0?e.nodeModel.properties.showNode:(Me.set(e.nodeModel.properties,"showNode",!0),!0));K_(r,()=>{r.value?Me.throttle(f,1e3)():Me.throttle(l,1e3)()});const i=He(),a=He(),s=()=>{var h;return Promise.all([a.value?a.value.validate():Promise.resolve(""),(h=i.value)==null?void 0:h.validate()]).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))},l=()=>{const v=e.nodeModel.graphModel.getNodeOutgoingNode(e.nodeModel.id).find(b=>b.type==c0.type);v&&(v.set_loop_body(),e.nodeModel.graphModel.deleteNode(v.id))},f=()=>{if(!e.nodeModel.graphModel.getNodeOutgoingNode(e.nodeModel.id).some(v=>v.type==c0.type)){let v={nodes:[E9],edges:[]},b=e.nodeModel.x,E=e.nodeModel.y+350;e.nodeModel.properties.node_data.loop_body&&(v=e.nodeModel.properties.node_data.loop_body),e.nodeModel.properties.node_data.loop&&(b=e.nodeModel.properties.node_data.loop.x,E=e.nodeModel.properties.node_data.loop.y);const O=e.nodeModel.graphModel.addNode({type:c0.type,properties:{...c0.properties,workflow:v,loop_node_id:e.nodeModel.id},x:b,y:E});e.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:e.nodeModel.id,sourceAnchorId:e.nodeModel.id+"_children",targetNodeId:O.id,virtual:!0})}};return bo(()=>{var h;typeof((h=e.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",s),e.nodeModel.virtual||f()}),(h,v)=>{const b=ne("el-option"),E=ne("el-select"),O=ne("el-form-item"),w=ne("el-input-number"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(M,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(S,{onSubmit:v[6]||(v[6]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:i},{default:j(()=>[k(O,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:v[1]||(v[1]=gn(()=>{},["prevent"])),prop:"loop_type",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:j(()=>[k(E,{modelValue:o.value.loop_type,"onUpdate:modelValue":v[0]||(v[0]=T=>o.value.loop_type=T),type:"small"},{default:j(()=>[k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.infiniteLoop"),value:"LOOP"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),o.value.loop_type=="ARRAY"?(Ne(),bt(O,{key:0,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:v[3]||(v[3]=gn(()=>{},["prevent"])),prop:"array",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:a,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.placeholder"),modelValue:o.value.array,"onUpdate:modelValue":v[2]||(v[2]=T=>o.value.array=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):o.value.loop_type=="NUMBER"?(Ne(),bt(O,{key:1,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:v[5]||(v[5]=gn(()=>{},["prevent"])),prop:"number",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(w,{modelValue:o.value.number,"onUpdate:modelValue":v[4]||(v[4]=T=>o.value.number=T),min:1},null,8,["modelValue"])]),_:1},8,["label","rules"])):Bn("",!0)]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class mae extends ai{constructor(e){const n=e.model.properties.config;super(e,vae),e.model.properties.config=n}}class gae extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i}=this,a=this.properties.showNode===void 0?!0:this.properties.showNode,s=[];return this.type&&this.type!==kr.Base.toString()&&(this.type!==kr.Start.toString()&&s.push({x:n-r/2+10,y:a?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"}),s.push({x:n+r/2-10,y:a?o:o-15,id:`${e}_right`,type:"right"})),s.push({x:n,y:o+i/2-25,id:`${e}_children`,type:"children"}),s}}const yae={type:"loop-node",model:gae,view:mae},C8=Object.freeze(Object.defineProperty({__proto__:null,default:yae},Symbol.toStringTag,{value:"Module"})),_ae={class:"dialog-footer"},bae=_r({__name:"LoopFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",_ae,[k($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),wae={class:"flex-between mb-16"},Eae={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},xae={class:"ml-4"},Oae=["title"],Sae=["title"],Aae={class:"mr-4"},Mae=_r({__name:"LoopFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1)}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close()}return bo(()=>{e.nodeModel.properties.loop_input_field_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.loop_input_field_list)),Me.set(e.nodeModel.properties,"loop_input_field_list",r)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",wae,[ee("h5",Eae,_e(l.$t("views.applicationWorkflow.variable.loop")),1),ee("div",null,[ee("span",xae,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=e.nodeModel.properties.loop_input_field_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:e.nodeModel.properties.loop_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,Oae)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,Sae)])]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",Aae,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:gn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(bae,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),Tae={class:"title-decoration-1 mb-8"},Cae={class:"title-decoration-1 mb-8"},Nae={class:"break-all"},kae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=hr(()=>(e.nodeModel.properties.loop_input_field_list?e.nodeModel.properties.loop_input_field_list:[]).map(r=>r.label&&r.label.input_type==="TooltipLabel"?{label:r.label.label,value:r.field||r.variable}:{label:r.label||r.name,value:r.field||r.variable}));K_(n,()=>{e.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))});const o=He(!1);return bo(()=>{e.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))}),(r,i)=>{const a=ne("AppIcon"),s=ne("el-button"),l=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var f;return[ee("h5",Tae,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(Mae,{nodeModel:t.nodeModel},null,8,["nodeModel"]),(f=n.value)!=null&&f.length?(Ne(),mn(Ir,{key:0},[ee("h5",Cae,_e(r.$t("views.applicationWorkflow.variable.loop")),1),(Ne(!0),mn(Ir,null,No(n.value||[],(h,v)=>(Ne(),mn("div",{key:v,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:i[0]||(i[0]=b=>o.value=!0),onMouseleave:i[1]||(i[1]=b=>o.value=!1)},[ee("span",Nae,_e(h.label)+" "+_e("{"+h.value+"}"),1),o.value===!0?(Ne(),bt(l,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(s,{link:"",onClick:b=>Wn(x_)(`{{loop.${h.value}}}`),style:{padding:"0"}},{default:j(()=>[k(a,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class Pae extends ai{constructor(e){super(e,kae)}get_node_field_list(){var n,o,r,i;const e=[];return this.props.model.type&&this.props.model.type==="loop-start-node"&&e.push({value:"loop",label:Pt("views.applicationWorkflow.variable.loop"),type:"loop",children:(Array.isArray(this.props.model.properties.loop_input_field_list)?this.props.model.properties.loop_input_field_list:[]).map(a=>a.label&&a.label.input_type==="TooltipLabel"?{label:a.label.label,value:a.field||a.variable}:{label:a.label||a.name,value:a.field||a.variable})||[]}),e.push({value:this.props.model.id,icon:(o=(n=this.props.model.properties)==null?void 0:n.node_data)==null?void 0:o.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((i=(r=this.props.model.properties)==null?void 0:r.config)==null?void 0:i.fields)||[]}),e}}const Rae={type:"loop-start-node",model:li,view:Pae},N8=Object.freeze(Object.defineProperty({__proto__:null,default:Rae},Symbol.toStringTag,{value:"Module"})),Dae={class:"dialog-footer"},jae=_r({__name:"McpServerInputDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(!1),i=He(!1),a=He(),s=He({}),l=He([]);function f(v){r.value=!0,l.value=v}const h=async v=>{v&&await v.validate(b=>{b&&(o("refresh",s.value),r.value=!1)})};return e({open:f}),(v,b)=>{const E=ne("el-input"),O=ne("el-form-item"),w=ne("el-form"),S=ne("el-button"),M=ne("el-dialog");return Ne(),bt(M,{width:"600",title:"设置变量",modelValue:r.value,"onUpdate:modelValue":b[2]||(b[2]=T=>r.value=T),"close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0},{footer:j(()=>[ee("span",Dae,[k(S,{onClick:b[0]||(b[0]=gn(T=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(S,{type:"primary",onClick:b[1]||(b[1]=T=>h(a.value)),loading:i.value},{default:j(()=>[ft(_e(v.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(w,{"label-position":"top",ref_key:"formRef",ref:a,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(l.value,T=>(Ne(),bt(O,{label:T,key:T,prop:T,rules:{required:!0,message:v.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:j(()=>[k(E,{modelValue:s.value[T],"onUpdate:modelValue":$=>s.value[T]=$},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"]))),128))]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),Lae={class:"title-decoration-1 mb-8"},Iae={class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Fae={class:"flex-between"},Bae={class:"flex align-center"},$ae=["src"],Uae={class:"flex-between"},Vae={class:"ml-4"},Wae={class:"title-decoration-1 mb-8"},Gae={key:0,class:"p-8-12"},zae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Hae={class:"flex-between"},Xae={key:1},Yae={key:2,class:"color-danger"},qae={key:0,class:"p-8-12"},Kae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Zae={class:"flex-between"},Jae={key:1},Qae={key:2,class:"color-danger"},ele=`{
|
||
"math": {
|
||
"url": "your_server",
|
||
"transport": "sse"
|
||
}
|
||
}`,tle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),{params:{id:o}}=n,i=ml("getApplicationDetail")(),a=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=He(),l=He(!1),f=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),h={mcp_tool:"",mcp_tools:[],mcp_servers:"",mcp_server:"",mcp_source:"referencing",mcp_tool_id:"",tool_params:{},tool_form_field:[],params_nested:""},v=He([]);function b(I){Me.set(e.nodeModel.properties.node_data,"mcp_servers",I)}async function E(){const I=await oi({type:"tool",systemType:a.value}).getToolById(D.value.mcp_tool_id,l);D.value.mcp_servers=I.data.code}function O(){if(D.value.mcp_source==="referencing"&&!D.value.mcp_tool_id){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="referencing"&&D.value.mcp_tool_id&&!v.value.find(I=>I.id===D.value.mcp_tool_id)){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="custom"&&!D.value.mcp_servers){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(D.value.mcp_servers);const I=M(D.value.mcp_servers);if(I.length>0){S.value.open(I);return}}catch{Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}w(D.value.mcp_servers)}function w(I){oi({type:"application",systemType:a.value}).getMcpTools(o,I,l).then(V=>{var z;D.value.mcp_tools=V.data,Oh(Pt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),D.value.mcp_server=(z=D.value.mcp_tools.find(X=>X.name===D.value.mcp_tool))==null?void 0:z.server})}const S=He();function M(I){const V=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,z=new Set,X=Y=>{if(typeof Y=="string"){let W;for(;(W=V.exec(Y))!==null;)z.add(W[1])}else Array.isArray(Y)?Y.forEach(X):Y&&typeof Y=="object"&&Object.values(Y).forEach(X)};if(typeof I=="string")try{X(JSON.parse(I))}catch{X(I)}else X(I);return[...z]}function T(I){let V=D.value.mcp_servers;for(const z in I)V=V.replace(`{{${z}}}`,I[z]);w(V)}function $(){var V,z,X,Y,W,Q;D.value.mcp_server=(V=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:V.server;const I=(z=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:z.args_schema;D.value.tool_form_field=[];for(const J in I==null?void 0:I.properties){const ie=I==null?void 0:I.properties[J].properties;if(ie){D.value.params_nested=J;for(const Se in ie){let Ae="TextInput";ie[Se].type==="string"?Ae="TextInput":ie[Se].type==="number"?Ae="NumberInput":ie[Se].type==="boolean"?Ae="SwitchInput":(ie[Se].type==="array"||ie[Se].type==="object")&&(Ae="JsonInput"),D.value.tool_form_field.push({field:Se,label:{input_type:"TooltipLabel",label:Se,attrs:{tooltip:ie[Se].description},props_info:{}},input_type:Ae,source:"referencing",required:((X=I.properties[J].required)==null?void 0:X.indexOf(Se))!==-1,props_info:{rules:[{required:((Y=I.properties[J].required)==null?void 0:Y.indexOf(Se))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{D.value.params_nested="";let Se="TextInput";I.properties[J].type==="string"?Se="TextInput":I.properties[J].type==="number"?Se="NumberInput":I.properties[J].type==="boolean"?Se="SwitchInput":(I.properties[J].type==="array"||I.properties[J].type==="object")&&(Se="JsonInput"),D.value.tool_form_field.push({field:J,label:{input_type:"TooltipLabel",label:J,attrs:{tooltip:I.properties[J].description},props_info:{}},input_type:Se,source:"referencing",required:((W=I.required)==null?void 0:W.indexOf(J))!==-1,props_info:{rules:[{required:((Q=I.required)==null?void 0:Q.indexOf(J))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}D.value.params_nested?D.value.tool_params={[D.value.params_nested]:{}}:D.value.tool_params={}}const D=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",h),e.nodeModel.properties.node_data),set:I=>{Me.set(e.nodeModel.properties,"node_data",I)}}),P=He(),B=async()=>{if(s.value){const I=D.value.tool_form_field.filter(V=>V.required).map(V=>V.label.label);if(I.length>0){for(const V of I)if(D.value.params_nested){if(!D.value.tool_params[D.value.params_nested][V])return Promise.reject({node:e.nodeModel,errMessage:V+Pt("dynamicsForm.tip.requiredMessage")})}else if(!D.value.tool_params[V])return Promise.reject({node:e.nodeModel,errMessage:V+Pt("dynamicsForm.tip.requiredMessage")})}}if(P.value){const I=Me.cloneDeep(D.value);if(!I.mcp_servers)return Promise.reject({node:e.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip")});if(!I.mcp_tool)return Promise.reject({node:e.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip")})}};function F(){var V;const I=a.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(V=i.value)==null?void 0:V.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:a.value}).getAllToolList(I,l).then(z=>{v.value=[...z.data.shared_tools,...z.data.tools].filter(X=>X.is_active)})}return bo(()=>{var I;typeof((I=e.nodeModel.properties.node_data)==null?void 0:I.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),e.nodeModel.properties.node_data.mcp_servers&&!e.nodeModel.properties.node_data.mcp_source&&Me.set(e.nodeModel.properties.node_data,"mcp_source","custom"),F(),Me.set(e.nodeModel,"validate",B)}),(I,V)=>{const z=ne("el-option"),X=ne("el-select"),Y=ne("MdEditorMagnify"),W=ne("el-avatar"),Q=ne("ToolIcon"),J=ne("el-tag"),ie=ne("el-form-item"),Se=ne("AppIcon"),Ae=ne("el-button"),Pe=ne("el-tooltip"),De=ne("el-form"),ze=ne("el-text"),Ye=ne("el-input"),Be=ne("el-input-number"),Je=ne("el-switch"),gt=Rg("loading");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Lae,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",Iae,[k(De,{onSubmit:V[5]||(V[5]=gn(()=>{},["prevent"])),model:D.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:P,"hide-required-asterisk":""},{default:j(()=>[k(ie,{label:"MCP Server Config"},{label:j(()=>[ee("div",Fae,[V[8]||(V[8]=ee("div",null,[ft(" MCP Server Config "),ee("span",{class:"color-danger"},"*")],-1)),k(X,{teleported:!1,modelValue:D.value.mcp_source,"onUpdate:modelValue":V[0]||(V[0]=le=>D.value.mcp_source=le),size:"small",style:{width:"85px"}},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[D.value.mcp_source==="custom"?(Ne(),bt(Y,{key:0,onWheel:f,title:"MCP Server Config",modelValue:D.value.mcp_servers,"onUpdate:modelValue":V[1]||(V[1]=le=>D.value.mcp_servers=le),style:{height:"150px"},onSubmitDialog:b,placeholder:ele},null,8,["modelValue"])):(Ne(),bt(X,{key:1,modelValue:D.value.mcp_tool_id,"onUpdate:modelValue":V[2]||(V[2]=le=>D.value.mcp_tool_id=le),filterable:"",onChange:E},{default:j(()=>[(Ne(!0),mn(Ir,null,No(v.value,le=>(Ne(),bt(z,{key:le.id,label:le.name,value:le.id},{default:j(()=>[ee("div",Bae,[le!=null&&le.icon?(Ne(),bt(W,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>[ee("img",{src:Wn(mh)(le==null?void 0:le.icon),alt:""},null,8,$ae)]),_:2},1024)):(Ne(),bt(Q,{key:1,size:20,type:le==null?void 0:le.tool_type,class:"mr-8"},null,8,["type"])),ee("span",null,_e(le.name),1),le.scope==="SHARED"?(Ne(),bt(J,{key:2,type:"info",class:"info-tag ml-8"},{default:j(()=>[ft(_e(Wn(Pt)("views.shared.title")),1)]),_:1})):Bn("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),k(ie,null,{label:j(()=>[ee("div",Uae,[ee("span",null,_e(I.$t("views.tool.title")),1),k(Ae,{type:"primary",link:"",onClick:V[3]||(V[3]=le=>O())},{default:j(()=>[k(Se,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(I.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:j(()=>[k(X,{modelValue:D.value.mcp_tool,"onUpdate:modelValue":V[4]||(V[4]=le=>D.value.mcp_tool=le),onChange:$,filterable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.mcp_tools,le=>(Ne(),bt(z,{key:le.value,label:le.name,value:le.name,class:"flex align-center"},{default:j(()=>[k(Pe,{effect:"dark",content:le.description,placement:"top-start","popper-class":"max-w-350"},{default:j(()=>[k(Se,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),ee("span",Vae,_e(le.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),ee("h5",Wae,_e(I.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),D.value.tool_params[D.value.params_nested]?(Ne(),mn(Ir,{key:0},[D.value.mcp_tool?(Ne(),mn("div",zae,[D.value.mcp_tool?Ql((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[6]||(V[6]=gn(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,le=>(Ne(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Hae,[ee("div",null,[le.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",Xae,_e(le.label.label),1)),le.required?(Ne(),mn("span",Yae,"*")):Bn("",!0)]),k(X,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=""},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),le.source==="referencing"?(Ne(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,l.value]]):Bn("",!0)])):(Ne(),mn("div",Gae,[k(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)):(Ne(),mn(Ir,{key:1},[D.value.mcp_tool?(Ne(),mn("div",Kae,[D.value.mcp_tool?Ql((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[7]||(V[7]=gn(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,le=>(Ne(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Zae,[ee("div",null,[le.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",Jae,_e(le.label.label),1)),le.required?(Ne(),mn("span",Qae,"*")):Bn("",!0)]),k(X,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[le.label.label]=""},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),le.source==="referencing"?(Ne(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,l.value]]):Bn("",!0)])):(Ne(),mn("div",qae,[k(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)),k(jae,{ref_key:"mcpServerInputDialogRef",ref:S,onRefresh:T},null,512)]),_:1},8,["nodeModel"])}}});class nle extends ai{constructor(e){super(e,tle)}}const rle={type:"mcp-node",model:li,view:nle},k8=Object.freeze(Object.defineProperty({__proto__:null,default:rle},Symbol.toStringTag,{value:"Module"})),ole={class:"dialog-footer"},ile=_r({__name:"ParametersFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"object",label:"Object"},{value:"boolean",label:"Boolean"},{value:"array",label:"Array"}],i=He(),a=He(!1),s=He(!1),l=He(null),f=He({field:"",label:"",parameter_type:"",desc:""}),h=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),v=He(!1),b=(w,S)=>{w&&(f.value=Me.cloneDeep(w),s.value=!0,l.value=S),v.value=!0},E=()=>{v.value=!1,s.value=!1,l.value=null,f.value={field:"",label:""}},O=async w=>{w&&await w.validate(S=>{S&&o("refresh",f.value,l.value)})};return e({open:b,close:E}),(w,S)=>{const M=ne("el-input"),T=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),P=ne("el-form"),B=ne("el-button"),F=ne("el-dialog");return Ne(),bt(F,{title:s.value?w.$t("common.param.editParam"):w.$t("common.param.addParam"),modelValue:v.value,"onUpdate:modelValue":S[5]||(S[5]=I=>v.value=I),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":E,"append-to-body":""},{footer:j(()=>[ee("span",ole,[k(B,{onClick:gn(E,["prevent"])},{default:j(()=>[ft(_e(w.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:S[4]||(S[4]=I=>O(i.value)),loading:a.value},{default:j(()=>[ft(_e(w.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(P,{"label-position":"top",ref_key:"fieldFormRef",ref:i,rules:h,model:f.value,"require-asterisk-position":"right"},{default:j(()=>[k(T,{label:w.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:h.field},{default:j(()=>[k(M,{modelValue:f.value.field,"onUpdate:modelValue":S[0]||(S[0]=I=>f.value.field=I),maxlength:64,placeholder:w.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:h.label},{default:j(()=>[k(M,{modelValue:f.value.label,"onUpdate:modelValue":S[1]||(S[1]=I=>f.value.label=I),maxlength:64,"show-word-limit":"",placeholder:w.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),required:!0,prop:"parameter_type",rules:h.label},{default:j(()=>[k(D,{modelValue:f.value.parameter_type,"onUpdate:modelValue":S[2]||(S[2]=I=>f.value.parameter_type=I),placeholder:w.$t("common.selectPlaceholder")+w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:j(()=>[(Ne(),mn(Ir,null,No(r,I=>k($,{key:I.value,label:I.label,value:I.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("common.desc"),prop:"desc"},{default:j(()=>[k(M,{modelValue:f.value.desc,"onUpdate:modelValue":S[3]||(S[3]=I=>f.value.desc=I),style:{width:"100%"},rows:2,type:"textarea",placeholder:w.$t("common.descPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),ale={class:"flex-between w-full"},lle={class:"break-all lighter"},sle={class:"ml-4",style:{"margin-top":"-4px"}},ule=["title"],cle=["title"],dle={class:"mr-4"},fle=_r({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(e.nodeModel.properties.config,"fields",f),e.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(e.nodeModel.properties.config,"fields",h),e.nodeModel.clear_next_node_field(!1)}return bo(()=>{e.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.node_data.variable_list)),Me.set(e.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",l)}),(l,f)=>{var S;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tag"),O=ne("el-tooltip"),w=ne("el-table");return Ne(),mn(Ir,null,[ee("div",ale,[ee("h5",lle,[ft(_e(l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",sle,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=M=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((S=e.nodeModel.properties.node_data.variable_list)==null?void 0:S.length)>0?(Ne(),bt(w,{key:0,data:e.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"90"},{default:j(({row:M})=>[ee("span",{title:M.field,class:"ellipsis-1"},_e(M.field),9,ule)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:M})=>[ee("span",null,[ee("span",{title:M.label,class:"ellipsis-1"},_e(M.label),9,cle)])]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:j(({row:M})=>[k(E,{type:"info",class:"info-tag"},{default:j(()=>[ft(_e(M.parameter_type),1)]),_:2},1024)]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"80"},{default:j(({row:M,$index:T})=>[ee("span",dle,[k(O,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:gn($=>i(M,T),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(O,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:$=>a(T)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(ile,{ref_key:"ParametersFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),ple={class:"title-decoration-1 mb-8"},hle={class:"flex-between w-full"},vle={class:"flex-between"},mle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=t,o=He(),r=ja(),{params:{id:i}}=r,a=T=>{var $;T&&(($=o.value)==null||$.open(T,i,O.value.model_params_setting))};function s(T){Me.set(n.nodeModel.properties.node_data,"model_params_setting",T)}const l=e(),f=He(null),h=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),v=hr(()=>r.path.includes("resource-management")?"systemManage":"workspace");function b(){var $;const T=v.value==="systemManage"?{model_type:"LLM",workspace_id:($=l.value)==null?void 0:$.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:v.value}).getSelectModelList(T).then(D=>{f.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const E={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},O=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",E),n.nodeModel.properties.node_data),set:T=>{Me.set(n.nodeModel.properties,"node_data",T)}}),w=T=>{var $;T?($=o.value)==null||$.reset_default(T,i):s({})},S=He(),M=async()=>S.value.validate().catch(T=>Promise.reject({node:n.nodeModel,errMessage:T}));return bo(()=>{b(),Me.set(n.nodeModel,"validate",M)}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-form"),V=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",ple,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(V,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(I,{onSubmit:$[3]||($[3]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:T.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hle,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.application.form.aiModel.label")),1),$[4]||($[4]=ee("span",{class:"color-danger ml-4"},"*",-1))])]),k(P,{disabled:!O.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=z=>a(O.value.model_id)),onRefreshForm:s},{default:j(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(B,{onChange:w,onWheel:h,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":$[1]||($[1]=z=>O.value.model_id=z),placeholder:T.$t("views.application.form.aiModel.placeholder"),options:f.value,onSubmitModel:b,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{prop:"input_variable",rules:{message:T.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",vle,[ee("div",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.variable.placeholder"),modelValue:O.value.input_variable,"onUpdate:modelValue":$[2]||($[2]=z=>O.value.input_variable=z)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(F,{prop:"variable_list",rules:{message:T.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(fle,{ref:"ParametersFieldTableRef","node-model":t.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:o,onRefresh:s},null,512)]),_:1},8,["nodeModel"])}}});class gle extends ai{constructor(e){super(e,mle)}getConfig(e){return e.model.properties.config}}const yle={type:"parameter-extraction-node",model:li,view:gle},P8=Object.freeze(Object.defineProperty({__proto__:null,default:yle},Symbol.toStringTag,{value:"Module"})),_le={class:"title-decoration-1 mb-8"},ble={class:"flex-between"},wle={class:"flex-between"},Ele={class:"flex align-center"},xle={class:"flex align-center"},Ole={class:"mr-4"},Sle={class:"flex align-center"},Ale={class:"mr-4"},Mle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),s=P=>{var B;P?(B=i.value)==null||B.reset_default(P,o):b({})};function l(P){Me.set(w.nodeModel.properties.node_data,"prompt",P)}function f(P){Me.set(w.nodeModel.properties.node_data,"system",P)}const h=`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,v={model_id:"",system:Pt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:h,dialogue_number:1,is_result:!1};function b(P){Me.set(w.nodeModel.properties.node_data,"model_params_setting",P)}const E=P=>{var B;P&&((B=i.value)==null||B.open(P,o,O.value.model_params_setting))},O=hr({get:()=>(w.nodeModel.properties.node_data||Me.set(w.nodeModel.properties,"node_data",v),w.nodeModel.properties.node_data),set:P=>{Me.set(w.nodeModel.properties,"node_data",P)}}),w=t,S=He(),M=He(null),T=()=>{var P;return(P=S.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:w.nodeModel,errMessage:B}))},$=e();function D(){var B;const P=r.value==="systemManage"?{model_type:"LLM",workspace_id:(B=$.value)==null?void 0:B.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{M.value=Me.groupBy(F==null?void 0:F.data,"provider")})}return bo(()=>{var P;D(),typeof((P=w.nodeModel.properties.node_data)==null?void 0:P.is_result)>"u"&&Qd(w.nodeModel)&&Me.set(w.nodeModel.properties.node_data,"is_result",!0),Me.set(w.nodeModel,"validate",T)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-input-number"),Q=ne("el-switch"),J=ne("el-form"),ie=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",_le,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(J,{onSubmit:B[7]||(B[7]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",ble,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.application.form.aiModel.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{type:"primary",link:"",disabled:!O.value.model_id,onClick:B[0]||(B[0]=Se=>E(O.value.model_id)),onRefreshForm:b},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:s,onWheel:a,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=Se=>O.value.model_id=Se),placeholder:P.$t("views.application.form.aiModel.placeholder"),options:M.value,onSubmitModel:D,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,null,{label:j(()=>[ee("div",wle,[ee("div",Ele,[ee("span",null,_e(P.$t("views.application.form.roleSettings.label")),1),k(X,{effect:"dark",content:P.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:j(()=>[k(Y,{title:P.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":B[2]||(B[2]=Se=>O.value.system=Se),style:{height:"100px"},onSubmitDialog:f,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(z,{label:P.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:j(()=>[ee("div",xle,[ee("div",Ole,[ee("span",null,[ft(_e(P.$t("views.application.form.prompt.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:a,title:P.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":B[3]||(B[3]=Se=>O.value.prompt=Se),style:{height:"150px"},onSubmitDialog:l,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(W,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":B[4]||(B[4]=Se=>O.value.dialogue_number=Se),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[6]||(B[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Sle,[ee("div",Ale,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Q,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":B[5]||(B[5]=Se=>O.value.is_result=Se)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:i,onRefresh:b},null,512)]),_:1},8,["nodeModel"])}}});class Tle extends ai{constructor(e){super(e,Mle)}}const Cle={type:"question-node",model:li,view:Tle},R8=Object.freeze(Object.defineProperty({__proto__:null,default:Cle},Symbol.toStringTag,{value:"Module"})),Nle={class:"flex-between"},kle={class:"flex align-center"},Ple={class:"mr-4"},Rle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),o={reply_type:"content",content:"",fields:[],is_result:!0},r=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",o),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}});function i(f){Me.set(e.nodeModel.properties.node_data,"content",f)}const a=He(),s=He(),l=()=>{var f;return Promise.all([s.value?s.value.validate():Promise.resolve(""),(f=a.value)==null?void 0:f.validate()]).catch(h=>Promise.reject({node:e.nodeModel,errMessage:h}))};return bo(()=>{var f;typeof((f=e.nodeModel.properties.node_data)==null?void 0:f.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("MdEditorMagnify"),O=ne("el-form-item"),w=ne("AppIcon"),S=ne("el-tooltip"),M=ne("el-switch"),T=ne("el-form"),$=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k($,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,{onSubmit:h[5]||(h[5]=gn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:a},{default:j(()=>[k(O,{label:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:j(()=>[ee("div",Nle,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),k(b,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":h[0]||(h[0]=D=>r.value.reply_type=D),size:"small",style:{width:"85px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(v,{label:f.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[r.value.reply_type==="content"?(Ne(),bt(E,{key:0,onWheel:n,title:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":h[1]||(h[1]=D=>r.value.content=D),style:{height:"150px"},onSubmitDialog:i},null,8,["title","modelValue"])):(Ne(),bt(Go,{key:1,ref_key:"nodeCascaderRef",ref:s,nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.fields,"onUpdate:modelValue":h[2]||(h[2]=D=>r.value.fields=D)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),k(O,{label:f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:h[4]||(h[4]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",kle,[ee("div",Ple,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(S,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(M,{size:"small",modelValue:r.value.is_result,"onUpdate:modelValue":h[3]||(h[3]=D=>r.value.is_result=D)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Dle extends ai{constructor(e){super(e,Rle)}}const jle={type:"reply-node",model:li,view:Dle},D8=Object.freeze(Object.defineProperty({__proto__:null,default:jle},Symbol.toStringTag,{value:"Module"})),Lle={class:"flex align-center"},Ile={class:"mr-4"},Fle={class:"dialog-footer"},Ble=_r({__name:"ParamSettingDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He({top_n:3,similarity:0,max_paragraph_char_number:5e3}),a=He(!1),s=He(!1);K_(a,h=>{h||(i.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const l=h=>{i.value={...i.value,...Me.cloneDeep(h)},a.value=!0},f=()=>{var h;(h=r==null?void 0:r.value)==null||h.validate((v,b)=>{v&&(o("refresh",Me.cloneDeep(i.value)),a.value=!1)})};return e({open:l}),(h,v)=>{const b=ne("AppIcon"),E=ne("el-tooltip"),O=ne("el-input-number"),w=ne("el-form-item"),S=ne("el-col"),M=ne("el-row"),T=ne("el-slider"),$=ne("el-form"),D=ne("el-button"),P=ne("el-dialog");return Ne(),bt(P,{"align-center":"",title:h.$t("common.paramSetting"),class:"param-dialog",modelValue:a.value,"onUpdate:modelValue":v[5]||(v[5]=B=>a.value=B),style:{width:"550px"},"append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:j(()=>[ee("span",Fle,[k(D,{onClick:v[3]||(v[3]=gn(B=>a.value=!1,["prevent"]))},{default:j(()=>[ft(_e(h.$t("common.cancel")),1)]),_:1}),k(D,{type:"primary",onClick:v[4]||(v[4]=B=>f()),loading:s.value},{default:j(()=>[ft(_e(h.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k($,{"label-position":"top",ref_key:"paramFormRef",ref:r,model:i.value},{default:j(()=>[k(M,{gutter:12},{default:j(()=>[k(S,{span:12},{default:j(()=>[k(w,null,{label:j(()=>[ee("div",Lle,[ee("span",Ile,"Score "+_e(h.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),k(E,{effect:"dark",content:h.$t("views.applicationWorkflow.nodes.rerankerNode.ScoreTooltip"),placement:"right"},{default:j(()=>[k(b,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(O,{modelValue:i.value.similarity,"onUpdate:modelValue":v[0]||(v[0]=B=>i.value.similarity=B),min:0,max:i.value.search_mode==="blend"?2:1,precision:3,step:.1,"value-on-clear":0,"controls-position":"right",class:"w-full"},null,8,["modelValue","max"])]),_:1})]),_:1}),k(S,{span:12},{default:j(()=>[k(w,{label:h.$t("views.application.dialog.topReferences")},{default:j(()=>[k(O,{modelValue:i.value.top_n,"onUpdate:modelValue":v[1]||(v[1]=B=>i.value.top_n=B),min:1,max:1e4,"value-on-clear":1,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),k(w,{label:h.$t("views.application.dialog.maxCharacters")},{default:j(()=>[k(T,{modelValue:i.value.max_paragraph_char_number,"onUpdate:modelValue":v[2]||(v[2]=B=>i.value.max_paragraph_char_number=B),"show-input":"","show-input-controls":!1,min:500,max:1e5,class:"custom-slider"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}}),$le={class:"flex-between"},Ule={class:"flex-between"},Vle={class:"w-full"},Wle={class:"flex-between"},Gle={class:"flex-between"},zle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(),s={reranker_reference_list:[[]],reranker_model_id:"",question_reference_address:[],reranker_setting:{top_n:3,similarity:0,max_paragraph_char_number:5e3},show_knowledge:!1},l=He(null),f=()=>{var D;(D=a.value)==null||D.open(b.value.reranker_setting)},h=D=>{const P=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);P.splice(D,1),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",P)},v=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.stopPropagation(),!0),b=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",s),i.nodeModel.properties.node_data),set:D=>{Me.set(i.nodeModel.properties,"node_data",D)}});function E(D){Me.set(i.nodeModel.properties.node_data,"reranker_setting",D)}const O=e();function w(){var P;const D=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(P=O.value)==null?void 0:P.workspace_id}:{model_type:"RERANKER"};oi({type:"model",systemType:r.value}).getSelectModelList(D).then(B=>{l.value=Me.groupBy(B==null?void 0:B.data,"provider")})}const S=()=>{const D=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);D.push([]),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",D)},M=He(),T=He(),$=()=>{var D;return Promise.all([T.value?T.value.validate():Promise.resolve(""),(D=M.value)==null?void 0:D.validate()]).catch(P=>Promise.reject({node:i.nodeModel,errMessage:P}))};return bo(()=>{w(),b.value.show_knowledge=b.value.show_knowledge?b.value.show_knowledge:!1,Me.set(i.nodeModel,"validate",$)}),(D,P)=>{const B=ne("AppIcon"),F=ne("el-button"),I=ne("el-form-item"),V=ne("el-col"),z=ne("el-row"),X=ne("ModelSelect"),Y=ne("el-switch"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(W,{onSubmit:P[4]||(P[4]=gn(()=>{},["prevent"])),model:b.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"rerankerNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label"),prop:"reranker_reference_list",rules:{type:"array",message:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),trigger:"change",required:!0}},{label:j(()=>[ee("div",$le,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),P[5]||(P[5]=ee("span",{class:"color-danger"},"*",-1))]),k(F,{onClick:S,link:"",type:"primary"},{default:j(()=>[k(B,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[(Ne(!0),mn(Ir,null,No(b.value.reranker_reference_list,(J,ie)=>(Ne(),bt(z,{gutter:8,style:{"margin-bottom":"8px"},key:ie,class:"w-full"},{default:j(()=>[k(V,{span:22},{default:j(()=>[k(I,{prop:"reranker_reference_list."+ie,rules:{type:"array",required:!0,message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[(Ne(),bt(Go,{key:ie,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:b.value.reranker_reference_list[ie],"onUpdate:modelValue":Se=>b.value.reranker_reference_list[ie]=Se},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),k(V,{span:2},{default:j(()=>[k(F,{link:"",type:"info",onClick:Se=>h(ie)},{default:j(()=>[k(B,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",Ule,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(F,{type:"primary",link:"",onClick:f},{default:j(()=>[k(B,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",Vle,[k(z,null,{default:j(()=>[k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(" Score "+_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=b.value.reranker_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.top_n),1)]),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),prop:"question_reference_address",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Wle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),P[6]||(P[6]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:T,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:b.value.question_reference_address,"onUpdate:modelValue":P[0]||(P[0]=J=>b.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label"),prop:"reranker_model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Gle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),P[7]||(P[7]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(X,{onWheel:v,teleported:!1,modelValue:b.value.reranker_model_id,"onUpdate:modelValue":P[1]||(P[1]=J=>b.value.reranker_model_id=J),placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),options:l.value,onSubmitModel:w,showFooter:"","model-type":"RERANKER"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:P[3]||(P[3]=gn(()=>{},["prevent"]))},{default:j(()=>[k(Y,{size:"small",modelValue:b.value.show_knowledge,"onUpdate:modelValue":P[2]||(P[2]=J=>b.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Ble,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}}),Hle=Ph(zle,[["__scopeId","data-v-298ea2ea"]]);class Xle extends ai{constructor(e){super(e,Hle)}}const Yle={type:"reranker-node",model:li,view:Xle},j8=Object.freeze(Object.defineProperty({__proto__:null,default:Yle},Symbol.toStringTag,{value:"Module"})),qle={class:"title-decoration-1 mb-8"},Kle={class:"flex-between"},Zle={key:0,class:"w-full"},Jle={class:"flex align-center",style:{"line-height":"20px"}},Qle=["title"],ese={key:1,class:"w-full"},tse={class:"flex-between"},nse={class:"flex align-center"},rse={class:"flex align-center"},ose={class:"w-full"},ise={key:1},ase={class:"flex align-center mb-8"},lse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=t,o=He(),r=He(),i=[{value:"contain",label:Pt("views.applicationWorkflow.compare.contain")},{value:"not_contain",label:Pt("views.applicationWorkflow.compare.not_contain")},{value:"eq",label:Pt("views.applicationWorkflow.compare.eq")}],a=hr(()=>e.path.includes("shared")?"systemShare":e.path.includes("resource-management")?"systemManage":e.path.includes("share/")?"workspaceShare":"workspace"),s={knowledge_id_list:[],search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[],search_mode:"auto",question_reference:[],search_condition_type:"AND",search_condition_list:[],knowledge_tags:[]},l=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",s),n.nodeModel.properties.node_data),set:D=>{Me.set(n.nodeModel.properties,"node_data",D)}}),f=He(),h=He(),v=He([]),b=He(!1);function E(D){const P=n.nodeModel.properties.node_data.knowledge_id_list.filter(B=>B!==D);Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",P)}function O(D){Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",D.map(P=>P.id)),Me.set(n.nodeModel.properties.node_data,"knowledge_list",D),v.value=D}function w(){h.value&&h.value.open(l.value.knowledge_id_list)}function S(){const D=Me.cloneDeep(l.value.search_condition_list);D.push({key:"",compare:"contain",value:""}),Me.set(l.value,"search_condition_list",D)}function M(D){const P=Me.cloneDeep(l.value.search_condition_list);P.splice(D,1),Me.set(l.value,"search_condition_list",P)}function T(D){if(D.length===0){Me.set(l.value,"knowledge_tags",[]);return}oi({type:"knowledge",systemType:a.value}).getAllTags({knowledge_ids:D},{}).then(P=>{Me.set(l.value,"knowledge_tags",P.data)})}const $=()=>{var D,P,B;return Promise.all([(D=o.value)==null?void 0:D.validate(),(P=r.value)==null?void 0:P.validate(),(B=f.value)==null?void 0:B.validate()]).catch(F=>Promise.reject({node:n.nodeModel,errMessage:F}))};return bo(()=>{v.value=n.nodeModel.properties.node_data.knowledge_list,Me.set(n.nodeModel,"validate",$)}),(D,P)=>{const B=ne("el-button"),F=ne("el-option"),I=ne("el-select"),V=ne("el-text"),z=ne("KnowledgeIcon"),X=ne("Close"),Y=ne("el-icon"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("el-radio"),ie=ne("el-radio-group"),Se=ne("el-col"),Ae=ne("el-input"),Pe=ne("el-row"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",qle,_e(D.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:P[8]||(P[8]=gn(()=>{},["prevent"])),model:l.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:f},{default:j(()=>[k(W,null,{label:j(()=>[ee("div",Kle,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[l.value.search_scope_type==="custom"?(Ne(),bt(B,{key:0,type:"primary",link:"",onClick:w},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),k(I,{teleported:!1,size:"small",modelValue:l.value.search_scope_type,"onUpdate:modelValue":P[0]||(P[0]=Ye=>l.value.search_scope_type=Ye),style:{width:"85px"}},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var Ye;return[l.value.search_scope_type==="custom"?(Ne(),mn("div",Zle,[((Ye=l.value.knowledge_id_list)==null?void 0:Ye.length)===0?(Ne(),bt(V,{key:0,type:"info"},{default:j(()=>[ft(_e(D.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(l.value.knowledge_id_list,(Be,Je)=>{var gt,le,Ze;return Ne(),mn("div",{key:Je,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Jle,[k(z,{type:(gt=Wn(bs)(v.value,Be,"id"))==null?void 0:gt.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(le=Wn(bs)(v.value,Be,"id"))==null?void 0:le.name},_e((Ze=Wn(bs)(v.value,Be,"id"))==null?void 0:Ze.name),9,Qle)]),k(B,{text:"",onClick:pe=>E(Be)},{default:j(()=>[k(Y,null,{default:j(()=>[k(X)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",ese,[k(W,{prop:"search_scope_reference",rules:{message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",tse,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),P[9]||(P[9]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(I,{teleported:!1,size:"small",modelValue:l.value.search_scope_source,"onUpdate:modelValue":P[1]||(P[1]=Be=>l.value.search_scope_source=Be),style:{width:"95px"},onChange:P[2]||(P[2]=Be=>l.value.search_scope_reference=[])},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:o,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.variable.placeholder"),modelValue:l.value.search_scope_reference,"onUpdate:modelValue":P[3]||(P[3]=Be=>l.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(W,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:j(()=>[k(ie,{modelValue:l.value.search_mode,"onUpdate:modelValue":P[4]||(P[4]=Ye=>l.value.search_mode=Ye)},{default:j(()=>[k(J,{value:"auto"},{default:j(()=>[ee("span",nse,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),k(Q,{content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.autoTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1}),l.value.search_scope_type==="custom"?(Ne(),bt(J,{key:0,value:"custom"},{default:j(()=>[ee("span",rse,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),k(Q,{c:"",content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.customTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1})):Bn("",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),ee("div",ose,[l.value.search_mode==="auto"?(Ne(),bt(W,{key:0,prop:"question_reference",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),P[10]||(P[10]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:l.value.question_reference,"onUpdate:modelValue":P[5]||(P[5]=Ye=>l.value.question_reference=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(Ne(),mn("div",ise,[ee("div",ase,[k(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),k(I,{modelValue:l.value.search_condition_type,"onUpdate:modelValue":P[6]||(P[6]=Ye=>l.value.search_condition_type=Ye),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),k(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(Ne(!0),mn(Ir,null,No(l.value.search_condition_list,(Ye,Be)=>(Ne(),mn("div",{key:Be},[k(Pe,{gutter:8,class:"mb-8"},{default:j(()=>[k(Se,{span:8},{default:j(()=>[k(I,{modelValue:Ye.key,"onUpdate:modelValue":Je=>Ye.key=Je,filterable:"",onFocus:P[7]||(P[7]=Je=>T(l.value.knowledge_id_list))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(l.value.knowledge_tags,Je=>(Ne(),bt(F,{key:Je,label:Je.key,value:Je.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:7},{default:j(()=>[k(I,{modelValue:Ye.compare,"onUpdate:modelValue":Je=>Ye.compare=Je},{default:j(()=>[(Ne(),mn(Ir,null,No(i,Je=>k(F,{key:Je.value,value:Je.value,label:Je.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:8},{default:j(()=>[k(Ae,{modelValue:Ye.value,"onUpdate:modelValue":Je=>Ye.value=Je,placeholder:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),k(Se,{span:1},{default:j(()=>[k(B,{link:"",onClick:Je=>M(Be),type:"info",class:"mt-4"},{default:j(()=>[k(Lv,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128)),k(B,{link:"",type:"primary",onClick:S,class:"mt-8"},{default:j(()=>[k(Lv,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(D.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),k(Bj,{ref_key:"AddKnowledgeDialogRef",ref:h,onAddData:O,data:v.value,loading:b.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class sse extends ai{constructor(e){super(e,lse)}}const use={type:"search-document-node",model:li,view:sse},L8=Object.freeze(Object.defineProperty({__proto__:null,default:use},Symbol.toStringTag,{value:"Module"})),cse={class:"title-decoration-1 mb-8"},dse={class:"flex-between"},fse={key:0,class:"w-full"},pse={class:"flex align-center",style:{"line-height":"20px"}},hse=["title"],vse={key:1,class:"w-full"},mse={class:"flex-between"},gse={class:"flex-between"},yse={class:"w-full"},_se={class:"flex-between"},bse={class:"flex-between"},wse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(),o={knowledge_id_list:[],knowledge_setting:{top_n:3,similarity:.6,max_paragraph_char_number:5e3,search_mode:"embedding"},question_reference_address:[],show_knowledge:!1,search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[]},r=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",o),e.nodeModel.properties.node_data),set:S=>{Me.set(e.nodeModel.properties,"node_data",S)}}),i=He(),a=He(),s=He(),l=He([]),f=He(!1);function h(S){Me.set(e.nodeModel.properties.node_data,"knowledge_setting",S.knowledge_setting)}const v=()=>{var S;(S=a.value)==null||S.open(r.value,"WORK_FLOW")};function b(S){const M=e.nodeModel.properties.node_data.knowledge_id_list.filter(T=>T!==S);Me.set(e.nodeModel.properties.node_data,"knowledge_id_list",M)}function E(S){Me.set(e.nodeModel.properties.node_data,"knowledge_id_list",S.map(M=>M.id)),Me.set(e.nodeModel.properties.node_data,"knowledge_list",S),l.value=S}function O(){s.value&&s.value.open(r.value.knowledge_id_list)}const w=()=>{var S;return Promise.all([n.value.validate(),(S=i.value)==null?void 0:S.validate()]).catch(M=>Promise.reject({node:e.nodeModel,errMessage:M}))};return bo(()=>{l.value=e.nodeModel.properties.node_data.knowledge_list,r.value.show_knowledge=r.value.show_knowledge?r.value.show_knowledge:!1,r.value.search_scope_type=r.value.search_scope_type?r.value.search_scope_type:"custom",r.value.search_scope_source=r.value.search_scope_source?r.value.search_scope_source:"knowledge",r.value.knowledge_id_list=r.value.knowledge_id_list?r.value.knowledge_id_list:[],Me.set(e.nodeModel,"validate",w)}),(S,M)=>{const T=ne("el-button"),$=ne("el-option"),D=ne("el-select"),P=ne("el-text"),B=ne("KnowledgeIcon"),F=ne("Close"),I=ne("el-icon"),V=ne("el-form-item"),z=ne("el-col"),X=ne("el-row"),Y=ne("el-switch"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",cse,_e(S.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never"},{default:j(()=>[k(W,{onSubmit:M[7]||(M[7]=gn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:i,"hide-required-asterisk":""},{default:j(()=>[k(V,null,{label:j(()=>[ee("div",dse,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[r.value.search_scope_type==="custom"?(Ne(),bt(T,{key:0,type:"primary",link:"",onClick:O},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_type,"onUpdate:modelValue":M[0]||(M[0]=J=>r.value.search_scope_type=J),style:{width:"85px"}},{default:j(()=>[k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k($,{label:S.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var J;return[r.value.search_scope_type==="custom"?(Ne(),mn("div",fse,[((J=r.value.knowledge_id_list)==null?void 0:J.length)===0?(Ne(),bt(P,{key:0,type:"info"},{default:j(()=>[ft(_e(S.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(r.value.knowledge_id_list,(ie,Se)=>{var Ae,Pe,De;return Ne(),mn("div",{key:Se,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",pse,[k(B,{type:(Ae=Wn(bs)(l.value,ie,"id"))==null?void 0:Ae.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(Pe=Wn(bs)(l.value,ie,"id"))==null?void 0:Pe.name},_e((De=Wn(bs)(l.value,ie,"id"))==null?void 0:De.name),9,hse)]),k(T,{text:"",onClick:ze=>b(ie)},{default:j(()=>[k(I,null,{default:j(()=>[k(F)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",vse,[k(V,{prop:"search_scope_reference",rules:{message:S.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",mse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),M[8]||(M[8]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_source,"onUpdate:modelValue":M[1]||(M[1]=ie=>r.value.search_scope_source=ie),style:{width:"95px"},onChange:M[2]||(M[2]=ie=>r.value.search_scope_reference=[])},{default:j(()=>[k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:n,nodeModel:t.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.variable.placeholder"),modelValue:r.value.search_scope_reference,"onUpdate:modelValue":M[3]||(M[3]=ie=>r.value.search_scope_reference=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(V,{label:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",gse,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(T,{type:"primary",link:"",onClick:v},{default:j(()=>[k(Lv,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",yse,[k(X,null,{default:j(()=>[k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(S.$t(Wn(v9)[r.value.knowledge_setting.search_mode])),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=r.value.knowledge_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.topReferences")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.top_n),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.maxCharacters")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(V,{prop:"question_reference_address",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",_se,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),M[9]||(M[9]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:n,nodeModel:t.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.question_reference_address,"onUpdate:modelValue":M[4]||(M[4]=J=>r.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(V,{prop:"show_knowledge",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:M[6]||(M[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",bse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"))+" ",1),M[10]||(M[10]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Y,{size:"small",modelValue:r.value.show_knowledge,"onUpdate:modelValue":M[5]||(M[5]=J=>r.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(A9,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:h},null,512),k(Bj,{ref_key:"AddknowledgeDialogRef",ref:s,onAddData:E,data:l.value,loading:f.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class Ese extends ai{constructor(e){super(e,wse)}}const xse={type:"search-knowledge-node",model:li,view:Ese},I8=Object.freeze(Object.defineProperty({__proto__:null,default:xse},Symbol.toStringTag,{value:"Module"})),Ose={class:"title-decoration-1 mb-8"},Sse={class:"flex-between w-full"},Ase={class:"flex-between w-full"},Mse={class:"flex align-center"},Tse={class:"mr-4"},Cse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=He(),h=()=>{var $;return Promise.all([f.value?f.value.validate():Promise.resolve(""),($=l.value)==null?void 0:$.validate()]).catch(D=>Promise.reject({node:i.nodeModel,errMessage:D}))},v=$=>$.ctrlKey===!0?($.preventDefault(),!0):($.stopPropagation(),!0),b={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:$=>{Me.set(i.nodeModel.properties,"node_data",$)}}),O=()=>{var D;const $=E.value.stt_model_id;if(!$){Oh(Pt("views.application.form.voiceInput.requiredMessage"));return}(D=s.value)==null||D.open($,o,E.value.model_params_setting)},w=$=>{Me.set(i.nodeModel.properties.node_data,"model_params_setting",$)};function S($){var D;$?(D=s.value)==null||D.reset_default($,o):w({})}const M=e();function T(){var D;const $=r.value==="systemManage"?{model_type:"STT",workspace_id:(D=M.value)==null?void 0:D.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList($).then(P=>{a.value=Me.groupBy(P==null?void 0:P.data,"provider")})}return bo(()=>{T(),Me.set(i.nodeModel,"validate",h)}),($,D)=>{const P=ne("AppIcon"),B=ne("el-button"),F=ne("ModelSelect"),I=ne("el-form-item"),V=ne("el-tooltip"),z=ne("el-switch"),X=ne("el-form"),Y=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Ose,_e($.$t("views.applicationWorkflow.nodeSetting")),1),k(Y,{shadow:"never",class:"card-never"},{default:j(()=>[k(X,{onSubmit:D[4]||(D[4]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label"),prop:"stt_model_id",rules:{required:!0,message:$.$t("views.application.form.voiceInput.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Sse,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),D[5]||(D[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(B,{type:"primary",link:"",onClick:O,disabled:!E.value.stt_model_id,class:"mr-4"},{default:j(()=>[k(P,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(F,{onWheel:v,teleported:!1,onChange:S,modelValue:E.value.stt_model_id,"onUpdate:modelValue":D[0]||(D[0]=W=>E.value.stt_model_id=W),placeholder:$.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Ase,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),D[6]||(D[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:E.value.audio_list,"onUpdate:modelValue":D[1]||(D[1]=W=>E.value.audio_list=W)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:$.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:D[3]||(D[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Mse,[ee("div",Tse,[ee("span",null,_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(V,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(P,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(z,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":D[2]||(D[2]=W=>E.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(M9,{ref_key:"STTModeParamSettingDialogRef",ref:s,onRefresh:w},null,512)]),_:1},8,["node-model"])}}});class Nse extends ai{constructor(e){super(e,Cse)}}const kse={type:"speech-to-text-node",model:li,view:Nse},F8=Object.freeze(Object.defineProperty({__proto__:null,default:kse},Symbol.toStringTag,{value:"Module"})),Pse={class:"title-decoration-1 mb-8"},Rse={class:"break-all"},Dse={class:"title-decoration-1 mb-8"},jse={class:"break-all"},Lse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(!1),o=[{label:Pt("views.applicationWorkflow.nodes.startNode.currentTime"),value:"time"},{label:Pt("views.application.form.historyRecord.label"),value:"history_context"},{label:Pt("chat.chatId"),value:"chat_id"},{label:Pt("chat.chatUserId"),value:"chat_user_id"},{label:Pt("chat.chatUserType"),value:"chat_user_type"},{label:Pt("views.chatUser.title"),value:"chat_user"}],r=()=>{const l=e.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.user_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>h.label&&h.label.input_type==="TooltipLabel"?{label:h.label.label,value:h.field||h.variable}:{label:h.label||h.name,value:h.field||h.variable}),f=e.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.api_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>({label:h.name||h.variable,value:h.variable}));return[...l,...f]},i=()=>{const l=r();Me.set(e.nodeModel.properties.config,"globalFields",[...o,...l])},a=()=>{const l=e.nodeModel.graphModel.nodes.filter(f=>f.id==="base-node").map(f=>Me.cloneDeep(f.properties.chat_input_field_list)).reduce((f,h)=>[...f,...h],[]).map(f=>({label:f.label,value:f.field}));Me.set(e.nodeModel.properties.config,"chatFields",l)};e.nodeModel.graphModel.eventCenter.on("refreshFieldList",i),e.nodeModel.graphModel.eventCenter.on("chatFieldList",a);const s=()=>{let l=Me.cloneDeep(e.nodeModel.properties.config.fields);const f=e.nodeModel.graphModel.nodes.filter(v=>v.id==="base-node").filter(v=>v.properties.node_data.file_upload_enable).map(v=>Me.cloneDeep(v.properties.node_data.file_upload_setting)).filter(v=>v);if(l=l.filter(v=>v.value!=="image"&&v.value!=="document"&&v.value!=="audio"&&v.value!=="video"&&v.value!=="other"),f.length===0){Me.set(e.nodeModel.properties.config,"fields",l);return}const h=[];f[0].document&&h.push({label:Pt("common.fileUpload.document"),value:"document"}),f[0].image&&h.push({label:Pt("common.fileUpload.image"),value:"image"}),f[0].audio&&h.push({label:Pt("common.fileUpload.audio"),value:"audio"}),f[0].video&&h.push({label:Pt("common.fileUpload.video"),value:"video"}),f[0].other&&h.push({label:Pt("common.fileUpload.other"),value:"other"}),Me.set(e.nodeModel.properties.config,"fields",[...l,...h])};return e.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",s),bo(()=>{a(),i(),s()}),(l,f)=>{const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var E;return[ee("h5",Pse,_e(l.$t("views.applicationWorkflow.variable.global")),1),(Ne(!0),mn(Ir,null,No(t.nodeModel.properties.config.globalFields,(O,w)=>(Ne(),mn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[0]||(f[0]=S=>n.value=!0),onMouseleave:f[1]||(f[1]=S=>n.value=!1)},[ee("span",Rse,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Wn(x_)(`{{global.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128)),(E=t.nodeModel.properties.config.chatFields)!=null&&E.length?(Ne(),mn(Ir,{key:0},[ee("h5",Dse,_e(l.$t("views.applicationWorkflow.variable.chat")),1),(Ne(!0),mn(Ir,null,No(t.nodeModel.properties.config.chatFields||[],(O,w)=>(Ne(),mn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[2]||(f[2]=S=>n.value=!0),onMouseleave:f[3]||(f[3]=S=>n.value=!1)},[ee("span",jse,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Wn(x_)(`{{chat.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class Ise extends ai{constructor(e){super(e,Lse)}}const Fse={type:"start-node",model:li,view:Ise},B8=Object.freeze(Object.defineProperty({__proto__:null,default:Fse},Symbol.toStringTag,{value:"Module"})),Bse={class:"title-decoration-1 mb-8"},$se={class:"flex-between w-full"},Use={class:"flex-between w-full"},Vse={class:"flex align-center"},Wse={class:"mr-4"},Gse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(),s=He(null),l=He(),f=He(),h=()=>{var T;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(T=l.value)==null?void 0:T.validate()]).catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},v=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),b={tts_model_id:"",is_result:!0,content_list:[],model_params_setting:{}},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:T=>{Me.set(i.nodeModel.properties,"node_data",T)}}),O=e();function w(){var $;const T=r.value==="systemManage"?{model_type:"TTS",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(T).then(D=>{s.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const S=()=>{var $;const T=E.value.tts_model_id;if(!T){Oh(Pt("views.application.form.voicePlay.requiredMessage"));return}($=a.value)==null||$.open(T,o,E.value.model_params_setting)},M=T=>{E.value.model_params_setting=T};return bo(()=>{w(),Me.set(i.nodeModel,"validate",h)}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-tooltip"),V=ne("el-switch"),z=ne("el-form"),X=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Bse,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(X,{shadow:"never",class:"card-never"},{default:j(()=>[k(z,{onSubmit:$[4]||($[4]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label"),prop:"tts_model_id",rules:{required:!0,message:T.$t("views.application.form.voicePlay.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",$se,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{type:"primary",link:"",onClick:S,disabled:!E.value.tts_model_id,class:"mr-4"},{default:j(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(B,{onWheel:v,teleported:!1,modelValue:E.value.tts_model_id,"onUpdate:modelValue":$[0]||($[0]=Y=>E.value.tts_model_id=Y),placeholder:T.$t("views.application.form.voicePlay.placeholder"),options:s.value,showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{prop:"content_list",label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),rules:{message:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Use,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),$[6]||($[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:E.value.content_list,"onUpdate:modelValue":$[1]||($[1]=Y=>E.value.content_list=Y)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[3]||($[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Vse,[ee("div",Wse,[ee("span",null,_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(I,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(V,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":$[2]||($[2]=Y=>E.value.is_result=Y)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:a,onRefresh:M},null,512)]),_:1},8,["node-model"])}}});class zse extends ai{constructor(e){super(e,Gse)}}const Hse={type:"text-to-speech-node",model:li,view:zse},$8=Object.freeze(Object.defineProperty({__proto__:null,default:Hse},Symbol.toStringTag,{value:"Module"})),Xse={class:"title-decoration-1 mb-8"},Yse={class:"flex-between w-full"},qse={class:"flex align-center"},Kse={class:"mr-4"},Zse={class:"flex align-center"},Jse={class:"mr-4"},Qse={class:"flex align-center"},eue={class:"mr-4"},tue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var B;const P=r.value==="systemManage"?{model_type:"TTV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Xse,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[6]||(B[6]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Yse,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,onFocus:w,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",qse,[ee("div",Kse,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Zse,[ee("div",Jse,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Qse,[ee("div",eue,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class nue extends ai{constructor(e){super(e,tue)}}const rue={type:"text-to-video-node",model:li,view:nue},U8=Object.freeze(Object.defineProperty({__proto__:null,default:rue},Symbol.toStringTag,{value:"Module"})),oue={class:"title-decoration-1 mb-16"},iue={class:"lighter mb-8"},aue={key:0},lue={class:"flex-between"},sue={class:"flex align-center"},uue={class:"mr-4"},cue={key:1,class:"color-danger"},due={class:"flex align-center"},fue={class:"mr-4"},pue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),o=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=He(),i={input_field_list:[],is_result:!1},a=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:h=>{Me.set(e.nodeModel.properties,"node_data",h)}}),s=He(),l=()=>{var h;return(h=s.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))},f=()=>{if(!e.nodeModel.properties.node_data.tool_lib_id){Me.set(e.nodeModel.properties,"status",500);return}oi({type:"tool",systemType:o.value}).getToolById(e.nodeModel.properties.node_data.tool_lib_id).then(h=>{const v=e.nodeModel.properties.node_data.input_field_list,b=h.data.input_field_list.map(E=>{const O=v.find(w=>w.name==E.name);return O&&O.source==E.source?{...E,value:JSON.parse(JSON.stringify(O.value))}:{...E,value:E.source=="reference"?[]:""}});Me.set(e.nodeModel.properties.node_data,"input_field_list",b),Me.set(e.nodeModel.properties,"status",h.data.is_active?200:500)}).catch(()=>{Me.set(e.nodeModel.properties,"status",500)})};return bo(()=>{var h;typeof((h=e.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),f(),Me.set(e.nodeModel,"validate",l)}),(h,v)=>{const b=ne("auto-tooltip"),E=ne("AppIcon"),O=ne("el-tooltip"),w=ne("el-tag"),S=ne("el-input"),M=ne("el-form-item"),T=ne("el-text"),$=ne("el-card"),D=ne("el-switch"),P=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",oue,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),ee("h5",iue,_e(h.$t("common.param.inputParam")),1),k(P,{onSubmit:v[2]||(v[2]=gn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:s,model:a.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k($,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var B;return[((B=a.value.input_field_list)==null?void 0:B.length)>0?(Ne(),mn("div",aue,[(Ne(!0),mn(Ir,null,No(a.value.input_field_list,(F,I)=>(Ne(),bt(M,{key:F.name,label:F.name,prop:"input_field_list."+I+".value",rules:{required:F.is_required,message:F.source==="reference"?h.$t("views.tool.form.param.selectPlaceholder"):h.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",lue,[ee("div",sue,[ee("div",uue,[k(b,{content:F.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(F.name),1)]),_:2},1032,["content"])]),F.desc?(Ne(),bt(O,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.desc),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),F.is_required?(Ne(),mn("span",cue,"*")):Bn("",!0),k(w,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(F.type),1)]),_:2},1024)])])]),default:j(()=>[F.source==="reference"?(Ne(),bt(Go,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.tool.form.param.selectPlaceholder"),modelValue:F.value,"onUpdate:modelValue":V=>F.value=V},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(S,{key:1,modelValue:F.value,"onUpdate:modelValue":V=>F.value=V,placeholder:h.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(T,{key:1,type:"info"},{default:j(()=>[ft(_e(h.$t("common.noData")),1)]),_:1}))]}),_:1}),k(M,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[1]||(v[1]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",due,[ee("div",fue,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(D,{size:"small",modelValue:a.value.is_result,"onUpdate:modelValue":v[0]||(v[0]=B=>a.value.is_result=B)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class hue extends ai{constructor(e){super(e,pue)}}const vue={type:"tool-lib-node",model:li,view:hue},V8=Object.freeze(Object.defineProperty({__proto__:null,default:vue},Symbol.toStringTag,{value:"Module"})),mue={class:"title-decoration-1 mb-16"},gue={class:"flex-between"},yue={class:"lighter mb-8"},_ue={key:0},bue={class:"flex-between"},wue={class:"flex align-center"},Eue={class:"mr-4"},xue={key:1,class:"color-danger"},Oue={class:"lighter mb-8"},Sue={key:0,class:"mb-8"},Aue={class:"flex align-center"},Mue={class:"mr-4"},Tue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),o=He(),r=He(),i={code:"",input_field_list:[],is_result:!1},a=He(null),s=He(!1),l=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:w=>{Me.set(e.nodeModel.properties,"node_data",w)}}),f=He(),h=()=>{var w;return(w=f.value)==null?void 0:w.validate().catch(S=>Promise.reject({node:e.nodeModel,errMessage:S}))};function v(w){Me.set(e.nodeModel.properties.node_data,"code",w)}function b(w,S){typeof S<"u"&&(a.value=S),o.value.open(w)}function E(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list);S.splice(w,1),Me.set(e.nodeModel.properties.node_data,"input_field_list",S)}function O(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list),M={...w,value:w.source==="reference"?[]:""};a.value!==null?S.splice(a.value,1,M):S.push(M),Me.set(e.nodeModel.properties.node_data,"input_field_list",S),a.value=null}return bo(()=>{var w;typeof((w=e.nodeModel.properties.node_data)==null?void 0:w.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",h),setTimeout(()=>{s.value=!0},100)}),(w,S)=>{const M=ne("AppIcon"),T=ne("el-button"),$=ne("auto-tooltip"),D=ne("el-tooltip"),P=ne("el-tag"),B=ne("el-input"),F=ne("el-form-item"),I=ne("el-text"),V=ne("el-card"),z=ne("CodemirrorEditor"),X=ne("el-switch"),Y=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",mue,_e(w.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",gue,[ee("h5",yue,_e(w.$t("common.param.inputParam")),1),k(T,{link:"",type:"primary",onClick:S[0]||(S[0]=W=>b())},{default:j(()=>[k(M,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("common.add")),1)]),_:1})]),k(Y,{onSubmit:S[4]||(S[4]=gn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:f,model:l.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(V,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var W;return[((W=l.value.input_field_list)==null?void 0:W.length)>0?(Ne(),mn("div",_ue,[(Ne(!0),mn(Ir,null,No(l.value.input_field_list,(Q,J)=>(Ne(),bt(F,{key:J,label:Q.name,prop:"input_field_list."+J+".value",rules:{required:Q.is_required,message:Q.source==="reference"?w.$t("views.tool.form.param.selectPlaceholder"):w.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",bue,[ee("div",wue,[ee("div",Eue,[k($,{content:Q.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(Q.name),1)]),_:2},1032,["content"])]),Q.desc?(Ne(),bt(D,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Q.desc),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),Q.is_required?(Ne(),mn("span",xue,"*")):Bn("",!0),k(P,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(Q.type),1)]),_:2},1024)]),ee("div",null,[k(T,{text:"",onClick:gn(ie=>b(Q,J),["stop"])},{default:j(()=>[k(M,{iconName:"app-edit"})]),_:1},8,["onClick"]),k(T,{text:"",onClick:ie=>E(J),style:{"margin-left":"4px !important"}},{default:j(()=>[k(M,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:j(()=>[Q.source==="reference"?(Ne(),bt(Go,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:w.$t("views.tool.form.param.selectPlaceholder"),modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(B,{key:1,modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(I,{key:1,type:"info"},{default:j(()=>[ft(_e(w.$t("common.noData")),1)]),_:1}))]}),_:1}),ee("h5",Oue,_e(w.$t("views.tool.form.param.code")),1),s.value?(Ne(),mn("div",Sue,[k(z,{title:w.$t("views.tool.form.param.code"),modelValue:l.value.code,"onUpdate:modelValue":S[1]||(S[1]=W=>l.value.code=W),onWheel:n,style:{height:"130px !important"},onSubmitDialog:v},null,8,["title","modelValue"])])):Bn("",!0),k(F,{label:w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:S[3]||(S[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Aue,[ee("div",Mue,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(D,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{size:"small",modelValue:l.value.is_result,"onUpdate:modelValue":S[2]||(S[2]=W=>l.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"]),k(l7,{ref_key:"FieldFormDialogRef",ref:o,onRefresh:O},null,512)]),_:1},8,["nodeModel"])}}});class Cue extends ai{constructor(e){super(e,Tue)}}const Nue={type:"tool-node",model:li,view:Cue},W8=Object.freeze(Object.defineProperty({__proto__:null,default:Nue},Symbol.toStringTag,{value:"Module"})),kue={class:"dialog-footer"},Pue=_r({__name:"GroupFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):O.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",kue,[k($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("common.variable"),prop:"field"},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Rue={class:"title-decoration-1 mb-8"},Due={class:"flex-between"},jue={class:"flex-between mb-12"},Lue=["title"],Iue={class:"flex align-center",style:{"margin-right":"-3px"}},Fue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He(),i={strategy:"first_non_null",group_list:[{id:yu(),label:"Group1",field:"Group1",variable_list:[{v_id:yu(),variable:[]}]}]},a=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:M=>{Me.set(e.nodeModel.properties,"node_data",M)}}),s=He([]);function l(M,T){let $=null;M&&T!==void 0&&($={field:M.field,label:M.label}),r.value.open($,T)}function f(M,T){for(let D=0;D<s.value.length;D++)if(s.value[D].field===M.field&&T!==D){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+M.field);return}[void 0,null].includes(T)?(s.value.push(M),O(M)):(s.value.splice(T,1,M),h(M,T)),r.value.close();const $=[...s.value.map(D=>({label:D.label,value:D.field}))];Me.set(e.nodeModel.properties.config,"fields",$)}const h=(M,T)=>{const $=Me.cloneDeep(a.value.group_list);$[T].field=M.field,$[T].label=M.label,a.value.group_list=$},v=M=>{const T=Me.cloneDeep(a.value.group_list);T.splice(M,1),a.value.group_list=T,s.value.splice(M,1);const $=T.map(D=>({label:D.label,value:D.field}));Me.set(e.nodeModel.properties.config,"fields",$)},b=M=>{const T=Me.cloneDeep(a.value.group_list);T[M].variable_list.push({v_id:yu(),variable:[]}),a.value.group_list=T},E=(M,T)=>{const $=Me.cloneDeep(a.value.group_list);$[M].variable_list.splice(T,1),a.value.group_list=$},O=M=>{const T=Me.cloneDeep(a.value.group_list);T.push({id:yu(),field:M.field,label:M.label,variable_list:[{v_id:yu(),variable:[]}]}),a.value.group_list=T},w=async()=>{var T;const M=[...o.value.map($=>$.validate()),(T=n.value)==null?void 0:T.validate()];return Promise.all(M).catch($=>Promise.reject({node:e.nodeModel,errMessage:$}))};function S(M,T){const{oldIndex:$,newIndex:D}=M;if($===void 0||D===void 0)return;const P=Me.cloneDeep(e.nodeModel.properties.node_data.group_list[T].variable_list),B={...P[$]},F={...P[D]};P[D]=B,P[$]=F,Me.set(e.nodeModel.properties.node_data.group_list[T],"variable_list",P)}return bo(()=>{var T;typeof((T=e.nodeModel.properties.node_data)==null?void 0:T.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",w),e.nodeModel.properties.node_data.group_list&&(s.value=a.value.group_list.map($=>({label:$.label,field:$.field})));const M=a.value.group_list.map($=>({label:$.label,value:$.field}));Me.set(e.nodeModel.properties.config,"fields",M)}),(M,T)=>{const $=ne("el-option"),D=ne("el-select"),P=ne("el-form-item"),B=ne("EditPen"),F=ne("el-icon"),I=ne("el-button"),V=ne("AppIcon"),z=ne("el-col"),X=ne("el-row"),Y=ne("el-card"),W=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Rue,_e(M.$t("views.applicationWorkflow.nodeSetting")),1),k(W,{onSubmit:T[2]||(T[2]=gn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableAggregationRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(P,{label:M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"),rules:{required:!0,trigger:"change"}},{label:j(()=>[ee("div",Due,[ee("div",null,[ee("span",null,[ft(_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"))+" ",1),T[3]||(T[3]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(D,{modelValue:a.value.strategy,"onUpdate:modelValue":T[0]||(T[0]=Q=>a.value.strategy=Q)},{default:j(()=>[k($,{label:Wn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder"),value:"first_non_null"},null,8,["label"]),k($,{label:Wn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder1"),value:"variable_to_json"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),(Ne(!0),mn(Ir,null,No(a.value.group_list,(Q,J)=>(Ne(),mn("div",{key:Q.id,class:"mb-8"},[k(Y,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",jue,[ee("span",{class:"ellipsis",title:Q.label},_e(Q.label),9,Lue),ee("div",Iue,[k(I,{onClick:ie=>l(Q,J),link:""},{default:j(()=>[k(F,null,{default:j(()=>[k(B)]),_:1})]),_:1},8,["onClick"]),k(I,{onClick:ie=>v(J),link:"",disabled:a.value.group_list.length<=1},{default:j(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),k(Wn(Xj),{ref_for:!0,ref:"el",modelValue:Q.variable_list,disabled:Q.variable_list.length===1,handle:".handle",animation:150,ghostClass:"ghost",onEnd:ie=>S(ie,J)},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Q.variable_list,(ie,Se)=>(Ne(),mn("div",{key:ie.v_id,class:"drag-card"},[k(X,{class:"handle"},{default:j(()=>[k(z,{span:22,class:"flex"},{default:j(()=>[T[4]||(T[4]=ee("img",{src:Yj,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),k(P,{prop:`group_list.${J}.variable_list.${Se}.variable`,rules:{type:"array",required:!0,message:M.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:o,nodeModel:t.nodeModel,style:{width:"200px"},placeholder:M.$t("views.applicationWorkflow.variable.placeholder"),modelValue:ie.variable,"onUpdate:modelValue":Ae=>ie.variable=Ae},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(z,{span:2},{default:j(()=>[k(I,{link:"",class:"mt-4 ml-4",disabled:Q.variable_list.length<=1,onClick:Ae=>E(J,Se)},{default:j(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),k(I,{onClick:ie=>b(J),type:"primary",size:"large",link:""},{default:j(()=>[k(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("common.add")),1)]),_:1},8,["onClick"])]),_:2},1024)]))),128)),k(I,{onClick:T[1]||(T[1]=Q=>l()),type:"primary",size:"large",link:""},{default:j(()=>[k(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),k(Pue,{ref_key:"GroupFieldDialogRef",ref:r,onRefresh:f},null,512)]),_:1},8,["nodeModel"])}}});class Bue extends ai{constructor(e){super(e,Fue)}getConfig(e){return e.model.properties.config}}const $ue={type:"variable-aggregation-node",model:li,view:Bue},G8=Object.freeze(Object.defineProperty({__proto__:null,default:$ue},Symbol.toStringTag,{value:"Module"})),Uue={class:"flex-between"},Vue={class:"flex-between mb-8"},Wue={class:"lighter"},Gue={key:0,class:"flex w-full"},zue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("workflowMode"),n=t,o=["string","num","json","bool"],r=O=>O.ctrlKey===!0?(O.preventDefault(),!0):(O.stopPropagation(),!0),i={variable_list:[{id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""}]};He(1);const a=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",i),n.nodeModel.properties.node_data),set:O=>{Me.set(n.nodeModel.properties,"node_data",O)}}),s=He(),l=He(),f=He(),h=async()=>{var w;let O=[(w=s.value)==null?void 0:w.validate(),...l.value.map(S=>S.validate())];return f.value&&(O=[...O,...l.value.map(S=>S.validate())]),Promise.all(O).catch(S=>Promise.reject({node:n.nodeModel,errMessage:S}))};function v(){const O=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list),w={id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};O.push(w),Me.set(n.nodeModel.properties.node_data,"variable_list",O)}function b(O){const w=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list);w.splice(O,1),Me.set(n.nodeModel.properties.node_data,"variable_list",w)}function E(O){(e==nc.ApplicationLoop?[...n.nodeModel.graphModel.nodes,...n.nodeModel.graphModel.get_parent_nodes()]:n.nodeModel.graphModel.nodes).map(w=>{w.id==="start-node"&&(w.properties.config.globalFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)}),w.properties.config.chatFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)})),w.id==="loop-start-node"&&w.properties.loop_input_field_list.forEach(S=>{S.field===O.fields[1]&&(O.name=S.label)})})}return bo(()=>{var O;typeof((O=n.nodeModel.properties.node_data)==null?void 0:O.is_result)>"u"&&Qd(n.nodeModel)&&Me.set(n.nodeModel.properties.node_data,"is_result",!0),Me.set(n.nodeModel,"validate",h)}),(O,w)=>{const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),P=ne("el-input"),B=ne("el-input-number"),F=ne("CodemirrorEditor"),I=ne("el-card"),V=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(V,{onSubmit:w[0]||(w[0]=gn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(a.value.variable_list,(z,X)=>(Ne(),bt(I,{key:z.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,null,{label:j(()=>[ee("div",Uue,[ee("div",null,[ft(_e(O.$t("common.variable"))+" ",1),w[1]||(w[1]=ee("span",{class:"color-danger"},"*",-1))]),a.value.variable_list.length>1?(Ne(),bt(M,{key:0,text:"",onClick:Y=>b(X)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])):Bn("",!0)])]),default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:l,nodeModel:t.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.fields,"onUpdate:modelValue":Y=>z.fields=Y,global:!0,onChange:Y=>E(z)},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),ee("div",Vue,[ee("span",Wue,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableAssignNode.assign")),1),w[2]||(w[2]=ee("span",{class:"color-danger"},"*",-1))]),k(D,{teleported:!1,modelValue:z.source,"onUpdate:modelValue":Y=>z.source=Y,size:"small",style:{width:"85px"}},{default:j(()=>[k($,{label:O.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k($,{label:O.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),z.source==="custom"?(Ne(),mn("div",Gue,[k(D,{modelValue:z.type,"onUpdate:modelValue":Y=>z.type=Y,style:{"max-width":"85px"},class:"mr-8",onChange:Y=>{Y==="bool"?a.value.variable_list[X].value=!0:a.value.variable_list[X].value=null}},{default:j(()=>[(Ne(),mn(Ir,null,No(o,Y=>k($,{key:Y,label:Y,value:Y},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),z.type==="string"?(Ne(),bt(T,{key:0,prop:"variable_list."+X+".value",rules:{message:Wn(Pt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(P,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,placeholder:O.$t("common.inputPlaceholder"),"show-word-limit":"",clearable:"",onWheel:r},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])):z.type==="num"?(Ne(),bt(T,{key:1,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(B,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):z.type==="json"?(Ne(),bt(T,{key:2,class:"w-full",prop:"variable_list."+X+".value",rules:[{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0},{validator:(Y,W,Q)=>{try{JSON.parse(W),Q()}catch{Q(new Error("Invalid JSON format"))}},trigger:"blur"}]},{default:j(()=>[k(F,{title:"JSON",modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,style:{height:"100px",width:"155px"},onSubmitDialog:Y=>a.value.variable_list[X].value=Y},null,8,["modelValue","onUpdate:modelValue","onSubmitDialog"])]),_:2},1032,["prop","rules"])):z.type==="bool"?(Ne(),bt(T,{key:3,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(D,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,style:{width:"155px"}},{default:j(()=>[k($,{label:"true",value:!0}),k($,{label:"false",value:!1})]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):Bn("",!0)])):(Ne(),bt(T,{key:1},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef2",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.reference,"onUpdate:modelValue":Y=>z.reference=Y},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1024))]),_:2},1024))),128)),k(M,{link:"",type:"primary",onClick:v},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Hue extends ai{constructor(e){super(e,zue)}}const Xue={type:"variable-assign-node",model:li,view:Hue},z8=Object.freeze(Object.defineProperty({__proto__:null,default:Xue},Symbol.toStringTag,{value:"Module"})),Yue={class:"flex align-center"},que={class:"mr-4"},Kue={class:"flex align-center"},Zue={class:"mr-4"},Jue={class:"flex align-center"},Que={class:"mr-4"},ece={class:"dialog-footer"},tce=_r({__name:"VariableFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:"",expression:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}],expression:[{required:!0,message:Pt("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("AppIcon"),$=ne("el-tooltip"),D=ne("el-form"),P=ne("el-button"),B=ne("el-dialog");return Ne(),bt(B,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):O.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:h.value,"onUpdate:modelValue":w[4]||(w[4]=F=>h.value=F),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",ece,[k(P,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(P,{type:"primary",onClick:w[3]||(w[3]=F=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(D,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(M,{prop:"field"},{label:j(()=>[ee("div",Yue,[ee("span",que,_e(O.$t("common.variable")),1),w[5]||(w[5]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=F=>l.value.field=F),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"label"},{label:j(()=>[ee("div",Kue,[ee("span",Zue,_e(O.$t("dynamicsForm.paramForm.name.label")),1),w[6]||(w[6]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value.label=F),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"expression"},{label:j(()=>[ee("div",Jue,[ee("span",Que,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),w[7]||(w[7]=ee("span",{class:"color-danger"},"*",-1))]),k($,{effect:"dark",content:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.tooltip"),placement:"right"},{default:j(()=>[k(T,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(S,{modelValue:l.value.expression,"onUpdate:modelValue":w[2]||(w[2]=F=>l.value.expression=F),maxlength:64,"show-word-limit":"",placeholder:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),nce={class:"flex-between w-full"},rce={class:"break-all lighter"},oce={class:"ml-4",style:{"margin-top":"-4px"}},ice=["title"],ace=["title"],lce={class:"mr-4"},sce=_r({__name:"VariableFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(e.nodeModel.properties.config,"fields",f),e.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(e.nodeModel.properties.config,"fields",h),e.nodeModel.clear_next_node_field(!1)}return bo(()=>{e.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.node_data.variable_list)),Me.set(e.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",l)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",nce,[ee("h5",rce,[ft(_e(l.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",oce,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined"})]),_:1})])]),((w=e.nodeModel.properties.node_data.variable_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:e.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(b,{prop:"field",label:l.$t("common.variable"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,ice)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,ace)]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",lce,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:gn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(tce,{ref_key:"VariableFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),uce={class:"title-decoration-1 mb-8"},cce={class:"flex-between"},dce=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={input_variable:[],variable_list:[]},o=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:a=>{Me.set(e.nodeModel.properties,"node_data",a)}}),r=He(),i=async()=>r.value.validate().catch(a=>Promise.reject({node:e.nodeModel,errMessage:a}));return bo(()=>{Me.set(e.nodeModel,"validate",i)}),(a,s)=>{const l=ne("el-form-item"),f=ne("el-form"),h=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",uce,_e(a.$t("views.applicationWorkflow.nodeSetting")),1),k(h,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(f,{onSubmit:s[1]||(s[1]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:r,"hide-required-asterisk":""},{default:j(()=>[k(l,{prop:"input_variable",rules:{message:a.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",cce,[ee("div",null,[ft(_e(a.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),s[2]||(s[2]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:a.$t("views.applicationWorkflow.variable.placeholder"),modelValue:o.value.input_variable,"onUpdate:modelValue":s[0]||(s[0]=v=>o.value.input_variable=v)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(l,{prop:"variable_list",rules:{message:a.$t("views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(sce,{ref:"VariableFieldTableRef","node-model":t.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class fce extends ai{constructor(e){super(e,dce)}getConfig(e){return e.model.properties.config}}const pce={type:"variable-splitting-node",model:li,view:fce},H8=Object.freeze(Object.defineProperty({__proto__:null,default:pce},Symbol.toStringTag,{value:"Module"})),hce={class:"title-decoration-1 mb-8"},vce={class:"flex-between w-full"},mce={class:"flex-between"},gce={class:"flex align-center"},yce={class:"flex align-center"},_ce={class:"mr-4"},bce={class:"flex-between"},wce={class:"flex align-center"},Ece={class:"mr-4"},xce=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),s=He(),l=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=l.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,video_list:["start-node","video"]},O=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),w=e();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=w.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function T(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=s.value)==null||V.open(I,o,O.value.model_params_setting))},D=He(),P=I=>{var V;I&&((V=D.value)==null||V.open(I,o))},B=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};function F(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),X=ne("el-button"),Y=ne("ModelSelect"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),Pe=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",hce,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:V[10]||(V[10]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(W,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",vce,[ee("div",null,[ee("span",null,[ft(_e(Wn(Pt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:F},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",mce,[ee("div",gce,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(X,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>P(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(W,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",yce,[ee("div",_ce,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",bce,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(W,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:O.value.video_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.video_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(W,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",wce,[ee("div",Ece,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:F},null,512),k(U2,{onReplace:B,ref_key:"GeneratePromptDialogRef",ref:D},null,512)]),_:1},8,["node-model"])}}});class Oce extends ai{constructor(e){super(e,xce)}}const Sce={type:"video-understand-node",model:li,view:Oce},X8=Object.freeze(Object.defineProperty({__proto__:null,default:Sce},Symbol.toStringTag,{value:"Module"})),BR=_r({__name:"CustomLine",props:{model:{}},setup(t){const e=t,n=()=>{e.model.graphModel.deleteEdgeById(e.model.id)};return(o,r)=>Ql((Ne(),mn("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=gn(()=>{},["stop"])),onClick:r[1]||(r[1]=gn(()=>{},["stop"]))},[(Ne(),mn("svg",{onClick:n,width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...r[2]||(r[2]=[ee("path",{d:"M12 23.0001C5.925 23.0001 1 18.0751 1 12.0001C1 5.92512 5.925 1.00012 12 1.00012C18.075 1.00012 23 5.92512 23 12.0001C23 18.0751 18.075 23.0001 12 23.0001Z",fill:"#3370FF"},null,-1),ee("path",{d:"M9.02524 7.61124L12.0002 10.5862L14.9752 7.61124C15.069 7.5175 15.1962 7.46484 15.3287 7.46484C15.4613 7.46484 15.5885 7.5175 15.6822 7.61124L16.3892 8.31824C16.483 8.412 16.5356 8.53915 16.5356 8.67174C16.5356 8.80432 16.483 8.93147 16.3892 9.02524L13.4142 12.0002L16.3892 14.9752C16.483 15.069 16.5356 15.1962 16.5356 15.3287C16.5356 15.4613 16.483 15.5885 16.3892 15.6822L15.6822 16.3892C15.5885 16.483 15.4613 16.5356 15.3287 16.5356C15.1962 16.5356 15.069 16.483 14.9752 16.3892L12.0002 13.4142L9.02524 16.3892C8.93147 16.483 8.80432 16.5356 8.67174 16.5356C8.53916 16.5356 8.412 16.483 8.31824 16.3892L7.61124 15.6822C7.5175 15.5885 7.46484 15.4613 7.46484 15.3287C7.46484 15.1962 7.5175 15.069 7.61124 14.9752L10.5862 12.0002L7.61124 9.02524C7.5175 8.93147 7.46484 8.80432 7.46484 8.67174C7.46484 8.53915 7.5175 8.412 7.61124 8.31824L8.31824 7.61124C8.412 7.5175 8.53916 7.46484 8.67174 7.46484C8.80432 7.46484 8.93147 7.5175 9.02524 7.61124Z",fill:"white"},null,-1)])]))],544)),[[Eh,e.model.isHovered]])}});function Ace(t,e){const n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom}const Mce=32,Tce=32;class Cce extends Hu.BezierEdge{constructor(){super();hl(this,"isMounted");hl(this,"customLineApp");hl(this,"root");this.isMounted=!1,this.handleMouseUp=n=>{this.props.graphModel.clearSelectElements(),this.props.model.isSelected=!0;const o=n.target.parentNode.parentNode.querySelector(".lf-custom-edge-wrapper");Ace(o,n)&&this.props.model.graphModel.deleteEdgeById(this.props.model.id)}}renderVueComponent(n){var r;this.unmountVueComponent(),this.root=n;const{graphModel:o}=this.props;n&&(d1()?t8(this.targetId(),BR,n,this.props.model,o,(i,a)=>({model:i,graph:a})):(this.customLineApp=Lj({render:()=>Dg(BR,{model:this.props.model})}),(r=this.customLineApp)==null||r.mount(n)))}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}componentWillUnmount(){super.componentWillUnmount&&super.componentWillUnmount(),d1()&&n8(this.targetId()),this.unmountVueComponent()}unmountVueComponent(){return this.customLineApp&&(this.customLineApp.unmount(),this.customLineApp=null),this.root&&(this.root.innerHTML=""),this.root}getEdge(){const{model:n}=this.props,o=n.id,{customWidth:r=Mce,customHeight:i=Tce}=n.getProperties(),{startPoint:a,endPoint:s,path:l,isAnimation:f,arrowConfig:h}=n,v=n.getEdgeAnimationStyle(),{strokeDasharray:b,stroke:E,strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:$}=v,D={x:(a.x+s.x-r)/2,y:(a.y+s.y-i)/2,width:r,height:i},P=n.getEdgeStyle(),B={width:r,height:i};return setTimeout(()=>{const F=document.getElementById(o);F&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(F))},0),delete P.stroke,Hu.h("g",{},[Hu.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),Hu.h("path",{d:l,...P,...h,...f?{strokeDasharray:b,stroke:E,style:{strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:$}}:{}}),Hu.h("foreignObject",{...D,y:D.y+5,x:D.x+5,style:{}},[Hu.h("div",{id:o,style:{...B},className:"lf-custom-edge-wrapper"})])])}}let Nce=class extends Hu.BezierEdgeModel{getArrowStyle(){const e=super.getArrowStyle();return e.offset=1,e.verticalLength=0,e}getEdgeStyle(){const e=super.getEdgeStyle();return e.strokeWidth=2,e.stroke="#BBBFC4",e.offset=0,e}getData(){const e=super.getData();return e&&(e.sourceAnchorId=this.sourceAnchorId,e.targetAnchorId=this.targetAnchorId),e}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y};this.updateStartPoint(i);const a={x:r.x,y:r.y};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}};const Y8={type:"app-edge",view:Cce,model:Nce};class kce{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(e){return this.init(e),this.execute(!0)}init(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[],this.comboEdges=e.comboEdges||[],this.hiddenNodes=e.hiddenNodes||[],this.hiddenEdges=e.hiddenEdges||[],this.hiddenCombos=e.hiddenCombos||[],this.vedges=e.vedges||[]}execute(e){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(e){e&&Object.assign(this,e)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}}const Pce=t=>typeof t=="string",$R=Array.isArray,g1=t=>typeof t=="number",q8=t=>t!==null&&typeof t=="object",y1=t=>{if(t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){const e=[];return t.forEach(n=>{e.push(n)}),e.map(n=>y1(n))}if(typeof t=="object"&&Object.keys(t).length){const e=Object.assign({},t);return Object.keys(e).forEach(n=>{e[n]=y1(e[n])}),e}return t},cg=(t,e)=>{const n=t[e];return q8(n)?n.cell:n},UR=(t,e,n)=>{let o;return n?o=n:g1(t)?o=()=>t:o=()=>e,o},Rce=(t,e)=>{if(t!=="next"&&t!=="prev")return e},VR=t=>{t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};let Dce=class{constructor(){const e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){const e=this.shortcut,n=e.prev;if(n&&n!==e)return VR(n),n}enqueue(e){const n=this.shortcut;e.prev&&e.next&&VR(e),e.next=n.next,n.next.prev=e,n.next=e,e.prev=n}toString(){const e=[],n=this.shortcut;let o=n.prev;for(;o!==n;)e.push(JSON.stringify(o,Rce)),o=o==null?void 0:o.prev;return`[${e.join(", ")}]`}};var Mg;(function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""})(Mg||(Mg={}));function WR(t,e){var n=t.get(e)||0;t.set(e,n+1)}function GR(t,e){var n=t.get(e);n!==void 0&&(n=n-1,n>0?t.set(e,n):t.delete(e))}function K8(t,e,n,o){var r=String(e),i=String(n);if(!t&&r>i){var a=r;r=i,i=a}return r+Mg.EDGE_KEY_DELIM+i+Mg.EDGE_KEY_DELIM+(o===void 0?Mg.DEFAULT_EDGE_NAME:o)}function zR(t,e,n,o){var r=String(e),i=String(n),a={v:e,w:n};if(!t&&r>i){var s=a.v;a.v=a.w,a.w=s}return o!==void 0&&(a.name=o),a}function kS(t,e){return K8(t,e.v,e.w,e.name)}function HR(t){return typeof t=="function"}var jce=function(e){return e.nodes().map(function(n){var o=e.node(n),r=e.parent(n),i={id:n,value:o,parent:r};return i.value===void 0&&delete i.value,i.parent===void 0&&delete i.parent,i})},Lce=function(e){return e.edges().map(function(n){var o=e.edge(n),r={v:n.v,w:n.w,value:o,name:n.name};return r.name===void 0&&delete r.name,r.value===void 0&&delete r.value,r})},Ice=function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:jce(e),edges:Lce(e),value:e.graph()};return n.value===void 0&&delete n.value,n},Fce=function(e){var n=new sb(e.options);return e.value!==void 0&&n.setGraph(e.value),e.nodes.forEach(function(o){n.setNode(o.id,o.value),o.parent&&n.setParent(o.id,o.parent)}),e.edges.forEach(function(o){n.setEdge(o.v,o.w,o.value,o.name)}),n};function XR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function YR(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XR(Object(n),!0).forEach(function(o){Bce(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XR(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Bce(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ce(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Vce(t,e,n){return e&&Uce(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Wce={compound:!1,multigraph:!1,directed:!0},sb=(function(){function t(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$ce(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=Mg.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(r){return e.label=r,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(r){return HR(r)?e.defaultNodeLabelFn=r:e.defaultNodeLabelFn=function(){return r},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(r){return e.nodesLabelMap.get(r)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(r){var i;return!(!((i=e.inEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.sinks=function(){return e.nodes().filter(function(r){var i;return!(!((i=e.outEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.setNodes=function(r,i){return r.map(function(a){return e.setNode(a,i)}),e},this.hasNode=function(r){return e.nodesLabelMap.has(r)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(r){if(e.isCompound()){var i,a=(i=e.parentMap)===null||i===void 0?void 0:i.get(r);if(a!==e.GRAPH_NODE)return a}},this.removeFromParentsChildList=function(r){var i=e.parentMap.get(r);e.childrenMap.get(i).delete(r)},this.setParent=function(r,i){var a,s;e.checkCompound();for(var l=i===void 0?e.GRAPH_NODE:i,f=e.parent(l);f;){if(r===f)throw new Error("Setting "+i+" as parent of "+r+" would create a cycle");f=e.parent(f)}i&&e.setNode(i),e.setNode(r),e.removeFromParentsChildList(r),(a=e.parentMap)===null||a===void 0||a.set(r,l);var h=e.childrenMap.get(l);return h.set(r,!0),(s=e.childrenMap)===null||s===void 0||s.set(l,h),e},this.children=function(r){var i=r===void 0?e.GRAPH_NODE:r;if(e.isCompound()){var a,s=(a=e.childrenMap)===null||a===void 0?void 0:a.get(i);return s?Array.from(s.keys()):void 0}if(i===e.GRAPH_NODE)return e.nodes();if(r&&e.hasNode(r))return[]},this.predecessors=function(r){var i=e.predecessorsMap.get(r);return i?Array.from(i.keys()):void 0},this.successors=function(r){var i=e.successorsMap.get(r);return i?Array.from(i.keys()):void 0},this.neighbors=function(r){var i;if(e.hasNode(r))return Array.from(new Set((i=e.predecessors(r))===null||i===void 0?void 0:i.concat(e.successors(r))))},this.isLeaf=function(r){var i;if(e.isDirected()){var a;return!(!((a=e.successors(r))===null||a===void 0)&&a.length)}return!(!((i=e.neighbors(r))===null||i===void 0)&&i.length)},this.filterNodes=function(r){var i=e.directed,a=e.multigraph,s=e.compound,l=new t({directed:i,multigraph:a,compound:s});if(l.setGraph(e.graph()),e.nodes().forEach(function(h){r(h)&&l.setNode(h,e.node(h))}),e.edges().forEach(function(h){l.hasNode(h.v)&&l.hasNode(h.w)&&l.setEdgeObj(h,e.edge(h))}),s){var f=function(v){for(var b=e.parent(v);b!==void 0&&!l.hasNode(b);)b=e.parent(b);return b};l.nodes().forEach(function(h){l.setParent(h,f(h))})}return l},this.setDefaultEdgeLabel=function(r){return HR(r)?e.defaultEdgeLabelFn=r:e.defaultEdgeLabelFn=function(){return r},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(r,i){return e.setEdge(r.v,r.w,i,r.name)},this.setPath=function(r,i){return r.reduce(function(a,s){return e.setEdge(a,s,i),s}),e},this.edgeFromArgs=function(r,i,a){return e.edge({v:r,w:i,name:a})},this.edge=function(r){return e.edgesLabelsMap.get(kS(e.isDirected(),r))},this.hasEdge=function(r,i,a){return e.edgesLabelsMap.has(kS(e.isDirected(),{v:r,w:i,name:a}))},this.removeEdgeObj=function(r){var i=r.v,a=r.w,s=r.name;return e.removeEdge(i,a,s)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(r,i){var a=e.inEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.v===i})},this.outEdges=function(r,i){var a=e.outEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.w===i})},this.nodeEdges=function(r,i){var a;if(e.hasNode(r))return(a=e.inEdges(r,i))===null||a===void 0?void 0:a.concat(e.outEdges(r,i))},this.toJSON=function(){return Ice(e)},this.nodeInDegree=function(r){var i=e.inEdgesMap.get(r);return i?i.size:0},this.nodeOutDegree=function(r){var i=e.outEdgesMap.get(r);return i?i.size:0},this.nodeDegree=function(r){return e.nodeInDegree(r)+e.nodeOutDegree(r)},this.source=function(r){return r.v},this.target=function(r){return r.w};var o=YR(YR({},Wce),n);this.compound=o.compound,this.directed=o.directed,this.multigraph=o.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return Vce(t,[{key:"setNode",value:function(n,o){var r=this.nodesLabelMap,i=this.defaultNodeLabelFn,a=this.isCompound,s=this.parentMap,l=this.childrenMap,f=this.inEdgesMap,h=this.outEdgesMap,v=this.predecessorsMap,b=this.successorsMap;if(r.has(n))return o!==void 0&&r.set(n,o),this;if(r.set(n,o||i(n)),a()){var E;s==null||s.set(n,this.GRAPH_NODE),l==null||l.set(n,new Map),l!=null&&l.has(this.GRAPH_NODE)||l==null||l.set(this.GRAPH_NODE,new Map),l==null||(E=l.get(this.GRAPH_NODE))===null||E===void 0||E.set(n,!0)}return[f,h,v,b].forEach(function(O){return O.set(n,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(n){var o=this;if(this.hasNode(n)){var r=function(S){o.removeEdge(S.v,S.w,S.name)},i=this.inEdgesMap,a=this.outEdgesMap,s=this.predecessorsMap,l=this.successorsMap,f=this.nodesLabelMap;if(this.isCompound()){var h,v,b;this.removeFromParentsChildList(n),(h=this.parentMap)===null||h===void 0||h.delete(n),(v=this.children(n))===null||v===void 0||v.forEach(function(w){return o.setParent(w)}),(b=this.childrenMap)===null||b===void 0||b.delete(n)}var E=i.get(n),O=a.get(n);Array.from(E.values()).forEach(function(w){return r(w)}),Array.from(O.values()).forEach(function(w){return r(w)}),f.delete(n),i.delete(n),a.delete(n),s.delete(n),l.delete(n),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(n,o,r,i){var a,s,l=zR(this.isDirected(),n,o,i),f=kS(this.isDirected(),l),h=l.v,v=l.w;if(this.edgesLabelsMap.has(f))return this.edgesLabelsMap.set(f,r),this;if(i!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(v),this.edgesLabelsMap.set(f,r||this.defaultEdgeLabelFn(h,v,i)),Object.freeze(l),this.edgesMap.set(f,l);var b=this.predecessorsMap.get(v),E=this.successorsMap.get(h);return WR(b,h),WR(E,v),(a=this.inEdgesMap.get(v))===null||a===void 0||a.set(f,l),(s=this.outEdgesMap.get(h))===null||s===void 0||s.set(f,l),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,o,r){var i=K8(this.isDirected(),n,o,r),a=this.edgesMap.get(i);if(a){var s=zR(this.isDirected(),n,o,r),l=s.v,f=s.w;this.edgesLabelsMap.delete(i),this.edgesMap.delete(i);var h=this.predecessorsMap.get(f),v=this.successorsMap.get(l);GR(h,l),GR(v,f),this.inEdgesMap.get(f).delete(i),this.outEdgesMap.get(l).delete(i),this.edgeCountNum-=1}return this}}]),t})();sb.fromJSON=Fce;var Gce=function t(e,n,o,r,i,a){r.includes(n)||(r.push(n),o||a.push(n),i(n).forEach(function(s){return t(e,s,o,r,i,a)}),o&&a.push(n))},$M=function(e,n,o){var r=Array.isArray(n)?n:[n],i=function(f){return e.isDirected()?e.successors(f):e.neighbors(f)},a=[],s=[];return r.forEach(function(l){if(e.hasNode(l))Gce(e,l,o==="post",s,i,a);else throw new Error("Graph does not have node: "+l)}),a},zce=function(e,n){return $M(e,n,"post")},Hce=function(e,n){return $M(e,n,"pre")};const Xce=Object.freeze(Object.defineProperty({__proto__:null,dfs:$M,postorder:zce,preorder:Hce},Symbol.toStringTag,{value:"Module"}));class Yce extends Dce{}class qce extends sb{}const Kce=()=>1,Zce=(t,e)=>{var n;if(t.nodeCount()<=1)return[];const o=Qce(t,e||Kce);return(n=Jce(o.graph,o.buckets,o.zeroIdx).map(i=>t.outEdges(i.v,i.w)))===null||n===void 0?void 0:n.flat()},Jce=(t,e,n)=>{let o=[];const r=e[e.length-1],i=e[0];let a;for(;t.nodeCount();){for(;a=i.dequeue();)PS(t,e,n,a);for(;a=r.dequeue();)PS(t,e,n,a);if(t.nodeCount()){for(let s=e.length-2;s>0;--s)if(a=e[s].dequeue(),a){o=o.concat(PS(t,e,n,a,!0));break}}}return o},PS=(t,e,n,o,r)=>{var i,a;const s=[];return(i=t.inEdges(o.v))===null||i===void 0||i.forEach(l=>{const f=t.edge(l),h=t.node(l.v);r&&s.push({v:l.v,w:l.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=f,b2(e,n,h)}),(a=t.outEdges(o.v))===null||a===void 0||a.forEach(l=>{const f=t.edge(l),h=l.w,v=t.node(h);v.in===void 0&&(v.in=0),v.in-=f,b2(e,n,v)}),t.removeNode(o.v),r?s:void 0},Qce=(t,e)=>{const n=new qce;let o=0,r=0;t.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),t.edges().forEach(l=>{const f=n.edge(l)||0,h=(e==null?void 0:e(l))||1,v=f+h;n.setEdge(l.v,l.w,v),r=Math.max(r,n.node(l.v).out+=h),o=Math.max(o,n.node(l.w).in+=h)});const i=[],a=r+o+3;for(let l=0;l<a;l++)i.push(new Yce);const s=o+1;return n.nodes().forEach(l=>{b2(i,s,n.node(l))}),{buckets:i,zeroIdx:s,graph:n}},b2=(t,e,n)=>{n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)},ede=t=>{const e=o=>r=>{var i;return((i=o.edge(r))===null||i===void 0?void 0:i.weight)||1},n=t.graph().acyclicer==="greedy"?Zce(t,e(t)):tde(t);n==null||n.forEach(o=>{const r=t.edge(o);t.removeEdgeObj(o),r.forwardName=o.name,r.reversed=!0,t.setEdge(o.w,o.v,r,`rev-${Math.random()}`)})},tde=t=>{const e=[],n={},o={},r=i=>{var a;o[i]||(o[i]=!0,n[i]=!0,(a=t.outEdges(i))===null||a===void 0||a.forEach(s=>{n[s.w]?e.push(s):r(s.w)}),delete n[i])};return t.nodes().forEach(r),e},nde=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);const o=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,o)}})},qR={run:ede,undo:nde};class cp extends sb{}const rde=(t,e)=>Number(t)-Number(e),uy=(t,e,n,o)=>{let r;do r=`${o}${Math.random()}`;while(t.hasNode(r));return n.dummy=e,t.setNode(r,n),r},ode=t=>{const e=new cp().setGraph(t.graph());return t.nodes().forEach(n=>{e.setNode(n,t.node(n))}),t.edges().forEach(n=>{const o=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),e},Z8=t=>{const e=new cp({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{var o;!((o=t.children(n))===null||o===void 0)&&o.length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdgeObj(n,t.edge(n))}),e},ide=(t,e)=>t==null?void 0:t.reduce((n,o,r)=>(n[o]=e[r],n),{}),KR=(t,e)=>{const n=Number(t.x),o=Number(t.y),r=Number(e.x)-n,i=Number(e.y)-o;let a=Number(t.width)/2,s=Number(t.height)/2;if(!r&&!i)return{x:0,y:0};let l,f;return Math.abs(i)*a>Math.abs(r)*s?(i<0&&(s=-s),l=s*r/i,f=s):(r<0&&(a=-a),l=a,f=a*i/r),{x:n+l,y:o+f}},U_=t=>{const e=[],n=J8(t)+1;for(let o=0;o<n;o++)e.push([]);t.nodes().forEach(o=>{const r=t.node(o);if(!r)return;const i=r.rank;i!==void 0&&e[i]&&e[i].push(o)});for(let o=0;o<n;o++)e[o]=e[o].sort((r,i)=>{var a,s;return rde((a=t.node(r))===null||a===void 0?void 0:a.order,(s=t.node(i))===null||s===void 0?void 0:s.order)});return e},ade=t=>{const e=t.nodes().filter(o=>{var r;return((r=t.node(o))===null||r===void 0?void 0:r.rank)!==void 0}).map(o=>t.node(o).rank),n=Math.min(...e);t.nodes().forEach(o=>{const r=t.node(o);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)})},lde=t=>{const e=t.nodes(),n=e.filter(s=>{var l;return((l=t.node(s))===null||l===void 0?void 0:l.rank)!==void 0}).map(s=>t.node(s).rank),o=Math.min(...n),r=[];e.forEach(s=>{var l;const f=(((l=t.node(s))===null||l===void 0?void 0:l.rank)||0)-o;r[f]||(r[f]=[]),r[f].push(s)});let i=0;const a=t.graph().nodeRankFactor||0;for(let s=0;s<r.length;s++){const l=r[s];l===void 0?s%a!==0&&(i-=1):i&&(l==null||l.forEach(f=>{const h=t.node(f);h&&(h.rank=h.rank||0,h.rank+=i)}))}},ZR=(t,e,n,o)=>{const r={width:0,height:0};return g1(n)&&g1(o)&&(r.rank=n,r.order=o),uy(t,"border",r,e)},J8=t=>{let e;return t.nodes().forEach(n=>{var o;const r=(o=t.node(n))===null||o===void 0?void 0:o.rank;r!==void 0&&(e===void 0||r>e)&&(e=r)}),e||(e=0),e},sde=(t,e)=>{const n={lhs:[],rhs:[]};return t==null||t.forEach(o=>{e(o)?n.lhs.push(o):n.rhs.push(o)}),n},Q8=(t,e)=>{const n=Date.now();try{return e()}finally{console.log(`${t} time: ${Date.now()-n}ms`)}},e4=(t,e)=>e(),UM=(t,e)=>t.reduce((n,o)=>{const r=e(n),i=e(o);return r>i?o:n}),ude=t=>{t.graph().dummyChains=[],t.edges().forEach(e=>cde(t,e))},cde=(t,e)=>{let n=e.v,o=t.node(n).rank;const r=e.w,i=t.node(r).rank,a=e.name,s=t.edge(e),l=s.labelRank;if(i===o+1)return;t.removeEdgeObj(e);const f=t.graph();let h,v,b;for(b=0,++o;o<i;++b,++o)s.points=[],v={edgeLabel:s,width:0,height:0,edgeObj:e,rank:o},h=uy(t,"edge",v,"_d"),o===l&&(v.width=s.width,v.height=s.height,v.dummy="edge-label",v.labelpos=s.labelpos),t.setEdge(n,h,{weight:s.weight},a),b===0&&(f.dummyChains||(f.dummyChains=[]),f.dummyChains.push(h)),n=h;t.setEdge(n,r,{weight:s.weight},a)},dde=t=>{var e;(e=t.graph().dummyChains)===null||e===void 0||e.forEach(n=>{let o=t.node(n);const r=o.edgeLabel;let i;o.edgeObj&&t.setEdgeObj(o.edgeObj,r);let a=n;for(;o.dummy;)i=t.successors(a)[0],t.removeNode(a),r.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(r.x=o.x,r.y=o.y,r.width=o.width,r.height=o.height),a=i,o=t.node(a)})},JR={run:ude,undo:dde},t4=t=>{var e;const n={},o=r=>{var i;const a=t.node(r);if(!a)return 0;if(n[r])return a.rank;n[r]=!0;let s;return(i=t.outEdges(r))===null||i===void 0||i.forEach(l=>{const f=o(l.w),h=t.edge(l).minlen,v=f-h;v&&(s===void 0||v<s)&&(s=v)}),s||(s=0),a.rank=s,s};(e=t.sources())===null||e===void 0||e.forEach(r=>o(r))},fde=t=>{var e;const n={};let o;const r=s=>{var l;const f=t.node(s);if(!f)return 0;if(n[s])return f.rank;n[s]=!0;let h;return(l=t.outEdges(s))===null||l===void 0||l.forEach(v=>{const b=r(v.w),E=t.edge(v).minlen,O=b-E;O&&(h===void 0||O<h)&&(h=O)}),h||(h=0),(o===void 0||h<o)&&(o=h),f.rank=h,h};(e=t.sources())===null||e===void 0||e.forEach(s=>{t.node(s)&&r(s)}),o===void 0&&(o=0);const i={},a=(s,l)=>{var f;const h=t.node(s),v=isNaN(h.layer)?l:h.layer;(h.rank===void 0||h.rank<v)&&(h.rank=v),!i[s]&&(i[s]=!0,(f=t.outEdges(s))===null||f===void 0||f.map(b=>{a(b.w,v+t.edge(b).minlen)}))};t.nodes().forEach(s=>{const l=t.node(s);l&&(isNaN(l.layer)?l.rank-=o:a(s,l.layer))})},Ch=(t,e)=>t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen,pde=t=>{const e=new cp({directed:!1}),n=t.nodes()[0],o=t.nodeCount();e.setNode(n,{});let r,i;for(;hde(e,t)<o;)r=n4(e,t),i=e.hasNode(r.v)?Ch(t,r):-Ch(t,r),r4(e,t,i);return e},hde=(t,e)=>{const n=o=>{e.nodeEdges(o).forEach(r=>{const i=r.v,a=o===i?r.w:i;!t.hasNode(a)&&!Ch(e,r)&&(t.setNode(a,{}),t.setEdge(o,a,{}),n(a))})};return t.nodes().forEach(n),t.nodeCount()},vde=t=>{const e=new cp({directed:!1}),n=t.nodes()[0],o=t.nodes().filter(a=>!!t.node(a)).length;e.setNode(n,{});let r,i;for(;mde(e,t)<o;)r=n4(e,t),i=e.hasNode(r.v)?Ch(t,r):-Ch(t,r),r4(e,t,i);return e},mde=(t,e)=>{const n=o=>{var r;(r=e.nodeEdges(o))===null||r===void 0||r.forEach(i=>{const a=i.v,s=o===a?i.w:a;!t.hasNode(s)&&(e.node(s).layer!==void 0||!Ch(e,i))&&(t.setNode(s,{}),t.setEdge(o,s,{}),n(s))})};return t.nodes().forEach(n),t.nodeCount()},n4=(t,e)=>UM(e.edges(),n=>t.hasNode(n.v)!==t.hasNode(n.w)?Ch(e,n):1/0),r4=(t,e,n)=>{t.nodes().forEach(o=>{e.node(o).rank||(e.node(o).rank=0),e.node(o).rank+=n})},{preorder:gde,postorder:yde}=Xce,_de=t=>{const e=ode(t);t4(e);const n=pde(e);i4(n),o4(n,e);let o,r;for(;o=Ede(n);)r=xde(n,e,o),Ode(n,e,o,r)},o4=(t,e)=>{let n=yde(t,t.nodes());n=n==null?void 0:n.slice(0,(n==null?void 0:n.length)-1),n==null||n.forEach(o=>{bde(t,e,o)})},bde=(t,e,n)=>{const r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=wde(t,e,n)},wde=(t,e,n)=>{var o;const i=t.node(n).parent;let a=!0,s=e.edgeFromArgs(n,i),l=0;return s||(a=!1,s=e.edgeFromArgs(i,n)),l=s.weight,(o=e.nodeEdges(n))===null||o===void 0||o.forEach(f=>{const h=f.v===n,v=h?f.w:f.v;if(v!==i){const b=h===a,E=e.edge(f).weight;if(l+=b?E:-E,Ade(t,n,v)){const O=t.edgeFromArgs(n,v).cutvalue;l+=b?-O:O}}}),l},i4=(t,e=t.nodes()[0])=>{a4(t,{},1,e)},a4=(t,e,n,o,r)=>{var i;const a=n;let s=n;const l=t.node(o);return e[o]=!0,(i=t.neighbors(o))===null||i===void 0||i.forEach(f=>{e[f]||(s=a4(t,e,s,f,o))}),l.low=a,l.lim=s++,r?l.parent=r:delete l.parent,s},Ede=t=>t.edges().find(e=>t.edge(e).cutvalue<0),xde=(t,e,n)=>{let o=n.v,r=n.w;e.hasEdge(o,r)||(o=n.w,r=n.v);const i=t.node(o),a=t.node(r);let s=i,l=!1;i.lim>a.lim&&(s=a,l=!0);const f=e.edges().filter(h=>l===QR(t,t.node(h.v),s)&&l!==QR(t,t.node(h.w),s));return UM(f,h=>Ch(e,h))},Ode=(t,e,n,o)=>{const r=n.v,i=n.w;t.removeEdge(r,i),t.setEdge(o.v,o.w,{}),i4(t),o4(t,e),Sde(t,e)},Sde=(t,e)=>{const n=t.nodes().find(r=>{var i;return!(!((i=e.node(r))===null||i===void 0)&&i.parent)});let o=gde(t,n);o=o==null?void 0:o.slice(1),o==null||o.forEach(r=>{const i=t.node(r).parent;let a=e.edgeFromArgs(r,i),s=!1;a||(a=e.edgeFromArgs(i,r),s=!0),e.node(r).rank=e.node(i).rank+(s?a.minlen:-a.minlen)})},Ade=(t,e,n)=>t.hasEdge(e,n),QR=(t,e,n)=>n.low<=e.lim&&e.lim<=n.lim,Mde=t=>{switch(t.graph().ranker){case"network-simplex":Cde(t);break;case"tight-tree":eD(t);break;case"longest-path":Tde(t);break;default:eD(t)}},Tde=t4,eD=t=>{fde(t),vde(t)},Cde=t=>{_de(t)},Nde=t=>{var e;const n={};let o=0;const r=i=>{var a;const s=o;(a=t.children(i))===null||a===void 0||a.forEach(r),n[i]={low:s,lim:o++}};return(e=t.children())===null||e===void 0||e.forEach(r),n},kde=(t,e,n,o)=>{const r=[],i=[],a=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim);let l,f;l=n;do l=t.parent(l),r.push(l);while(l&&(e[l].low>a||s>e[l].lim));for(f=l,l=o;l&&l!==f;)i.push(l),l=t.parent(l);return{lca:f,path:r.concat(i.reverse())}},Pde=t=>{var e;const n=Nde(t);(e=t.graph().dummyChains)===null||e===void 0||e.forEach(o=>{var r,i;let a=o,s=t.node(a);const l=s.edgeObj;if(!l)return;const f=kde(t,n,l.v,l.w),h=f.path,v=f.lca;let b=0,E=h[b],O=!0;for(;a!==l.w;){if(s=t.node(a),O){for(;E!==v&&((r=t.node(E))===null||r===void 0?void 0:r.maxRank)<s.rank;)b++,E=h[b];E===v&&(O=!1)}if(!O){for(;b<h.length-1&&((i=t.node(h[b+1]))===null||i===void 0?void 0:i.minRank)<=s.rank;)b++;E=h[b]}t.setParent(a,E),a=t.successors(a)[0]}})},Rde=t=>{var e;const n=uy(t,"root",{},"_root"),o=Dde(t);let r=Math.max(...Object.values(o));Math.abs(r)===1/0&&(r=1);const i=r-1,a=2*i+1;t.graph().nestingRoot=n,t.edges().forEach(l=>{t.edge(l).minlen*=a});const s=jde(t)+1;(e=t.children())===null||e===void 0||e.forEach(l=>{l4(t,n,a,s,i,o,l)}),t.graph().nodeRankFactor=a},l4=(t,e,n,o,r,i,a)=>{const s=t.children(a);if(!(s!=null&&s.length)){a!==e&&t.setEdge(e,a,{weight:0,minlen:n});return}const l=ZR(t,"_bt"),f=ZR(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(f,a),h.borderBottom=f,s==null||s.forEach(v=>{l4(t,e,n,o,r,i,v);const b=t.node(v),E=b.borderTop?b.borderTop:v,O=b.borderBottom?b.borderBottom:v,w=b.borderTop?o:2*o,S=E!==O?1:r-i[a]+1;t.setEdge(l,E,{minlen:S,weight:w,nestingEdge:!0}),t.setEdge(O,f,{minlen:S,weight:w,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:r+i[a]})},Dde=t=>{var e;const n={},o=(r,i)=>{const a=t.children(r);a==null||a.forEach(s=>o(s,i+1)),n[r]=i};return(e=t.children())===null||e===void 0||e.forEach(r=>o(r,1)),n},jde=t=>{let e=0;return t.edges().forEach(n=>{e+=t.edge(n).weight}),e},Lde=t=>{const e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdgeObj(n)})},tD={run:Rde,cleanup:Lde},Ide=t=>{var e;const n=o=>{const r=t.children(o),i=t.node(o);if(r!=null&&r.length&&r.forEach(a=>n(a)),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,s=i.maxRank+1;a<s;a+=1)nD(t,"borderLeft","_bl",o,i,a),nD(t,"borderRight","_br",o,i,a)}};(e=t.children())===null||e===void 0||e.forEach(o=>n(o))},nD=(t,e,n,o,r,i)=>{const a={rank:i,borderType:e,width:0,height:0},s=r[e][i-1],l=uy(t,"border",a,n);r[e][i]=l,t.setParent(l,o),s&&t.setEdge(s,l,{weight:1})},Fde=t=>{var e;const n=(e=t.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&s4(t)},Bde=t=>{var e;const n=(e=t.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&$de(t),(n==="lr"||n==="rl")&&(Ude(t),s4(t))},s4=t=>{t.nodes().forEach(e=>{rD(t.node(e))}),t.edges().forEach(e=>{rD(t.edge(e))})},rD=t=>{const e=t.width;t.width=t.height,t.height=e},$de=t=>{t.nodes().forEach(e=>{RS(t.node(e))}),t.edges().forEach(e=>{var n;const o=t.edge(e);(n=o.points)===null||n===void 0||n.forEach(r=>RS(r)),o.hasOwnProperty("y")&&RS(o)})},RS=t=>{t!=null&&t.y&&(t.y=-t.y)},Ude=t=>{t.nodes().forEach(e=>{DS(t.node(e))}),t.edges().forEach(e=>{var n;const o=t.edge(e);(n=o.points)===null||n===void 0||n.forEach(r=>DS(r)),o.hasOwnProperty("x")&&DS(o)})},DS=t=>{const e=t.x;t.x=t.y,t.y=e},oD={adjust:Fde,undo:Bde};function Vde(t){return Array.isArray(t)}function w2(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],o=1;o<e;o++)n=Math.max(n,t[o]);return n}const iD=(function(t){if(Vde(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])}),aD=t=>{const e={},n=t.nodes().filter(h=>{var v;return!(!((v=t.children(h))===null||v===void 0)&&v.length)}),o=n.map(h=>t.node(h).rank),r=w2(o),i=[];for(let h=0;h<r+1;h++)i.push([]);const a=h=>{var v;if(e.hasOwnProperty(h))return;e[h]=!0;const b=t.node(h);isNaN(b.rank)||i[b.rank].push(h),(v=t.successors(h))===null||v===void 0||v.forEach(E=>a(E))},s=n.sort((h,v)=>t.node(h).rank-t.node(v).rank),f=s.filter(h=>t.node(h).fixorder!==void 0).sort((h,v)=>t.node(h).fixorder-t.node(v).fixorder);return f==null||f.forEach(h=>{isNaN(t.node(h).rank)||i[t.node(h).rank].push(h),e[h]=!0}),s==null||s.forEach(a),i},Wde=(t,e,n)=>{const o=ide(n,n.map((h,v)=>v)),i=e.map(h=>{var v;const b=(v=t.outEdges(h))===null||v===void 0?void 0:v.map(E=>({pos:o[E.w]||0,weight:t.edge(E).weight}));return b==null?void 0:b.sort((E,O)=>E.pos-O.pos)}).flat().filter(h=>h!==void 0);let a=1;for(;a<n.length;)a<<=1;const s=2*a-1;a-=1;const l=Array(s).fill(0,0,s);let f=0;return i==null||i.forEach(h=>{if(h){let v=h.pos+a;l[v]+=h.weight;let b=0;for(;v>0;)v%2&&(b+=l[v+1]),v=v-1>>1,l[v]+=h.weight;f+=h.weight*b}}),f},lD=(t,e)=>{let n=0;for(let o=1;o<(e==null?void 0:e.length);o+=1)n+=Wde(t,e[o-1],e[o]);return n},Gde=(t,e,n)=>{const o=zde(t),r=new cp({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return t.nodes().forEach(i=>{var a;const s=t.node(i),l=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(r.setNode(i),r.setParent(i,l||o),(a=t[n](i))===null||a===void 0||a.forEach(f=>{const h=f.v===i?f.w:f.v,v=r.edgeFromArgs(h,i),b=v!==void 0?v.weight:0;r.setEdge(h,i,{weight:t.edge(f).weight+b})}),s.hasOwnProperty("minRank")&&r.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),r},zde=t=>{let e;for(;t.hasNode(e=`_root${Math.random()}`););return e},Hde=(t,e,n)=>{const o={};let r;n==null||n.forEach(i=>{let a=t.parent(i),s,l;for(;a;){if(s=t.parent(a),s?(l=o[s],o[s]=a):(l=r,r=a),l&&l!==a){e.setEdge(l,a);return}a=s}})},Xde=(t,e)=>e.map(n=>{const o=t.inEdges(n);if(!(o!=null&&o.length))return{v:n};{const r={sum:0,weight:0};return o==null||o.forEach(i=>{const a=t.edge(i),s=t.node(i.v);r.sum+=a.weight*s.order,r.weight+=a.weight}),{v:n,barycenter:r.sum/r.weight,weight:r.weight}}}),Yde=(t,e)=>{var n,o,r;const i={};t==null||t.forEach((s,l)=>{i[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};const f=i[s.v];s.barycenter!==void 0&&(f.barycenter=s.barycenter,f.weight=s.weight)}),(n=e.edges())===null||n===void 0||n.forEach(s=>{const l=i[s.v],f=i[s.w];l!==void 0&&f!==void 0&&(f.indegree++,l.out.push(i[s.w]))});const a=(r=(o=Object.values(i)).filter)===null||r===void 0?void 0:r.call(o,s=>!s.indegree);return qde(a)},qde=t=>{var e,n;const o=[],r=l=>f=>{f.merged||(f.barycenter===void 0||l.barycenter===void 0||f.barycenter>=l.barycenter)&&Kde(l,f)},i=l=>f=>{f.in.push(l),--f.indegree===0&&t.push(f)};for(;t!=null&&t.length;){const l=t.pop();o.push(l),(e=l.in.reverse())===null||e===void 0||e.forEach(f=>r(l)(f)),(n=l.out)===null||n===void 0||n.forEach(f=>i(l)(f))}const a=o.filter(l=>!l.merged),s=["vs","i","barycenter","weight"];return a.map(l=>{const f={};return s==null||s.forEach(h=>{l[h]!==void 0&&(f[h]=l[h])}),f})},Kde=(t,e)=>{var n;let o=0,r=0;t.weight&&(o+=t.barycenter*t.weight,r+=t.weight),e.weight&&(o+=e.barycenter*e.weight,r+=e.weight),t.vs=(n=e.vs)===null||n===void 0?void 0:n.concat(t.vs),t.barycenter=o/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0},Zde=(t,e,n,o)=>{const r=sde(t,b=>{const E=b.hasOwnProperty("fixorder")&&!isNaN(b.fixorder);return o?!E&&b.hasOwnProperty("barycenter"):E||b.hasOwnProperty("barycenter")}),i=r.lhs,a=r.rhs.sort((b,E)=>-b.i- -E.i),s=[];let l=0,f=0,h=0;i==null||i.sort(Jde(!!e,!!n)),h=sD(s,a,h),i==null||i.forEach(b=>{var E;h+=(E=b.vs)===null||E===void 0?void 0:E.length,s.push(b.vs),l+=b.barycenter*b.weight,f+=b.weight,h=sD(s,a,h)});const v={vs:s.flat()};return f&&(v.barycenter=l/f,v.weight=f),v},sD=(t,e,n)=>{let o=n,r;for(;e.length&&(r=e[e.length-1]).i<=o;)e.pop(),t==null||t.push(r.vs),o++;return o},Jde=(t,e)=>(n,o)=>{if(n.fixorder!==void 0&&o.fixorder!==void 0)return n.fixorder-o.fixorder;if(n.barycenter<o.barycenter)return-1;if(n.barycenter>o.barycenter)return 1;if(e&&n.order!==void 0&&o.order!==void 0){if(n.order<o.order)return-1;if(n.order>o.order)return 1}return t?o.i-n.i:n.i-o.i},u4=(t,e,n,o,r,i)=>{var a,s,l,f;let h=t.children(e);const v=t.node(e),b=v?v.borderLeft:void 0,E=v?v.borderRight:void 0,O={};b&&(h=h==null?void 0:h.filter(T=>T!==b&&T!==E));const w=Xde(t,h||[]);w==null||w.forEach(T=>{var $;if(!(($=t.children(T.v))===null||$===void 0)&&$.length){const D=u4(t,T.v,n,o,i);O[T.v]=D,D.hasOwnProperty("barycenter")&&efe(T,D)}});const S=Yde(w,n);Qde(S,O),(a=S.filter(T=>T.vs.length>0))===null||a===void 0||a.forEach(T=>{const $=t.node(T.vs[0]);$&&(T.fixorder=$.fixorder,T.order=$.order)});const M=Zde(S,o,r,i);if(b&&(M.vs=[b,M.vs,E].flat(),!((s=t.predecessors(b))===null||s===void 0)&&s.length)){const T=t.node(((l=t.predecessors(b))===null||l===void 0?void 0:l[0])||""),$=t.node(((f=t.predecessors(E))===null||f===void 0?void 0:f[0])||"");M.hasOwnProperty("barycenter")||(M.barycenter=0,M.weight=0),M.barycenter=(M.barycenter*M.weight+T.order+$.order)/(M.weight+2),M.weight+=2}return M},Qde=(t,e)=>{t==null||t.forEach(n=>{var o;const r=(o=n.vs)===null||o===void 0?void 0:o.map(i=>e[i]?e[i].vs:i);n.vs=r.flat()})},efe=(t,e)=>{t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)},tfe=(t,e)=>{const n=J8(t),o=[],r=[];for(let h=1;h<n+1;h++)o.push(h);for(let h=n-1;h>-1;h--)r.push(h);const i=uD(t,o,"inEdges"),a=uD(t,r,"outEdges");let s=aD(t);jS(t,s);let l=Number.POSITIVE_INFINITY,f;for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!1,e),s=U_(t);const b=lD(t,s);b<l&&(v=0,f=y1(s),l=b)}s=aD(t),jS(t,s);for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!0,e),s=U_(t);const b=lD(t,s);b<l&&(v=0,f=y1(s),l=b)}jS(t,f)},uD=(t,e,n)=>e.map(o=>Gde(t,o,n)),cD=(t,e,n,o)=>{const r=new cp;t==null||t.forEach(i=>{var a;const s=i.graph().root,l=u4(i,s,r,e,n,o);for(let f=0;f<((a=l.vs)===null||a===void 0?void 0:a.length);f++){const h=i.node(l.vs[f]);h&&(h.order=f)}Hde(i,r,l.vs)})},jS=(t,e)=>{e==null||e.forEach(n=>{n==null||n.forEach((o,r)=>{t.node(o).order=r})})};class nfe extends sb{}const rfe=(t,e)=>{const n={},o=(r,i)=>{let a=0,s=0;const l=r.length,f=i==null?void 0:i[(i==null?void 0:i.length)-1];return i==null||i.forEach((h,v)=>{var b;const E=ife(t,h),O=E?t.node(E).order:l;(E||h===f)&&((b=i.slice(s,v+1))===null||b===void 0||b.forEach(w=>{var S;(S=t.predecessors(w))===null||S===void 0||S.forEach(M=>{var T;const $=t.node(M),D=$.order;(D<a||O<D)&&!($.dummy&&(!((T=t.node(w))===null||T===void 0)&&T.dummy))&&c4(n,M,w)})}),s=v+1,a=O)}),i};return e!=null&&e.length&&e.reduce(o),n},ofe=(t,e)=>{const n={};function o(s,l,f,h,v){var b,E;let O;for(let w=l;w<f;w++)O=s[w],!((b=t.node(O))===null||b===void 0)&&b.dummy&&((E=t.predecessors(O))===null||E===void 0||E.forEach(S=>{const M=t.node(S);M.dummy&&(M.order<h||M.order>v)&&c4(n,S,O)}))}function r(s){return JSON.stringify(s.slice(1))}function i(s,l){const f=r(s);l.get(f)||(o(...s),l.set(f,!0))}const a=(s,l)=>{let f=-1,h,v=0;const b=new Map;return l==null||l.forEach((E,O)=>{var w;if(((w=t.node(E))===null||w===void 0?void 0:w.dummy)==="border"){const S=t.predecessors(E)||[];S.length&&(h=t.node(S[0]).order,i([l,v,O,f,h],b),v=O,f=h)}i([l,v,l.length,h,s.length],b)}),l};return e!=null&&e.length&&e.reduce(a),n},ife=(t,e)=>{var n,o;if(!((n=t.node(e))===null||n===void 0)&&n.dummy)return(o=t.predecessors(e))===null||o===void 0?void 0:o.find(r=>t.node(r).dummy)},c4=(t,e,n)=>{let o=e,r=n;if(o>r){const a=o;o=r,r=a}let i=t[o];i||(t[o]=i={}),i[r]=!0},afe=(t,e,n)=>{let o=e,r=n;if(o>r){const i=e;o=r,r=i}return!!t[o]},lfe=(t,e,n,o)=>{const r={},i={},a={};return e==null||e.forEach(s=>{s==null||s.forEach((l,f)=>{r[l]=l,i[l]=l,a[l]=f})}),e==null||e.forEach(s=>{let l=-1;s==null||s.forEach(f=>{let h=o(f);if(h.length){h=h.sort((b,E)=>a[b]-a[E]);const v=(h.length-1)/2;for(let b=Math.floor(v),E=Math.ceil(v);b<=E;++b){const O=h[b];i[f]===f&&l<a[O]&&!afe(n,f,O)&&(i[O]=f,i[f]=r[f]=r[O],l=a[O])}}})}),{root:r,align:i}},sfe=(t,e,n,o,r)=>{var i;const a={},s=ufe(t,e,n,r),l=r?"borderLeft":"borderRight",f=(b,E)=>{let O=s.nodes(),w=O.pop();const S={};for(;w;)S[w]?b(w):(S[w]=!0,O.push(w),O=O.concat(E(w))),w=O.pop()},h=b=>{a[b]=(s.inEdges(b)||[]).reduce((E,O)=>Math.max(E,(a[O.v]||0)+s.edge(O)),0)},v=b=>{const E=(s.outEdges(b)||[]).reduce((w,S)=>Math.min(w,(a[S.w]||0)-s.edge(S)),Number.POSITIVE_INFINITY),O=t.node(b);E!==Number.POSITIVE_INFINITY&&O.borderType!==l&&(a[b]=Math.max(a[b],E))};return f(h,s.predecessors.bind(s)),f(v,s.successors.bind(s)),(i=Object.values(o))===null||i===void 0||i.forEach(b=>{a[b]=a[n[b]]}),a},ufe=(t,e,n,o)=>{const r=new nfe,i=t.graph(),a=pfe(i.nodesep,i.edgesep,o);return e==null||e.forEach(s=>{let l;s==null||s.forEach(f=>{const h=n[f];if(r.setNode(h),l){const v=n[l],b=r.edgeFromArgs(v,h);r.setEdge(v,h,Math.max(a(t,f,l),b||0))}l=f})}),r},cfe=(t,e)=>UM(Object.values(e),n=>{var o;let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return(o=Object.keys(n))===null||o===void 0||o.forEach(a=>{const s=n[a],l=hfe(t,a)/2;r=Math.max(s+l,r),i=Math.min(s-l,i)}),r-i});function dfe(t,e){const n=Object.values(e),o=iD(n),r=w2(n);["u","d"].forEach(i=>{["l","r"].forEach(a=>{const s=i+a,l=t[s];let f;if(l===e)return;const h=Object.values(l);f=a==="l"?o-iD(h):r-w2(h),f&&(t[s]={},Object.keys(l).forEach(v=>{t[s][v]=l[v]+f}))})})}const ffe=(t,e)=>{const n={};return Object.keys(t.ul).forEach(o=>{if(e)n[o]=t[e.toLowerCase()][o];else{const r=Object.values(t).map(i=>i[o]);n[o]=(r[0]+r[1])/2}}),n},pfe=(t,e,n)=>(o,r,i)=>{const a=o.node(r),s=o.node(i);let l=0,f;if(l+=a.width/2,a.hasOwnProperty("labelpos"))switch((a.labelpos||"").toLowerCase()){case"l":f=-a.width/2;break;case"r":f=a.width/2;break}if(f&&(l+=n?f:-f),f=0,l+=(a.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":f=s.width/2;break;case"r":f=-s.width/2;break}return f&&(l+=n?f:-f),f=0,l},hfe=(t,e)=>t.node(e).width||0,vfe=t=>{const e=U_(t),n=t.graph().ranksep;let o=0;e==null||e.forEach(r=>{const i=r.map(s=>t.node(s).height),a=Math.max(...i,0);r==null||r.forEach(s=>{t.node(s).y=o+a/2}),o+=a+n})},mfe=t=>{const e=U_(t),n=Object.assign(rfe(t,e),ofe(t,e)),o={};let r=[];["u","d"].forEach(a=>{r=a==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(r=r.map(v=>Object.values(v).reverse()));const l=(a==="u"?t.predecessors:t.successors).bind(t),f=lfe(t,r,n,l),h=sfe(t,r,f.root,f.align,s==="r");s==="r"&&Object.keys(h).forEach(v=>h[v]=-h[v]),o[a+s]=h})});const i=cfe(t,o);return i&&dfe(o,i),ffe(o,t.graph().align)},gfe=t=>{var e;const n=Z8(t);vfe(n);const o=mfe(n);(e=Object.keys(o))===null||e===void 0||e.forEach(r=>{n.node(r).x=o[r]})},yfe=(t,e)=>{const o=t.nodes().filter(a=>{var s;return!(!((s=t.children(a))===null||s===void 0)&&s.length)}).map(a=>t.node(a).rank),r=Math.max(...o),i=[];for(let a=0;a<r+1;a++)i[a]=[];e==null||e.forEach(a=>{const s=t.node(a);!s||s!=null&&s.dummy||isNaN(s.rank)||(s.fixorder=i[s.rank].length,i[s.rank].push(a))})},_fe=(t,e)=>{const n=e&&e.debugTiming?Q8:e4;n("layout",()=>{e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",()=>{wfe(t,e.prevGraph)});const o=n(" buildLayoutGraph",()=>Cfe(t));e&&e.edgeLabelSpace===!1||n(" makeSpaceForEdgeLabels",()=>{Nfe(o)});try{n(" runLayout",()=>{bfe(o,n,e)})}catch(r){if(r.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
|
||
`,r);return}throw r}n(" updateInputGraph",()=>{Efe(t,o)})})},bfe=(t,e,n)=>{e(" removeSelfEdges",()=>{Bfe(t)}),e(" acyclic",()=>{qR.run(t)}),e(" nestingGraph.run",()=>{tD.run(t)}),e(" rank",()=>{Mde(Z8(t))}),e(" injectEdgeLabelProxies",()=>{kfe(t)}),e(" removeEmptyRanks",()=>{lde(t)}),e(" nestingGraph.cleanup",()=>{tD.cleanup(t)}),e(" normalizeRanks",()=>{ade(t)}),e(" assignRankMinMax",()=>{Pfe(t)}),e(" removeEdgeLabelProxies",()=>{Rfe(t)}),e(" normalize.run",()=>{JR.run(t)}),e(" parentDummyChains",()=>{Pde(t)}),e(" addBorderSegments",()=>{Ide(t)}),n&&n.keepNodeOrder&&e(" initDataOrder",()=>{yfe(t,n.nodeOrder)}),e(" order",()=>{tfe(t,n==null?void 0:n.keepNodeOrder)}),e(" insertSelfEdges",()=>{$fe(t)}),e(" adjustCoordinateSystem",()=>{oD.adjust(t)}),e(" position",()=>{gfe(t)}),e(" positionSelfEdges",()=>{Ufe(t)}),e(" removeBorderNodes",()=>{Ffe(t)}),e(" normalize.undo",()=>{JR.undo(t)}),e(" fixupEdgeLabelCoords",()=>{Lfe(t)}),e(" undoCoordinateSystem",()=>{oD.undo(t)}),e(" translateGraph",()=>{Dfe(t)}),e(" assignNodeIntersects",()=>{jfe(t)}),e(" reversePoints",()=>{Ife(t)}),e(" acyclic.undo",()=>{qR.undo(t)})},wfe=(t,e)=>{t.nodes().forEach(n=>{const o=t.node(n),r=e.node(n);r!==void 0?(o.fixorder=r._order,delete r._order):delete o.fixorder})},Efe=(t,e)=>{t.nodes().forEach(n=>{var o;const r=t.node(n);if(r){const i=e.node(n);r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,!((o=e.children(n))===null||o===void 0)&&o.length&&(r.width=i.width,r.height=i.height)}}),t.edges().forEach(n=>{const o=t.edge(n),r=e.edge(n);o.points=r?r.points:[],r&&r.hasOwnProperty("x")&&(o.x=r.x,o.y=r.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height},xfe=["nodesep","edgesep","ranksep","marginx","marginy"],Ofe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},LS=["acyclicer","ranker","rankdir","align"],Sfe=["width","height","layer","fixorder"],Afe={width:0,height:0},Mfe=["minlen","weight","width","height","labeloffset"],Tfe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},IS=["labelpos"],Cfe=t=>{const e=new cp({multigraph:!0,compound:!0}),n=BS(t.graph()),o={};return LS==null||LS.forEach(r=>{n[r]!==void 0&&(o[r]=n[r])}),e.setGraph(Object.assign({},Ofe,FS(n,xfe),o)),t.nodes().forEach(r=>{const i=BS(t.node(r)),a=Object.assign(Object.assign({},Afe),i),s=FS(a,Sfe);e.setNode(r,s),e.setParent(r,t.parent(r))}),t.edges().forEach(r=>{const i=BS(t.edge(r)),a={};IS==null||IS.forEach(s=>{i[s]!==void 0&&(a[s]=i[s])}),e.setEdgeObj(r,Object.assign({},Tfe,FS(i,Mfe),a))}),e},Nfe=t=>{const e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach(n=>{const o=t.node(n);isNaN(o.layer)||o.layer||(o.layer=0)}),t.edges().forEach(n=>{var o;const r=t.edge(n);r.minlen*=2,((o=r.labelpos)===null||o===void 0?void 0:o.toLowerCase())!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})},kfe=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n.width&&n.height){const o=t.node(e.v),r=t.node(e.w),i={e,rank:(r.rank-o.rank)/2+o.rank};uy(t,"edge-proxy",i,"_ep")}})},Pfe=t=>{let e=0;t.nodes().forEach(n=>{var o,r;const i=t.node(n);i.borderTop&&(i.minRank=(o=t.node(i.borderTop))===null||o===void 0?void 0:o.rank,i.maxRank=(r=t.node(i.borderBottom))===null||r===void 0?void 0:r.rank,e=Math.max(e,i.maxRank||-1/0))}),t.graph().maxRank=e},Rfe=t=>{t.nodes().forEach(e=>{const n=t.node(e);n.dummy==="edge-proxy"&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})},Dfe=t=>{let e,n=0,o,r=0;const i=t.graph(),a=i.marginx||0,s=i.marginy||0,l=f=>{if(!f)return;const h=f.x,v=f.y,b=f.width,E=f.height;!isNaN(h)&&!isNaN(b)&&(e===void 0&&(e=h-b/2),e=Math.min(e,h-b/2),n=Math.max(n,h+b/2)),!isNaN(v)&&!isNaN(E)&&(o===void 0&&(o=v-E/2),o=Math.min(o,v-E/2),r=Math.max(r,v+E/2))};t.nodes().forEach(f=>{l(t.node(f))}),t.edges().forEach(f=>{const h=t.edge(f);h!=null&&h.hasOwnProperty("x")&&l(h)}),e-=a,o-=s,t.nodes().forEach(f=>{const h=t.node(f);h&&(h.x-=e,h.y-=o)}),t.edges().forEach(f=>{var h;const v=t.edge(f);(h=v.points)===null||h===void 0||h.forEach(b=>{b.x-=e,b.y-=o}),v.hasOwnProperty("x")&&(v.x-=e),v.hasOwnProperty("y")&&(v.y-=o)}),i.width=n-e+a,i.height=r-o+s},jfe=t=>{t.edges().forEach(e=>{const n=t.edge(e),o=t.node(e.v),r=t.node(e.w);let i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=r,a=o),n.points.unshift(KR(o,i)),n.points.push(KR(r,a))})},Lfe=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n!=null&&n.hasOwnProperty("x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})},Ife=t=>{t.edges().forEach(e=>{var n;const o=t.edge(e);o.reversed&&((n=o.points)===null||n===void 0||n.reverse())})},Ffe=t=>{t.nodes().forEach(e=>{var n,o,r;if(!((n=t.children(e))===null||n===void 0)&&n.length){const i=t.node(e),a=t.node(i.borderTop),s=t.node(i.borderBottom),l=t.node(i.borderLeft[((o=i.borderLeft)===null||o===void 0?void 0:o.length)-1]),f=t.node(i.borderRight[((r=i.borderRight)===null||r===void 0?void 0:r.length)-1]);i.width=Math.abs((f==null?void 0:f.x)-(l==null?void 0:l.x))||10,i.height=Math.abs((s==null?void 0:s.y)-(a==null?void 0:a.y))||10,i.x=((l==null?void 0:l.x)||0)+i.width/2,i.y=((a==null?void 0:a.y)||0)+i.height/2}}),t.nodes().forEach(e=>{var n;((n=t.node(e))===null||n===void 0?void 0:n.dummy)==="border"&&t.removeNode(e)})},Bfe=t=>{t.edges().forEach(e=>{if(e.v===e.w){const n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdgeObj(e)}})},$fe=t=>{const e=U_(t);e==null||e.forEach(n=>{let o=0;n==null||n.forEach((r,i)=>{var a;const s=t.node(r);s.order=i+o,(a=s.selfEdges)===null||a===void 0||a.forEach(l=>{uy(t,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:i+ ++o,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Ufe=t=>{t.nodes().forEach(e=>{const n=t.node(e);if(n.dummy==="selfedge"){const o=t.node(n.e.v),r=o.x+o.width/2,i=o.y,a=n.x-r,s=o.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*a/3,y:i-s},{x:r+5*a/6,y:i-s},{y:i,x:r+a},{x:r+5*a/6,y:i+s},{x:r+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})},FS=(t,e)=>{const n={};return e==null||e.forEach(o=>{t[o]!==void 0&&(n[o]=+t[o])}),n},BS=(t={})=>{const e={};return Object.keys(t).forEach(n=>{e[n.toLowerCase()]=t[n]}),e},Vfe={layout:_fe,util:{time:Q8,notime:e4}};class Wfe extends kce{constructor(e){super(),this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.radial=!1,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=n=>{const o=this,{nodes:r}=o,i=r.find(a=>a.id===n);return i?i.layout!==!1:!0},this.updateCfg(e)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}}execute(){var e,n,o,r;const i=this,{nodes:a,nodeSize:s,rankdir:l,combos:f,begin:h,radial:v,comboEdges:b=[],vedges:E=[]}=i;if(!a)return;const O=i.edges||[],w=new cp({multigraph:!0,compound:!0});i.nodeMap={};const S={};a.forEach(Y=>{i.nodeMap[Y.id]=Y,Y.comboId&&(S[Y.comboId]=S[Y.comboId]||[],S[Y.comboId].push(Y.id))});let M=[];const T={};!((e=i.nodeOrder)===null||e===void 0)&&e.length?(i.nodeOrder.forEach(Y=>{T[Y]=!0,M.push(i.nodeMap[Y])}),a.forEach(Y=>{T[Y.id]||M.push(Y)})):M=a;let $;s?$R(s)?$=()=>s:$=()=>[s,s]:$=Y=>Y.size?$R(Y.size)?Y.size:q8(Y.size)?[Y.size.width||40,Y.size.height||40]:[Y.size,Y.size]:[40,40];const D=UR(i.ranksep,50,i.ranksepFunc),P=UR(i.nodesep,50,i.nodesepFunc);let B=P,F=D;(l==="LR"||l==="RL")&&(B=D,F=P),w.setDefaultEdgeLabel(()=>({})),w.setGraph(i);const I={};this.sortByCombo&&f&&f.forEach(Y=>{if(I[Y.id]=Y,Y.collapsed){const W=$(Y),Q=F(Y),J=B(Y),ie=W[0]+2*J,Se=W[1]+2*Q;w.setNode(Y.id,{width:ie,height:Se})}Y.parentId&&(I[Y.parentId]||w.setNode(Y.parentId,{}),w.setParent(Y.id,Y.parentId))}),M.filter(Y=>Y.layout!==!1).forEach(Y=>{const W=$(Y),Q=F(Y),J=B(Y),ie=W[0]+2*J,Se=W[1]+2*Q,Ae=Y.layer;g1(Ae)?w.setNode(Y.id,{width:ie,height:Se,layer:Ae}):w.setNode(Y.id,{width:ie,height:Se}),this.sortByCombo&&Y.comboId&&(I[Y.comboId]||(I[Y.comboId]={id:Y.comboId},w.setNode(Y.comboId,{})),w.setParent(Y.id,Y.comboId))}),O.forEach(Y=>{const W=cg(Y,"source"),Q=cg(Y,"target");this.layoutNode(W)&&this.layoutNode(Q)&&w.setEdge(W,Q,{weight:Y.weight||1})}),(n=b==null?void 0:b.concat(E||[]))===null||n===void 0||n.forEach(Y=>{var W,Q;const{source:J,target:ie}=Y,Se=!((W=I[J])===null||W===void 0)&&W.collapsed?[J]:S[J]||[J],Ae=!((Q=I[ie])===null||Q===void 0)&&Q.collapsed?[ie]:S[ie]||[ie];Se.forEach(Pe=>{Ae.forEach(De=>{w.setEdge(Pe,De,{weight:Y.weight||1})})})});let V;!((o=i.preset)===null||o===void 0)&&o.nodes&&(V=new cp({multigraph:!0,compound:!0}),i.preset.nodes.forEach(Y=>{V==null||V.setNode(Y.id,Y)})),Vfe.layout(w,{prevGraph:V,edgeLabelSpace:i.edgeLabelSpace,keepNodeOrder:!!i.nodeOrder,nodeOrder:i.nodeOrder});const z=[0,0];if(h){let Y=1/0,W=1/0;w.nodes().forEach(Q=>{const J=w.node(Q);Y>J.x&&(Y=J.x),W>J.y&&(W=J.y)}),w.edges().forEach(Q=>{var J;(J=w.edge(Q).points)===null||J===void 0||J.forEach(Se=>{Y>Se.x&&(Y=Se.x),W>Se.y&&(W=Se.y)})}),z[0]=h[0]-Y,z[1]=h[1]-W}const X=l==="LR"||l==="RL";if(v){const{focusNode:Y,ranksep:W,getRadialPos:Q}=this,J=Pce(Y)?Y:Y==null?void 0:Y.id,ie=J?(r=w.node(J))===null||r===void 0?void 0:r._rank:0,Se=[],Ae=X?"y":"x",Pe=X?"height":"width";let De=1/0,ze=-1/0;w.nodes().forEach(se=>{const we=w.node(se);if(!i.nodeMap[se])return;const $e=P(i.nodeMap[se]);if(ie===0)Se[we._rank]||(Se[we._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[we._rank].nodes.push(se),Se[we._rank].totalWidth+=$e*2+we[Pe],Se[we._rank].maxSize<Math.max(we.width,we.height)&&(Se[we._rank].maxSize=Math.max(we.width,we.height));else{const Lt=we._rank-ie;if(Lt===0)Se[Lt]||(Se[Lt]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[Lt].nodes.push(se),Se[Lt].totalWidth+=$e*2+we[Pe],Se[Lt].maxSize<Math.max(we.width,we.height)&&(Se[Lt].maxSize=Math.max(we.width,we.height));else{const Jt=Math.abs(Lt);Se[Jt]||(Se[Jt]={left:[],right:[],totalWidth:0,maxSize:-1/0}),Se[Jt].totalWidth+=$e*2+we[Pe],Se[Jt].maxSize<Math.max(we.width,we.height)&&(Se[Jt].maxSize=Math.max(we.width,we.height)),Lt<0?Se[Jt].left.push(se):Se[Jt].right.push(se)}}const rt=we[Ae]-we[Pe]/2-$e,pt=we[Ae]+we[Pe]/2+$e;rt<De&&(De=rt),pt>ze&&(ze=pt)});let Ye=W||50;const Be={},Je=(ze-De)/.9,gt=[(De+ze-Je)*.5,(De+ze+Je)*.5],le=(se,we,$e=-1/0,rt=[0,1])=>{let pt=$e;return se.forEach(Lt=>{const Jt=w.node(Lt);Be[Lt]=we;const{x:en,y:zt}=Q(Jt[Ae],gt,Je,we,rt);if(!i.nodeMap[Lt])return;i.nodeMap[Lt].x=en+z[0],i.nodeMap[Lt].y=zt+z[1],i.nodeMap[Lt]._order=Jt._order;const it=D(i.nodeMap[Lt]);pt<it&&(pt=it)}),pt};let Ze=!0;const pe=0;Se.forEach(se=>{var we,$e,rt,pt,Lt,Jt,en;if(!(!((we=se==null?void 0:se.nodes)===null||we===void 0)&&we.length)&&!(!(($e=se==null?void 0:se.left)===null||$e===void 0)&&$e.length)&&!(!((rt=se==null?void 0:se.right)===null||rt===void 0)&&rt.length))return;if(Ze&&se.nodes.length===1){const it=se.nodes[0];if(!i.nodeMap[it])return;i.nodeMap[it].x=z[0],i.nodeMap[it].y=z[1],Be[se.nodes[0]]=0,Ye=D(i.nodeMap[it]),Ze=!1;return}Ye=Math.max(Ye,se.totalWidth/(2*Math.PI));let zt=-1/0;if(ie===0||!((pt=se.nodes)===null||pt===void 0)&&pt.length)zt=le(se.nodes,Ye,zt,[0,1]);else{const it=((Lt=se.left)===null||Lt===void 0?void 0:Lt.length)/(((Jt=se.left)===null||Jt===void 0?void 0:Jt.length)+((en=se.right)===null||en===void 0?void 0:en.length));zt=le(se.left,Ye,zt,[0,it]),zt=le(se.right,Ye,zt,[it+.05,1])}Ye+=zt,Ze=!1,pe-se.maxSize}),w.edges().forEach(se=>{var we,$e,rt;const pt=w.edge(se),Lt=O.findIndex(Jt=>{const en=cg(Jt,"source"),zt=cg(Jt,"target");return en===se.v&&zt===se.w});if(!(Lt<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[Lt].type!=="loop"){const Jt=Ae==="x"?"y":"x",en=(we=pt==null?void 0:pt.points)===null||we===void 0?void 0:we.slice(1,pt.points.length-1),zt=[],it=($e=w.node(se.v))===null||$e===void 0?void 0:$e[Jt],ae=it-((rt=w.node(se.w))===null||rt===void 0?void 0:rt[Jt]),re=Be[se.v],je=re-Be[se.w];en==null||en.forEach(vt=>{const q=(vt[Jt]-it)/ae*je+re,kt=Q(vt[Ae],gt,Je,q);zt.push({x:kt.x+z[0],y:kt.y+z[1]})}),O[Lt].controlPoints=zt}})}else{const Y=new Set,Q=l==="BT"||l==="RL"?(Ae,Pe)=>Pe-Ae:(Ae,Pe)=>Ae-Pe;w.nodes().forEach(Ae=>{const Pe=w.node(Ae);if(!Pe)return;let De=this.nodeMap[Ae];De||(De=f==null?void 0:f.find(ze=>ze.id===Ae)),De&&(De.x=Pe.x+z[0],De.y=Pe.y+z[1],De._order=Pe._order,Y.add(X?De.x:De.y))});const J=Array.from(Y).sort(Q),ie=X?(Ae,Pe)=>Ae.x!==Pe.x:(Ae,Pe)=>Ae.y!==Pe.y,Se=X?(Ae,Pe,De)=>{const ze=Math.max(Pe.y,De.y),Ye=Math.min(Pe.y,De.y);return Ae.filter(Be=>Be.y<=ze&&Be.y>=Ye)}:(Ae,Pe,De)=>{const ze=Math.max(Pe.x,De.x),Ye=Math.min(Pe.x,De.x);return Ae.filter(Be=>Be.x<=ze&&Be.x>=Ye)};w.edges().forEach(Ae=>{var Pe;const De=w.edge(Ae),ze=O.findIndex(Ye=>{const Be=cg(Ye,"source"),Je=cg(Ye,"target");return Be===Ae.v&&Je===Ae.w});if(!(ze<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[ze].type!=="loop"){(Pe=De==null?void 0:De.points)===null||Pe===void 0||Pe.forEach(Je=>{Je.x+=z[0],Je.y+=z[1]});const Ye=i.nodeMap[Ae.v],Be=i.nodeMap[Ae.w];O[ze].controlPoints=Gfe(De==null?void 0:De.points,Ye,Be,J,X,ie,Se)}})}return i.onLayoutEnd&&i.onLayoutEnd(),{nodes:a,edges:O}}getRadialPos(e,n,o,r,i=[0,1]){let a=(e-n[0])/o;a=a*(i[1]-i[0])+i[0];const s=a*2*Math.PI;return{x:Math.cos(s)*r,y:Math.sin(s)*r}}getType(){return"dagre"}}const Gfe=(t,e,n,o,r,i,a)=>{let s=(t==null?void 0:t.slice(1,t.length-1))||[];if(e&&n){let{x:l,y:f}=e,{x:h,y:v}=n;if(r&&(l=e.y,f=e.x,h=n.y,v=n.x),v!==f&&l!==h){const b=o.indexOf(f),E=o[b+1];if(E){const S=s[0],M=r?{x:(f+E)/2,y:(S==null?void 0:S.y)||h}:{x:(S==null?void 0:S.x)||h,y:(f+E)/2};(!S||i(S,M))&&s.unshift(M)}const O=o.indexOf(v),w=Math.abs(O-b);if(w===1)s=a(s,e,n),s.length||s.push(r?{x:(f+v)/2,y:l}:{x:l,y:(f+v)/2});else if(w>1){const S=o[O-1];if(S){const M=s[s.length-1],T=r?{x:(v+S)/2,y:(M==null?void 0:M.y)||h}:{x:(M==null?void 0:M.x)||l,y:(v+S)/2};(!M||i(M,T))&&s.push(T)}}}}return s};var dD,fD,pD,hD;(function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"})(dD||(dD={})),(function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"})(fD||(fD={})),(function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"})(pD||(pD={})),(function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"})(hD||(hD={}));var V0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VM(t,e){return t(e={exports:{}},e.exports),e.exports}var zfe=function(){this.__data__=[],this.size=0},cy=function(t,e){return t===e||t!=t&&e!=e},nE=function(t,e){for(var n=t.length;n--;)if(cy(t[n][0],e))return n;return-1},Hfe=Array.prototype.splice,Xfe=function(t){var e=this.__data__,n=nE(e,t);return!(n<0)&&(n==e.length-1?e.pop():Hfe.call(e,n,1),--this.size,!0)},Yfe=function(t){var e=this.__data__,n=nE(e,t);return n<0?void 0:e[n][1]},qfe=function(t){return nE(this.__data__,t)>-1},Kfe=function(t,e){var n=this.__data__,o=nE(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function vg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}vg.prototype.clear=zfe,vg.prototype.delete=Xfe,vg.prototype.get=Yfe,vg.prototype.has=qfe,vg.prototype.set=Kfe;var rE=vg,Zfe=function(){this.__data__=new rE,this.size=0},Jfe=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qfe=function(t){return this.__data__.get(t)},epe=function(t){return this.__data__.has(t)},d4=typeof V0=="object"&&V0&&V0.Object===Object&&V0,tpe=typeof self=="object"&&self&&self.Object===Object&&self,od=d4||tpe||Function("return this")(),ic=od.Symbol,f4=Object.prototype,npe=f4.hasOwnProperty,rpe=f4.toString,$y=ic?ic.toStringTag:void 0,ope=function(t){var e=npe.call(t,$y),n=t[$y];try{t[$y]=void 0;var o=!0}catch{}var r=rpe.call(t);return o&&(e?t[$y]=n:delete t[$y]),r},ipe=Object.prototype.toString,ape=function(t){return ipe.call(t)},vD=ic?ic.toStringTag:void 0,Bh=function(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":vD&&vD in Object(t)?ope(t):ape(t)},Xs=function(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")},mD,ub=function(t){if(!Xs(t))return!1;var e=Bh(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},$S=od["__core-js_shared__"],gD=(mD=/[^.]+$/.exec($S&&$S.keys&&$S.keys.IE_PROTO||""))?"Symbol(src)_1."+mD:"",lpe=function(t){return!!gD&&gD in t},spe=Function.prototype.toString,sm=function(t){if(t!=null){try{return spe.call(t)}catch{}try{return t+""}catch{}}return""},upe=/^\[object .+?Constructor\]$/,cpe=Function.prototype,dpe=Object.prototype,fpe=cpe.toString,ppe=dpe.hasOwnProperty,hpe=RegExp("^"+fpe.call(ppe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vpe=function(t){return!(!Xs(t)||lpe(t))&&(ub(t)?hpe:upe).test(sm(t))},mpe=function(t,e){return t==null?void 0:t[e]},um=function(t,e){var n=mpe(t,e);return vpe(n)?n:void 0},V_=um(od,"Map"),W_=um(Object,"create"),gpe=function(){this.__data__=W_?W_(null):{},this.size=0},ype=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_pe=Object.prototype.hasOwnProperty,bpe=function(t){var e=this.__data__;if(W_){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return _pe.call(e,t)?e[t]:void 0},wpe=Object.prototype.hasOwnProperty,Epe=function(t){var e=this.__data__;return W_?e[t]!==void 0:wpe.call(e,t)},xpe=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=W_&&e===void 0?"__lodash_hash_undefined__":e,this};function mg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}mg.prototype.clear=gpe,mg.prototype.delete=ype,mg.prototype.get=bpe,mg.prototype.has=Epe,mg.prototype.set=xpe;var yD=mg,Ope=function(){this.size=0,this.__data__={hash:new yD,map:new(V_||rE),string:new yD}},Spe=function(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null},oE=function(t,e){var n=t.__data__;return Spe(e)?n[typeof e=="string"?"string":"hash"]:n.map},Ape=function(t){var e=oE(this,t).delete(t);return this.size-=e?1:0,e},Mpe=function(t){return oE(this,t).get(t)},Tpe=function(t){return oE(this,t).has(t)},Cpe=function(t,e){var n=oE(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function gg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}gg.prototype.clear=Ope,gg.prototype.delete=Ape,gg.prototype.get=Mpe,gg.prototype.has=Tpe,gg.prototype.set=Cpe;var iE=gg,Npe=function(t,e){var n=this.__data__;if(n instanceof rE){var o=n.__data__;if(!V_||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new iE(o)}return n.set(t,e),this.size=n.size,this};function yg(t){var e=this.__data__=new rE(t);this.size=e.size}yg.prototype.clear=Zfe,yg.prototype.delete=Jfe,yg.prototype.get=Qfe,yg.prototype.has=epe,yg.prototype.set=Npe;var Tg=yg,WM=function(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t},_1=(function(){try{var t=um(Object,"defineProperty");return t({},"",{}),t}catch{}})(),aE=function(t,e,n){e=="__proto__"&&_1?_1(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},kpe=Object.prototype.hasOwnProperty,lE=function(t,e,n){var o=t[e];kpe.call(t,e)&&cy(o,n)&&(n!==void 0||e in t)||aE(t,e,n)},cb=function(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=void 0;l===void 0&&(l=t[s]),r?aE(n,s,l):lE(n,s,l)}return n},Ppe=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},nd=function(t){return t!=null&&typeof t=="object"},_D=function(t){return nd(t)&&Bh(t)=="[object Arguments]"},p4=Object.prototype,Rpe=p4.hasOwnProperty,Dpe=p4.propertyIsEnumerable,Yg=_D((function(){return arguments})())?_D:function(t){return nd(t)&&Rpe.call(t,"callee")&&!Dpe.call(t,"callee")},Ma=Array.isArray,jpe=function(){return!1},Jv=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?od.Buffer:void 0,i=(r?r.isBuffer:void 0)||jpe;t.exports=i})),Lpe=/^(?:0|[1-9]\d*)$/,sE=function(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&Lpe.test(t))&&t>-1&&t%1==0&&t<e},GM=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991},ea={};ea["[object Float32Array]"]=ea["[object Float64Array]"]=ea["[object Int8Array]"]=ea["[object Int16Array]"]=ea["[object Int32Array]"]=ea["[object Uint8Array]"]=ea["[object Uint8ClampedArray]"]=ea["[object Uint16Array]"]=ea["[object Uint32Array]"]=!0,ea["[object Arguments]"]=ea["[object Array]"]=ea["[object ArrayBuffer]"]=ea["[object Boolean]"]=ea["[object DataView]"]=ea["[object Date]"]=ea["[object Error]"]=ea["[object Function]"]=ea["[object Map]"]=ea["[object Number]"]=ea["[object Object]"]=ea["[object RegExp]"]=ea["[object Set]"]=ea["[object String]"]=ea["[object WeakMap]"]=!1;var Ipe=function(t){return nd(t)&&GM(t.length)&&!!ea[Bh(t)]},uE=function(t){return function(e){return t(e)}},qg=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n&&d4.process,i=(function(){try{var a=o&&o.require&&o.require("util").types;return a||r&&r.binding&&r.binding("util")}catch{}})();t.exports=i})),bD=qg&&qg.isTypedArray,db=bD?uE(bD):Ipe,Fpe=Object.prototype.hasOwnProperty,h4=function(t,e){var n=Ma(t),o=!n&&Yg(t),r=!n&&!o&&Jv(t),i=!n&&!o&&!r&&db(t),a=n||o||r||i,s=a?Ppe(t.length,String):[],l=s.length;for(var f in t)!e&&!Fpe.call(t,f)||a&&(f=="length"||r&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||sE(f,l))||s.push(f);return s},Bpe=Object.prototype,cE=function(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Bpe)},v4=function(t,e){return function(n){return t(e(n))}},$pe=v4(Object.keys,Object),Upe=Object.prototype.hasOwnProperty,zM=function(t){if(!cE(t))return $pe(t);var e=[];for(var n in Object(t))Upe.call(t,n)&&n!="constructor"&&e.push(n);return e},vp=function(t){return t!=null&&GM(t.length)&&!ub(t)},$h=function(t){return vp(t)?h4(t):zM(t)},Vpe=function(t,e){return t&&cb(e,$h(e),t)},Wpe=function(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e},Gpe=Object.prototype.hasOwnProperty,zpe=function(t){if(!Xs(t))return Wpe(t);var e=cE(t),n=[];for(var o in t)(o!="constructor"||!e&&Gpe.call(t,o))&&n.push(o);return n},cm=function(t){return vp(t)?h4(t,!0):zpe(t)},Hpe=function(t,e){return t&&cb(e,cm(e),t)},m4=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?od.Buffer:void 0,i=r?r.allocUnsafe:void 0;t.exports=function(a,s){if(s)return a.slice();var l=a.length,f=i?i(l):new a.constructor(l);return a.copy(f),f}})),g4=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},y4=function(t,e){for(var n=-1,o=t==null?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a)}return i},_4=function(){return[]},Xpe=Object.prototype.propertyIsEnumerable,wD=Object.getOwnPropertySymbols,HM=wD?function(t){return t==null?[]:(t=Object(t),y4(wD(t),(function(e){return Xpe.call(t,e)})))}:_4,Ype=function(t,e){return cb(t,HM(t),e)},XM=function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t},dE=v4(Object.getPrototypeOf,Object),b4=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)XM(e,HM(t)),t=dE(t);return e}:_4,qpe=function(t,e){return cb(t,b4(t),e)},w4=function(t,e,n){var o=e(t);return Ma(t)?o:XM(o,n(t))},E2=function(t){return w4(t,$h,HM)},Kpe=function(t){return w4(t,cm,b4)},x2=um(od,"DataView"),O2=um(od,"Promise"),Cg=um(od,"Set"),S2=um(od,"WeakMap"),Zpe=sm(x2),Jpe=sm(V_),Qpe=sm(O2),ehe=sm(Cg),the=sm(S2),jv=Bh;(x2&&jv(new x2(new ArrayBuffer(1)))!="[object DataView]"||V_&&jv(new V_)!="[object Map]"||O2&&jv(O2.resolve())!="[object Promise]"||Cg&&jv(new Cg)!="[object Set]"||S2&&jv(new S2)!="[object WeakMap]")&&(jv=function(t){var e=Bh(t),n=e=="[object Object]"?t.constructor:void 0,o=n?sm(n):"";if(o)switch(o){case Zpe:return"[object DataView]";case Jpe:return"[object Map]";case Qpe:return"[object Promise]";case ehe:return"[object Set]";case the:return"[object WeakMap]"}return e});var Qv=jv,nhe=Object.prototype.hasOwnProperty,rhe=function(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&nhe.call(t,"index")&&(n.index=t.index,n.input=t.input),n},b1=od.Uint8Array,YM=function(t){var e=new t.constructor(t.byteLength);return new b1(e).set(new b1(t)),e},ohe=function(t,e){var n=e?YM(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},ihe=/\w*$/,ahe=function(t){var e=new t.constructor(t.source,ihe.exec(t));return e.lastIndex=t.lastIndex,e},ED=ic?ic.prototype:void 0,xD=ED?ED.valueOf:void 0,lhe=function(t){return xD?Object(xD.call(t)):{}},E4=function(t,e){var n=e?YM(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},she=function(t,e,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return YM(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return ohe(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return E4(t,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return ahe(t);case"[object Set]":return new o;case"[object Symbol]":return lhe(t)}},OD=Object.create,x4=(function(){function t(){}return function(e){if(!Xs(e))return{};if(OD)return OD(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),O4=function(t){return typeof t.constructor!="function"||cE(t)?{}:x4(dE(t))},uhe=function(t){return nd(t)&&Qv(t)=="[object Map]"},SD=qg&&qg.isMap,che=SD?uE(SD):uhe,dhe=function(t){return nd(t)&&Qv(t)=="[object Set]"},AD=qg&&qg.isSet,fhe=AD?uE(AD):dhe,Hi={};Hi["[object Arguments]"]=Hi["[object Array]"]=Hi["[object ArrayBuffer]"]=Hi["[object DataView]"]=Hi["[object Boolean]"]=Hi["[object Date]"]=Hi["[object Float32Array]"]=Hi["[object Float64Array]"]=Hi["[object Int8Array]"]=Hi["[object Int16Array]"]=Hi["[object Int32Array]"]=Hi["[object Map]"]=Hi["[object Number]"]=Hi["[object Object]"]=Hi["[object RegExp]"]=Hi["[object Set]"]=Hi["[object String]"]=Hi["[object Symbol]"]=Hi["[object Uint8Array]"]=Hi["[object Uint8ClampedArray]"]=Hi["[object Uint16Array]"]=Hi["[object Uint32Array]"]=!0,Hi["[object Error]"]=Hi["[object Function]"]=Hi["[object WeakMap]"]=!1;var S4=function t(e,n,o,r,i,a){var s,l=1&n,f=2&n,h=4&n;if(s!==void 0)return s;if(!Xs(e))return e;var v=Ma(e);if(v){if(s=rhe(e),!l)return g4(e,s)}else{var b=Qv(e),E=b=="[object Function]"||b=="[object GeneratorFunction]";if(Jv(e))return m4(e,l);if(b=="[object Object]"||b=="[object Arguments]"||E&&!i){if(s=f||E?{}:O4(e),!l)return f?qpe(e,Hpe(s,e)):Ype(e,Vpe(s,e))}else{if(!Hi[b])return i?e:{};s=she(e,b,l)}}a||(a=new Tg);var O=a.get(e);if(O)return O;a.set(e,s),fhe(e)?e.forEach((function(S){s.add(t(S,n,o,S,e,a))})):che(e)&&e.forEach((function(S,M){s.set(M,t(S,n,o,M,e,a))}));var w=v?void 0:(h?f?Kpe:E2:f?cm:$h)(e);return WM(w||e,(function(S,M){w&&(S=e[M=S]),lE(s,M,t(S,n,o,M,e,a))})),s},phe=function(t){return S4(t,4)},qM=function(t){return function(){return t}},KM=(function(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),s=a.length;s--;){var l=a[++r];if(n(i[l],l,i)===!1)break}return e}})(),ZM=function(t,e){return t&&KM(t,e,$h)},fE=(function(t,e){return function(n,o){if(n==null)return n;if(!vp(n))return t(n,o);for(var r=n.length,i=-1,a=Object(n);++i<r&&o(a[i],i,a)!==!1;);return n}})(ZM),dm=function(t){return t},A4=function(t){return typeof t=="function"?t:dm},M4=function(t,e){return(Ma(t)?WM:fE)(t,A4(e))},T4=M4,hhe=function(t,e){var n=[];return fE(t,(function(o,r,i){e(o,r,i)&&n.push(o)})),n},vhe=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},mhe=function(t){return this.__data__.has(t)};function aw(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new iE;++e<n;)this.add(t[e])}aw.prototype.add=aw.prototype.push=vhe,aw.prototype.has=mhe;var C4=aw,ghe=function(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1},N4=function(t,e){return t.has(e)},k4=function(t,e,n,o,r,i){var a=1&n,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var v=-1,b=!0,E=2&n?new C4:void 0;for(i.set(t,e),i.set(e,t);++v<s;){var O=t[v],w=e[v];if(o)var S=a?o(w,O,v,e,t,i):o(O,w,v,t,e,i);if(S!==void 0){if(S)continue;b=!1;break}if(E){if(!ghe(e,(function(M,T){if(!N4(E,T)&&(O===M||r(O,M,n,o,i)))return E.push(T)}))){b=!1;break}}else if(O!==w&&!r(O,w,n,o,i)){b=!1;break}}return i.delete(t),i.delete(e),b},yhe=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o,r){n[++e]=[r,o]})),n},JM=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o){n[++e]=o})),n},MD=ic?ic.prototype:void 0,US=MD?MD.valueOf:void 0,_he=function(t,e,n,o,r,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new b1(t),new b1(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return cy(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=yhe;case"[object Set]":var l=1&o;if(s||(s=JM),t.size!=e.size&&!l)return!1;var f=a.get(t);if(f)return f==e;o|=2,a.set(t,e);var h=k4(s(t),s(e),o,r,i,a);return a.delete(t),h;case"[object Symbol]":if(US)return US.call(t)==US.call(e)}return!1},bhe=Object.prototype.hasOwnProperty,whe=function(t,e,n,o,r,i){var a=1&n,s=E2(t),l=s.length;if(l!=E2(e).length&&!a)return!1;for(var f=l;f--;){var h=s[f];if(!(a?h in e:bhe.call(e,h)))return!1}var v=i.get(t),b=i.get(e);if(v&&b)return v==e&&b==t;var E=!0;i.set(t,e),i.set(e,t);for(var O=a;++f<l;){var w=t[h=s[f]],S=e[h];if(o)var M=a?o(S,w,h,e,t,i):o(w,S,h,t,e,i);if(!(M===void 0?w===S||r(w,S,n,o,i):M)){E=!1;break}O||(O=h=="constructor")}if(E&&!O){var T=t.constructor,$=e.constructor;T==$||!("constructor"in t)||!("constructor"in e)||typeof T=="function"&&T instanceof T&&typeof $=="function"&&$ instanceof $||(E=!1)}return i.delete(t),i.delete(e),E},TD=Object.prototype.hasOwnProperty,Ehe=function(t,e,n,o,r,i){var a=Ma(t),s=Ma(e),l=a?"[object Array]":Qv(t),f=s?"[object Array]":Qv(e),h=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",v=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",b=l==f;if(b&&Jv(t)){if(!Jv(e))return!1;a=!0,h=!1}if(b&&!h)return i||(i=new Tg),a||db(t)?k4(t,e,n,o,r,i):_he(t,e,l,n,o,r,i);if(!(1&n)){var E=h&&TD.call(t,"__wrapped__"),O=v&&TD.call(e,"__wrapped__");if(E||O){var w=E?t.value():t,S=O?e.value():e;return i||(i=new Tg),r(w,S,n,o,i)}}return!!b&&(i||(i=new Tg),whe(t,e,n,o,r,i))},P4=function t(e,n,o,r,i){return e===n||(e==null||n==null||!nd(e)&&!nd(n)?e!=e&&n!=n:Ehe(e,n,o,r,t,i))},xhe=function(t,e,n,o){var r=n.length,i=r;if(t==null)return!i;for(t=Object(t);r--;){var a=n[r];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<i;){var s=(a=n[r])[0],l=t[s],f=a[1];if(a[2]){if(l===void 0&&!(s in t))return!1}else{var h=new Tg,v;if(!(v===void 0?P4(f,l,3,o,h):v))return!1}}return!0},R4=function(t){return t==t&&!Xs(t)},Ohe=function(t){for(var e=$h(t),n=e.length;n--;){var o=e[n],r=t[o];e[n]=[o,r,R4(r)]}return e},D4=function(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}},She=function(t){var e=Ohe(t);return e.length==1&&e[0][2]?D4(e[0][0],e[0][1]):function(n){return n===t||xhe(n,t,e)}},em=function(t){return typeof t=="symbol"||nd(t)&&Bh(t)=="[object Symbol]"},Ahe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mhe=/^\w*$/,QM=function(t,e){if(Ma(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!em(t))||Mhe.test(t)||!Ahe.test(t)||e!=null&&t in Object(e)};function eT(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,r=e?e.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=t.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(eT.Cache||iE),n}eT.Cache=iE;var The=eT,Che=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nhe=/\\(\\)?/g,khe=(function(t){var e=The(t,(function(o){return n.size===500&&n.clear(),o})),n=e.cache;return e})((function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Che,(function(n,o,r,i){e.push(r?i.replace(Nhe,"$1"):o||n)})),e})),Ng=function(t,e){for(var n=-1,o=t==null?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r},CD=ic?ic.prototype:void 0,ND=CD?CD.toString:void 0,Phe=function t(e){if(typeof e=="string")return e;if(Ma(e))return Ng(e,t)+"";if(em(e))return ND?ND.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n},j4=function(t){return t==null?"":Phe(t)},pE=function(t,e){return Ma(t)?t:QM(t,e)?[t]:khe(j4(t))},fb=function(t){if(typeof t=="string"||em(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},hE=function(t,e){for(var n=0,o=(e=pE(e,t)).length;t!=null&&n<o;)t=t[fb(e[n++])];return n&&n==o?t:void 0},Rhe=function(t,e,n){var o=t==null?void 0:hE(t,e);return o===void 0?n:o},Dhe=function(t,e){return t!=null&&e in Object(t)},L4=function(t,e,n){for(var o=-1,r=(e=pE(e,t)).length,i=!1;++o<r;){var a=fb(e[o]);if(!(i=t!=null&&n(t,a)))break;t=t[a]}return i||++o!=r?i:!!(r=t==null?0:t.length)&&GM(r)&&sE(a,r)&&(Ma(t)||Yg(t))},I4=function(t,e){return t!=null&&L4(t,e,Dhe)},jhe=function(t,e){return QM(t)&&R4(e)?D4(fb(t),e):function(n){var o=Rhe(n,t);return o===void 0&&o===e?I4(n,t):P4(e,o,3)}},F4=function(t){return function(e){return e==null?void 0:e[t]}},Lhe=function(t){return function(e){return hE(e,t)}},Ihe=function(t){return QM(t)?F4(fb(t)):Lhe(t)},mp=function(t){return typeof t=="function"?t:t==null?dm:typeof t=="object"?Ma(t)?jhe(t[0],t[1]):She(t):Ihe(t)},B4=function(t,e){return(Ma(t)?y4:hhe)(t,mp(e))},Fhe=Object.prototype.hasOwnProperty,Bhe=function(t,e){return t!=null&&Fhe.call(t,e)},$4=function(t,e){return t!=null&&L4(t,e,Bhe)},$he=Object.prototype.hasOwnProperty,Uhe=function(t){if(t==null)return!0;if(vp(t)&&(Ma(t)||typeof t=="string"||typeof t.splice=="function"||Jv(t)||db(t)||Yg(t)))return!t.length;var e=Qv(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(cE(t))return!zM(t).length;for(var n in t)if($he.call(t,n))return!1;return!0},U4=function(t){return t===void 0},V4=function(t,e){var n=-1,o=vp(t)?Array(t.length):[];return fE(t,(function(r,i,a){o[++n]=e(r,i,a)})),o},W4=function(t,e){return(Ma(t)?Ng:V4)(t,mp(e))},Vhe=function(t,e,n,o){var r=-1,i=t==null?0:t.length;for(o&&i&&(n=t[++r]);++r<i;)n=e(n,t[r],r,t);return n},Whe=function(t,e,n,o,r){return r(t,(function(i,a,s){n=o?(o=!1,i):e(n,i,a,s)})),n},G4=function(t,e,n){var o=Ma(t)?Vhe:Whe,r=arguments.length<3;return o(t,mp(e),n,r,fE)},Ghe=function(t){return typeof t=="string"||!Ma(t)&&nd(t)&&Bh(t)=="[object String]"},zhe=F4("length"),Hhe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Xhe=function(t){return Hhe.test(t)},Yhe="[\\ud800-\\udfff]",A2="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",M2="\\ud83c[\\udffb-\\udfff]",z4="[^\\ud800-\\udfff]",H4="(?:\\ud83c[\\udde6-\\uddff]){2}",X4="[\\ud800-\\udbff][\\udc00-\\udfff]",kD="(?:"+A2+"|"+M2+")?",qhe="[\\ufe0e\\ufe0f]?"+kD+("(?:\\u200d(?:"+[z4,H4,X4].join("|")+")[\\ufe0e\\ufe0f]?"+kD+")*"),Khe="(?:"+[z4+A2+"?",A2,H4,X4,Yhe].join("|")+")",PD=RegExp(M2+"(?="+M2+")|"+Khe+qhe,"g"),Zhe=function(t){for(var e=PD.lastIndex=0;PD.test(t);)++e;return e},Jhe=function(t){return Xhe(t)?Zhe(t):zhe(t)},Qhe=function(t){if(t==null)return 0;if(vp(t))return Ghe(t)?Jhe(t):t.length;var e=Qv(t);return e=="[object Map]"||e=="[object Set]"?t.size:zM(t).length},eve=function(t,e,n){var o=Ma(t),r=o||Jv(t)||db(t);if(e=mp(e),n==null){var i=t&&t.constructor;n=r?o?new i:[]:Xs(t)&&ub(i)?x4(dE(t)):{}}return(r?WM:ZM)(t,(function(a,s,l){return e(n,a,s,l)})),n},RD=ic?ic.isConcatSpreadable:void 0,tve=function(t){return Ma(t)||Yg(t)||!!(RD&&t&&t[RD])},tT=function(e,n,o,r,i){var a=-1,s=e.length;for(o||(o=tve),i||(i=[]);++a<s;){var l=e[a];o(l)?XM(i,l):r||(i[i.length]=l)}return i},nve=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},DD=Math.max,Y4=function(t,e,n){return e=DD(e===void 0?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=DD(o.length-e,0),a=Array(i);++r<i;)a[r]=o[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=o[r];return s[e]=n(a),nve(t,this,s)}},rve=_1?function(t,e){return _1(t,"toString",{configurable:!0,enumerable:!1,value:qM(e),writable:!0})}:dm,ove=Date.now,q4=(function(t){var e=0,n=0;return function(){var o=ove(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}})(rve),vE=function(t,e){return q4(Y4(t,e,dm),t+"")},K4=function(t,e,n,o){for(var r=t.length,i=n+-1;++i<r;)if(e(t[i],i,t))return i;return-1},ive=function(t){return t!=t},ave=function(t,e,n){for(var o=n-1,r=t.length;++o<r;)if(t[o]===e)return o;return-1},lve=function(t,e,n){return e==e?ave(t,e,n):K4(t,ive,n)},sve=function(t,e){return!!(t!=null&&t.length)&&lve(t,e,0)>-1},uve=function(){},cve=Cg&&1/JM(new Cg([,-0]))[1]==1/0?function(t){return new Cg(t)}:uve,dve=function(t,e,n){var o=-1,r=sve,i=t.length,a=!0,s=[],l=s;if(i>=200){var f=cve(t);if(f)return JM(f);a=!1,r=N4,l=new C4}else l=s;e:for(;++o<i;){var h=t[o],v=h;if(h=h!==0?h:0,a&&v==v){for(var b=l.length;b--;)if(l[b]===v)continue e;s.push(h)}else r(l,v,n)||(l!==s&&l.push(v),s.push(h))}return s},Z4=function(t){return nd(t)&&vp(t)},fve=vE((function(t){return dve(tT(t,1,Z4,!0))})),pve=function(t,e){return Ng(e,(function(n){return t[n]}))},w1,J4=function(t){return t==null?[]:pve(t,$h(t))};try{w1={clone:phe,constant:qM,each:T4,filter:B4,has:$4,isArray:Ma,isEmpty:Uhe,isFunction:ub,isUndefined:U4,keys:$h,map:W4,reduce:G4,size:Qhe,transform:eve,union:fve,values:J4}}catch{}w1||(w1=window._);var tr=w1,nT=Po;function Po(t){this._isDirected=!tr.has(t,"directed")||t.directed,this._isMultigraph=!!tr.has(t,"multigraph")&&t.multigraph,this._isCompound=!!tr.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=tr.constant(void 0),this._defaultEdgeLabelFn=tr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function jD(t,e){t[e]?t[e]++:t[e]=1}function LD(t,e){--t[e]||delete t[e]}function Zy(t,e,n,o){var r=""+e,i=""+n;if(!t&&r>i){var a=r;r=i,i=a}return r+""+i+""+(tr.isUndefined(o)?"\0":o)}function hve(t,e,n,o){var r=""+e,i=""+n;if(!t&&r>i){var a=r;r=i,i=a}var s={v:r,w:i};return o&&(s.name=o),s}function VS(t,e){return Zy(t,e.v,e.w,e.name)}Po.prototype._nodeCount=0,Po.prototype._edgeCount=0,Po.prototype.isDirected=function(){return this._isDirected},Po.prototype.isMultigraph=function(){return this._isMultigraph},Po.prototype.isCompound=function(){return this._isCompound},Po.prototype.setGraph=function(t){return this._label=t,this},Po.prototype.graph=function(){return this._label},Po.prototype.setDefaultNodeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultNodeLabelFn=t,this},Po.prototype.nodeCount=function(){return this._nodeCount},Po.prototype.nodes=function(){return tr.keys(this._nodes)},Po.prototype.sources=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._in[e])}))},Po.prototype.sinks=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._out[e])}))},Po.prototype.setNodes=function(t,e){var n=arguments,o=this;return tr.each(t,(function(r){n.length>1?o.setNode(r,e):o.setNode(r)})),this},Po.prototype.setNode=function(t,e){return tr.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},Po.prototype.node=function(t){return this._nodes[t]},Po.prototype.hasNode=function(t){return tr.has(this._nodes,t)},Po.prototype.removeNode=function(t){var e=this;if(tr.has(this._nodes,t)){var n=function(o){e.removeEdge(e._edgeObjs[o])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],tr.each(this.children(t),(function(o){e.setParent(o)})),delete this._children[t]),tr.each(tr.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],tr.each(tr.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},Po.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(tr.isUndefined(e))e="\0";else{for(var n=e+="";!tr.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},Po.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},Po.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!=="\0")return e}},Po.prototype.children=function(t){if(tr.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return tr.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}},Po.prototype.predecessors=function(t){var e=this._preds[t];if(e)return tr.keys(e)},Po.prototype.successors=function(t){var e=this._sucs[t];if(e)return tr.keys(e)},Po.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return tr.union(e,this.successors(t))},Po.prototype.isLeaf=function(t){return(this.isDirected()?this.successors(t):this.neighbors(t)).length===0},Po.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;tr.each(this._nodes,(function(i,a){t(a)&&e.setNode(a,i)})),tr.each(this._edgeObjs,(function(i){e.hasNode(i.v)&&e.hasNode(i.w)&&e.setEdge(i,n.edge(i))}));var o={};function r(i){var a=n.parent(i);return a===void 0||e.hasNode(a)?(o[i]=a,a):a in o?o[a]:r(a)}return this._isCompound&&tr.each(e.nodes(),(function(i){e.setParent(i,r(i))})),e},Po.prototype.setDefaultEdgeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultEdgeLabelFn=t,this},Po.prototype.edgeCount=function(){return this._edgeCount},Po.prototype.edges=function(){return tr.values(this._edgeObjs)},Po.prototype.setPath=function(t,e){var n=this,o=arguments;return tr.reduce(t,(function(r,i){return o.length>1?n.setEdge(r,i,e):n.setEdge(r,i),i})),this},Po.prototype.setEdge=function(){var t,e,n,o,r=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,e=i.w,n=i.name,arguments.length===2&&(o=arguments[1],r=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),t=""+t,e=""+e,tr.isUndefined(n)||(n=""+n);var a=Zy(this._isDirected,t,e,n);if(tr.has(this._edgeLabels,a))return r&&(this._edgeLabels[a]=o),this;if(!tr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=r?o:this._defaultEdgeLabelFn(t,e,n);var s=hve(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,jD(this._preds[e],t),jD(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},Po.prototype.edge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n);return this._edgeLabels[o]},Po.prototype.hasEdge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n);return tr.has(this._edgeLabels,o)},Po.prototype.removeEdge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n),r=this._edgeObjs[o];return r&&(t=r.v,e=r.w,delete this._edgeLabels[o],delete this._edgeObjs[o],LD(this._preds[e],t),LD(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--),this},Po.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var o=tr.values(n);return e?tr.filter(o,(function(r){return r.v===e})):o}},Po.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var o=tr.values(n);return e?tr.filter(o,(function(r){return r.w===e})):o}},Po.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var ID={Graph:nT,version:"2.1.8"},vve={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:mve(t),edges:gve(t)};return tr.isUndefined(t.graph())||(e.value=tr.clone(t.graph())),e},read:function(t){var e=new nT(t.options).setGraph(t.value);return tr.each(t.nodes,(function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)})),tr.each(t.edges,(function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),e}};function mve(t){return tr.map(t.nodes(),(function(e){var n=t.node(e),o=t.parent(e),r={v:e};return tr.isUndefined(n)||(r.value=n),tr.isUndefined(o)||(r.parent=o),r}))}function gve(t){return tr.map(t.edges(),(function(e){var n=t.edge(e),o={v:e.v,w:e.w};return tr.isUndefined(e.name)||(o.name=e.name),tr.isUndefined(n)||(o.value=n),o}))}var yve=function(t){var e,n={},o=[];function r(i){tr.has(n,i)||(n[i]=!0,e.push(i),tr.each(t.successors(i),r),tr.each(t.predecessors(i),r))}return tr.each(t.nodes(),(function(i){e=[],r(i),e.length&&o.push(e)})),o},Q4=Gu;function Gu(){this._arr=[],this._keyIndices={}}Gu.prototype.size=function(){return this._arr.length},Gu.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Gu.prototype.has=function(t){return tr.has(this._keyIndices,t)},Gu.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority},Gu.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Gu.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!tr.has(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1},Gu.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Gu.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},Gu.prototype._heapify=function(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))},Gu.prototype._decrease=function(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e},Gu.prototype._swap=function(t,e){var n=this._arr,o=this._keyIndices,r=n[t],i=n[e];n[t]=i,n[e]=r,o[i.key]=t,o[r.key]=e};var e5=function(t,e,n,o){return(function(r,i,a,s){var l,f,h={},v=new Q4,b=function(E){var O=E.v!==l?E.v:E.w,w=h[O],S=a(E),M=f.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+E+" Weight: "+S);M<w.distance&&(w.distance=M,w.predecessor=l,v.decrease(O,M))};for(r.nodes().forEach((function(E){var O=E===i?0:Number.POSITIVE_INFINITY;h[E]={distance:O},v.add(E,O)}));v.size()>0&&(l=v.removeMin(),(f=h[l]).distance!==Number.POSITIVE_INFINITY);)s(l).forEach(b);return h})(t,String(e),n||_ve,o||function(r){return t.outEdges(r)})},_ve=tr.constant(1),bve=function(t,e,n){return tr.transform(t.nodes(),(function(o,r){o[r]=e5(t,r,e,n)}),{})},t5=function(t){var e=0,n=[],o={},r=[];function i(a){var s=o[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(h){tr.has(o,h)?o[h].onStack&&(s.lowlink=Math.min(s.lowlink,o[h].index)):(i(h),s.lowlink=Math.min(s.lowlink,o[h].lowlink))})),s.lowlink===s.index){var l,f=[];do l=n.pop(),o[l].onStack=!1,f.push(l);while(a!==l);r.push(f)}}return t.nodes().forEach((function(a){tr.has(o,a)||i(a)})),r},wve=function(t){return tr.filter(t5(t),(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])}))},Eve=function(t,e,n){return(function(o,r,i){var a={},s=o.nodes();return s.forEach((function(l){a[l]={},a[l][l]={distance:0},s.forEach((function(f){l!==f&&(a[l][f]={distance:Number.POSITIVE_INFINITY})})),i(l).forEach((function(f){var h=f.v===l?f.w:f.v,v=r(f);a[l][h]={distance:v,predecessor:l}}))})),s.forEach((function(l){var f=a[l];s.forEach((function(h){var v=a[h];s.forEach((function(b){var E=v[l],O=f[b],w=v[b],S=E.distance+O.distance;S<w.distance&&(w.distance=S,w.predecessor=O.predecessor)}))}))})),a})(t,e||xve,n||function(o){return t.outEdges(o)})},xve=tr.constant(1),WS=n5;function n5(t){var e={},n={},o=[];if(tr.each(t.sinks(),(function r(i){if(tr.has(n,i))throw new E1;tr.has(e,i)||(n[i]=!0,e[i]=!0,tr.each(t.predecessors(i),r),delete n[i],o.push(i))})),tr.size(e)!==t.nodeCount())throw new E1;return o}function E1(){}n5.CycleException=E1,E1.prototype=new Error;var FD=function(t,e,n){tr.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],i={};return tr.each(e,(function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);r5(t,a,n==="post",i,o,r)})),r};function r5(t,e,n,o,r,i){tr.has(o,e)||(o[e]=!0,n||i.push(e),tr.each(r(e),(function(a){r5(t,a,n,o,r,i)})),n&&i.push(e))}var x1,Ove={Graph:ID.Graph,json:vve,alg:{components:yve,dijkstra:e5,dijkstraAll:bve,findCycles:wve,floydWarshall:Eve,isAcyclic:function(t){try{WS(t)}catch(e){if(e instanceof WS.CycleException)return!1;throw e}return!0},postorder:function(t,e){return FD(t,e,"post")},preorder:function(t,e){return FD(t,e,"pre")},prim:function(t,e){var n,o=new nT,r={},i=new Q4;function a(l){var f=l.v===n?l.w:l.v,h=i.priority(f);if(h!==void 0){var v=e(l);v<h&&(r[f]=n,i.decrease(f,v))}}if(t.nodeCount()===0)return o;tr.each(t.nodes(),(function(l){i.add(l,Number.POSITIVE_INFINITY),o.setNode(l)})),i.decrease(t.nodes()[0],0);for(var s=!1;i.size()>0;){if(n=i.removeMin(),tr.has(r,n))o.setEdge(n,r[n]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(n).forEach(a)}return o},tarjan:t5,topsort:WS},version:ID.version};try{x1=Ove}catch{}x1||(x1=window.graphlib);var nf=x1,Sve=function(t){return S4(t,5)},G_=function(t,e,n){if(!Xs(n))return!1;var o=typeof e;return!!(o=="number"?vp(n)&&sE(e,n.length):o=="string"&&e in n)&&cy(n[e],t)},o5=Object.prototype,Ave=o5.hasOwnProperty,Mve=vE((function(t,e){t=Object(t);var n=-1,o=e.length,r=o>2?e[2]:void 0;for(r&&G_(e[0],e[1],r)&&(o=1);++n<o;)for(var i=e[n],a=cm(i),s=-1,l=a.length;++s<l;){var f=a[s],h=t[f];(h===void 0||cy(h,o5[f])&&!Ave.call(t,f))&&(t[f]=i[f])}return t})),Tve=function(t){return function(e,n,o){var r=Object(e);if(!vp(e)){var i=mp(n);e=$h(e),n=function(s){return i(r[s],s,r)}}var a=t(e,n,o);return a>-1?r[i?e[a]:a]:void 0}},Cve=/^\s+|\s+$/g,Nve=/^[-+]0x[0-9a-f]+$/i,kve=/^0b[01]+$/i,Pve=/^0o[0-7]+$/i,Rve=parseInt,Dve=function(t){if(typeof t=="number")return t;if(em(t))return NaN;if(Xs(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xs(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Cve,"");var n=kve.test(t);return n||Pve.test(t)?Rve(t.slice(2),n?2:8):Nve.test(t)?NaN:+t},lw=function(t){return t?(t=Dve(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:t===0?t:0},jve=function(t){var e=lw(t),n=e%1;return e==e?n?e-n:e:0},Lve=Math.max,Ive=Tve((function(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=n==null?0:jve(n);return r<0&&(r=Lve(o+r,0)),K4(t,mp(e),r)})),i5=function(t){return t!=null&&t.length?tT(t):[]},Fve=function(t,e){return t==null?t:KM(t,A4(e),cm)},Bve=function(t){var e=t==null?0:t.length;return e?t[e-1]:void 0},$ve=function(t,e){var n={};return e=mp(e),ZM(t,(function(o,r,i){aE(n,r,e(o,r,i))})),n},rT=function(t,e,n){for(var o=-1,r=t.length;++o<r;){var i=t[o],a=e(i);if(a!=null&&(s===void 0?a==a&&!em(a):n(a,s)))var s=a,l=i}return l},Uve=function(t,e){return t>e},Vve=function(t){return t&&t.length?rT(t,dm,Uve):void 0},T2=function(t,e,n){(n!==void 0&&!cy(t[e],n)||n===void 0&&!(e in t))&&aE(t,e,n)},Wve=Function.prototype,Gve=Object.prototype,a5=Wve.toString,zve=Gve.hasOwnProperty,Hve=a5.call(Object),Xve=function(t){if(!nd(t)||Bh(t)!="[object Object]")return!1;var e=dE(t);if(e===null)return!0;var n=zve.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&a5.call(n)==Hve},BD=function(t,e){if((e!=="constructor"||typeof t[e]!="function")&&e!="__proto__")return t[e]},Yve=function(t){return cb(t,cm(t))},qve=function(t,e,n,o,r,i,a){var s=BD(t,n),l=BD(e,n),f=a.get(l);if(f)T2(t,n,f);else{var h=void 0,v=h===void 0;if(v){var b=Ma(l),E=!b&&Jv(l),O=!b&&!E&&db(l);h=l,b||E||O?Ma(s)?h=s:Z4(s)?h=g4(s):E?(v=!1,h=m4(l,!0)):O?(v=!1,h=E4(l,!0)):h=[]:Xve(l)||Yg(l)?(h=s,Yg(s)?h=Yve(s):Xs(s)&&!ub(s)||(h=O4(l))):v=!1}v&&(a.set(l,h),r(h,l,o,i,a),a.delete(l)),T2(t,n,h)}},Kve=function t(e,n,o,r,i){e!==n&&KM(n,(function(a,s){if(i||(i=new Tg),Xs(a))qve(e,n,s,o,t,r,i);else{var l=void 0;l===void 0&&(l=a),T2(e,s,l)}}),cm)},Zve=(function(t){return vE((function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(r--,i):void 0,a&&G_(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var s=n[o];s&&t(e,s,o,i)}return e}))})((function(t,e,n){Kve(t,e,n)})),l5=function(t,e){return t<e},Jve=function(t){return t&&t.length?rT(t,dm,l5):void 0},Qve=function(t,e){return t&&t.length?rT(t,mp(e),l5):void 0},eme=function(){return od.Date.now()},tme=function(t,e,n,o){if(!Xs(t))return t;for(var r=-1,i=(e=pE(e,t)).length,a=i-1,s=t;s!=null&&++r<i;){var l=fb(e[r]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(r!=a){var h=s[l];(f=void 0)==void 0&&(f=Xs(h)?h:sE(e[r+1])?[]:{})}lE(s,l,f),s=s[l]}return t},nme=function(t,e,n){for(var o=-1,r=e.length,i={};++o<r;){var a=e[o],s=hE(t,a);n(s,a)&&tme(i,pE(a,t),s)}return i},rme=function(t,e){return nme(t,e,(function(n,o){return I4(t,o)}))},ome=(function(t){return q4(Y4(t,void 0,i5),t+"")})((function(t,e){return t==null?{}:rme(t,e)})),ime=Math.ceil,ame=Math.max,lme=function(t,e,n,o){for(var r=-1,i=ame(ime((e-t)/(n||1)),0),a=Array(i);i--;)a[++r]=t,t+=n;return a},sme=(function(t){return function(e,n,o){return o&&typeof o!="number"&&G_(e,n,o)&&(n=o=void 0),e=lw(e),n===void 0?(n=e,e=0):n=lw(n),o=o===void 0?e<n?1:-1:lw(o),lme(e,n,o)}})(),ume=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},cme=function(t,e){if(t!==e){var n=t!==void 0,o=t===null,r=t==t,i=em(t),a=e!==void 0,s=e===null,l=e==e,f=em(e);if(!s&&!f&&!i&&t>e||i&&a&&l&&!s&&!f||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!f&&t<e||f&&n&&r&&!o&&!i||s&&n&&r||!a&&r||!l)return-1}return 0},dme=function(t,e,n){for(var o=-1,r=t.criteria,i=e.criteria,a=r.length,s=n.length;++o<a;){var l=cme(r[o],i[o]);if(l)return o>=s?l:l*(n[o]=="desc"?-1:1)}return t.index-e.index},fme=function(t,e,n){e=e.length?Ng(e,(function(i){return Ma(i)?function(a){return hE(a,i.length===1?i[0]:i)}:i})):[dm];var o=-1;e=Ng(e,uE(mp));var r=V4(t,(function(i,a,s){return{criteria:Ng(e,(function(l){return l(i)})),index:++o,value:i}}));return ume(r,(function(i,a){return dme(i,a,n)}))},pme=vE((function(t,e){if(t==null)return[];var n=e.length;return n>1&&G_(t,e[0],e[1])?e=[]:n>2&&G_(e[0],e[1],e[2])&&(e=[e[0]]),fme(t,tT(e),[])})),hme=0,vme=function(t){var e=++hme;return j4(t)+e},mme=function(t,e,n){for(var o=-1,r=t.length,i=e.length,a={};++o<r;){var s=o<i?e[o]:void 0;n(a,t[o],s)}return a},O1,gme=function(t,e){return mme(t||[],e||[],lE)};try{O1={cloneDeep:Sve,constant:qM,defaults:Mve,each:T4,filter:B4,find:Ive,flatten:i5,forEach:M4,forIn:Fve,has:$4,isUndefined:U4,last:Bve,map:W4,mapValues:$ve,max:Vve,merge:Zve,min:Jve,minBy:Qve,now:eme,pick:ome,range:sme,reduce:G4,sortBy:pme,uniqueId:vme,values:J4,zipObject:gme}}catch{}O1||(O1=window._);var yme=O1;nf.Graph;yme.constant(1);nf.Graph;nf.Graph;nf.alg.preorder;nf.alg.postorder;nf.Graph;nf.Graph;nf.Graph;nf.Graph;nf.Graph;var GS,$D;function _me(){if($D)return GS;$D=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return GS=e,GS}var zS,UD;function bme(){if(UD)return zS;UD=1;var t=F2(),e=_me(),n=B2(),o="[object Arguments]",r="[object Array]",i="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",h="[object Number]",v="[object Object]",b="[object RegExp]",E="[object Set]",O="[object String]",w="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",T="[object Float32Array]",$="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",I="[object Uint8ClampedArray]",V="[object Uint16Array]",z="[object Uint32Array]",X={};X[T]=X[$]=X[D]=X[P]=X[B]=X[F]=X[I]=X[V]=X[z]=!0,X[o]=X[r]=X[S]=X[i]=X[M]=X[a]=X[s]=X[l]=X[f]=X[h]=X[v]=X[b]=X[E]=X[O]=X[w]=!1;function Y(W){return n(W)&&e(W.length)&&!!X[t(W)]}return zS=Y,zS}var HS,VD;function wme(){if(VD)return HS;VD=1;function t(e){return function(n){return e(n)}}return HS=t,HS}var Jy={exports:{}};Jy.exports;var WD;function Eme(){return WD||(WD=1,(function(t,e){var n=m9(),o=e&&!e.nodeType&&e,r=o&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===o,a=i&&n.process,s=(function(){try{var l=r&&r.require&&r.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();t.exports=s})(Jy,Jy.exports)),Jy.exports}var XS,GD;function xme(){if(GD)return XS;GD=1;var t=bme(),e=wme(),n=Eme(),o=n&&n.isTypedArray,r=o?e(o):t;return XS=r,XS}xme();var YS,zD;function Ome(){if(zD)return YS;zD=1;var t=F2(),e=B2(),n="[object Number]";function o(r){return typeof r=="number"||e(r)&&t(r)==n}return YS=o,YS}Ome();var qS={exports:{}},KS={exports:{}},HD;function s5(){return HD||(HD=1,(function(t){function e(n,o){this.v=n,this.k=o}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(KS)),KS.exports}var ZS={exports:{}},JS={exports:{}},XD;function u5(){return XD||(XD=1,(function(t){function e(n,o,r,i){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}t.exports=e=function(l,f,h,v){function b(E,O){e(l,E,function(w){return this._invoke(E,O,w)})}f?a?a(l,f,{value:h,enumerable:!v,configurable:!v,writable:!v}):l[f]=h:(b("next",0),b("throw",1),b("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,r,i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(JS)),JS.exports}var YD;function c5(){return YD||(YD=1,(function(t){var e=u5();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var o,r,i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function l(S,M,T,$){var D=M&&M.prototype instanceof h?M:h,P=Object.create(D.prototype);return e(P,"_invoke",(function(B,F,I){var V,z,X,Y=0,W=I||[],Q=!1,J={p:0,n:0,v:o,a:ie,f:ie.bind(o,4),d:function(Ae,Pe){return V=Ae,z=0,X=o,J.n=Pe,f}};function ie(Se,Ae){for(z=Se,X=Ae,r=0;!Q&&Y&&!Pe&&r<W.length;r++){var Pe,De=W[r],ze=J.p,Ye=De[2];Se>3?(Pe=Ye===Ae)&&(X=De[(z=De[4])?5:(z=3,3)],De[4]=De[5]=o):De[0]<=ze&&((Pe=Se<2&&ze<De[1])?(z=0,J.v=Ae,J.n=De[1]):ze<Ye&&(Pe=Se<3||De[0]>Ae||Ae>Ye)&&(De[4]=Se,De[5]=Ae,J.n=Ye,z=0))}if(Pe||Se>1)return f;throw Q=!0,Ae}return function(Se,Ae,Pe){if(Y>1)throw TypeError("Generator is already running");for(Q&&Ae===1&&ie(Ae,Pe),z=Ae,X=Pe;(r=z<2?o:X)||!Q;){V||(z?z<3?(z>1&&(J.n=-1),ie(z,X)):J.n=X:J.v=X);try{if(Y=2,V){if(z||(Se="next"),r=V[Se]){if(!(r=r.call(V,X)))throw TypeError("iterator result is not an object");if(!r.done)return r;X=r.value,z<2&&(z=0)}else z===1&&(r=V.return)&&r.call(V),z<2&&(X=TypeError("The iterator does not provide a '"+Se+"' method"),z=1);V=o}else if((r=(Q=J.n<0)?X:B.call(F,J))!==f)break}catch(De){V=o,z=1,X=De}finally{Y=1}}return{value:r,done:Q}}})(S,T,$),!0),P}var f={};function h(){}function v(){}function b(){}r=Object.getPrototypeOf;var E=[][a]?r(r([][a]())):(e(r={},a,function(){return this}),r),O=b.prototype=h.prototype=Object.create(E);function w(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,b):(S.__proto__=b,e(S,s,"GeneratorFunction")),S.prototype=Object.create(O),S}return v.prototype=b,e(O,"constructor",b),e(b,"constructor",v),v.displayName="GeneratorFunction",e(b,s,"GeneratorFunction"),e(O),e(O,s,"Generator"),e(O,a,function(){return this}),e(O,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m:w}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(ZS)),ZS.exports}var QS={exports:{}},eA={exports:{}},tA={exports:{}},qD;function d5(){return qD||(qD=1,(function(t){var e=s5(),n=u5();function o(r,i){function a(l,f,h,v){try{var b=r[l](f),E=b.value;return E instanceof e?i.resolve(E.v).then(function(O){a("next",O,h,v)},function(O){a("throw",O,h,v)}):i.resolve(E).then(function(O){b.value=O,h(b)},function(O){return a("throw",O,h,v)})}catch(O){v(O)}}var s;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(l,f,h){function v(){return new i(function(b,E){a(l,h,b,E)})}return s=s?s.then(v,v):v()},!0)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(tA)),tA.exports}var KD;function f5(){return KD||(KD=1,(function(t){var e=c5(),n=d5();function o(r,i,a,s,l){return new n(e().w(r,i,a,s),l||Promise)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(eA)),eA.exports}var ZD;function Sme(){return ZD||(ZD=1,(function(t){var e=f5();function n(o,r,i,a,s){var l=e(o,r,i,a,s);return l.next().then(function(f){return f.done?f.value:l.next()})}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(QS)),QS.exports}var nA={exports:{}},JD;function Ame(){return JD||(JD=1,(function(t){function e(n){var o=Object(n),r=[];for(var i in o)r.unshift(i);return function a(){for(;r.length;)if((i=r.pop())in o)return a.value=i,a.done=!1,a;return a.done=!0,a}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(nA)),nA.exports}var rA={exports:{}},oA={exports:{}},QD;function Mme(){return QD||(QD=1,(function(t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(oA)),oA.exports}var ej;function Tme(){return ej||(ej=1,(function(t){var e=Mme().default;function n(o){if(o!=null){var r=o[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length))return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}throw new TypeError(e(o)+" is not iterable")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(rA)),rA.exports}var tj;function Cme(){return tj||(tj=1,(function(t){var e=s5(),n=c5(),o=Sme(),r=f5(),i=d5(),a=Ame(),s=Tme();function l(){var f=n(),h=f.m(l),v=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function b(w){var S=typeof w=="function"&&w.constructor;return!!S&&(S===v||(S.displayName||S.name)==="GeneratorFunction")}var E={throw:1,return:2,break:3,continue:3};function O(w){var S,M;return function(T){S||(S={stop:function(){return M(T.a,2)},catch:function(){return T.v},abrupt:function(D,P){return M(T.a,E[D],P)},delegateYield:function(D,P,B){return S.resultName=P,M(T.d,s(D),B)},finish:function(D){return M(T.f,D)}},M=function(D,P,B){T.p=S.prev,T.n=S.next;try{return D(P,B)}finally{S.next=T.n}}),S.resultName&&(S[S.resultName]=T.v,S.resultName=void 0),S.sent=T.v,S.next=T.n;try{return w.call(this,S)}finally{T.p=S.prev,T.n=S.next}}}return(t.exports=l=function(){return{wrap:function(M,T,$,D){return f.w(O(M),T,$,D&&D.reverse())},isGeneratorFunction:b,mark:f.m,awrap:function(M,T){return new e(M,T)},AsyncIterator:i,async:function(M,T,$,D,P){return(b(T)?r:o)(O(M),T,$,D,P)},keys:a,values:s}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports})(qS)),qS.exports}var iA,nj;function Nme(){if(nj)return iA;nj=1;var t=Cme()();iA=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return iA}Nme();var jn;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(jn||(jn={}));var rj;(function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"})(rj||(rj={}));var oj;(function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"})(oj||(oj={}));var ij;(function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"})(ij||(ij={}));var aj;(function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"})(aj||(aj={}));var sw={exports:{}},kme=sw.exports,lj;function Pme(){return lj||(lj=1,(function(t,e){(function(n,o){t.exports=o()})(kme,(function(){var n=function(K){return K instanceof Uint8Array||K instanceof Uint16Array||K instanceof Uint32Array||K instanceof Int8Array||K instanceof Int16Array||K instanceof Int32Array||K instanceof Float32Array||K instanceof Float64Array||K instanceof Uint8ClampedArray},o=function(K,me){for(var Ie=Object.keys(me),wt=0;wt<Ie.length;++wt)K[Ie[wt]]=me[Ie[wt]];return K},r=`
|
||
`;function i(K){return typeof atob<"u"?atob(K):"base64:"+K}function a(K){var me=new Error("(regl) "+K);throw console.error(me),me}function s(K,me){K||a(me)}function l(K){return K?": "+K:""}function f(K,me,Ie){K in me||a("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(me).join())}function h(K,me){n(K)||a("invalid parameter type"+l(me)+". must be a typed array")}function v(K,me){switch(me){case"number":return typeof K=="number";case"object":return typeof K=="object";case"string":return typeof K=="string";case"boolean":return typeof K=="boolean";case"function":return typeof K=="function";case"undefined":return typeof K>"u";case"symbol":return typeof K=="symbol"}}function b(K,me,Ie){v(K,me)||a("invalid parameter type"+l(Ie)+". expected "+me+", got "+typeof K)}function E(K,me){K>=0&&(K|0)===K||a("invalid parameter type, ("+K+")"+l(me)+". must be a nonnegative integer")}function O(K,me,Ie){me.indexOf(K)<0&&a("invalid value"+l(Ie)+". must be one of: "+me)}var w=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function S(K){Object.keys(K).forEach(function(me){w.indexOf(me)<0&&a('invalid regl constructor argument "'+me+'". must be one of '+w)})}function M(K,me){for(K=K+"";K.length<me;)K=" "+K;return K}function T(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function $(K,me){this.number=K,this.line=me,this.errors=[]}function D(K,me,Ie){this.file=K,this.line=me,this.message=Ie}function P(){var K=new Error,me=(K.stack||K).toString(),Ie=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(me);return wt?wt[1]:"unknown"}function B(){var K=new Error,me=(K.stack||K).toString(),Ie=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(me);return wt?wt[1]:"unknown"}function F(K,me){var Ie=K.split(`
|
||
`),wt=1,Dt=0,yt={unknown:new T,0:new T};yt.unknown.name=yt[0].name=me||P(),yt.unknown.lines.push(new $(0,""));for(var Nt=0;Nt<Ie.length;++Nt){var tn=Ie[Nt],sn=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(tn);if(sn)switch(sn[1]){case"line":var nn=/(\d+)(\s+\d+)?/.exec(sn[2]);nn&&(wt=nn[1]|0,nn[2]&&(Dt=nn[2]|0,Dt in yt||(yt[Dt]=new T)));break;case"define":var Mt=/SHADER_NAME(_B64)?\s+(.*)$/.exec(sn[2]);Mt&&(yt[Dt].name=Mt[1]?i(Mt[2]):Mt[2]);break}yt[Dt].lines.push(new $(wt++,tn))}return Object.keys(yt).forEach(function(wn){var pn=yt[wn];pn.lines.forEach(function(rn){pn.index[rn.number]=rn})}),yt}function I(K){var me=[];return K.split(`
|
||
`).forEach(function(Ie){if(!(Ie.length<5)){var wt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Ie);wt?me.push(new D(wt[1]|0,wt[2]|0,wt[3].trim())):Ie.length>0&&me.push(new D("unknown",0,Ie))}}),me}function V(K,me){me.forEach(function(Ie){var wt=K[Ie.file];if(wt){var Dt=wt.index[Ie.line];if(Dt){Dt.errors.push(Ie),wt.hasErrors=!0;return}}K.unknown.hasErrors=!0,K.unknown.lines[0].errors.push(Ie)})}function z(K,me,Ie,wt,Dt){if(!K.getShaderParameter(me,K.COMPILE_STATUS)){var yt=K.getShaderInfoLog(me),Nt=wt===K.FRAGMENT_SHADER?"fragment":"vertex";Se(Ie,"string",Nt+" shader source must be a string",Dt);var tn=F(Ie,Dt),sn=I(yt);V(tn,sn),Object.keys(tn).forEach(function(nn){var Mt=tn[nn];if(!Mt.hasErrors)return;var wn=[""],pn=[""];function rn(Wt,st){wn.push(Wt),pn.push(st||"")}rn("file number "+nn+": "+Mt.name+`
|
||
`,"color:red;text-decoration:underline;font-weight:bold"),Mt.lines.forEach(function(Wt){if(Wt.errors.length>0){rn(M(Wt.number,4)+"| ","background-color:yellow; font-weight:bold"),rn(Wt.line+r,"color:red; background-color:yellow; font-weight:bold");var st=0;Wt.errors.forEach(function(St){var ln=St.message,An=/^\s*'(.*)'\s*:\s*(.*)$/.exec(ln);if(An){var Xt=An[1];switch(ln=An[2],Xt){case"assign":Xt="=";break}st=Math.max(Wt.line.indexOf(Xt,st),0)}else st=0;rn(M("| ",6)),rn(M("^^^",st+3)+r,"font-weight:bold"),rn(M("| ",6)),rn(ln+r,"font-weight:bold")}),rn(M("| ",6)+r)}else rn(M(Wt.number,4)+"| "),rn(Wt.line+r,"color:red")}),typeof document<"u"&&!window.chrome?(pn[0]=wn.join("%c"),console.log.apply(console,pn)):console.log(wn.join(""))}),s.raise("Error compiling "+Nt+" shader, "+tn[0].name)}}function X(K,me,Ie,wt,Dt){if(!K.getProgramParameter(me,K.LINK_STATUS)){var yt=K.getProgramInfoLog(me),Nt=F(Ie,Dt),tn=F(wt,Dt),sn='Error linking program with vertex shader, "'+tn[0].name+'", and fragment shader "'+Nt[0].name+'"';typeof document<"u"?console.log("%c"+sn+r+"%c"+yt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(sn+r+yt),s.raise(sn)}}function Y(K){K._commandRef=P()}function W(K,me,Ie,wt){Y(K);function Dt(sn){return sn?wt.id(sn):0}K._fragId=Dt(K.static.frag),K._vertId=Dt(K.static.vert);function yt(sn,nn){Object.keys(nn).forEach(function(Mt){sn[wt.id(Mt)]=!0})}var Nt=K._uniformSet={};yt(Nt,me.static),yt(Nt,me.dynamic);var tn=K._attributeSet={};yt(tn,Ie.static),yt(tn,Ie.dynamic),K._hasCount="count"in K.static||"count"in K.dynamic||"elements"in K.static||"elements"in K.dynamic}function Q(K,me){var Ie=B();a(K+" in command "+(me||P())+(Ie==="unknown"?"":" called from "+Ie))}function J(K,me,Ie){K||Q(me,Ie||P())}function ie(K,me,Ie,wt){K in me||Q("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(me).join(),wt||P())}function Se(K,me,Ie,wt){v(K,me)||Q("invalid parameter type"+l(Ie)+". expected "+me+", got "+typeof K,wt||P())}function Ae(K){K()}function Pe(K,me,Ie){K.texture?O(K.texture._texture.internalformat,me,"unsupported texture format for attachment"):O(K.renderbuffer._renderbuffer.format,Ie,"unsupported renderbuffer format for attachment")}var De=33071,ze=9728,Ye=9984,Be=9985,Je=9986,gt=9987,le=5120,Ze=5121,pe=5122,se=5123,we=5124,$e=5125,rt=5126,pt=32819,Lt=32820,Jt=33635,en=34042,zt=36193,it={};it[le]=it[Ze]=1,it[pe]=it[se]=it[zt]=it[Jt]=it[pt]=it[Lt]=2,it[we]=it[$e]=it[rt]=it[en]=4;function ae(K,me){return K===Lt||K===pt||K===Jt?2:K===en?4:it[K]*me}function re(K){return!(K&K-1)&&!!K}function je(K,me,Ie){var wt,Dt=me.width,yt=me.height,Nt=me.channels;s(Dt>0&&Dt<=Ie.maxTextureSize&&yt>0&&yt<=Ie.maxTextureSize,"invalid texture shape"),(K.wrapS!==De||K.wrapT!==De)&&s(re(Dt)&&re(yt),"incompatible wrap mode for texture, both width and height must be power of 2"),me.mipmask===1?Dt!==1&&yt!==1&&s(K.minFilter!==Ye&&K.minFilter!==Je&&K.minFilter!==Be&&K.minFilter!==gt,"min filter requires mipmap"):(s(re(Dt)&&re(yt),"texture must be a square power of 2 to support mipmapping"),s(me.mipmask===(Dt<<1)-1,"missing or incomplete mipmap data")),me.type===rt&&(Ie.extensions.indexOf("oes_texture_float_linear")<0&&s(K.minFilter===ze&&K.magFilter===ze,"filter not supported, must enable oes_texture_float_linear"),s(!K.genMipmaps,"mipmap generation not supported with float textures"));var tn=me.images;for(wt=0;wt<16;++wt)if(tn[wt]){var sn=Dt>>wt,nn=yt>>wt;s(me.mipmask&1<<wt,"missing mipmap data");var Mt=tn[wt];if(s(Mt.width===sn&&Mt.height===nn,"invalid shape for mip images"),s(Mt.format===me.format&&Mt.internalformat===me.internalformat&&Mt.type===me.type,"incompatible type for mip image"),!Mt.compressed)if(Mt.data){var wn=Math.ceil(ae(Mt.type,Nt)*sn/Mt.unpackAlignment)*Mt.unpackAlignment;s(Mt.data.byteLength===wn*nn,"invalid data for image, buffer size is inconsistent with image format")}else Mt.element||Mt.copy}else K.genMipmaps||s((me.mipmask&1<<wt)===0,"extra mipmap data");me.compressed&&s(!K.genMipmaps,"mipmap generation for compressed images not supported")}function vt(K,me,Ie,wt){var Dt=K.width,yt=K.height,Nt=K.channels;s(Dt>0&&Dt<=wt.maxTextureSize&&yt>0&&yt<=wt.maxTextureSize,"invalid texture shape"),s(Dt===yt,"cube map must be square"),s(me.wrapS===De&&me.wrapT===De,"wrap mode not supported by cube map");for(var tn=0;tn<Ie.length;++tn){var sn=Ie[tn];s(sn.width===Dt&&sn.height===yt,"inconsistent cube map face shape"),me.genMipmaps&&(s(!sn.compressed,"can not generate mipmap for compressed textures"),s(sn.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var nn=sn.images,Mt=0;Mt<16;++Mt){var wn=nn[Mt];if(wn){var pn=Dt>>Mt,rn=yt>>Mt;s(sn.mipmask&1<<Mt,"missing mipmap data"),s(wn.width===pn&&wn.height===rn,"invalid shape for mip images"),s(wn.format===K.format&&wn.internalformat===K.internalformat&&wn.type===K.type,"incompatible type for mip image"),wn.compressed||(wn.data?s(wn.data.byteLength===pn*rn*Math.max(ae(wn.type,Nt),wn.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):wn.element||wn.copy)}}}}var q=o(s,{optional:Ae,raise:a,commandRaise:Q,command:J,parameter:f,commandParameter:ie,constructor:S,type:b,commandType:Se,isTypedArray:h,nni:E,oneOf:O,shaderError:z,linkError:X,callSite:B,saveCommandRef:Y,saveDrawInfo:W,framebufferFormat:Pe,guessCommand:P,texture2D:je,textureCube:vt}),kt=0,Rt=0,Gt=5,Pn=6;function qt(K,me){this.id=kt++,this.type=K,this.data=me}function On(K){return K.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ke(K){if(K.length===0)return[];var me=K.charAt(0),Ie=K.charAt(K.length-1);if(K.length>1&&me===Ie&&(me==='"'||me==="'"))return['"'+On(K.substr(1,K.length-2))+'"'];var wt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(wt)return ke(K.substr(0,wt.index)).concat(ke(wt[1])).concat(ke(K.substr(wt.index+wt[0].length)));var Dt=K.split(".");if(Dt.length===1)return['"'+On(K)+'"'];for(var yt=[],Nt=0;Nt<Dt.length;++Nt)yt=yt.concat(ke(Dt[Nt]));return yt}function Ke(K){return"["+ke(K).join("][")+"]"}function Le(K,me){return new qt(K,Ke(me+""))}function dt(K){return typeof K=="function"&&!K._reglType||K instanceof qt}function At(K,me){if(typeof K=="function")return new qt(Rt,K);if(typeof K=="number"||typeof K=="boolean")return new qt(Gt,K);if(Array.isArray(K))return new qt(Pn,K.map((Ie,wt)=>At(Ie,me+"["+wt+"]")));if(K instanceof qt)return K;q(!1,"invalid option type in uniform "+me)}var Tt={DynamicVariable:qt,define:Le,isDynamic:dt,unbox:At,accessor:Ke},En={next:typeof requestAnimationFrame=="function"?function(K){return requestAnimationFrame(K)}:function(K){return setTimeout(K,16)},cancel:typeof cancelAnimationFrame=="function"?function(K){return cancelAnimationFrame(K)}:clearTimeout},Zn=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ao(){var K={"":0},me=[""];return{id:function(Ie){var wt=K[Ie];return wt||(wt=K[Ie]=me.length,me.push(Ie),wt)},str:function(Ie){return me[Ie]}}}function Lo(K,me,Ie){var wt=document.createElement("canvas");o(wt.style,{border:0,margin:0,padding:0,top:0,left:0}),K.appendChild(wt),K===document.body&&(wt.style.position="absolute",o(K.style,{margin:0,padding:0}));function Dt(){var tn=window.innerWidth,sn=window.innerHeight;if(K!==document.body){var nn=K.getBoundingClientRect();tn=nn.right-nn.left,sn=nn.bottom-nn.top}wt.width=Ie*tn,wt.height=Ie*sn,o(wt.style,{width:tn+"px",height:sn+"px"})}var yt;K!==document.body&&typeof ResizeObserver=="function"?(yt=new ResizeObserver(function(){setTimeout(Dt)}),yt.observe(K)):window.addEventListener("resize",Dt,!1);function Nt(){yt?yt.disconnect():window.removeEventListener("resize",Dt),K.removeChild(wt)}return Dt(),{canvas:wt,onDestroy:Nt}}function yo(K,me){function Ie(wt){try{return K.getContext(wt,me)}catch{return null}}return Ie("webgl")||Ie("experimental-webgl")||Ie("webgl-experimental")}function ho(K){return typeof K.nodeName=="string"&&typeof K.appendChild=="function"&&typeof K.getBoundingClientRect=="function"}function Nn(K){return typeof K.drawArrays=="function"||typeof K.drawElements=="function"}function qn(K){return typeof K=="string"?K.split():(q(Array.isArray(K),"invalid extension array"),K)}function rr(K){return typeof K=="string"?(q(typeof document<"u","not supported outside of DOM"),document.querySelector(K)):K}function ut(K){var me=K||{},Ie,wt,Dt,yt,Nt={},tn=[],sn=[],nn=typeof window>"u"?1:window.devicePixelRatio,Mt=!1,wn=function(Wt){Wt&&q.raise(Wt)},pn=function(){};if(typeof me=="string"?(q(typeof document<"u","selector queries only supported in DOM enviroments"),Ie=document.querySelector(me),q(Ie,"invalid query string for element")):typeof me=="object"?ho(me)?Ie=me:Nn(me)?(yt=me,Dt=yt.canvas):(q.constructor(me),"gl"in me?yt=me.gl:"canvas"in me?Dt=rr(me.canvas):"container"in me&&(wt=rr(me.container)),"attributes"in me&&(Nt=me.attributes,q.type(Nt,"object","invalid context attributes")),"extensions"in me&&(tn=qn(me.extensions)),"optionalExtensions"in me&&(sn=qn(me.optionalExtensions)),"onDone"in me&&(q.type(me.onDone,"function","invalid or missing onDone callback"),wn=me.onDone),"profile"in me&&(Mt=!!me.profile),"pixelRatio"in me&&(nn=+me.pixelRatio,q(nn>0,"invalid pixel ratio"))):q.raise("invalid arguments to regl"),Ie&&(Ie.nodeName.toLowerCase()==="canvas"?Dt=Ie:wt=Ie),!yt){if(!Dt){q(typeof document<"u","must manually specify webgl context outside of DOM environments");var rn=Lo(wt||document.body,wn,nn);if(!rn)return null;Dt=rn.canvas,pn=rn.onDestroy}Nt.premultipliedAlpha===void 0&&(Nt.premultipliedAlpha=!0),yt=yo(Dt,Nt)}return yt?{gl:yt,canvas:Dt,container:wt,extensions:tn,optionalExtensions:sn,pixelRatio:nn,profile:Mt,onDone:wn,onDestroy:pn}:(pn(),wn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function vn(K,me){var Ie={};function wt(Nt){q.type(Nt,"string","extension name must be string");var tn=Nt.toLowerCase(),sn;try{sn=Ie[tn]=K.getExtension(tn)}catch{}return!!sn}for(var Dt=0;Dt<me.extensions.length;++Dt){var yt=me.extensions[Dt];if(!wt(yt))return me.onDestroy(),me.onDone('"'+yt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return me.optionalExtensions.forEach(wt),{extensions:Ie,restore:function(){Object.keys(Ie).forEach(function(Nt){if(Ie[Nt]&&!wt(Nt))throw new Error("(regl): error restoring extension "+Nt)})}}}function In(K,me){for(var Ie=Array(K),wt=0;wt<K;++wt)Ie[wt]=me(wt);return Ie}var sr=5120,wo=5121,oo=5122,ta=5123,Ca=5124,Yi=5125,fa=5126;function Ka(K){for(var me=16;me<=1<<28;me*=16)if(K<=me)return me;return 0}function Sn(K){var me,Ie;return me=(K>65535)<<4,K>>>=me,Ie=(K>255)<<3,K>>>=Ie,me|=Ie,Ie=(K>15)<<2,K>>>=Ie,me|=Ie,Ie=(K>3)<<1,K>>>=Ie,me|=Ie,me|K>>1}function Ts(){var K=In(8,function(){return[]});function me(yt){var Nt=Ka(yt),tn=K[Sn(Nt)>>2];return tn.length>0?tn.pop():new ArrayBuffer(Nt)}function Ie(yt){K[Sn(yt.byteLength)>>2].push(yt)}function wt(yt,Nt){var tn=null;switch(yt){case sr:tn=new Int8Array(me(Nt),0,Nt);break;case wo:tn=new Uint8Array(me(Nt),0,Nt);break;case oo:tn=new Int16Array(me(2*Nt),0,Nt);break;case ta:tn=new Uint16Array(me(2*Nt),0,Nt);break;case Ca:tn=new Int32Array(me(4*Nt),0,Nt);break;case Yi:tn=new Uint32Array(me(4*Nt),0,Nt);break;case fa:tn=new Float32Array(me(4*Nt),0,Nt);break;default:return null}return tn.length!==Nt?tn.subarray(0,Nt):tn}function Dt(yt){Ie(yt.buffer)}return{alloc:me,free:Ie,allocType:wt,freeType:Dt}}var Oo=Ts();Oo.zero=Ts();var es=3408,Ui=3410,gr=3411,gl=3412,pa=3413,qi=3414,Na=3415,al=33901,yl=33902,Cs=3379,_l=3386,ts=34921,ve=36347,mt=36348,cn=35661,Kn=35660,br=34930,so=36349,si=34076,ye=34024,ht=7936,fn=7937,Rn=7938,Cn=35724,nr=34047,Mn=36063,or=34852,lr=3553,qr=34067,na=34069,vi=33984,bl=6408,Vi=5126,Ns=5121,Fl=36160,Ro=36053,La=36064,id=16384,_u=function(K,me){var Ie=1;me.ext_texture_filter_anisotropic&&(Ie=K.getParameter(nr));var wt=1,Dt=1;me.webgl_draw_buffers&&(wt=K.getParameter(or),Dt=K.getParameter(Mn));var yt=!!me.oes_texture_float;if(yt){var Nt=K.createTexture();K.bindTexture(lr,Nt),K.texImage2D(lr,0,bl,1,1,0,bl,Vi,null);var tn=K.createFramebuffer();if(K.bindFramebuffer(Fl,tn),K.framebufferTexture2D(Fl,La,lr,Nt,0),K.bindTexture(lr,null),K.checkFramebufferStatus(Fl)!==Ro)yt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(id);var sn=Oo.allocType(Vi,4);K.readPixels(0,0,1,1,bl,Vi,sn),K.getError()?yt=!1:(K.deleteFramebuffer(tn),K.deleteTexture(Nt),yt=sn[0]===1),Oo.freeType(sn)}}var nn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Mt=!0;if(!nn){var wn=K.createTexture(),pn=Oo.allocType(Ns,36);K.activeTexture(vi),K.bindTexture(qr,wn),K.texImage2D(na,0,bl,3,3,0,bl,Ns,pn),Oo.freeType(pn),K.bindTexture(qr,null),K.deleteTexture(wn),Mt=!K.getError()}return{colorBits:[K.getParameter(Ui),K.getParameter(gr),K.getParameter(gl),K.getParameter(pa)],depthBits:K.getParameter(qi),stencilBits:K.getParameter(Na),subpixelBits:K.getParameter(es),extensions:Object.keys(me).filter(function(rn){return!!me[rn]}),maxAnisotropic:Ie,maxDrawbuffers:wt,maxColorAttachments:Dt,pointSizeDims:K.getParameter(al),lineWidthDims:K.getParameter(yl),maxViewportDims:K.getParameter(_l),maxCombinedTextureUnits:K.getParameter(cn),maxCubeMapSize:K.getParameter(si),maxRenderbufferSize:K.getParameter(ye),maxTextureUnits:K.getParameter(br),maxTextureSize:K.getParameter(Cs),maxAttributes:K.getParameter(ts),maxVertexUniforms:K.getParameter(ve),maxVertexTextureUnits:K.getParameter(Kn),maxVaryingVectors:K.getParameter(mt),maxFragmentUniforms:K.getParameter(so),glsl:K.getParameter(Cn),renderer:K.getParameter(fn),vendor:K.getParameter(ht),version:K.getParameter(Rn),readFloat:yt,npotTextureCube:Mt}};function Ia(K){return!!K&&typeof K=="object"&&Array.isArray(K.shape)&&Array.isArray(K.stride)&&typeof K.offset=="number"&&K.shape.length===K.stride.length&&(Array.isArray(K.data)||n(K.data))}var ra=function(K){return Object.keys(K).map(function(me){return K[me]})},wl={shape:Ba,flatten:yp};function qo(K,me,Ie){for(var wt=0;wt<me;++wt)Ie[wt]=K[wt]}function Uh(K,me,Ie,wt){for(var Dt=0,yt=0;yt<me;++yt)for(var Nt=K[yt],tn=0;tn<Ie;++tn)wt[Dt++]=Nt[tn]}function Fa(K,me,Ie,wt,Dt,yt){for(var Nt=yt,tn=0;tn<me;++tn)for(var sn=K[tn],nn=0;nn<Ie;++nn)for(var Mt=sn[nn],wn=0;wn<wt;++wn)Dt[Nt++]=Mt[wn]}function gp(K,me,Ie,wt,Dt){for(var yt=1,Nt=Ie+1;Nt<me.length;++Nt)yt*=me[Nt];var tn=me[Ie];if(me.length-Ie===4){var sn=me[Ie+1],nn=me[Ie+2],Mt=me[Ie+3];for(Nt=0;Nt<tn;++Nt)Fa(K[Nt],sn,nn,Mt,wt,Dt),Dt+=yt}else for(Nt=0;Nt<tn;++Nt)gp(K[Nt],me,Ie+1,wt,Dt),Dt+=yt}function yp(K,me,Ie,wt){var Dt=1;if(me.length)for(var yt=0;yt<me.length;++yt)Dt*=me[yt];else Dt=0;var Nt=wt||Oo.allocType(Ie,Dt);switch(me.length){case 0:break;case 1:qo(K,me[0],Nt);break;case 2:Uh(K,me[0],me[1],Nt);break;case 3:Fa(K,me[0],me[1],me[2],Nt,0);break;default:gp(K,me,0,Nt,0)}return Nt}function Ba(K){for(var me=[],Ie=K;Ie.length;Ie=Ie[0])me.push(Ie.length);return me}var Za={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},rf=5120,Mo=5122,oa=5124,ad=5121,_p=5123,of=5125,ld=5126,ns=5126,$a={int8:rf,int16:Mo,int32:oa,uint8:ad,uint16:_p,uint32:of,float:ld,float32:ns},bu=35048,Ja=35040,El={dynamic:bu,stream:Ja,static:35044},vo=wl.flatten,Ua=wl.shape,Bl=35044,ha=35040,wu=5121,Ks=5126,$l=[];$l[5120]=1,$l[5122]=2,$l[5124]=4,$l[5121]=1,$l[5123]=2,$l[5125]=4,$l[5126]=4;function ui(K){return Za[Object.prototype.toString.call(K)]|0}function lc(K,me){for(var Ie=0;Ie<me.length;++Ie)K[Ie]=me[Ie]}function rs(K,me,Ie,wt,Dt,yt,Nt){for(var tn=0,sn=0;sn<Ie;++sn)for(var nn=0;nn<wt;++nn)K[tn++]=me[Dt*sn+yt*nn+Nt]}function xl(K,me,Ie,wt){var Dt=0,yt={};function Nt(st){this.id=Dt++,this.buffer=K.createBuffer(),this.type=st,this.usage=Bl,this.byteLength=0,this.dimension=1,this.dtype=wu,this.persistentData=null,Ie.profile&&(this.stats={size:0})}Nt.prototype.bind=function(){K.bindBuffer(this.type,this.buffer)},Nt.prototype.destroy=function(){pn(this)};var tn=[];function sn(st,St){var ln=tn.pop();return ln||(ln=new Nt(st)),ln.bind(),wn(ln,St,ha,0,1,!1),ln}function nn(st){tn.push(st)}function Mt(st,St,ln){st.byteLength=St.byteLength,K.bufferData(st.type,St,ln)}function wn(st,St,ln,An,Xt,kn){var Kt;if(st.usage=ln,Array.isArray(St)){if(st.dtype=An||Ks,St.length>0){var _n;if(Array.isArray(St[0])){Kt=Ua(St);for(var Yt=1,xn=1;xn<Kt.length;++xn)Yt*=Kt[xn];st.dimension=Yt,_n=vo(St,Kt,st.dtype),Mt(st,_n,ln),kn?st.persistentData=_n:Oo.freeType(_n)}else if(typeof St[0]=="number"){st.dimension=Xt;var ar=Oo.allocType(st.dtype,St.length);lc(ar,St),Mt(st,ar,ln),kn?st.persistentData=ar:Oo.freeType(ar)}else n(St[0])?(st.dimension=St[0].length,st.dtype=An||ui(St[0])||Ks,_n=vo(St,[St.length,St[0].length],st.dtype),Mt(st,_n,ln),kn?st.persistentData=_n:Oo.freeType(_n)):q.raise("invalid buffer data")}}else if(n(St))st.dtype=An||ui(St),st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St.buffer)));else if(Ia(St)){Kt=St.shape;var xr=St.stride,on=St.offset,Zt=0,Ht=0,fr=0,Dr=0;Kt.length===1?(Zt=Kt[0],Ht=1,fr=xr[0],Dr=0):Kt.length===2?(Zt=Kt[0],Ht=Kt[1],fr=xr[0],Dr=xr[1]):q.raise("invalid shape"),st.dtype=An||ui(St.data)||Ks,st.dimension=Ht;var Un=Oo.allocType(st.dtype,Zt*Ht);rs(Un,St.data,Zt,Ht,fr,Dr,on),Mt(st,Un,ln),kn?st.persistentData=Un:Oo.freeType(Un)}else St instanceof ArrayBuffer?(st.dtype=wu,st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St)))):q.raise("invalid buffer data")}function pn(st){me.bufferCount--,wt(st);var St=st.buffer;q(St,"buffer must not be deleted already"),K.deleteBuffer(St),st.buffer=null,delete yt[st.id]}function rn(st,St,ln,An){me.bufferCount++;var Xt=new Nt(St);yt[Xt.id]=Xt;function kn(Yt){var xn=Bl,ar=null,xr=0,on=0,Zt=1;return Array.isArray(Yt)||n(Yt)||Ia(Yt)||Yt instanceof ArrayBuffer?ar=Yt:typeof Yt=="number"?xr=Yt|0:Yt&&(q.type(Yt,"object","buffer arguments must be an object, a number or an array"),"data"in Yt&&(q(ar===null||Array.isArray(ar)||n(ar)||Ia(ar),"invalid data for buffer"),ar=Yt.data),"usage"in Yt&&(q.parameter(Yt.usage,El,"invalid buffer usage"),xn=El[Yt.usage]),"type"in Yt&&(q.parameter(Yt.type,$a,"invalid buffer type"),on=$a[Yt.type]),"dimension"in Yt&&(q.type(Yt.dimension,"number","invalid dimension"),Zt=Yt.dimension|0),"length"in Yt&&(q.nni(xr,"buffer length must be a nonnegative integer"),xr=Yt.length|0)),Xt.bind(),ar?wn(Xt,ar,xn,on,Zt,An):(xr&&K.bufferData(Xt.type,xr,xn),Xt.dtype=on||wu,Xt.usage=xn,Xt.dimension=Zt,Xt.byteLength=xr),Ie.profile&&(Xt.stats.size=Xt.byteLength*$l[Xt.dtype]),kn}function Kt(Yt,xn){q(xn+Yt.byteLength<=Xt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Yt.byteLength+" starting from offset "+xn+" to a buffer of size "+Xt.byteLength),K.bufferSubData(Xt.type,xn,Yt)}function _n(Yt,xn){var ar=(xn||0)|0,xr;if(Xt.bind(),n(Yt)||Yt instanceof ArrayBuffer)Kt(Yt,ar);else if(Array.isArray(Yt)){if(Yt.length>0)if(typeof Yt[0]=="number"){var on=Oo.allocType(Xt.dtype,Yt.length);lc(on,Yt),Kt(on,ar),Oo.freeType(on)}else if(Array.isArray(Yt[0])||n(Yt[0])){xr=Ua(Yt);var Zt=vo(Yt,xr,Xt.dtype);Kt(Zt,ar),Oo.freeType(Zt)}else q.raise("invalid buffer data")}else if(Ia(Yt)){xr=Yt.shape;var Ht=Yt.stride,fr=0,Dr=0,Un=0,$r=0;xr.length===1?(fr=xr[0],Dr=1,Un=Ht[0],$r=0):xr.length===2?(fr=xr[0],Dr=xr[1],Un=Ht[0],$r=Ht[1]):q.raise("invalid shape");var Or=Array.isArray(Yt.data)?Xt.dtype:ui(Yt.data),Fr=Oo.allocType(Or,fr*Dr);rs(Fr,Yt.data,fr,Dr,Un,$r,Yt.offset),Kt(Fr,ar),Oo.freeType(Fr)}else q.raise("invalid data for buffer subdata");return kn}return ln||kn(st),kn._reglType="buffer",kn._buffer=Xt,kn.subdata=_n,Ie.profile&&(kn.stats=Xt.stats),kn.destroy=function(){pn(Xt)},kn}function Wt(){ra(yt).forEach(function(st){st.buffer=K.createBuffer(),K.bindBuffer(st.type,st.buffer),K.bufferData(st.type,st.persistentData||st.byteLength,st.usage)})}return Ie.profile&&(me.getTotalBufferSize=function(){var st=0;return Object.keys(yt).forEach(function(St){st+=yt[St].stats.size}),st}),{create:rn,createStream:sn,destroyStream:nn,clear:function(){ra(yt).forEach(pn),tn.forEach(pn)},getBuffer:function(st){return st&&st._buffer instanceof Nt?st._buffer:null},restore:Wt,_initBuffer:wn}}var af=0,Vh=0,lf=1,Wi=1,sc=4,os=4,Ki={points:af,point:Vh,lines:lf,line:Wi,triangles:sc,triangle:os,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},sf=0,ll=1,Ol=4,sd=5120,Va=5121,Qa=5122,ia=5123,sl=5124,ka=5125,Ct=34963,un=35040,dn=35044;function Gn(K,me,Ie,wt){var Dt={},yt=0,Nt={uint8:Va,uint16:ia};me.oes_element_index_uint&&(Nt.uint32=ka);function tn(Wt){this.id=yt++,Dt[this.id]=this,this.buffer=Wt,this.primType=Ol,this.vertCount=0,this.type=0}tn.prototype.bind=function(){this.buffer.bind()};var sn=[];function nn(Wt){var st=sn.pop();return st||(st=new tn(Ie.create(null,Ct,!0,!1)._buffer)),wn(st,Wt,un,-1,-1,0,0),st}function Mt(Wt){sn.push(Wt)}function wn(Wt,st,St,ln,An,Xt,kn){Wt.buffer.bind();var Kt;if(st){var _n=kn;!kn&&(!n(st)||Ia(st)&&!n(st.data))&&(_n=me.oes_element_index_uint?ka:ia),Ie._initBuffer(Wt.buffer,st,St,_n,3)}else K.bufferData(Ct,Xt,St),Wt.buffer.dtype=Kt||Va,Wt.buffer.usage=St,Wt.buffer.dimension=3,Wt.buffer.byteLength=Xt;if(Kt=kn,!kn){switch(Wt.buffer.dtype){case Va:case sd:Kt=Va;break;case ia:case Qa:Kt=ia;break;case ka:case sl:Kt=ka;break;default:q.raise("unsupported type for element array")}Wt.buffer.dtype=Kt}Wt.type=Kt,q(Kt!==ka||!!me.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Yt=An;Yt<0&&(Yt=Wt.buffer.byteLength,Kt===ia?Yt>>=1:Kt===ka&&(Yt>>=2)),Wt.vertCount=Yt;var xn=ln;if(ln<0){xn=Ol;var ar=Wt.buffer.dimension;ar===1&&(xn=sf),ar===2&&(xn=ll),ar===3&&(xn=Ol)}Wt.primType=xn}function pn(Wt){wt.elementsCount--,q(Wt.buffer!==null,"must not double destroy elements"),delete Dt[Wt.id],Wt.buffer.destroy(),Wt.buffer=null}function rn(Wt,st){var St=Ie.create(null,Ct,!0),ln=new tn(St._buffer);wt.elementsCount++;function An(Xt){if(!Xt)St(),ln.primType=Ol,ln.vertCount=0,ln.type=Va;else if(typeof Xt=="number")St(Xt),ln.primType=Ol,ln.vertCount=Xt|0,ln.type=Va;else{var kn=null,Kt=dn,_n=-1,Yt=-1,xn=0,ar=0;Array.isArray(Xt)||n(Xt)||Ia(Xt)?kn=Xt:(q.type(Xt,"object","invalid arguments for elements"),"data"in Xt&&(kn=Xt.data,q(Array.isArray(kn)||n(kn)||Ia(kn),"invalid data for element buffer")),"usage"in Xt&&(q.parameter(Xt.usage,El,"invalid element buffer usage"),Kt=El[Xt.usage]),"primitive"in Xt&&(q.parameter(Xt.primitive,Ki,"invalid element buffer primitive"),_n=Ki[Xt.primitive]),"count"in Xt&&(q(typeof Xt.count=="number"&&Xt.count>=0,"invalid vertex count for elements"),Yt=Xt.count|0),"type"in Xt&&(q.parameter(Xt.type,Nt,"invalid buffer type"),ar=Nt[Xt.type]),"length"in Xt?xn=Xt.length|0:(xn=Yt,ar===ia||ar===Qa?xn*=2:(ar===ka||ar===sl)&&(xn*=4))),wn(ln,kn,Kt,_n,Yt,xn,ar)}return An}return An(Wt),An._reglType="elements",An._elements=ln,An.subdata=function(Xt,kn){return St.subdata(Xt,kn),An},An.destroy=function(){pn(ln)},An}return{create:rn,createStream:nn,destroyStream:Mt,getElements:function(Wt){return typeof Wt=="function"&&Wt._elements instanceof tn?Wt._elements:null},clear:function(){ra(Dt).forEach(pn)}}}var Wr=new Float32Array(1),mo=new Uint32Array(Wr.buffer),ci=5123;function R(K){for(var me=Oo.allocType(ci,K.length),Ie=0;Ie<K.length;++Ie)if(isNaN(K[Ie]))me[Ie]=65535;else if(K[Ie]===1/0)me[Ie]=31744;else if(K[Ie]===-1/0)me[Ie]=64512;else{Wr[0]=K[Ie];var wt=mo[0],Dt=wt>>>31<<15,yt=(wt<<1>>>24)-127,Nt=wt>>13&1023;if(yt<-24)me[Ie]=Dt;else if(yt<-14){var tn=-14-yt;me[Ie]=Dt+(Nt+1024>>tn)}else yt>15?me[Ie]=Dt+31744:me[Ie]=Dt+(yt+15<<10)+Nt}return me}function L(K){return Array.isArray(K)||n(K)}var Z=function(K){return!(K&K-1)&&!!K},fe=34467,Re=3553,lt=34067,It=34069,bn=6408,Jn=6406,no=6407,$n=6409,Do=6410,Kr=32854,So=32855,ul=36194,wi=32819,el=32820,ks=33635,Ps=34042,Zs=6402,Eu=34041,is=35904,xu=35906,Zi=36193,Js=33776,Rs=33777,as=33778,ls=33779,uc=35986,fm=35987,pm=34798,Wh=35840,uf=35841,cc=35842,bp=35843,hm=36196,dc=5121,cf=5123,wp=5125,ji=5126,Wa=10242,Ep=10243,xp=10497,ud=33071,dy=33648,cd=10240,dd=10241,df=9728,fc=9729,Ou=9984,fd=9985,ff=9986,Su=9987,fy=33170,pf=4352,py=4353,hy=4354,vm=34046,Op=3317,Pa=37440,mm=37441,he=37443,pc=37444,Qs=33984,Ul=[Ou,ff,fd,Su],go=[0,$n,Do,no,bn],ba={};ba[$n]=ba[Jn]=ba[Zs]=1,ba[Eu]=ba[Do]=2,ba[no]=ba[is]=3,ba[bn]=ba[xu]=4;function To(K){return"[object "+K+"]"}var ss=To("HTMLCanvasElement"),eu=To("OffscreenCanvas"),Sl=To("CanvasRenderingContext2D"),Sp=To("ImageBitmap"),Ap=To("HTMLImageElement"),Gh=To("HTMLVideoElement"),gm=Object.keys(Za).concat([ss,eu,Sl,Sp,Ap,Gh]),tu=[];tu[dc]=1,tu[ji]=4,tu[Zi]=2,tu[cf]=2,tu[wp]=4;var Li=[];Li[Kr]=2,Li[So]=2,Li[ul]=2,Li[Eu]=4,Li[Js]=.5,Li[Rs]=.5,Li[as]=1,Li[ls]=1,Li[uc]=.5,Li[fm]=1,Li[pm]=1,Li[Wh]=.5,Li[uf]=.25,Li[cc]=.5,Li[bp]=.25,Li[hm]=.5;function pd(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function zh(K){if(!Array.isArray(K))return!1;var me=K.length;return!(me===0||!L(K[0]))}function nu(K){return Object.prototype.toString.call(K)}function us(K){return nu(K)===ss}function hf(K){return nu(K)===eu}function Au(K){return nu(K)===Sl}function Al(K){return nu(K)===Sp}function Hh(K){return nu(K)===Ap}function Xh(K){return nu(K)===Gh}function cs(K){if(!K)return!1;var me=nu(K);return gm.indexOf(me)>=0?!0:pd(K)||zh(K)||Ia(K)}function mi(K){return Za[Object.prototype.toString.call(K)]|0}function ym(K,me){var Ie=me.length;switch(K.type){case dc:case cf:case wp:case ji:var wt=Oo.allocType(K.type,Ie);wt.set(me),K.data=wt;break;case Zi:K.data=R(me);break;default:q.raise("unsupported texture type, must specify a typed array")}}function Yh(K,me){return Oo.allocType(K.type===Zi?ji:K.type,me)}function Ii(K,me){K.type===Zi?(K.data=R(me),Oo.freeType(me)):K.data=me}function Io(K,me,Ie,wt,Dt,yt){for(var Nt=K.width,tn=K.height,sn=K.channels,nn=Nt*tn*sn,Mt=Yh(K,nn),wn=0,pn=0;pn<tn;++pn)for(var rn=0;rn<Nt;++rn)for(var Wt=0;Wt<sn;++Wt)Mt[wn++]=me[Ie*rn+wt*pn+Dt*Wt+yt];Ii(K,Mt)}function Ji(K,me,Ie,wt,Dt,yt){var Nt;if(typeof Li[K]<"u"?Nt=Li[K]:Nt=ba[K]*tu[me],yt&&(Nt*=6),Dt){for(var tn=0,sn=Ie;sn>=1;)tn+=Nt*sn*sn,sn/=2;return tn}else return Nt*Ie*wt}function lo(K,me,Ie,wt,Dt,yt,Nt){var tn={"don't care":pf,"dont care":pf,nice:hy,fast:py},sn={repeat:xp,clamp:ud,mirror:dy},nn={nearest:df,linear:fc},Mt=o({mipmap:Su,"nearest mipmap nearest":Ou,"linear mipmap nearest":fd,"nearest mipmap linear":ff,"linear mipmap linear":Su},nn),wn={none:0,browser:pc},pn={uint8:dc,rgba4:wi,rgb565:ks,"rgb5 a1":el},rn={alpha:Jn,luminance:$n,"luminance alpha":Do,rgb:no,rgba:bn,rgba4:Kr,"rgb5 a1":So,rgb565:ul},Wt={};me.ext_srgb&&(rn.srgb=is,rn.srgba=xu),me.oes_texture_float&&(pn.float32=pn.float=ji),me.oes_texture_half_float&&(pn.float16=pn["half float"]=Zi),me.webgl_depth_texture&&(o(rn,{depth:Zs,"depth stencil":Eu}),o(pn,{uint16:cf,uint32:wp,"depth stencil":Ps})),me.webgl_compressed_texture_s3tc&&o(Wt,{"rgb s3tc dxt1":Js,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":as,"rgba s3tc dxt5":ls}),me.webgl_compressed_texture_atc&&o(Wt,{"rgb atc":uc,"rgba atc explicit alpha":fm,"rgba atc interpolated alpha":pm}),me.webgl_compressed_texture_pvrtc&&o(Wt,{"rgb pvrtc 4bppv1":Wh,"rgb pvrtc 2bppv1":uf,"rgba pvrtc 4bppv1":cc,"rgba pvrtc 2bppv1":bp}),me.webgl_compressed_texture_etc1&&(Wt["rgb etc1"]=hm);var st=Array.prototype.slice.call(K.getParameter(fe));Object.keys(Wt).forEach(function(Te){var Et=Wt[Te];st.indexOf(Et)>=0&&(rn[Te]=Et)});var St=Object.keys(rn);Ie.textureFormats=St;var ln=[];Object.keys(rn).forEach(function(Te){var Et=rn[Te];ln[Et]=Te});var An=[];Object.keys(pn).forEach(function(Te){var Et=pn[Te];An[Et]=Te});var Xt=[];Object.keys(nn).forEach(function(Te){var Et=nn[Te];Xt[Et]=Te});var kn=[];Object.keys(Mt).forEach(function(Te){var Et=Mt[Te];kn[Et]=Te});var Kt=[];Object.keys(sn).forEach(function(Te){var Et=sn[Te];Kt[Et]=Te});var _n=St.reduce(function(Te,Et){var _t=rn[Et];return _t===$n||_t===Jn||_t===$n||_t===Do||_t===Zs||_t===Eu||me.ext_srgb&&(_t===is||_t===xu)?Te[_t]=_t:_t===So||Et.indexOf("rgba")>=0?Te[_t]=bn:Te[_t]=no,Te},{});function Yt(){this.internalformat=bn,this.format=bn,this.type=dc,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=pc,this.width=0,this.height=0,this.channels=0}function xn(Te,Et){Te.internalformat=Et.internalformat,Te.format=Et.format,Te.type=Et.type,Te.compressed=Et.compressed,Te.premultiplyAlpha=Et.premultiplyAlpha,Te.flipY=Et.flipY,Te.unpackAlignment=Et.unpackAlignment,Te.colorSpace=Et.colorSpace,Te.width=Et.width,Te.height=Et.height,Te.channels=Et.channels}function ar(Te,Et){if(!(typeof Et!="object"||!Et)){if("premultiplyAlpha"in Et&&(q.type(Et.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Te.premultiplyAlpha=Et.premultiplyAlpha),"flipY"in Et&&(q.type(Et.flipY,"boolean","invalid texture flip"),Te.flipY=Et.flipY),"alignment"in Et&&(q.oneOf(Et.alignment,[1,2,4,8],"invalid texture unpack alignment"),Te.unpackAlignment=Et.alignment),"colorSpace"in Et&&(q.parameter(Et.colorSpace,wn,"invalid colorSpace"),Te.colorSpace=wn[Et.colorSpace]),"type"in Et){var _t=Et.type;q(me.oes_texture_float||!(_t==="float"||_t==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),q(me.oes_texture_half_float||!(_t==="half float"||_t==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),q(me.webgl_depth_texture||!(_t==="uint16"||_t==="uint32"||_t==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),q.parameter(_t,pn,"invalid texture type"),Te.type=pn[_t]}var Ln=Te.width,Gr=Te.height,xe=Te.channels,de=!1;"shape"in Et?(q(Array.isArray(Et.shape)&&Et.shape.length>=2,"shape must be an array"),Ln=Et.shape[0],Gr=Et.shape[1],Et.shape.length===3&&(xe=Et.shape[2],q(xe>0&&xe<=4,"invalid number of channels"),de=!0),q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width"),q(Gr>=0&&Gr<=Ie.maxTextureSize,"invalid height")):("radius"in Et&&(Ln=Gr=Et.radius,q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid radius")),"width"in Et&&(Ln=Et.width,q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width")),"height"in Et&&(Gr=Et.height,q(Gr>=0&&Gr<=Ie.maxTextureSize,"invalid height")),"channels"in Et&&(xe=Et.channels,q(xe>0&&xe<=4,"invalid number of channels"),de=!0)),Te.width=Ln|0,Te.height=Gr|0,Te.channels=xe|0;var We=!1;if("format"in Et){var tt=Et.format;q(me.webgl_depth_texture||!(tt==="depth"||tt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),q.parameter(tt,rn,"invalid texture format");var ct=Te.internalformat=rn[tt];Te.format=_n[ct],tt in pn&&("type"in Et||(Te.type=pn[tt])),tt in Wt&&(Te.compressed=!0),We=!0}!de&&We?Te.channels=ba[Te.format]:de&&!We?Te.channels!==go[Te.format]&&(Te.format=Te.internalformat=go[Te.channels]):We&&de&&q(Te.channels===ba[Te.format],"number of channels inconsistent with specified format")}}function xr(Te){K.pixelStorei(Pa,Te.flipY),K.pixelStorei(mm,Te.premultiplyAlpha),K.pixelStorei(he,Te.colorSpace),K.pixelStorei(Op,Te.unpackAlignment)}function on(){Yt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Zt(Te,Et){var _t=null;if(cs(Et)?_t=Et:Et&&(q.type(Et,"object","invalid pixel data type"),ar(Te,Et),"x"in Et&&(Te.xOffset=Et.x|0),"y"in Et&&(Te.yOffset=Et.y|0),cs(Et.data)&&(_t=Et.data)),q(!Te.compressed||_t instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Et.copy){q(!_t,"can not specify copy and data field for the same texture");var Ln=Dt.viewportWidth,Gr=Dt.viewportHeight;Te.width=Te.width||Ln-Te.xOffset,Te.height=Te.height||Gr-Te.yOffset,Te.needsCopy=!0,q(Te.xOffset>=0&&Te.xOffset<Ln&&Te.yOffset>=0&&Te.yOffset<Gr&&Te.width>0&&Te.width<=Ln&&Te.height>0&&Te.height<=Gr,"copy texture read out of bounds")}else if(!_t)Te.width=Te.width||1,Te.height=Te.height||1,Te.channels=Te.channels||4;else if(n(_t))Te.channels=Te.channels||4,Te.data=_t,!("type"in Et)&&Te.type===dc&&(Te.type=mi(_t));else if(pd(_t))Te.channels=Te.channels||4,ym(Te,_t),Te.alignment=1,Te.needsFree=!0;else if(Ia(_t)){var xe=_t.data;!Array.isArray(xe)&&Te.type===dc&&(Te.type=mi(xe));var de=_t.shape,We=_t.stride,tt,ct,Xe,Ge,Qe,Ee;de.length===3?(Xe=de[2],Ee=We[2]):(q(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Xe=1,Ee=1),tt=de[0],ct=de[1],Ge=We[0],Qe=We[1],Te.alignment=1,Te.width=tt,Te.height=ct,Te.channels=Xe,Te.format=Te.internalformat=go[Xe],Te.needsFree=!0,Io(Te,xe,Ge,Qe,Ee,_t.offset)}else if(us(_t)||hf(_t)||Au(_t))us(_t)||hf(_t)?Te.element=_t:Te.element=_t.canvas,Te.width=Te.element.width,Te.height=Te.element.height,Te.channels=4;else if(Al(_t))Te.element=_t,Te.width=_t.width,Te.height=_t.height,Te.channels=4;else if(Hh(_t))Te.element=_t,Te.width=_t.naturalWidth,Te.height=_t.naturalHeight,Te.channels=4;else if(Xh(_t))Te.element=_t,Te.width=_t.videoWidth,Te.height=_t.videoHeight,Te.channels=4;else if(zh(_t)){var Ue=Te.width||_t[0].length,be=Te.height||_t.length,nt=Te.channels;L(_t[0][0])?nt=nt||_t[0][0].length:nt=nt||1;for(var ot=wl.shape(_t),g=1,x=0;x<ot.length;++x)g*=ot[x];var C=Yh(Te,g);wl.flatten(_t,ot,"",C),Ii(Te,C),Te.alignment=1,Te.width=Ue,Te.height=be,Te.channels=nt,Te.format=Te.internalformat=go[nt],Te.needsFree=!0}Te.type===ji?q(Ie.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Te.type===Zi&&q(Ie.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ht(Te,Et,_t){var Ln=Te.element,Gr=Te.data,xe=Te.internalformat,de=Te.format,We=Te.type,tt=Te.width,ct=Te.height;xr(Te),Ln?K.texImage2D(Et,_t,de,de,We,Ln):Te.compressed?K.compressedTexImage2D(Et,_t,xe,tt,ct,0,Gr):Te.needsCopy?(wt(),K.copyTexImage2D(Et,_t,de,Te.xOffset,Te.yOffset,tt,ct,0)):K.texImage2D(Et,_t,de,tt,ct,0,de,We,Gr||null)}function fr(Te,Et,_t,Ln,Gr){var xe=Te.element,de=Te.data,We=Te.internalformat,tt=Te.format,ct=Te.type,Xe=Te.width,Ge=Te.height;xr(Te),xe?K.texSubImage2D(Et,Gr,_t,Ln,tt,ct,xe):Te.compressed?K.compressedTexSubImage2D(Et,Gr,_t,Ln,We,Xe,Ge,de):Te.needsCopy?(wt(),K.copyTexSubImage2D(Et,Gr,_t,Ln,Te.xOffset,Te.yOffset,Xe,Ge)):K.texSubImage2D(Et,Gr,_t,Ln,Xe,Ge,tt,ct,de)}var Dr=[];function Un(){return Dr.pop()||new on}function $r(Te){Te.needsFree&&Oo.freeType(Te.data),on.call(Te),Dr.push(Te)}function Or(){Yt.call(this),this.genMipmaps=!1,this.mipmapHint=pf,this.mipmask=0,this.images=Array(16)}function Fr(Te,Et,_t){var Ln=Te.images[0]=Un();Te.mipmask=1,Ln.width=Te.width=Et,Ln.height=Te.height=_t,Ln.channels=Te.channels=4}function Qr(Te,Et){var _t=null;if(cs(Et))_t=Te.images[0]=Un(),xn(_t,Te),Zt(_t,Et),Te.mipmask=1;else if(ar(Te,Et),Array.isArray(Et.mipmap))for(var Ln=Et.mipmap,Gr=0;Gr<Ln.length;++Gr)_t=Te.images[Gr]=Un(),xn(_t,Te),_t.width>>=Gr,_t.height>>=Gr,Zt(_t,Ln[Gr]),Te.mipmask|=1<<Gr;else _t=Te.images[0]=Un(),xn(_t,Te),Zt(_t,Et),Te.mipmask=1;xn(Te,Te.images[0]),Te.compressed&&(Te.internalformat===Js||Te.internalformat===Rs||Te.internalformat===as||Te.internalformat===ls)&&q(Te.width%4===0&&Te.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function ki(Te,Et){for(var _t=Te.images,Ln=0;Ln<_t.length;++Ln){if(!_t[Ln])return;Ht(_t[Ln],Et,Ln)}}var Si=[];function jr(){var Te=Si.pop()||new Or;Yt.call(Te),Te.mipmask=0;for(var Et=0;Et<16;++Et)Te.images[Et]=null;return Te}function Gi(Te){for(var Et=Te.images,_t=0;_t<Et.length;++_t)Et[_t]&&$r(Et[_t]),Et[_t]=null;Si.push(Te)}function Ko(){this.minFilter=df,this.magFilter=df,this.wrapS=ud,this.wrapT=ud,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=pf}function Pi(Te,Et){if("min"in Et){var _t=Et.min;q.parameter(_t,Mt),Te.minFilter=Mt[_t],Ul.indexOf(Te.minFilter)>=0&&!("faces"in Et)&&(Te.genMipmaps=!0)}if("mag"in Et){var Ln=Et.mag;q.parameter(Ln,nn),Te.magFilter=nn[Ln]}var Gr=Te.wrapS,xe=Te.wrapT;if("wrap"in Et){var de=Et.wrap;typeof de=="string"?(q.parameter(de,sn),Gr=xe=sn[de]):Array.isArray(de)&&(q.parameter(de[0],sn),q.parameter(de[1],sn),Gr=sn[de[0]],xe=sn[de[1]])}else{if("wrapS"in Et){var We=Et.wrapS;q.parameter(We,sn),Gr=sn[We]}if("wrapT"in Et){var tt=Et.wrapT;q.parameter(tt,sn),xe=sn[tt]}}if(Te.wrapS=Gr,Te.wrapT=xe,"anisotropic"in Et){var ct=Et.anisotropic;q(typeof ct=="number"&&ct>=1&&ct<=Ie.maxAnisotropic,"aniso samples must be between 1 and "),Te.anisotropic=Et.anisotropic}if("mipmap"in Et){var Xe=!1;switch(typeof Et.mipmap){case"string":q.parameter(Et.mipmap,tn,"invalid mipmap hint"),Te.mipmapHint=tn[Et.mipmap],Te.genMipmaps=!0,Xe=!0;break;case"boolean":Xe=Te.genMipmaps=Et.mipmap;break;case"object":q(Array.isArray(Et.mipmap),"invalid mipmap type"),Te.genMipmaps=!1,Xe=!0;break;default:q.raise("invalid mipmap type")}Xe&&!("min"in Et)&&(Te.minFilter=Ou)}}function $i(Te,Et){K.texParameteri(Et,dd,Te.minFilter),K.texParameteri(Et,cd,Te.magFilter),K.texParameteri(Et,Wa,Te.wrapS),K.texParameteri(Et,Ep,Te.wrapT),me.ext_texture_filter_anisotropic&&K.texParameteri(Et,vm,Te.anisotropic),Te.genMipmaps&&(K.hint(fy,Te.mipmapHint),K.generateMipmap(Et))}var Qi=0,la={},zi=Ie.maxTextureUnits,di=Array(zi).map(function(){return null});function Cr(Te){Yt.call(this),this.mipmask=0,this.internalformat=bn,this.id=Qi++,this.refCount=1,this.target=Te,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ko,Nt.profile&&(this.stats={size:0})}function sa(Te){K.activeTexture(Qs),K.bindTexture(Te.target,Te.texture)}function co(){var Te=di[0];Te?K.bindTexture(Te.target,Te.texture):K.bindTexture(Re,null)}function cr(Te){var Et=Te.texture;q(Et,"must not double destroy texture");var _t=Te.unit,Ln=Te.target;_t>=0&&(K.activeTexture(Qs+_t),K.bindTexture(Ln,null),di[_t]=null),K.deleteTexture(Et),Te.texture=null,Te.params=null,Te.pixels=null,Te.refCount=0,delete la[Te.id],yt.textureCount--}o(Cr.prototype,{bind:function(){var Te=this;Te.bindCount+=1;var Et=Te.unit;if(Et<0){for(var _t=0;_t<zi;++_t){var Ln=di[_t];if(Ln){if(Ln.bindCount>0)continue;Ln.unit=-1}di[_t]=Te,Et=_t;break}Et>=zi&&q.raise("insufficient number of texture units"),Nt.profile&&yt.maxTextureUnits<Et+1&&(yt.maxTextureUnits=Et+1),Te.unit=Et,K.activeTexture(Qs+Et),K.bindTexture(Te.target,Te.texture)}return Et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&cr(this)}});function Xr(Te,Et){var _t=new Cr(Re);la[_t.id]=_t,yt.textureCount++;function Ln(de,We){var tt=_t.texInfo;Ko.call(tt);var ct=jr();return typeof de=="number"?typeof We=="number"?Fr(ct,de|0,We|0):Fr(ct,de|0,de|0):de?(q.type(de,"object","invalid arguments to regl.texture"),Pi(tt,de),Qr(ct,de)):Fr(ct,1,1),tt.genMipmaps&&(ct.mipmask=(ct.width<<1)-1),_t.mipmask=ct.mipmask,xn(_t,ct),q.texture2D(tt,ct,Ie),_t.internalformat=ct.internalformat,Ln.width=ct.width,Ln.height=ct.height,sa(_t),ki(ct,Re),$i(tt,Re),co(),Gi(ct),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,ct.width,ct.height,tt.genMipmaps,!1)),Ln.format=ln[_t.internalformat],Ln.type=An[_t.type],Ln.mag=Xt[tt.magFilter],Ln.min=kn[tt.minFilter],Ln.wrapS=Kt[tt.wrapS],Ln.wrapT=Kt[tt.wrapT],Ln}function Gr(de,We,tt,ct){q(!!de,"must specify image data");var Xe=We|0,Ge=tt|0,Qe=ct|0,Ee=Un();return xn(Ee,_t),Ee.width=0,Ee.height=0,Zt(Ee,de),Ee.width=Ee.width||(_t.width>>Qe)-Xe,Ee.height=Ee.height||(_t.height>>Qe)-Ge,q(_t.type===Ee.type&&_t.format===Ee.format&&_t.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),q(Xe>=0&&Ge>=0&&Xe+Ee.width<=_t.width&&Ge+Ee.height<=_t.height,"texture.subimage write out of bounds"),q(_t.mipmask&1<<Qe,"missing mipmap data"),q(Ee.data||Ee.element||Ee.needsCopy,"missing image data"),sa(_t),fr(Ee,Re,Xe,Ge,Qe),co(),$r(Ee),Ln}function xe(de,We){var tt=de|0,ct=We|0||tt;if(tt===_t.width&&ct===_t.height)return Ln;Ln.width=_t.width=tt,Ln.height=_t.height=ct,sa(_t);for(var Xe=0;_t.mipmask>>Xe;++Xe){var Ge=tt>>Xe,Qe=ct>>Xe;if(!Ge||!Qe)break;K.texImage2D(Re,Xe,_t.format,Ge,Qe,0,_t.format,_t.type,null)}return co(),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,tt,ct,!1,!1)),Ln}return Ln(Te,Et),Ln.subimage=Gr,Ln.resize=xe,Ln._reglType="texture2d",Ln._texture=_t,Nt.profile&&(Ln.stats=_t.stats),Ln.destroy=function(){_t.decRef()},Ln}function Nr(Te,Et,_t,Ln,Gr,xe){var de=new Cr(lt);la[de.id]=de,yt.cubeCount++;var We=new Array(6);function tt(Ge,Qe,Ee,Ue,be,nt){var ot,g=de.texInfo;for(Ko.call(g),ot=0;ot<6;++ot)We[ot]=jr();if(typeof Ge=="number"||!Ge){var x=Ge|0||1;for(ot=0;ot<6;++ot)Fr(We[ot],x,x)}else if(typeof Ge=="object")if(Qe)Qr(We[0],Ge),Qr(We[1],Qe),Qr(We[2],Ee),Qr(We[3],Ue),Qr(We[4],be),Qr(We[5],nt);else if(Pi(g,Ge),ar(de,Ge),"faces"in Ge){var C=Ge.faces;for(q(Array.isArray(C)&&C.length===6,"cube faces must be a length 6 array"),ot=0;ot<6;++ot)q(typeof C[ot]=="object"&&!!C[ot],"invalid input for cube map face"),xn(We[ot],de),Qr(We[ot],C[ot])}else for(ot=0;ot<6;++ot)Qr(We[ot],Ge);else q.raise("invalid arguments to cube map");for(xn(de,We[0]),Ie.npotTextureCube||q(Z(de.width)&&Z(de.height),"your browser does not support non power or two texture dimensions"),g.genMipmaps?de.mipmask=(We[0].width<<1)-1:de.mipmask=We[0].mipmask,q.textureCube(de,g,We,Ie),de.internalformat=We[0].internalformat,tt.width=We[0].width,tt.height=We[0].height,sa(de),ot=0;ot<6;++ot)ki(We[ot],It+ot);for($i(g,lt),co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,g.genMipmaps,!0)),tt.format=ln[de.internalformat],tt.type=An[de.type],tt.mag=Xt[g.magFilter],tt.min=kn[g.minFilter],tt.wrapS=Kt[g.wrapS],tt.wrapT=Kt[g.wrapT],ot=0;ot<6;++ot)Gi(We[ot]);return tt}function ct(Ge,Qe,Ee,Ue,be){q(!!Qe,"must specify image data"),q(typeof Ge=="number"&&Ge===(Ge|0)&&Ge>=0&&Ge<6,"invalid face");var nt=Ee|0,ot=Ue|0,g=be|0,x=Un();return xn(x,de),x.width=0,x.height=0,Zt(x,Qe),x.width=x.width||(de.width>>g)-nt,x.height=x.height||(de.height>>g)-ot,q(de.type===x.type&&de.format===x.format&&de.internalformat===x.internalformat,"incompatible format for texture.subimage"),q(nt>=0&&ot>=0&&nt+x.width<=de.width&&ot+x.height<=de.height,"texture.subimage write out of bounds"),q(de.mipmask&1<<g,"missing mipmap data"),q(x.data||x.element||x.needsCopy,"missing image data"),sa(de),fr(x,It+Ge,nt,ot,g),co(),$r(x),tt}function Xe(Ge){var Qe=Ge|0;if(Qe!==de.width){tt.width=de.width=Qe,tt.height=de.height=Qe,sa(de);for(var Ee=0;Ee<6;++Ee)for(var Ue=0;de.mipmask>>Ue;++Ue)K.texImage2D(It+Ee,Ue,de.format,Qe>>Ue,Qe>>Ue,0,de.format,de.type,null);return co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,!1,!0)),tt}}return tt(Te,Et,_t,Ln,Gr,xe),tt.subimage=ct,tt.resize=Xe,tt._reglType="textureCube",tt._texture=de,Nt.profile&&(tt.stats=de.stats),tt.destroy=function(){de.decRef()},tt}function fi(){for(var Te=0;Te<zi;++Te)K.activeTexture(Qs+Te),K.bindTexture(Re,null),di[Te]=null;ra(la).forEach(cr),yt.cubeCount=0,yt.textureCount=0}Nt.profile&&(yt.getTotalTextureSize=function(){var Te=0;return Object.keys(la).forEach(function(Et){Te+=la[Et].stats.size}),Te});function $s(){for(var Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null)}ra(la).forEach(function(_t){_t.texture=K.createTexture(),K.bindTexture(_t.target,_t.texture);for(var Ln=0;Ln<32;++Ln)if((_t.mipmask&1<<Ln)!==0)if(_t.target===Re)K.texImage2D(Re,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);else for(var Gr=0;Gr<6;++Gr)K.texImage2D(It+Gr,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);$i(_t.texInfo,_t.target)})}function yi(){for(var Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null),K.activeTexture(Qs+Te),K.bindTexture(Re,null),K.bindTexture(lt,null)}}return{create2D:Xr,createCube:Nr,clear:fi,getTexture:function(Te){return null},restore:$s,refresh:yi}}var ei=36161,ur=32854,ti=32855,vf=36194,Ds=33189,Mp=36168,Ei=34041,Mi=35907,qh=34836,Kh=34842,mf=34843,Ga=[];Ga[ur]=2,Ga[ti]=2,Ga[vf]=2,Ga[Ds]=2,Ga[Mp]=1,Ga[Ei]=4,Ga[Mi]=4,Ga[qh]=16,Ga[Kh]=8,Ga[mf]=6;function Tp(K,me,Ie){return Ga[K]*me*Ie}var hd=function(K,me,Ie,wt,Dt){var yt={rgba4:ur,rgb565:vf,"rgb5 a1":ti,depth:Ds,stencil:Mp,"depth stencil":Ei};me.ext_srgb&&(yt.srgba=Mi),me.ext_color_buffer_half_float&&(yt.rgba16f=Kh,yt.rgb16f=mf),me.webgl_color_buffer_float&&(yt.rgba32f=qh);var Nt=[];Object.keys(yt).forEach(function(rn){var Wt=yt[rn];Nt[Wt]=rn});var tn=0,sn={};function nn(rn){this.id=tn++,this.refCount=1,this.renderbuffer=rn,this.format=ur,this.width=0,this.height=0,Dt.profile&&(this.stats={size:0})}nn.prototype.decRef=function(){--this.refCount<=0&&Mt(this)};function Mt(rn){var Wt=rn.renderbuffer;q(Wt,"must not double destroy renderbuffer"),K.bindRenderbuffer(ei,null),K.deleteRenderbuffer(Wt),rn.renderbuffer=null,rn.refCount=0,delete sn[rn.id],wt.renderbufferCount--}function wn(rn,Wt){var st=new nn(K.createRenderbuffer());sn[st.id]=st,wt.renderbufferCount++;function St(An,Xt){var kn=0,Kt=0,_n=ur;if(typeof An=="object"&&An){var Yt=An;if("shape"in Yt){var xn=Yt.shape;q(Array.isArray(xn)&&xn.length>=2,"invalid renderbuffer shape"),kn=xn[0]|0,Kt=xn[1]|0}else"radius"in Yt&&(kn=Kt=Yt.radius|0),"width"in Yt&&(kn=Yt.width|0),"height"in Yt&&(Kt=Yt.height|0);"format"in Yt&&(q.parameter(Yt.format,yt,"invalid renderbuffer format"),_n=yt[Yt.format])}else typeof An=="number"?(kn=An|0,typeof Xt=="number"?Kt=Xt|0:Kt=kn):An?q.raise("invalid arguments to renderbuffer constructor"):kn=Kt=1;if(q(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),!(kn===st.width&&Kt===st.height&&_n===st.format))return St.width=st.width=kn,St.height=st.height=Kt,st.format=_n,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,_n,kn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Tp(st.format,st.width,st.height)),St.format=Nt[st.format],St}function ln(An,Xt){var kn=An|0,Kt=Xt|0||kn;return kn===st.width&&Kt===st.height||(q(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),St.width=st.width=kn,St.height=st.height=Kt,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,st.format,kn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Tp(st.format,st.width,st.height))),St}return St(rn,Wt),St.resize=ln,St._reglType="renderbuffer",St._renderbuffer=st,Dt.profile&&(St.stats=st.stats),St.destroy=function(){st.decRef()},St}Dt.profile&&(wt.getTotalRenderbufferSize=function(){var rn=0;return Object.keys(sn).forEach(function(Wt){rn+=sn[Wt].stats.size}),rn});function pn(){ra(sn).forEach(function(rn){rn.renderbuffer=K.createRenderbuffer(),K.bindRenderbuffer(ei,rn.renderbuffer),K.renderbufferStorage(ei,rn.format,rn.width,rn.height)}),K.bindRenderbuffer(ei,null)}return{create:wn,clear:function(){ra(sn).forEach(Mt)},restore:pn}},Vl=36160,Mu=36161,ru=3553,Wl=34069,_m=36064,js=36096,Ml=36128,Zh=33306,Jh=36053,Cp=36054,bm=36055,wm=36057,Em=36061,Np=36193,Qh=5121,ev=5126,gf=6407,uo=6408,vy=6402,tv=[gf,uo],hc=[];hc[uo]=4,hc[gf]=3;var yf=[];yf[Qh]=1,yf[ev]=4,yf[Np]=2;var my=32854,xm=32855,Tl=36194,gy=33189,_f=36168,kp=34041,nv=35907,Om=34836,cl=34842,Tu=34843,Pp=[my,xm,Tl,nv,cl,Tu,Om],vc={};vc[Jh]="complete",vc[Cp]="incomplete attachment",vc[wm]="incomplete dimensions",vc[bm]="incomplete, missing attachment",vc[Em]="unsupported";function Rp(K,me,Ie,wt,Dt,yt){var Nt={cur:null,next:null,dirty:!1,setFBO:null},tn=["rgba"],sn=["rgba4","rgb565","rgb5 a1"];me.ext_srgb&&sn.push("srgba"),me.ext_color_buffer_half_float&&sn.push("rgba16f","rgb16f"),me.webgl_color_buffer_float&&sn.push("rgba32f");var nn=["uint8"];me.oes_texture_half_float&&nn.push("half float","float16"),me.oes_texture_float&&nn.push("float","float32");function Mt(on,Zt,Ht){this.target=on,this.texture=Zt,this.renderbuffer=Ht;var fr=0,Dr=0;Zt?(fr=Zt.width,Dr=Zt.height):Ht&&(fr=Ht.width,Dr=Ht.height),this.width=fr,this.height=Dr}function wn(on){on&&(on.texture&&on.texture._texture.decRef(),on.renderbuffer&&on.renderbuffer._renderbuffer.decRef())}function pn(on,Zt,Ht){if(on)if(on.texture){var fr=on.texture._texture,Dr=Math.max(1,fr.width),Un=Math.max(1,fr.height);q(Dr===Zt&&Un===Ht,"inconsistent width/height for supplied texture"),fr.refCount+=1}else{var $r=on.renderbuffer._renderbuffer;q($r.width===Zt&&$r.height===Ht,"inconsistent width/height for renderbuffer"),$r.refCount+=1}}function rn(on,Zt){Zt&&(Zt.texture?K.framebufferTexture2D(Vl,on,Zt.target,Zt.texture._texture.texture,0):K.framebufferRenderbuffer(Vl,on,Mu,Zt.renderbuffer._renderbuffer.renderbuffer))}function Wt(on){var Zt=ru,Ht=null,fr=null,Dr=on;typeof on=="object"&&(Dr=on.data,"target"in on&&(Zt=on.target|0)),q.type(Dr,"function","invalid attachment data");var Un=Dr._reglType;return Un==="texture2d"?(Ht=Dr,q(Zt===ru)):Un==="textureCube"?(Ht=Dr,q(Zt>=Wl&&Zt<Wl+6,"invalid cube map target")):Un==="renderbuffer"?(fr=Dr,Zt=Mu):q.raise("invalid regl object for attachment"),new Mt(Zt,Ht,fr)}function st(on,Zt,Ht,fr,Dr){if(Ht){var Un=wt.create2D({width:on,height:Zt,format:fr,type:Dr});return Un._texture.refCount=0,new Mt(ru,Un,null)}else{var $r=Dt.create({width:on,height:Zt,format:fr});return $r._renderbuffer.refCount=0,new Mt(Mu,null,$r)}}function St(on){return on&&(on.texture||on.renderbuffer)}function ln(on,Zt,Ht){on&&(on.texture?on.texture.resize(Zt,Ht):on.renderbuffer&&on.renderbuffer.resize(Zt,Ht),on.width=Zt,on.height=Ht)}var An=0,Xt={};function kn(){this.id=An++,Xt[this.id]=this,this.framebuffer=K.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Kt(on){on.colorAttachments.forEach(wn),wn(on.depthAttachment),wn(on.stencilAttachment),wn(on.depthStencilAttachment)}function _n(on){var Zt=on.framebuffer;q(Zt,"must not double destroy framebuffer"),K.deleteFramebuffer(Zt),on.framebuffer=null,yt.framebufferCount--,delete Xt[on.id]}function Yt(on){var Zt;K.bindFramebuffer(Vl,on.framebuffer);var Ht=on.colorAttachments;for(Zt=0;Zt<Ht.length;++Zt)rn(_m+Zt,Ht[Zt]);for(Zt=Ht.length;Zt<Ie.maxColorAttachments;++Zt)K.framebufferTexture2D(Vl,_m+Zt,ru,null,0);K.framebufferTexture2D(Vl,Zh,ru,null,0),K.framebufferTexture2D(Vl,js,ru,null,0),K.framebufferTexture2D(Vl,Ml,ru,null,0),rn(js,on.depthAttachment),rn(Ml,on.stencilAttachment),rn(Zh,on.depthStencilAttachment);var fr=K.checkFramebufferStatus(Vl);!K.isContextLost()&&fr!==Jh&&q.raise("framebuffer configuration not supported, status = "+vc[fr]),K.bindFramebuffer(Vl,Nt.next?Nt.next.framebuffer:null),Nt.cur=Nt.next,K.getError()}function xn(on,Zt){var Ht=new kn;yt.framebufferCount++;function fr(Un,$r){var Or;q(Nt.next!==Ht,"can not update framebuffer which is currently in use");var Fr=0,Qr=0,ki=!0,Si=!0,jr=null,Gi=!0,Ko="rgba",Pi="uint8",$i=1,Qi=null,la=null,zi=null,di=!1;if(typeof Un=="number")Fr=Un|0,Qr=$r|0||Fr;else if(!Un)Fr=Qr=1;else{q.type(Un,"object","invalid arguments for framebuffer");var Cr=Un;if("shape"in Cr){var sa=Cr.shape;q(Array.isArray(sa)&&sa.length>=2,"invalid shape for framebuffer"),Fr=sa[0],Qr=sa[1]}else"radius"in Cr&&(Fr=Qr=Cr.radius),"width"in Cr&&(Fr=Cr.width),"height"in Cr&&(Qr=Cr.height);("color"in Cr||"colors"in Cr)&&(jr=Cr.color||Cr.colors,Array.isArray(jr)&&q(jr.length===1||me.webgl_draw_buffers,"multiple render targets not supported")),jr||("colorCount"in Cr&&($i=Cr.colorCount|0,q($i>0,"invalid color buffer count")),"colorTexture"in Cr&&(Gi=!!Cr.colorTexture,Ko="rgba4"),"colorType"in Cr&&(Pi=Cr.colorType,Gi?(q(me.oes_texture_float||!(Pi==="float"||Pi==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),q(me.oes_texture_half_float||!(Pi==="half float"||Pi==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Pi==="half float"||Pi==="float16"?(q(me.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Ko="rgba16f"):(Pi==="float"||Pi==="float32")&&(q(me.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Ko="rgba32f"),q.oneOf(Pi,nn,"invalid color type")),"colorFormat"in Cr&&(Ko=Cr.colorFormat,tn.indexOf(Ko)>=0?Gi=!0:sn.indexOf(Ko)>=0?Gi=!1:Gi?q.oneOf(Cr.colorFormat,tn,"invalid color format for texture"):q.oneOf(Cr.colorFormat,sn,"invalid color format for renderbuffer"))),("depthTexture"in Cr||"depthStencilTexture"in Cr)&&(di=!!(Cr.depthTexture||Cr.depthStencilTexture),q(!di||me.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Cr&&(typeof Cr.depth=="boolean"?ki=Cr.depth:(Qi=Cr.depth,Si=!1)),"stencil"in Cr&&(typeof Cr.stencil=="boolean"?Si=Cr.stencil:(la=Cr.stencil,ki=!1)),"depthStencil"in Cr&&(typeof Cr.depthStencil=="boolean"?ki=Si=Cr.depthStencil:(zi=Cr.depthStencil,ki=!1,Si=!1))}var co=null,cr=null,Xr=null,Nr=null;if(Array.isArray(jr))co=jr.map(Wt);else if(jr)co=[Wt(jr)];else for(co=new Array($i),Or=0;Or<$i;++Or)co[Or]=st(Fr,Qr,Gi,Ko,Pi);q(me.webgl_draw_buffers||co.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),q(co.length<=Ie.maxColorAttachments,"too many color attachments, not supported"),Fr=Fr||co[0].width,Qr=Qr||co[0].height,Qi?cr=Wt(Qi):ki&&!Si&&(cr=st(Fr,Qr,di,"depth","uint32")),la?Xr=Wt(la):Si&&!ki&&(Xr=st(Fr,Qr,!1,"stencil","uint8")),zi?Nr=Wt(zi):!Qi&&!la&&Si&&ki&&(Nr=st(Fr,Qr,di,"depth stencil","depth stencil")),q(!!Qi+!!la+!!zi<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var fi=null;for(Or=0;Or<co.length;++Or)if(pn(co[Or],Fr,Qr),q(!co[Or]||co[Or].texture&&tv.indexOf(co[Or].texture._texture.format)>=0||co[Or].renderbuffer&&Pp.indexOf(co[Or].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Or+" is invalid"),co[Or]&&co[Or].texture){var $s=hc[co[Or].texture._texture.format]*yf[co[Or].texture._texture.type];fi===null?fi=$s:q(fi===$s,"all color attachments much have the same number of bits per pixel.")}return pn(cr,Fr,Qr),q(!cr||cr.texture&&cr.texture._texture.format===vy||cr.renderbuffer&&cr.renderbuffer._renderbuffer.format===gy,"invalid depth attachment for framebuffer object"),pn(Xr,Fr,Qr),q(!Xr||Xr.renderbuffer&&Xr.renderbuffer._renderbuffer.format===_f,"invalid stencil attachment for framebuffer object"),pn(Nr,Fr,Qr),q(!Nr||Nr.texture&&Nr.texture._texture.format===kp||Nr.renderbuffer&&Nr.renderbuffer._renderbuffer.format===kp,"invalid depth-stencil attachment for framebuffer object"),Kt(Ht),Ht.width=Fr,Ht.height=Qr,Ht.colorAttachments=co,Ht.depthAttachment=cr,Ht.stencilAttachment=Xr,Ht.depthStencilAttachment=Nr,fr.color=co.map(St),fr.depth=St(cr),fr.stencil=St(Xr),fr.depthStencil=St(Nr),fr.width=Ht.width,fr.height=Ht.height,Yt(Ht),fr}function Dr(Un,$r){q(Nt.next!==Ht,"can not resize a framebuffer which is currently in use");var Or=Math.max(Un|0,1),Fr=Math.max($r|0||Or,1);if(Or===Ht.width&&Fr===Ht.height)return fr;for(var Qr=Ht.colorAttachments,ki=0;ki<Qr.length;++ki)ln(Qr[ki],Or,Fr);return ln(Ht.depthAttachment,Or,Fr),ln(Ht.stencilAttachment,Or,Fr),ln(Ht.depthStencilAttachment,Or,Fr),Ht.width=fr.width=Or,Ht.height=fr.height=Fr,Yt(Ht),fr}return fr(on,Zt),o(fr,{resize:Dr,_reglType:"framebuffer",_framebuffer:Ht,destroy:function(){_n(Ht),Kt(Ht)},use:function(Un){Nt.setFBO({framebuffer:fr},Un)}})}function ar(on){var Zt=Array(6);function Ht(Dr){var Un;q(Zt.indexOf(Nt.next)<0,"can not update framebuffer which is currently in use");var $r={color:null},Or=0,Fr=null,Qr="rgba",ki="uint8",Si=1;if(typeof Dr=="number")Or=Dr|0;else if(!Dr)Or=1;else{q.type(Dr,"object","invalid arguments for framebuffer");var jr=Dr;if("shape"in jr){var Gi=jr.shape;q(Array.isArray(Gi)&&Gi.length>=2,"invalid shape for framebuffer"),q(Gi[0]===Gi[1],"cube framebuffer must be square"),Or=Gi[0]}else"radius"in jr&&(Or=jr.radius|0),"width"in jr?(Or=jr.width|0,"height"in jr&&q(jr.height===Or,"must be square")):"height"in jr&&(Or=jr.height|0);("color"in jr||"colors"in jr)&&(Fr=jr.color||jr.colors,Array.isArray(Fr)&&q(Fr.length===1||me.webgl_draw_buffers,"multiple render targets not supported")),Fr||("colorCount"in jr&&(Si=jr.colorCount|0,q(Si>0,"invalid color buffer count")),"colorType"in jr&&(q.oneOf(jr.colorType,nn,"invalid color type"),ki=jr.colorType),"colorFormat"in jr&&(Qr=jr.colorFormat,q.oneOf(jr.colorFormat,tn,"invalid color format for texture"))),"depth"in jr&&($r.depth=jr.depth),"stencil"in jr&&($r.stencil=jr.stencil),"depthStencil"in jr&&($r.depthStencil=jr.depthStencil)}var Ko;if(Fr)if(Array.isArray(Fr))for(Ko=[],Un=0;Un<Fr.length;++Un)Ko[Un]=Fr[Un];else Ko=[Fr];else{Ko=Array(Si);var Pi={radius:Or,format:Qr,type:ki};for(Un=0;Un<Si;++Un)Ko[Un]=wt.createCube(Pi)}for($r.color=Array(Ko.length),Un=0;Un<Ko.length;++Un){var $i=Ko[Un];q(typeof $i=="function"&&$i._reglType==="textureCube","invalid cube map"),Or=Or||$i.width,q($i.width===Or&&$i.height===Or,"invalid cube map shape"),$r.color[Un]={target:Wl,data:Ko[Un]}}for(Un=0;Un<6;++Un){for(var Qi=0;Qi<Ko.length;++Qi)$r.color[Qi].target=Wl+Un;Un>0&&($r.depth=Zt[0].depth,$r.stencil=Zt[0].stencil,$r.depthStencil=Zt[0].depthStencil),Zt[Un]?Zt[Un]($r):Zt[Un]=xn($r)}return o(Ht,{width:Or,height:Or,color:Ko})}function fr(Dr){var Un,$r=Dr|0;if(q($r>0&&$r<=Ie.maxCubeMapSize,"invalid radius for cube fbo"),$r===Ht.width)return Ht;var Or=Ht.color;for(Un=0;Un<Or.length;++Un)Or[Un].resize($r);for(Un=0;Un<6;++Un)Zt[Un].resize($r);return Ht.width=Ht.height=$r,Ht}return Ht(on),o(Ht,{faces:Zt,resize:fr,_reglType:"framebufferCube",destroy:function(){Zt.forEach(function(Dr){Dr.destroy()})}})}function xr(){Nt.cur=null,Nt.next=null,Nt.dirty=!0,ra(Xt).forEach(function(on){on.framebuffer=K.createFramebuffer(),Yt(on)})}return o(Nt,{getFramebuffer:function(on){if(typeof on=="function"&&on._reglType==="framebuffer"){var Zt=on._framebuffer;if(Zt instanceof kn)return Zt}return null},create:xn,createCube:ar,clear:function(){ra(Xt).forEach(_n)},restore:xr})}var rv=5126,Dp=34962;function bf(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=rv,this.offset=0,this.stride=0,this.divisor=0}function jp(K,me,Ie,wt,Dt){for(var yt=Ie.maxAttributes,Nt=new Array(yt),tn=0;tn<yt;++tn)Nt[tn]=new bf;var sn=0,nn={},Mt={Record:bf,scope:{},state:Nt,currentVAO:null,targetVAO:null,restore:pn()?Xt:function(){},createVAO:kn,getVAO:Wt,destroyBuffer:wn,setVAO:pn()?st:St,clear:pn()?ln:function(){}};function wn(Kt){for(var _n=0;_n<Nt.length;++_n){var Yt=Nt[_n];Yt.buffer===Kt&&(K.disableVertexAttribArray(_n),Yt.buffer=null)}}function pn(){return me.oes_vertex_array_object}function rn(){return me.angle_instanced_arrays}function Wt(Kt){return typeof Kt=="function"&&Kt._vao?Kt._vao:null}function st(Kt){if(Kt!==Mt.currentVAO){var _n=pn();Kt?_n.bindVertexArrayOES(Kt.vao):_n.bindVertexArrayOES(null),Mt.currentVAO=Kt}}function St(Kt){if(Kt!==Mt.currentVAO){if(Kt)Kt.bindAttrs();else for(var _n=rn(),Yt=0;Yt<Nt.length;++Yt){var xn=Nt[Yt];xn.buffer?(K.enableVertexAttribArray(Yt),K.vertexAttribPointer(Yt,xn.size,xn.type,xn.normalized,xn.stride,xn.offfset),_n&&xn.divisor&&_n.vertexAttribDivisorANGLE(Yt,xn.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,xn.x,xn.y,xn.z,xn.w))}Mt.currentVAO=Kt}}function ln(){ra(nn).forEach(function(Kt){Kt.destroy()})}function An(){this.id=++sn,this.attributes=[];var Kt=pn();Kt?this.vao=Kt.createVertexArrayOES():this.vao=null,nn[this.id]=this,this.buffers=[]}An.prototype.bindAttrs=function(){for(var Kt=rn(),_n=this.attributes,Yt=0;Yt<_n.length;++Yt){var xn=_n[Yt];xn.buffer?(K.enableVertexAttribArray(Yt),K.bindBuffer(Dp,xn.buffer.buffer),K.vertexAttribPointer(Yt,xn.size,xn.type,xn.normalized,xn.stride,xn.offset),Kt&&xn.divisor&&Kt.vertexAttribDivisorANGLE(Yt,xn.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,xn.x,xn.y,xn.z,xn.w))}for(var ar=_n.length;ar<yt;++ar)K.disableVertexAttribArray(ar)},An.prototype.refresh=function(){var Kt=pn();Kt&&(Kt.bindVertexArrayOES(this.vao),this.bindAttrs(),Mt.currentVAO=this)},An.prototype.destroy=function(){if(this.vao){var Kt=pn();this===Mt.currentVAO&&(Mt.currentVAO=null,Kt.bindVertexArrayOES(null)),Kt.deleteVertexArrayOES(this.vao),this.vao=null}nn[this.id]&&(delete nn[this.id],wt.vaoCount-=1)};function Xt(){var Kt=pn();Kt&&ra(nn).forEach(function(_n){_n.refresh()})}function kn(Kt){var _n=new An;wt.vaoCount+=1;function Yt(xn){q(Array.isArray(xn),"arguments to vertex array constructor must be an array"),q(xn.length<yt,"too many attributes"),q(xn.length>0,"must specify at least one attribute");var ar={},xr=_n.attributes;xr.length=xn.length;for(var on=0;on<xn.length;++on){var Zt=xn[on],Ht=xr[on]=new bf,fr=Zt.data||Zt;if(Array.isArray(fr)||n(fr)||Ia(fr)){var Dr;_n.buffers[on]&&(Dr=_n.buffers[on],n(fr)&&Dr._buffer.byteLength>=fr.byteLength?Dr.subdata(fr):(Dr.destroy(),_n.buffers[on]=null)),_n.buffers[on]||(Dr=_n.buffers[on]=Dt.create(Zt,Dp,!1,!0)),Ht.buffer=Dt.getBuffer(Dr),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1,ar[on]=1}else Dt.getBuffer(Zt)?(Ht.buffer=Dt.getBuffer(Zt),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1):Dt.getBuffer(Zt.buffer)?(Ht.buffer=Dt.getBuffer(Zt.buffer),Ht.size=(+Zt.size||Ht.buffer.dimension)|0,Ht.normalized=!!Zt.normalized||!1,"type"in Zt?(q.parameter(Zt.type,$a,"invalid buffer type"),Ht.type=$a[Zt.type]):Ht.type=Ht.buffer.dtype,Ht.offset=(Zt.offset||0)|0,Ht.stride=(Zt.stride||0)|0,Ht.divisor=(Zt.divisor||0)|0,Ht.state=1,q(Ht.size>=1&&Ht.size<=4,"size must be between 1 and 4"),q(Ht.offset>=0,"invalid offset"),q(Ht.stride>=0&&Ht.stride<=255,"stride must be between 0 and 255"),q(Ht.divisor>=0,"divisor must be positive"),q(!Ht.divisor||!!me.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Zt?(q(on>0,"first attribute must not be a constant"),Ht.x=+Zt.x||0,Ht.y=+Zt.y||0,Ht.z=+Zt.z||0,Ht.w=+Zt.w||0,Ht.state=2):q(!1,"invalid attribute spec for location "+on)}for(var Un=0;Un<_n.buffers.length;++Un)!ar[Un]&&_n.buffers[Un]&&(_n.buffers[Un].destroy(),_n.buffers[Un]=null);return _n.refresh(),Yt}return Yt.destroy=function(){for(var xn=0;xn<_n.buffers.length;++xn)_n.buffers[xn]&&_n.buffers[xn].destroy();_n.buffers.length=0,_n.destroy()},Yt._vao=_n,Yt._reglType="vao",Yt(Kt)}return Mt}var Lp=35632,jo=35633,yy=35718,Uo=35721;function Ip(K,me,Ie,wt){var Dt={},yt={};function Nt(st,St,ln,An){this.name=st,this.id=St,this.location=ln,this.info=An}function tn(st,St){for(var ln=0;ln<st.length;++ln)if(st[ln].id===St.id){st[ln].location=St.location;return}st.push(St)}function sn(st,St,ln){var An=st===Lp?Dt:yt,Xt=An[St];if(!Xt){var kn=me.str(St);Xt=K.createShader(st),K.shaderSource(Xt,kn),K.compileShader(Xt),q.shaderError(K,Xt,kn,st,ln),An[St]=Xt}return Xt}var nn={},Mt=[],wn=0;function pn(st,St){this.id=wn++,this.fragId=st,this.vertId=St,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,wt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function rn(st,St,ln){var An,Xt,kn=sn(Lp,st.fragId),Kt=sn(jo,st.vertId),_n=st.program=K.createProgram();if(K.attachShader(_n,kn),K.attachShader(_n,Kt),ln)for(An=0;An<ln.length;++An){var Yt=ln[An];K.bindAttribLocation(_n,Yt[0],Yt[1])}K.linkProgram(_n),q.linkError(K,_n,me.str(st.fragId),me.str(st.vertId),St);var xn=K.getProgramParameter(_n,yy);wt.profile&&(st.stats.uniformsCount=xn);var ar=st.uniforms;for(An=0;An<xn;++An)if(Xt=K.getActiveUniform(_n,An),Xt)if(Xt.size>1)for(var xr=0;xr<Xt.size;++xr){var on=Xt.name.replace("[0]","["+xr+"]");tn(ar,new Nt(on,me.id(on),K.getUniformLocation(_n,on),Xt))}else tn(ar,new Nt(Xt.name,me.id(Xt.name),K.getUniformLocation(_n,Xt.name),Xt));var Zt=K.getProgramParameter(_n,Uo);wt.profile&&(st.stats.attributesCount=Zt);var Ht=st.attributes;for(An=0;An<Zt;++An)Xt=K.getActiveAttrib(_n,An),Xt&&tn(Ht,new Nt(Xt.name,me.id(Xt.name),K.getAttribLocation(_n,Xt.name),Xt))}wt.profile&&(Ie.getMaxUniformsCount=function(){var st=0;return Mt.forEach(function(St){St.stats.uniformsCount>st&&(st=St.stats.uniformsCount)}),st},Ie.getMaxAttributesCount=function(){var st=0;return Mt.forEach(function(St){St.stats.attributesCount>st&&(st=St.stats.attributesCount)}),st});function Wt(){Dt={},yt={};for(var st=0;st<Mt.length;++st)rn(Mt[st],null,Mt[st].attributes.map(function(St){return[St.location,St.name]}))}return{clear:function(){var st=K.deleteShader.bind(K);ra(Dt).forEach(st),Dt={},ra(yt).forEach(st),yt={},Mt.forEach(function(St){K.deleteProgram(St.program)}),Mt.length=0,nn={},Ie.shaderCount=0},program:function(st,St,ln,An){q.command(st>=0,"missing vertex shader",ln),q.command(St>=0,"missing fragment shader",ln);var Xt=nn[St];Xt||(Xt=nn[St]={});var kn=Xt[st];if(kn&&(kn.refCount++,!An))return kn;var Kt=new pn(St,st);return Ie.shaderCount++,rn(Kt,ln,An),kn||(Xt[st]=Kt),Mt.push(Kt),o(Kt,{destroy:function(){if(Kt.refCount--,Kt.refCount<=0){K.deleteProgram(Kt.program);var _n=Mt.indexOf(Kt);Mt.splice(_n,1),Ie.shaderCount--}Xt[Kt.vertId].refCount<=0&&(K.deleteShader(yt[Kt.vertId]),delete yt[Kt.vertId],delete nn[Kt.fragId][Kt.vertId]),Object.keys(nn[Kt.fragId]).length||(K.deleteShader(Dt[Kt.fragId]),delete Dt[Kt.fragId],delete nn[Kt.fragId])}})},restore:Wt,shader:sn,frag:-1,vert:-1}}var Sm=6408,mc=5121,Am=3333,vd=5126;function Mm(K,me,Ie,wt,Dt,yt,Nt){function tn(Mt){var wn;me.next===null?(q(Dt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),wn=mc):(q(me.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),wn=me.next.colorAttachments[0].texture._texture.type,yt.oes_texture_float?(q(wn===mc||wn===vd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),wn===vd&&q(Nt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):q(wn===mc,"Reading from a framebuffer is only allowed for the type 'uint8'"));var pn=0,rn=0,Wt=wt.framebufferWidth,st=wt.framebufferHeight,St=null;n(Mt)?St=Mt:Mt&&(q.type(Mt,"object","invalid arguments to regl.read()"),pn=Mt.x|0,rn=Mt.y|0,q(pn>=0&&pn<wt.framebufferWidth,"invalid x offset for regl.read"),q(rn>=0&&rn<wt.framebufferHeight,"invalid y offset for regl.read"),Wt=(Mt.width||wt.framebufferWidth-pn)|0,st=(Mt.height||wt.framebufferHeight-rn)|0,St=Mt.data||null),St&&(wn===mc?q(St instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):wn===vd&&q(St instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),q(Wt>0&&Wt+pn<=wt.framebufferWidth,"invalid width for read pixels"),q(st>0&&st+rn<=wt.framebufferHeight,"invalid height for read pixels"),Ie();var ln=Wt*st*4;return St||(wn===mc?St=new Uint8Array(ln):wn===vd&&(St=St||new Float32Array(ln))),q.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),q(St.byteLength>=ln,"data buffer for regl.read() too small"),K.pixelStorei(Am,4),K.readPixels(pn,rn,Wt,st,Sm,wn,St),St}function sn(Mt){var wn;return me.setFBO({framebuffer:Mt.framebuffer},function(){wn=tn(Mt)}),wn}function nn(Mt){return!Mt||!("framebuffer"in Mt)?tn(Mt):sn(Mt)}return nn}function gc(K){return Array.prototype.slice.call(K)}function va(K){return gc(K).join("")}function ds(){var K=0,me=[],Ie=[];function wt(wn){for(var pn=0;pn<Ie.length;++pn)if(Ie[pn]===wn)return me[pn];var rn="g"+K++;return me.push(rn),Ie.push(wn),rn}function Dt(){var wn=[];function pn(){wn.push.apply(wn,gc(arguments))}var rn=[];function Wt(){var st="v"+K++;return rn.push(st),arguments.length>0&&(wn.push(st,"="),wn.push.apply(wn,gc(arguments)),wn.push(";")),st}return o(pn,{def:Wt,toString:function(){return va([rn.length>0?"var "+rn.join(",")+";":"",va(wn)])}})}function yt(){var wn=Dt(),pn=Dt(),rn=wn.toString,Wt=pn.toString;function st(St,ln){pn(St,ln,"=",wn.def(St,ln),";")}return o(function(){wn.apply(wn,gc(arguments))},{def:wn.def,entry:wn,exit:pn,save:st,set:function(St,ln,An){st(St,ln),wn(St,ln,"=",An,";")},toString:function(){return rn()+Wt()}})}function Nt(){var wn=va(arguments),pn=yt(),rn=yt(),Wt=pn.toString,st=rn.toString;return o(pn,{then:function(){return pn.apply(pn,gc(arguments)),this},else:function(){return rn.apply(rn,gc(arguments)),this},toString:function(){var St=st();return St&&(St="else{"+St+"}"),va(["if(",wn,"){",Wt(),"}",St])}})}var tn=Dt(),sn={};function nn(wn,pn){var rn=[];function Wt(){var Xt="a"+rn.length;return rn.push(Xt),Xt}pn=pn||0;for(var st=0;st<pn;++st)Wt();var St=yt(),ln=St.toString,An=sn[wn]=o(St,{arg:Wt,toString:function(){return va(["function(",rn.join(),"){",ln(),"}"])}});return An}function Mt(){var wn=['"use strict";',tn,"return {"];Object.keys(sn).forEach(function(Wt){wn.push('"',Wt,'":',sn[Wt].toString(),",")}),wn.push("}");var pn=va(wn).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),rn=Function.apply(null,me.concat(pn));return rn.apply(null,Ie)}return{global:tn,link:wt,block:Dt,proc:nn,scope:yt,cond:Nt,compile:Mt}}var ou="xyzw".split(""),yc=5121,_c=1,bc=2,Fp=0,iu=1,wc=2,Bp=3,fs=4,wf=5,Ef=6,md="dither",gd="blend.enable",yd="blend.color",$p="blend.equation",_d="blend.func",ov="depth.enable",Up="depth.func",Tm="depth.range",iv="depth.mask",ps="colorMask",av="cull.enable",lv="cull.face",sv="frontFace",bd="lineWidth",Ls="polygonOffset.enable",xf="polygonOffset.offset",Vp="sample.alpha",Wp="sample.enable",Cu="sample.coverage",Nu="stencil.enable",Rr="stencil.mask",wd="stencil.func",Of="stencil.opFront",hs="stencil.opBack",aa="scissor.enable",Ec="scissor.box",Ti="viewport",ku="profile",tl="framebuffer",Sf="vert",Ra="frag",Fi="elements",Is="primitive",Fs="count",Gp="offset",Qt="instances",xc="vao",Af="Width",Mf="Height",Pu=tl+Af,Oc=tl+Mf,zp=Ti+Af,uv=Ti+Mf,Sc="drawingBuffer",Tf=Sc+Af,Hp=Sc+Mf,cv=[_d,$p,wd,Of,hs,Cu,Ti,Ec,xf],Bs=34962,dv=34963,vs=35632,Ru=35633,Xp=3553,Cm=34067,Nm=2884,km=3042,fv=3024,Yp=2960,Cf=2929,Pm=3089,ms=32823,Du=32926,_y=32928,gi=5126,Nf=35664,Ac=35665,kf=35666,Ed=5124,Pf=35667,Rf=35668,Df=35669,Mc=35670,au=35671,ma=35672,qp=35673,jf=35674,Tc=35675,xd=35676,wa=35678,xi=35680,Lf=4,za=1028,wr=1029,Kp=2304,If=2305,Zp=32775,pv=32776,Rm=519,ju=7680,Dm=0,Cc=1,jm=32774,hv=513,Ff=36160,Lm=36064,Gl={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},lu=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Lu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vv={frag:vs,vert:Ru},Od={cw:Kp,ccw:If};function su(K){return Array.isArray(K)||n(K)||Ia(K)}function Bf(K){return K.sort(function(me,Ie){return me===Ti?-1:Ie===Ti?1:me<Ie?-1:1})}function Ha(K,me,Ie,wt){this.thisDep=K,this.contextDep=me,this.propDep=Ie,this.append=wt}function gs(K){return K&&!(K.thisDep||K.contextDep||K.propDep)}function Ci(K){return new Ha(!1,!1,!1,K)}function dl(K,me){var Ie=K.type;if(Ie===Fp){var wt=K.data.length;return new Ha(!0,wt>=1,wt>=2,me)}else if(Ie===fs){var Dt=K.data;return new Ha(Dt.thisDep,Dt.contextDep,Dt.propDep,me)}else{if(Ie===wf)return new Ha(!1,!1,!1,me);if(Ie===Ef){for(var yt=!1,Nt=!1,tn=!1,sn=0;sn<K.data.length;++sn){var nn=K.data[sn];if(nn.type===iu)tn=!0;else if(nn.type===wc)Nt=!0;else if(nn.type===Bp)yt=!0;else if(nn.type===Fp){yt=!0;var Mt=nn.data;Mt>=1&&(Nt=!0),Mt>=2&&(tn=!0)}else nn.type===fs&&(yt=yt||nn.data.thisDep,Nt=Nt||nn.data.contextDep,tn=tn||nn.data.propDep)}return new Ha(yt,Nt,tn,me)}else return new Ha(Ie===Bp,Ie===wc,Ie===iu,me)}}var zl=new Ha(!1,!1,!1,function(){});function by(K,me,Ie,wt,Dt,yt,Nt,tn,sn,nn,Mt,wn,pn,rn,Wt){var st=nn.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Ie.ext_blend_minmax&&(St.min=Zp,St.max=pv);var ln=Ie.angle_instanced_arrays,An=Ie.webgl_draw_buffers,Xt={dirty:!0,profile:Wt.profile},kn={},Kt=[],_n={},Yt={};function xn(xe){return xe.replace(".","_")}function ar(xe,de,We){var tt=xn(xe);Kt.push(xe),kn[tt]=Xt[tt]=!!We,_n[tt]=de}function xr(xe,de,We){var tt=xn(xe);Kt.push(xe),Array.isArray(We)?(Xt[tt]=We.slice(),kn[tt]=We.slice()):Xt[tt]=kn[tt]=We,Yt[tt]=de}ar(md,fv),ar(gd,km),xr(yd,"blendColor",[0,0,0,0]),xr($p,"blendEquationSeparate",[jm,jm]),xr(_d,"blendFuncSeparate",[Cc,Dm,Cc,Dm]),ar(ov,Cf,!0),xr(Up,"depthFunc",hv),xr(Tm,"depthRange",[0,1]),xr(iv,"depthMask",!0),xr(ps,ps,[!0,!0,!0,!0]),ar(av,Nm),xr(lv,"cullFace",wr),xr(sv,sv,If),xr(bd,bd,1),ar(Ls,ms),xr(xf,"polygonOffset",[0,0]),ar(Vp,Du),ar(Wp,_y),xr(Cu,"sampleCoverage",[1,!1]),ar(Nu,Yp),xr(Rr,"stencilMask",-1),xr(wd,"stencilFunc",[Rm,0,-1]),xr(Of,"stencilOpSeparate",[za,ju,ju,ju]),xr(hs,"stencilOpSeparate",[wr,ju,ju,ju]),ar(aa,Pm),xr(Ec,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),xr(Ti,Ti,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var on={gl:K,context:pn,strings:me,next:kn,current:Xt,draw:wn,elements:yt,buffer:Dt,shader:Mt,attributes:nn.state,vao:nn,uniforms:sn,framebuffer:tn,extensions:Ie,timer:rn,isBufferArgs:su},Zt={primTypes:Ki,compareFuncs:Lu,blendFuncs:Gl,blendEquations:St,stencilOps:Er,glTypes:$a,orientationType:Od};q.optional(function(){on.isArrayLike=L}),An&&(Zt.backBuffer=[wr],Zt.drawBuffer=In(wt.maxDrawbuffers,function(xe){return xe===0?[0]:In(xe,function(de){return Lm+de})}));var Ht=0;function fr(){var xe=ds(),de=xe.link,We=xe.global;xe.id=Ht++,xe.batchId="0";var tt=de(on),ct=xe.shared={props:"a0"};Object.keys(on).forEach(function(Ue){ct[Ue]=We.def(tt,".",Ue)}),q.optional(function(){xe.CHECK=de(q),xe.commandStr=q.guessCommand(),xe.command=de(xe.commandStr),xe.assert=function(Ue,be,nt){Ue("if(!(",be,"))",this.CHECK,".commandRaise(",de(nt),",",this.command,");")},Zt.invalidBlendCombinations=lu});var Xe=xe.next={},Ge=xe.current={};Object.keys(Yt).forEach(function(Ue){Array.isArray(Xt[Ue])&&(Xe[Ue]=We.def(ct.next,".",Ue),Ge[Ue]=We.def(ct.current,".",Ue))});var Qe=xe.constants={};Object.keys(Zt).forEach(function(Ue){Qe[Ue]=We.def(JSON.stringify(Zt[Ue]))}),xe.invoke=function(Ue,be){switch(be.type){case Fp:var nt=["this",ct.context,ct.props,xe.batchId];return Ue.def(de(be.data),".call(",nt.slice(0,Math.max(be.data.length+1,4)),")");case iu:return Ue.def(ct.props,be.data);case wc:return Ue.def(ct.context,be.data);case Bp:return Ue.def("this",be.data);case fs:return be.data.append(xe,Ue),be.data.ref;case wf:return be.data.toString();case Ef:return be.data.map(function(ot){return xe.invoke(Ue,ot)})}},xe.attribCache={};var Ee={};return xe.scopeAttrib=function(Ue){var be=me.id(Ue);if(be in Ee)return Ee[be];var nt=nn.scope[be];nt||(nt=nn.scope[be]=new st);var ot=Ee[be]=de(nt);return ot},xe}function Dr(xe){var de=xe.static,We=xe.dynamic,tt;if(ku in de){var ct=!!de[ku];tt=Ci(function(Ge,Qe){return ct}),tt.enable=ct}else if(ku in We){var Xe=We[ku];tt=dl(Xe,function(Ge,Qe){return Ge.invoke(Qe,Xe)})}return tt}function Un(xe,de){var We=xe.static,tt=xe.dynamic;if(tl in We){var ct=We[tl];return ct?(ct=tn.getFramebuffer(ct),q.command(ct,"invalid framebuffer object"),Ci(function(Ge,Qe){var Ee=Ge.link(ct),Ue=Ge.shared;Qe.set(Ue.framebuffer,".next",Ee);var be=Ue.context;return Qe.set(be,"."+Pu,Ee+".width"),Qe.set(be,"."+Oc,Ee+".height"),Ee})):Ci(function(Ge,Qe){var Ee=Ge.shared;Qe.set(Ee.framebuffer,".next","null");var Ue=Ee.context;return Qe.set(Ue,"."+Pu,Ue+"."+Tf),Qe.set(Ue,"."+Oc,Ue+"."+Hp),"null"})}else if(tl in tt){var Xe=tt[tl];return dl(Xe,function(Ge,Qe){var Ee=Ge.invoke(Qe,Xe),Ue=Ge.shared,be=Ue.framebuffer,nt=Qe.def(be,".getFramebuffer(",Ee,")");q.optional(function(){Ge.assert(Qe,"!"+Ee+"||"+nt,"invalid framebuffer object")}),Qe.set(be,".next",nt);var ot=Ue.context;return Qe.set(ot,"."+Pu,nt+"?"+nt+".width:"+ot+"."+Tf),Qe.set(ot,"."+Oc,nt+"?"+nt+".height:"+ot+"."+Hp),nt})}else return null}function $r(xe,de,We){var tt=xe.static,ct=xe.dynamic;function Xe(Ee){if(Ee in tt){var Ue=tt[Ee];q.commandType(Ue,"object","invalid "+Ee,We.commandStr);var be=!0,nt=Ue.x|0,ot=Ue.y|0,g,x;return"width"in Ue?(g=Ue.width|0,q.command(g>=0,"invalid "+Ee,We.commandStr)):be=!1,"height"in Ue?(x=Ue.height|0,q.command(x>=0,"invalid "+Ee,We.commandStr)):be=!1,new Ha(!be&&de&&de.thisDep,!be&&de&&de.contextDep,!be&&de&&de.propDep,function(te,ce){var Oe=te.shared.context,Fe=g;"width"in Ue||(Fe=ce.def(Oe,".",Pu,"-",nt));var et=x;return"height"in Ue||(et=ce.def(Oe,".",Oc,"-",ot)),[nt,ot,Fe,et]})}else if(Ee in ct){var C=ct[Ee],G=dl(C,function(te,ce){var Oe=te.invoke(ce,C);q.optional(function(){te.assert(ce,Oe+"&&typeof "+Oe+'==="object"',"invalid "+Ee)});var Fe=te.shared.context,et=ce.def(Oe,".x|0"),jt=ce.def(Oe,".y|0"),Vt=ce.def('"width" in ',Oe,"?",Oe,".width|0:","(",Fe,".",Pu,"-",et,")"),yn=ce.def('"height" in ',Oe,"?",Oe,".height|0:","(",Fe,".",Oc,"-",jt,")");return q.optional(function(){te.assert(ce,Vt+">=0&&"+yn+">=0","invalid "+Ee)}),[et,jt,Vt,yn]});return de&&(G.thisDep=G.thisDep||de.thisDep,G.contextDep=G.contextDep||de.contextDep,G.propDep=G.propDep||de.propDep),G}else return de?new Ha(de.thisDep,de.contextDep,de.propDep,function(te,ce){var Oe=te.shared.context;return[0,0,ce.def(Oe,".",Pu),ce.def(Oe,".",Oc)]}):null}var Ge=Xe(Ti);if(Ge){var Qe=Ge;Ge=new Ha(Ge.thisDep,Ge.contextDep,Ge.propDep,function(Ee,Ue){var be=Qe.append(Ee,Ue),nt=Ee.shared.context;return Ue.set(nt,"."+zp,be[2]),Ue.set(nt,"."+uv,be[3]),be})}return{viewport:Ge,scissor_box:Xe(Ec)}}function Or(xe,de){var We=xe.static,tt=typeof We[Ra]=="string"&&typeof We[Sf]=="string";if(tt){if(Object.keys(de.dynamic).length>0)return null;var ct=de.static,Xe=Object.keys(ct);if(Xe.length>0&&typeof ct[Xe[0]]=="number"){for(var Ge=[],Qe=0;Qe<Xe.length;++Qe)q(typeof ct[Xe[Qe]]=="number","must specify all vertex attribute locations when using vaos"),Ge.push([ct[Xe[Qe]]|0,Xe[Qe]]);return Ge}}return null}function Fr(xe,de,We){var tt=xe.static,ct=xe.dynamic;function Xe(be){if(be in tt){var nt=me.id(tt[be]);q.optional(function(){Mt.shader(vv[be],nt,q.guessCommand())});var ot=Ci(function(){return nt});return ot.id=nt,ot}else if(be in ct){var g=ct[be];return dl(g,function(x,C){var G=x.invoke(C,g),te=C.def(x.shared.strings,".id(",G,")");return q.optional(function(){C(x.shared.shader,".shader(",vv[be],",",te,",",x.command,");")}),te})}return null}var Ge=Xe(Ra),Qe=Xe(Sf),Ee=null,Ue;return gs(Ge)&&gs(Qe)?(Ee=Mt.program(Qe.id,Ge.id,null,We),Ue=Ci(function(be,nt){return be.link(Ee)})):Ue=new Ha(Ge&&Ge.thisDep||Qe&&Qe.thisDep,Ge&&Ge.contextDep||Qe&&Qe.contextDep,Ge&&Ge.propDep||Qe&&Qe.propDep,function(be,nt){var ot=be.shared.shader,g;Ge?g=Ge.append(be,nt):g=nt.def(ot,".",Ra);var x;Qe?x=Qe.append(be,nt):x=nt.def(ot,".",Sf);var C=ot+".program("+x+","+g;return q.optional(function(){C+=","+be.command}),nt.def(C+")")}),{frag:Ge,vert:Qe,progVar:Ue,program:Ee}}function Qr(xe,de){var We=xe.static,tt=xe.dynamic;function ct(){if(Fi in We){var be=We[Fi];su(be)?be=yt.getElements(yt.create(be,!0)):be&&(be=yt.getElements(be),q.command(be,"invalid elements",de.commandStr));var nt=Ci(function(g,x){if(be){var C=g.link(be);return g.ELEMENTS=C,C}return g.ELEMENTS=null,null});return nt.value=be,nt}else if(Fi in tt){var ot=tt[Fi];return dl(ot,function(g,x){var C=g.shared,G=C.isBufferArgs,te=C.elements,ce=g.invoke(x,ot),Oe=x.def("null"),Fe=x.def(G,"(",ce,")"),et=g.cond(Fe).then(Oe,"=",te,".createStream(",ce,");").else(Oe,"=",te,".getElements(",ce,");");return q.optional(function(){g.assert(et.else,"!"+ce+"||"+Oe,"invalid elements")}),x.entry(et),x.exit(g.cond(Fe).then(te,".destroyStream(",Oe,");")),g.ELEMENTS=Oe,Oe})}return null}var Xe=ct();function Ge(){if(Is in We){var be=We[Is];return q.commandParameter(be,Ki,"invalid primitve",de.commandStr),Ci(function(ot,g){return Ki[be]})}else if(Is in tt){var nt=tt[Is];return dl(nt,function(ot,g){var x=ot.constants.primTypes,C=ot.invoke(g,nt);return q.optional(function(){ot.assert(g,C+" in "+x,"invalid primitive, must be one of "+Object.keys(Ki))}),g.def(x,"[",C,"]")})}else if(Xe)return gs(Xe)?Xe.value?Ci(function(ot,g){return g.def(ot.ELEMENTS,".primType")}):Ci(function(){return Lf}):new Ha(Xe.thisDep,Xe.contextDep,Xe.propDep,function(ot,g){var x=ot.ELEMENTS;return g.def(x,"?",x,".primType:",Lf)});return null}function Qe(be,nt){if(be in We){var ot=We[be]|0;return q.command(!nt||ot>=0,"invalid "+be,de.commandStr),Ci(function(x,C){return nt&&(x.OFFSET=ot),ot})}else if(be in tt){var g=tt[be];return dl(g,function(x,C){var G=x.invoke(C,g);return nt&&(x.OFFSET=G,q.optional(function(){x.assert(C,G+">=0","invalid "+be)})),G})}else if(nt&&Xe)return Ci(function(x,C){return x.OFFSET="0",0});return null}var Ee=Qe(Gp,!0);function Ue(){if(Fs in We){var be=We[Fs]|0;return q.command(typeof be=="number"&&be>=0,"invalid vertex count",de.commandStr),Ci(function(){return be})}else if(Fs in tt){var nt=tt[Fs];return dl(nt,function(x,C){var G=x.invoke(C,nt);return q.optional(function(){x.assert(C,"typeof "+G+'==="number"&&'+G+">=0&&"+G+"===("+G+"|0)","invalid vertex count")}),G})}else if(Xe)if(gs(Xe)){if(Xe)return Ee?new Ha(Ee.thisDep,Ee.contextDep,Ee.propDep,function(x,C){var G=C.def(x.ELEMENTS,".vertCount-",x.OFFSET);return q.optional(function(){x.assert(C,G+">=0","invalid vertex offset/element buffer too small")}),G}):Ci(function(x,C){return C.def(x.ELEMENTS,".vertCount")});var ot=Ci(function(){return-1});return q.optional(function(){ot.MISSING=!0}),ot}else{var g=new Ha(Xe.thisDep||Ee.thisDep,Xe.contextDep||Ee.contextDep,Xe.propDep||Ee.propDep,function(x,C){var G=x.ELEMENTS;return x.OFFSET?C.def(G,"?",G,".vertCount-",x.OFFSET,":-1"):C.def(G,"?",G,".vertCount:-1")});return q.optional(function(){g.DYNAMIC=!0}),g}return null}return{elements:Xe,primitive:Ge(),count:Ue(),instances:Qe(Qt,!1),offset:Ee}}function ki(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Kt.forEach(function(Xe){var Ge=xn(Xe);function Qe(Ee,Ue){if(Xe in We){var be=Ee(We[Xe]);ct[Ge]=Ci(function(){return be})}else if(Xe in tt){var nt=tt[Xe];ct[Ge]=dl(nt,function(ot,g){return Ue(ot,g,ot.invoke(g,nt))})}}switch(Xe){case av:case gd:case md:case Nu:case ov:case aa:case Ls:case Vp:case Wp:case iv:return Qe(function(Ee){return q.commandType(Ee,"boolean",Xe,de.commandStr),Ee},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="boolean"',"invalid flag "+Xe,Ee.commandStr)}),be});case Up:return Qe(function(Ee){return q.commandParameter(Ee,Lu,"invalid "+Xe,de.commandStr),Lu[Ee]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;return q.optional(function(){Ee.assert(Ue,be+" in "+nt,"invalid "+Xe+", must be one of "+Object.keys(Lu))}),Ue.def(nt,"[",be,"]")});case Tm:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===2&&typeof Ee[0]=="number"&&typeof Ee[1]=="number"&&Ee[0]<=Ee[1],"depth range is 2d array",de.commandStr),Ee},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===2&&typeof "+be+'[0]==="number"&&typeof '+be+'[1]==="number"&&'+be+"[0]<="+be+"[1]","depth range must be a 2d array")});var nt=Ue.def("+",be,"[0]"),ot=Ue.def("+",be,"[1]");return[nt,ot]});case _d:return Qe(function(Ee){q.commandType(Ee,"object","blend.func",de.commandStr);var Ue="srcRGB"in Ee?Ee.srcRGB:Ee.src,be="srcAlpha"in Ee?Ee.srcAlpha:Ee.src,nt="dstRGB"in Ee?Ee.dstRGB:Ee.dst,ot="dstAlpha"in Ee?Ee.dstAlpha:Ee.dst;return q.commandParameter(Ue,Gl,Ge+".srcRGB",de.commandStr),q.commandParameter(be,Gl,Ge+".srcAlpha",de.commandStr),q.commandParameter(nt,Gl,Ge+".dstRGB",de.commandStr),q.commandParameter(ot,Gl,Ge+".dstAlpha",de.commandStr),q.command(lu.indexOf(Ue+", "+nt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ue+", "+nt+")",de.commandStr),[Gl[Ue],Gl[nt],Gl[be],Gl[ot]]},function(Ee,Ue,be){var nt=Ee.constants.blendFuncs;q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid blend func, must be an object")});function ot(Oe,Fe){var et=Ue.def('"',Oe,Fe,'" in ',be,"?",be,".",Oe,Fe,":",be,".",Oe);return q.optional(function(){Ee.assert(Ue,et+" in "+nt,"invalid "+Xe+"."+Oe+Fe+", must be one of "+Object.keys(Gl))}),et}var g=ot("src","RGB"),x=ot("dst","RGB");q.optional(function(){var Oe=Ee.constants.invalidBlendCombinations;Ee.assert(Ue,Oe+".indexOf("+g+'+", "+'+x+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var C=Ue.def(nt,"[",g,"]"),G=Ue.def(nt,"[",ot("src","Alpha"),"]"),te=Ue.def(nt,"[",x,"]"),ce=Ue.def(nt,"[",ot("dst","Alpha"),"]");return[C,te,G,ce]});case $p:return Qe(function(Ee){if(typeof Ee=="string")return q.commandParameter(Ee,St,"invalid "+Xe,de.commandStr),[St[Ee],St[Ee]];if(typeof Ee=="object")return q.commandParameter(Ee.rgb,St,Xe+".rgb",de.commandStr),q.commandParameter(Ee.alpha,St,Xe+".alpha",de.commandStr),[St[Ee.rgb],St[Ee.alpha]];q.commandRaise("invalid blend.equation",de.commandStr)},function(Ee,Ue,be){var nt=Ee.constants.blendEquations,ot=Ue.def(),g=Ue.def(),x=Ee.cond("typeof ",be,'==="string"');return q.optional(function(){function C(G,te,ce){Ee.assert(G,ce+" in "+nt,"invalid "+te+", must be one of "+Object.keys(St))}C(x.then,Xe,be),Ee.assert(x.else,be+"&&typeof "+be+'==="object"',"invalid "+Xe),C(x.else,Xe+".rgb",be+".rgb"),C(x.else,Xe+".alpha",be+".alpha")}),x.then(ot,"=",g,"=",nt,"[",be,"];"),x.else(ot,"=",nt,"[",be,".rgb];",g,"=",nt,"[",be,".alpha];"),Ue(x),[ot,g]});case yd:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),In(4,function(Ue){return+Ee[Ue]})},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","blend.color must be a 4d array")}),In(4,function(nt){return Ue.def("+",be,"[",nt,"]")})});case Rr:return Qe(function(Ee){return q.commandType(Ee,"number",Ge,de.commandStr),Ee|0},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"',"invalid stencil.mask")}),Ue.def(be,"|0")});case wd:return Qe(function(Ee){q.commandType(Ee,"object",Ge,de.commandStr);var Ue=Ee.cmp||"keep",be=Ee.ref||0,nt="mask"in Ee?Ee.mask:-1;return q.commandParameter(Ue,Lu,Xe+".cmp",de.commandStr),q.commandType(be,"number",Xe+".ref",de.commandStr),q.commandType(nt,"number",Xe+".mask",de.commandStr),[Lu[Ue],be,nt]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;q.optional(function(){function C(){Ee.assert(Ue,Array.prototype.join.call(arguments,""),"invalid stencil.func")}C(be+"&&typeof ",be,'==="object"'),C('!("cmp" in ',be,")||(",be,".cmp in ",nt,")")});var ot=Ue.def('"cmp" in ',be,"?",nt,"[",be,".cmp]",":",ju),g=Ue.def(be,".ref|0"),x=Ue.def('"mask" in ',be,"?",be,".mask|0:-1");return[ot,g,x]});case Of:case hs:return Qe(function(Ee){q.commandType(Ee,"object",Ge,de.commandStr);var Ue=Ee.fail||"keep",be=Ee.zfail||"keep",nt=Ee.zpass||"keep";return q.commandParameter(Ue,Er,Xe+".fail",de.commandStr),q.commandParameter(be,Er,Xe+".zfail",de.commandStr),q.commandParameter(nt,Er,Xe+".zpass",de.commandStr),[Xe===hs?wr:za,Er[Ue],Er[be],Er[nt]]},function(Ee,Ue,be){var nt=Ee.constants.stencilOps;q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});function ot(g){return q.optional(function(){Ee.assert(Ue,'!("'+g+'" in '+be+")||("+be+"."+g+" in "+nt+")","invalid "+Xe+"."+g+", must be one of "+Object.keys(Er))}),Ue.def('"',g,'" in ',be,"?",nt,"[",be,".",g,"]:",ju)}return[Xe===hs?wr:za,ot("fail"),ot("zfail"),ot("zpass")]});case xf:return Qe(function(Ee){q.commandType(Ee,"object",Ge,de.commandStr);var Ue=Ee.factor|0,be=Ee.units|0;return q.commandType(Ue,"number",Ge+".factor",de.commandStr),q.commandType(be,"number",Ge+".units",de.commandStr),[Ue,be]},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});var nt=Ue.def(be,".factor|0"),ot=Ue.def(be,".units|0");return[nt,ot]});case lv:return Qe(function(Ee){var Ue=0;return Ee==="front"?Ue=za:Ee==="back"&&(Ue=wr),q.command(!!Ue,Ge,de.commandStr),Ue},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,be+'==="front"||'+be+'==="back"',"invalid cull.face")}),Ue.def(be,'==="front"?',za,":",wr)});case bd:return Qe(function(Ee){return q.command(typeof Ee=="number"&&Ee>=wt.lineWidthDims[0]&&Ee<=wt.lineWidthDims[1],"invalid line width, must be a positive number between "+wt.lineWidthDims[0]+" and "+wt.lineWidthDims[1],de.commandStr),Ee},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"&&'+be+">="+wt.lineWidthDims[0]+"&&"+be+"<="+wt.lineWidthDims[1],"invalid line width")}),be});case sv:return Qe(function(Ee){return q.commandParameter(Ee,Od,Ge,de.commandStr),Od[Ee]},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,be+'==="cw"||'+be+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Ue.def(be+'==="cw"?'+Kp+":"+If)});case ps:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===4,"color.mask must be length 4 array",de.commandStr),Ee.map(function(Ue){return!!Ue})},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","invalid color.mask")}),In(4,function(nt){return"!!"+be+"["+nt+"]"})});case Cu:return Qe(function(Ee){q.command(typeof Ee=="object"&&Ee,Ge,de.commandStr);var Ue="value"in Ee?Ee.value:1,be=!!Ee.invert;return q.command(typeof Ue=="number"&&Ue>=0&&Ue<=1,"sample.coverage.value must be a number between 0 and 1",de.commandStr),[Ue,be]},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid sample.coverage")});var nt=Ue.def('"value" in ',be,"?+",be,".value:1"),ot=Ue.def("!!",be,".invert");return[nt,ot]})}}),ct}function Si(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Object.keys(We).forEach(function(Xe){var Ge=We[Xe],Qe;if(typeof Ge=="number"||typeof Ge=="boolean")Qe=Ci(function(){return Ge});else if(typeof Ge=="function"){var Ee=Ge._reglType;Ee==="texture2d"||Ee==="textureCube"?Qe=Ci(function(Ue){return Ue.link(Ge)}):Ee==="framebuffer"||Ee==="framebufferCube"?(q.command(Ge.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Xe+'"',de.commandStr),Qe=Ci(function(Ue){return Ue.link(Ge.color[0])})):q.commandRaise('invalid data for uniform "'+Xe+'"',de.commandStr)}else L(Ge)?Qe=Ci(function(Ue){var be=Ue.global.def("[",In(Ge.length,function(nt){return q.command(typeof Ge[nt]=="number"||typeof Ge[nt]=="boolean","invalid uniform "+Xe,Ue.commandStr),Ge[nt]}),"]");return be}):q.commandRaise('invalid or missing data for uniform "'+Xe+'"',de.commandStr);Qe.value=Ge,ct[Xe]=Qe}),Object.keys(tt).forEach(function(Xe){var Ge=tt[Xe];ct[Xe]=dl(Ge,function(Qe,Ee){return Qe.invoke(Ee,Ge)})}),ct}function jr(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Object.keys(We).forEach(function(Xe){var Ge=We[Xe],Qe=me.id(Xe),Ee=new st;if(su(Ge))Ee.state=_c,Ee.buffer=Dt.getBuffer(Dt.create(Ge,Bs,!1,!0)),Ee.type=0;else{var Ue=Dt.getBuffer(Ge);if(Ue)Ee.state=_c,Ee.buffer=Ue,Ee.type=0;else if(q.command(typeof Ge=="object"&&Ge,"invalid data for attribute "+Xe,de.commandStr),"constant"in Ge){var be=Ge.constant;Ee.buffer="null",Ee.state=bc,typeof be=="number"?Ee.x=be:(q.command(L(be)&&be.length>0&&be.length<=4,"invalid constant for attribute "+Xe,de.commandStr),ou.forEach(function(te,ce){ce<be.length&&(Ee[te]=be[ce])}))}else{su(Ge.buffer)?Ue=Dt.getBuffer(Dt.create(Ge.buffer,Bs,!1,!0)):Ue=Dt.getBuffer(Ge.buffer),q.command(!!Ue,'missing buffer for attribute "'+Xe+'"',de.commandStr);var nt=Ge.offset|0;q.command(nt>=0,'invalid offset for attribute "'+Xe+'"',de.commandStr);var ot=Ge.stride|0;q.command(ot>=0&&ot<256,'invalid stride for attribute "'+Xe+'", must be integer betweeen [0, 255]',de.commandStr);var g=Ge.size|0;q.command(!("size"in Ge)||g>0&&g<=4,'invalid size for attribute "'+Xe+'", must be 1,2,3,4',de.commandStr);var x=!!Ge.normalized,C=0;"type"in Ge&&(q.commandParameter(Ge.type,$a,"invalid type for attribute "+Xe,de.commandStr),C=$a[Ge.type]);var G=Ge.divisor|0;"divisor"in Ge&&(q.command(G===0||ln,'cannot specify divisor for attribute "'+Xe+'", instancing not supported',de.commandStr),q.command(G>=0,'invalid divisor for attribute "'+Xe+'"',de.commandStr)),q.optional(function(){var te=de.commandStr,ce=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Ge).forEach(function(Oe){q.command(ce.indexOf(Oe)>=0,'unknown parameter "'+Oe+'" for attribute pointer "'+Xe+'" (valid parameters are '+ce+")",te)})}),Ee.buffer=Ue,Ee.state=_c,Ee.size=g,Ee.normalized=x,Ee.type=C||Ue.dtype,Ee.offset=nt,Ee.stride=ot,Ee.divisor=G}}ct[Xe]=Ci(function(te,ce){var Oe=te.attribCache;if(Qe in Oe)return Oe[Qe];var Fe={isStream:!1};return Object.keys(Ee).forEach(function(et){Fe[et]=Ee[et]}),Ee.buffer&&(Fe.buffer=te.link(Ee.buffer),Fe.type=Fe.type||Fe.buffer+".dtype"),Oe[Qe]=Fe,Fe})}),Object.keys(tt).forEach(function(Xe){var Ge=tt[Xe];function Qe(Ee,Ue){var be=Ee.invoke(Ue,Ge),nt=Ee.shared,ot=Ee.constants,g=nt.isBufferArgs,x=nt.buffer;q.optional(function(){Ee.assert(Ue,be+"&&(typeof "+be+'==="object"||typeof '+be+'==="function")&&('+g+"("+be+")||"+x+".getBuffer("+be+")||"+x+".getBuffer("+be+".buffer)||"+g+"("+be+'.buffer)||("constant" in '+be+"&&(typeof "+be+'.constant==="number"||'+nt.isArrayLike+"("+be+".constant))))",'invalid dynamic attribute "'+Xe+'"')});var C={isStream:Ue.def(!1)},G=new st;G.state=_c,Object.keys(G).forEach(function(Fe){C[Fe]=Ue.def(""+G[Fe])});var te=C.buffer,ce=C.type;Ue("if(",g,"(",be,")){",C.isStream,"=true;",te,"=",x,".createStream(",Bs,",",be,");",ce,"=",te,".dtype;","}else{",te,"=",x,".getBuffer(",be,");","if(",te,"){",ce,"=",te,".dtype;",'}else if("constant" in ',be,"){",C.state,"=",bc,";","if(typeof "+be+'.constant === "number"){',C[ou[0]],"=",be,".constant;",ou.slice(1).map(function(Fe){return C[Fe]}).join("="),"=0;","}else{",ou.map(function(Fe,et){return C[Fe]+"="+be+".constant.length>"+et+"?"+be+".constant["+et+"]:0;"}).join(""),"}}else{","if(",g,"(",be,".buffer)){",te,"=",x,".createStream(",Bs,",",be,".buffer);","}else{",te,"=",x,".getBuffer(",be,".buffer);","}",ce,'="type" in ',be,"?",ot.glTypes,"[",be,".type]:",te,".dtype;",C.normalized,"=!!",be,".normalized;");function Oe(Fe){Ue(C[Fe],"=",be,".",Fe,"|0;")}return Oe("size"),Oe("offset"),Oe("stride"),Oe("divisor"),Ue("}}"),Ue.exit("if(",C.isStream,"){",x,".destroyStream(",te,");","}"),C}ct[Xe]=dl(Ge,Qe)}),ct}function Gi(xe,de){var We=xe.static,tt=xe.dynamic;if(xc in We){var ct=We[xc];return ct!==null&&nn.getVAO(ct)===null&&(ct=nn.createVAO(ct)),Ci(function(Ge){return Ge.link(nn.getVAO(ct))})}else if(xc in tt){var Xe=tt[xc];return dl(Xe,function(Ge,Qe){var Ee=Ge.invoke(Qe,Xe);return Qe.def(Ge.shared.vao+".getVAO("+Ee+")")})}return null}function Ko(xe){var de=xe.static,We=xe.dynamic,tt={};return Object.keys(de).forEach(function(ct){var Xe=de[ct];tt[ct]=Ci(function(Ge,Qe){return typeof Xe=="number"||typeof Xe=="boolean"?""+Xe:Ge.link(Xe)})}),Object.keys(We).forEach(function(ct){var Xe=We[ct];tt[ct]=dl(Xe,function(Ge,Qe){return Ge.invoke(Qe,Xe)})}),tt}function Pi(xe,de,We,tt,ct){var Xe=xe.static,Ge=xe.dynamic;q.optional(function(){var Oe=[tl,Sf,Ra,Fi,Is,Gp,Fs,Qt,ku,xc].concat(Kt);function Fe(et){Object.keys(et).forEach(function(jt){q.command(Oe.indexOf(jt)>=0,'unknown parameter "'+jt+'"',ct.commandStr)})}Fe(Xe),Fe(Ge)});var Qe=Or(xe,de),Ee=Un(xe),Ue=$r(xe,Ee,ct),be=Qr(xe,ct),nt=ki(xe,ct),ot=Fr(xe,ct,Qe);function g(Oe){var Fe=Ue[Oe];Fe&&(nt[Oe]=Fe)}g(Ti),g(xn(Ec));var x=Object.keys(nt).length>0,C={framebuffer:Ee,draw:be,shader:ot,state:nt,dirty:x,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=Dr(xe),C.uniforms=Si(We,ct),C.drawVAO=C.scopeVAO=Gi(xe),!C.drawVAO&&ot.program&&!Qe&&Ie.angle_instanced_arrays){var G=!0,te=ot.program.attributes.map(function(Oe){var Fe=de.static[Oe];return G=G&&!!Fe,Fe});if(G&&te.length>0){var ce=nn.getVAO(nn.createVAO(te));C.drawVAO=new Ha(null,null,null,function(Oe,Fe){return Oe.link(ce)}),C.useVAO=!0}}return Qe?C.useVAO=!0:C.attributes=jr(de,ct),C.context=Ko(tt),C}function $i(xe,de,We){var tt=xe.shared,ct=tt.context,Xe=xe.scope();Object.keys(We).forEach(function(Ge){de.save(ct,"."+Ge);var Qe=We[Ge],Ee=Qe.append(xe,de);Array.isArray(Ee)?Xe(ct,".",Ge,"=[",Ee.join(),"];"):Xe(ct,".",Ge,"=",Ee,";")}),de(Xe)}function Qi(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,Ge=ct.framebuffer,Qe;An&&(Qe=de.def(ct.extensions,".webgl_draw_buffers"));var Ee=xe.constants,Ue=Ee.drawBuffer,be=Ee.backBuffer,nt;We?nt=We.append(xe,de):nt=de.def(Ge,".next"),tt||de("if(",nt,"!==",Ge,".cur){"),de("if(",nt,"){",Xe,".bindFramebuffer(",Ff,",",nt,".framebuffer);"),An&&de(Qe,".drawBuffersWEBGL(",Ue,"[",nt,".colorAttachments.length]);"),de("}else{",Xe,".bindFramebuffer(",Ff,",null);"),An&&de(Qe,".drawBuffersWEBGL(",be,");"),de("}",Ge,".cur=",nt,";"),tt||de("}")}function la(xe,de,We){var tt=xe.shared,ct=tt.gl,Xe=xe.current,Ge=xe.next,Qe=tt.current,Ee=tt.next,Ue=xe.cond(Qe,".dirty");Kt.forEach(function(be){var nt=xn(be);if(!(nt in We.state)){var ot,g;if(nt in Ge){ot=Ge[nt],g=Xe[nt];var x=In(Xt[nt].length,function(G){return Ue.def(ot,"[",G,"]")});Ue(xe.cond(x.map(function(G,te){return G+"!=="+g+"["+te+"]"}).join("||")).then(ct,".",Yt[nt],"(",x,");",x.map(function(G,te){return g+"["+te+"]="+G}).join(";"),";"))}else{ot=Ue.def(Ee,".",nt);var C=xe.cond(ot,"!==",Qe,".",nt);Ue(C),nt in _n?C(xe.cond(ot).then(ct,".enable(",_n[nt],");").else(ct,".disable(",_n[nt],");"),Qe,".",nt,"=",ot,";"):C(ct,".",Yt[nt],"(",ot,");",Qe,".",nt,"=",ot,";")}}}),Object.keys(We.state).length===0&&Ue(Qe,".dirty=false;"),de(Ue)}function zi(xe,de,We,tt){var ct=xe.shared,Xe=xe.current,Ge=ct.current,Qe=ct.gl;Bf(Object.keys(We)).forEach(function(Ee){var Ue=We[Ee];if(!(tt&&!tt(Ue))){var be=Ue.append(xe,de);if(_n[Ee]){var nt=_n[Ee];gs(Ue)?be?de(Qe,".enable(",nt,");"):de(Qe,".disable(",nt,");"):de(xe.cond(be).then(Qe,".enable(",nt,");").else(Qe,".disable(",nt,");")),de(Ge,".",Ee,"=",be,";")}else if(L(be)){var ot=Xe[Ee];de(Qe,".",Yt[Ee],"(",be,");",be.map(function(g,x){return ot+"["+x+"]="+g}).join(";"),";")}else de(Qe,".",Yt[Ee],"(",be,");",Ge,".",Ee,"=",be,";")}})}function di(xe,de){ln&&(xe.instancing=de.def(xe.shared.extensions,".angle_instanced_arrays"))}function Cr(xe,de,We,tt,ct){var Xe=xe.shared,Ge=xe.stats,Qe=Xe.current,Ee=Xe.timer,Ue=We.profile;function be(){return typeof performance>"u"?"Date.now()":"performance.now()"}var nt,ot;function g(Oe){nt=de.def(),Oe(nt,"=",be(),";"),typeof ct=="string"?Oe(Ge,".count+=",ct,";"):Oe(Ge,".count++;"),rn&&(tt?(ot=de.def(),Oe(ot,"=",Ee,".getNumPendingQueries();")):Oe(Ee,".beginQuery(",Ge,");"))}function x(Oe){Oe(Ge,".cpuTime+=",be(),"-",nt,";"),rn&&(tt?Oe(Ee,".pushScopeStats(",ot,",",Ee,".getNumPendingQueries(),",Ge,");"):Oe(Ee,".endQuery();"))}function C(Oe){var Fe=de.def(Qe,".profile");de(Qe,".profile=",Oe,";"),de.exit(Qe,".profile=",Fe,";")}var G;if(Ue){if(gs(Ue)){Ue.enable?(g(de),x(de.exit),C("true")):C("false");return}G=Ue.append(xe,de),C(G)}else G=de.def(Qe,".profile");var te=xe.block();g(te),de("if(",G,"){",te,"}");var ce=xe.block();x(ce),de.exit("if(",G,"){",ce,"}")}function sa(xe,de,We,tt,ct){var Xe=xe.shared;function Ge(Ee){switch(Ee){case Nf:case Pf:case au:return 2;case Ac:case Rf:case ma:return 3;case kf:case Df:case qp:return 4;default:return 1}}function Qe(Ee,Ue,be){var nt=Xe.gl,ot=de.def(Ee,".location"),g=de.def(Xe.attributes,"[",ot,"]"),x=be.state,C=be.buffer,G=[be.x,be.y,be.z,be.w],te=["buffer","normalized","offset","stride"];function ce(){de("if(!",g,".buffer){",nt,".enableVertexAttribArray(",ot,");}");var Fe=be.type,et;if(be.size?et=de.def(be.size,"||",Ue):et=Ue,de("if(",g,".type!==",Fe,"||",g,".size!==",et,"||",te.map(function(Vt){return g+"."+Vt+"!=="+be[Vt]}).join("||"),"){",nt,".bindBuffer(",Bs,",",C,".buffer);",nt,".vertexAttribPointer(",[ot,et,Fe,be.normalized,be.stride,be.offset],");",g,".type=",Fe,";",g,".size=",et,";",te.map(function(Vt){return g+"."+Vt+"="+be[Vt]+";"}).join(""),"}"),ln){var jt=be.divisor;de("if(",g,".divisor!==",jt,"){",xe.instancing,".vertexAttribDivisorANGLE(",[ot,jt],");",g,".divisor=",jt,";}")}}function Oe(){de("if(",g,".buffer){",nt,".disableVertexAttribArray(",ot,");",g,".buffer=null;","}if(",ou.map(function(Fe,et){return g+"."+Fe+"!=="+G[et]}).join("||"),"){",nt,".vertexAttrib4f(",ot,",",G,");",ou.map(function(Fe,et){return g+"."+Fe+"="+G[et]+";"}).join(""),"}")}x===_c?ce():x===bc?Oe():(de("if(",x,"===",_c,"){"),ce(),de("}else{"),Oe(),de("}"))}tt.forEach(function(Ee){var Ue=Ee.name,be=We.attributes[Ue],nt;if(be){if(!ct(be))return;nt=be.append(xe,de)}else{if(!ct(zl))return;var ot=xe.scopeAttrib(Ue);q.optional(function(){xe.assert(de,ot+".state","missing attribute "+Ue)}),nt={},Object.keys(new st).forEach(function(g){nt[g]=de.def(ot,".",g)})}Qe(xe.link(Ee),Ge(Ee.info.type),nt)})}function co(xe,de,We,tt,ct){for(var Xe=xe.shared,Ge=Xe.gl,Qe,Ee=0;Ee<tt.length;++Ee){var Ue=tt[Ee],be=Ue.name,nt=Ue.info.type,ot=We.uniforms[be],g=xe.link(Ue),x=g+".location",C;if(ot){if(!ct(ot))continue;if(gs(ot)){var G=ot.value;if(q.command(G!==null&&typeof G<"u",'missing uniform "'+be+'"',xe.commandStr),nt===wa||nt===xi){q.command(typeof G=="function"&&(nt===wa&&(G._reglType==="texture2d"||G._reglType==="framebuffer")||nt===xi&&(G._reglType==="textureCube"||G._reglType==="framebufferCube")),"invalid texture for uniform "+be,xe.commandStr);var te=xe.link(G._texture||G.color[0]._texture);de(Ge,".uniform1i(",x,",",te+".bind());"),de.exit(te,".unbind();")}else if(nt===jf||nt===Tc||nt===xd){q.optional(function(){q.command(L(G),"invalid matrix for uniform "+be,xe.commandStr),q.command(nt===jf&&G.length===4||nt===Tc&&G.length===9||nt===xd&&G.length===16,"invalid length for matrix uniform "+be,xe.commandStr)});var ce=xe.global.def("new Float32Array(["+Array.prototype.slice.call(G)+"])"),Oe=2;nt===Tc?Oe=3:nt===xd&&(Oe=4),de(Ge,".uniformMatrix",Oe,"fv(",x,",false,",ce,");")}else{switch(nt){case gi:q.commandType(G,"number","uniform "+be,xe.commandStr),Qe="1f";break;case Nf:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2f";break;case Ac:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3f";break;case kf:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4f";break;case Mc:q.commandType(G,"boolean","uniform "+be,xe.commandStr),Qe="1i";break;case Ed:q.commandType(G,"number","uniform "+be,xe.commandStr),Qe="1i";break;case au:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case Pf:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case ma:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case Rf:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case qp:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4i";break;case Df:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4i";break}de(Ge,".uniform",Qe,"(",x,",",L(G)?Array.prototype.slice.call(G):G,");")}continue}else C=ot.append(xe,de)}else{if(!ct(zl))continue;C=de.def(Xe.uniforms,"[",me.id(be),"]")}nt===wa?(q(!Array.isArray(C),"must specify a scalar prop for textures"),de("if(",C,"&&",C,'._reglType==="framebuffer"){',C,"=",C,".color[0];","}")):nt===xi&&(q(!Array.isArray(C),"must specify a scalar prop for cube maps"),de("if(",C,"&&",C,'._reglType==="framebufferCube"){',C,"=",C,".color[0];","}")),q.optional(function(){function yn(an,Tn){xe.assert(de,an,'bad data or missing for uniform "'+be+'". '+Tn)}function Yn(an){q(!Array.isArray(C),"must not specify an array type for uniform"),yn("typeof "+C+'==="'+an+'"',"invalid type, expected "+an)}function Qn(an,Tn){Array.isArray(C)?q(C.length===an,"must have length "+an):yn(Xe.isArrayLike+"("+C+")&&"+C+".length==="+an,"invalid vector, should have length "+an,xe.commandStr)}function Sr(an){q(!Array.isArray(C),"must not specify a value type"),yn("typeof "+C+'==="function"&&'+C+'._reglType==="texture'+(an===Xp?"2d":"Cube")+'"',"invalid texture type",xe.commandStr)}switch(nt){case Ed:Yn("number");break;case Pf:Qn(2);break;case Rf:Qn(3);break;case Df:Qn(4);break;case gi:Yn("number");break;case Nf:Qn(2);break;case Ac:Qn(3);break;case kf:Qn(4);break;case Mc:Yn("boolean");break;case au:Qn(2);break;case ma:Qn(3);break;case qp:Qn(4);break;case jf:Qn(4);break;case Tc:Qn(9);break;case xd:Qn(16);break;case wa:Sr(Xp);break;case xi:Sr(Cm);break}});var Fe=1;switch(nt){case wa:case xi:var et=de.def(C,"._texture");de(Ge,".uniform1i(",x,",",et,".bind());"),de.exit(et,".unbind();");continue;case Ed:case Mc:Qe="1i";break;case Pf:case au:Qe="2i",Fe=2;break;case Rf:case ma:Qe="3i",Fe=3;break;case Df:case qp:Qe="4i",Fe=4;break;case gi:Qe="1f";break;case Nf:Qe="2f",Fe=2;break;case Ac:Qe="3f",Fe=3;break;case kf:Qe="4f",Fe=4;break;case jf:Qe="Matrix2fv";break;case Tc:Qe="Matrix3fv";break;case xd:Qe="Matrix4fv";break}if(de(Ge,".uniform",Qe,"(",x,","),Qe.charAt(0)==="M"){var jt=Math.pow(nt-jf+2,2),Vt=xe.global.def("new Float32Array(",jt,")");Array.isArray(C)?de("false,(",In(jt,function(yn){return Vt+"["+yn+"]="+C[yn]}),",",Vt,")"):de("false,(Array.isArray(",C,")||",C," instanceof Float32Array)?",C,":(",In(jt,function(yn){return Vt+"["+yn+"]="+C+"["+yn+"]"}),",",Vt,")")}else Fe>1?de(In(Fe,function(yn){return Array.isArray(C)?C[yn]:C+"["+yn+"]"})):(q(!Array.isArray(C),"uniform value must not be an array"),de(C));de(");")}}function cr(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,Ge=ct.draw,Qe=tt.draw;function Ee(){var et=Qe.elements,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=We),jt=et.append(xe,Vt)):jt=Vt.def(Ge,".",Fi),jt&&Vt("if("+jt+")"+Xe+".bindBuffer("+dv+","+jt+".buffer.buffer);"),jt}function Ue(){var et=Qe.count,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=We),jt=et.append(xe,Vt),q.optional(function(){et.MISSING&&xe.assert(de,"false","missing vertex count"),et.DYNAMIC&&xe.assert(Vt,jt+">=0","missing vertex count")})):(jt=Vt.def(Ge,".",Fs),q.optional(function(){xe.assert(Vt,jt+">=0","missing vertex count")})),jt}var be=Ee();function nt(et){var jt=Qe[et];return jt?jt.contextDep&&tt.contextDynamic||jt.propDep?jt.append(xe,We):jt.append(xe,de):de.def(Ge,".",et)}var ot=nt(Is),g=nt(Gp),x=Ue();if(typeof x=="number"){if(x===0)return}else We("if(",x,"){"),We.exit("}");var C,G;ln&&(C=nt(Qt),G=xe.instancing);var te=be+".type",ce=Qe.elements&&gs(Qe.elements);function Oe(){function et(){We(G,".drawElementsInstancedANGLE(",[ot,x,te,g+"<<(("+te+"-"+yc+")>>1)",C],");")}function jt(){We(G,".drawArraysInstancedANGLE(",[ot,g,x,C],");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}function Fe(){function et(){We(Xe+".drawElements("+[ot,x,te,g+"<<(("+te+"-"+yc+")>>1)"]+");")}function jt(){We(Xe+".drawArrays("+[ot,g,x]+");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}ln&&(typeof C!="number"||C>=0)?typeof C=="string"?(We("if(",C,">0){"),Oe(),We("}else if(",C,"<0){"),Fe(),We("}")):Oe():Fe()}function Xr(xe,de,We,tt,ct){var Xe=fr(),Ge=Xe.proc("body",ct);return q.optional(function(){Xe.commandStr=de.commandStr,Xe.command=Xe.link(de.commandStr)}),ln&&(Xe.instancing=Ge.def(Xe.shared.extensions,".angle_instanced_arrays")),xe(Xe,Ge,We,tt),Xe.compile().body}function Nr(xe,de,We,tt){di(xe,de),We.useVAO?We.drawVAO?de(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,de),");"):de(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(de(xe.shared.vao,".setVAO(null);"),sa(xe,de,We,tt.attributes,function(){return!0})),co(xe,de,We,tt.uniforms,function(){return!0}),cr(xe,de,de,We)}function fi(xe,de){var We=xe.proc("draw",1);di(xe,We),$i(xe,We,de.context),Qi(xe,We,de.framebuffer),la(xe,We,de),zi(xe,We,de.state),Cr(xe,We,de,!1,!0);var tt=de.shader.progVar.append(xe,We);if(We(xe.shared.gl,".useProgram(",tt,".program);"),de.shader.program)Nr(xe,We,de,de.shader.program);else{We(xe.shared.vao,".setVAO(null);");var ct=xe.global.def("{}"),Xe=We.def(tt,".id"),Ge=We.def(ct,"[",Xe,"]");We(xe.cond(Ge).then(Ge,".call(this,a0);").else(Ge,"=",ct,"[",Xe,"]=",xe.link(function(Qe){return Xr(Nr,xe,de,Qe,1)}),"(",tt,");",Ge,".call(this,a0);"))}Object.keys(de.state).length>0&&We(xe.shared.current,".dirty=true;")}function $s(xe,de,We,tt){xe.batchId="a1",di(xe,de);function ct(){return!0}sa(xe,de,We,tt.attributes,ct),co(xe,de,We,tt.uniforms,ct),cr(xe,de,de,We)}function yi(xe,de,We,tt){di(xe,de);var ct=We.contextDep,Xe=de.def(),Ge="a0",Qe="a1",Ee=de.def();xe.shared.props=Ee,xe.batchId=Xe;var Ue=xe.scope(),be=xe.scope();de(Ue.entry,"for(",Xe,"=0;",Xe,"<",Qe,";++",Xe,"){",Ee,"=",Ge,"[",Xe,"];",be,"}",Ue.exit);function nt(te){return te.contextDep&&ct||te.propDep}function ot(te){return!nt(te)}if(We.needsContext&&$i(xe,be,We.context),We.needsFramebuffer&&Qi(xe,be,We.framebuffer),zi(xe,be,We.state,nt),We.profile&&nt(We.profile)&&Cr(xe,be,We,!1,!0),tt)We.useVAO?We.drawVAO?nt(We.drawVAO)?be(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,be),");"):Ue(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,Ue),");"):Ue(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(Ue(xe.shared.vao,".setVAO(null);"),sa(xe,Ue,We,tt.attributes,ot),sa(xe,be,We,tt.attributes,nt)),co(xe,Ue,We,tt.uniforms,ot),co(xe,be,We,tt.uniforms,nt),cr(xe,Ue,be,We);else{var g=xe.global.def("{}"),x=We.shader.progVar.append(xe,be),C=be.def(x,".id"),G=be.def(g,"[",C,"]");be(xe.shared.gl,".useProgram(",x,".program);","if(!",G,"){",G,"=",g,"[",C,"]=",xe.link(function(te){return Xr($s,xe,We,te,2)}),"(",x,");}",G,".call(this,a0[",Xe,"],",Xe,");")}}function Te(xe,de){var We=xe.proc("batch",2);xe.batchId="0",di(xe,We);var tt=!1,ct=!0;Object.keys(de.context).forEach(function(g){tt=tt||de.context[g].propDep}),tt||($i(xe,We,de.context),ct=!1);var Xe=de.framebuffer,Ge=!1;Xe?(Xe.propDep?tt=Ge=!0:Xe.contextDep&&tt&&(Ge=!0),Ge||Qi(xe,We,Xe)):Qi(xe,We,null),de.state.viewport&&de.state.viewport.propDep&&(tt=!0);function Qe(g){return g.contextDep&&tt||g.propDep}la(xe,We,de),zi(xe,We,de.state,function(g){return!Qe(g)}),(!de.profile||!Qe(de.profile))&&Cr(xe,We,de,!1,"a1"),de.contextDep=tt,de.needsContext=ct,de.needsFramebuffer=Ge;var Ee=de.shader.progVar;if(Ee.contextDep&&tt||Ee.propDep)yi(xe,We,de,null);else{var Ue=Ee.append(xe,We);if(We(xe.shared.gl,".useProgram(",Ue,".program);"),de.shader.program)yi(xe,We,de,de.shader.program);else{We(xe.shared.vao,".setVAO(null);");var be=xe.global.def("{}"),nt=We.def(Ue,".id"),ot=We.def(be,"[",nt,"]");We(xe.cond(ot).then(ot,".call(this,a0,a1);").else(ot,"=",be,"[",nt,"]=",xe.link(function(g){return Xr(yi,xe,de,g,2)}),"(",Ue,");",ot,".call(this,a0,a1);"))}}Object.keys(de.state).length>0&&We(xe.shared.current,".dirty=true;")}function Et(xe,de){var We=xe.proc("scope",3);xe.batchId="a2";var tt=xe.shared,ct=tt.current;$i(xe,We,de.context),de.framebuffer&&de.framebuffer.append(xe,We),Bf(Object.keys(de.state)).forEach(function(Ge){var Qe=de.state[Ge],Ee=Qe.append(xe,We);L(Ee)?Ee.forEach(function(Ue,be){We.set(xe.next[Ge],"["+be+"]",Ue)}):We.set(tt.next,"."+Ge,Ee)}),Cr(xe,We,de,!0,!0),[Fi,Gp,Fs,Qt,Is].forEach(function(Ge){var Qe=de.draw[Ge];Qe&&We.set(tt.draw,"."+Ge,""+Qe.append(xe,We))}),Object.keys(de.uniforms).forEach(function(Ge){var Qe=de.uniforms[Ge].append(xe,We);Array.isArray(Qe)&&(Qe="["+Qe.join()+"]"),We.set(tt.uniforms,"["+me.id(Ge)+"]",Qe)}),Object.keys(de.attributes).forEach(function(Ge){var Qe=de.attributes[Ge].append(xe,We),Ee=xe.scopeAttrib(Ge);Object.keys(new st).forEach(function(Ue){We.set(Ee,"."+Ue,Qe[Ue])})}),de.scopeVAO&&We.set(tt.vao,".targetVAO",de.scopeVAO.append(xe,We));function Xe(Ge){var Qe=de.shader[Ge];Qe&&We.set(tt.shader,"."+Ge,Qe.append(xe,We))}Xe(Sf),Xe(Ra),Object.keys(de.state).length>0&&(We(ct,".dirty=true;"),We.exit(ct,".dirty=true;")),We("a1(",xe.shared.context,",a0,",xe.batchId,");")}function _t(xe){if(!(typeof xe!="object"||L(xe))){for(var de=Object.keys(xe),We=0;We<de.length;++We)if(Tt.isDynamic(xe[de[We]]))return!0;return!1}}function Ln(xe,de,We){var tt=de.static[We];if(!tt||!_t(tt))return;var ct=xe.global,Xe=Object.keys(tt),Ge=!1,Qe=!1,Ee=!1,Ue=xe.global.def("{}");Xe.forEach(function(nt){var ot=tt[nt];if(Tt.isDynamic(ot)){typeof ot=="function"&&(ot=tt[nt]=Tt.unbox(ot));var g=dl(ot,null);Ge=Ge||g.thisDep,Ee=Ee||g.propDep,Qe=Qe||g.contextDep}else{switch(ct(Ue,".",nt,"="),typeof ot){case"number":ct(ot);break;case"string":ct('"',ot,'"');break;case"object":Array.isArray(ot)&&ct("[",ot.join(),"]");break;default:ct(xe.link(ot));break}ct(";")}});function be(nt,ot){Xe.forEach(function(g){var x=tt[g];if(Tt.isDynamic(x)){var C=nt.invoke(ot,x);ot(Ue,".",g,"=",C,";")}})}de.dynamic[We]=new Tt.DynamicVariable(fs,{thisDep:Ge,contextDep:Qe,propDep:Ee,ref:Ue,append:be}),delete de.static[We]}function Gr(xe,de,We,tt,ct){var Xe=fr();Xe.stats=Xe.link(ct),Object.keys(de.static).forEach(function(Qe){Ln(Xe,de,Qe)}),cv.forEach(function(Qe){Ln(Xe,xe,Qe)});var Ge=Pi(xe,de,We,tt,Xe);return fi(Xe,Ge),Et(Xe,Ge),Te(Xe,Ge),o(Xe.compile(),{destroy:function(){Ge.shader.program.destroy()}})}return{next:kn,current:Xt,procs:(function(){var xe=fr(),de=xe.proc("poll"),We=xe.proc("refresh"),tt=xe.block();de(tt),We(tt);var ct=xe.shared,Xe=ct.gl,Ge=ct.next,Qe=ct.current;tt(Qe,".dirty=false;"),Qi(xe,de),Qi(xe,We,null,!0);var Ee;ln&&(Ee=xe.link(ln)),Ie.oes_vertex_array_object&&We(xe.link(Ie.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Ue=0;Ue<wt.maxAttributes;++Ue){var be=We.def(ct.attributes,"[",Ue,"]"),nt=xe.cond(be,".buffer");nt.then(Xe,".enableVertexAttribArray(",Ue,");",Xe,".bindBuffer(",Bs,",",be,".buffer.buffer);",Xe,".vertexAttribPointer(",Ue,",",be,".size,",be,".type,",be,".normalized,",be,".stride,",be,".offset);").else(Xe,".disableVertexAttribArray(",Ue,");",Xe,".vertexAttrib4f(",Ue,",",be,".x,",be,".y,",be,".z,",be,".w);",be,".buffer=null;"),We(nt),ln&&We(Ee,".vertexAttribDivisorANGLE(",Ue,",",be,".divisor);")}return We(xe.shared.vao,".currentVAO=null;",xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"),Object.keys(_n).forEach(function(ot){var g=_n[ot],x=tt.def(Ge,".",ot),C=xe.block();C("if(",x,"){",Xe,".enable(",g,")}else{",Xe,".disable(",g,")}",Qe,".",ot,"=",x,";"),We(C),de("if(",x,"!==",Qe,".",ot,"){",C,"}")}),Object.keys(Yt).forEach(function(ot){var g=Yt[ot],x=Xt[ot],C,G,te=xe.block();if(te(Xe,".",g,"("),L(x)){var ce=x.length;C=xe.global.def(Ge,".",ot),G=xe.global.def(Qe,".",ot),te(In(ce,function(Oe){return C+"["+Oe+"]"}),");",In(ce,function(Oe){return G+"["+Oe+"]="+C+"["+Oe+"];"}).join("")),de("if(",In(ce,function(Oe){return C+"["+Oe+"]!=="+G+"["+Oe+"]"}).join("||"),"){",te,"}")}else C=tt.def(Ge,".",ot),G=tt.def(Qe,".",ot),te(C,");",Qe,".",ot,"=",C,";"),de("if(",C,"!==",G,"){",te,"}");We(te)}),xe.compile()})(),compile:Gr}}function $f(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Nc=34918,Jr=34919,Im=35007,fl=function(K,me){if(!me.ext_disjoint_timer_query)return null;var Ie=[];function wt(){return Ie.pop()||me.ext_disjoint_timer_query.createQueryEXT()}function Dt(ln){Ie.push(ln)}var yt=[];function Nt(ln){var An=wt();me.ext_disjoint_timer_query.beginQueryEXT(Im,An),yt.push(An),rn(yt.length-1,yt.length,ln)}function tn(){me.ext_disjoint_timer_query.endQueryEXT(Im)}function sn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var nn=[];function Mt(){return nn.pop()||new sn}function wn(ln){nn.push(ln)}var pn=[];function rn(ln,An,Xt){var kn=Mt();kn.startQueryIndex=ln,kn.endQueryIndex=An,kn.sum=0,kn.stats=Xt,pn.push(kn)}var Wt=[],st=[];function St(){var ln,An,Xt=yt.length;if(Xt!==0){st.length=Math.max(st.length,Xt+1),Wt.length=Math.max(Wt.length,Xt+1),Wt[0]=0,st[0]=0;var kn=0;for(ln=0,An=0;An<yt.length;++An){var Kt=yt[An];me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Jr)?(kn+=me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Nc),Dt(Kt)):yt[ln++]=Kt,Wt[An+1]=kn,st[An+1]=ln}for(yt.length=ln,ln=0,An=0;An<pn.length;++An){var _n=pn[An],Yt=_n.startQueryIndex,xn=_n.endQueryIndex;_n.sum+=Wt[xn]-Wt[Yt];var ar=st[Yt],xr=st[xn];xr===ar?(_n.stats.gpuTime+=_n.sum/1e6,wn(_n)):(_n.startQueryIndex=ar,_n.endQueryIndex=xr,pn[ln++]=_n)}pn.length=ln}}return{beginQuery:Nt,endQuery:tn,pushScopeStats:rn,update:St,getNumPendingQueries:function(){return yt.length},clear:function(){Ie.push.apply(Ie,yt);for(var ln=0;ln<Ie.length;ln++)me.ext_disjoint_timer_query.deleteQueryEXT(Ie[ln]);yt.length=0,Ie.length=0},restore:function(){yt.length=0,Ie.length=0}}},Oi=16384,nl=256,mv=1024,Ea=34962,Cl="webglcontextlost",kc="webglcontextrestored",Uf=1,Ni=2,Bi=3;function Jp(K,me){for(var Ie=0;Ie<K.length;++Ie)if(K[Ie]===me)return Ie;return-1}function gv(K){var me=ut(K);if(!me)return null;var Ie=me.gl,wt=Ie.getContextAttributes(),Dt=Ie.isContextLost(),yt=vn(Ie,me);if(!yt)return null;var Nt=ao(),tn=$f(),sn=yt.extensions,nn=fl(Ie,sn),Mt=Zn(),wn=Ie.drawingBufferWidth,pn=Ie.drawingBufferHeight,rn={tick:0,time:0,viewportWidth:wn,viewportHeight:pn,framebufferWidth:wn,framebufferHeight:pn,drawingBufferWidth:wn,drawingBufferHeight:pn,pixelRatio:me.pixelRatio},Wt={},st={elements:null,primitive:4,count:-1,offset:0,instances:-1},St=_u(Ie,sn),ln=xl(Ie,tn,me,Xt),An=jp(Ie,sn,St,tn,ln);function Xt(cr){return An.destroyBuffer(cr)}var kn=Gn(Ie,sn,ln,tn),Kt=Ip(Ie,Nt,tn,me),_n=lo(Ie,sn,St,function(){ar.procs.poll()},rn,tn,me),Yt=hd(Ie,sn,St,tn,me),xn=Rp(Ie,sn,St,_n,Yt,tn),ar=by(Ie,Nt,sn,St,ln,kn,_n,xn,Wt,An,Kt,st,rn,nn,me),xr=Mm(Ie,xn,ar.procs.poll,rn,wt,sn,St),on=ar.next,Zt=Ie.canvas,Ht=[],fr=[],Dr=[],Un=[me.onDestroy],$r=null;function Or(){if(Ht.length===0){nn&&nn.update(),$r=null;return}$r=En.next(Or),zi();for(var cr=Ht.length-1;cr>=0;--cr){var Xr=Ht[cr];Xr&&Xr(rn,null,0)}Ie.flush(),nn&&nn.update()}function Fr(){!$r&&Ht.length>0&&($r=En.next(Or))}function Qr(){$r&&(En.cancel(Or),$r=null)}function ki(cr){cr.preventDefault(),Dt=!0,Qr(),fr.forEach(function(Xr){Xr()})}function Si(cr){Ie.getError(),Dt=!1,yt.restore(),Kt.restore(),ln.restore(),_n.restore(),Yt.restore(),xn.restore(),An.restore(),nn&&nn.restore(),ar.procs.refresh(),Fr(),Dr.forEach(function(Xr){Xr()})}Zt&&(Zt.addEventListener(Cl,ki,!1),Zt.addEventListener(kc,Si,!1));function jr(){Ht.length=0,Qr(),Zt&&(Zt.removeEventListener(Cl,ki),Zt.removeEventListener(kc,Si)),Kt.clear(),xn.clear(),Yt.clear(),_n.clear(),kn.clear(),ln.clear(),An.clear(),nn&&nn.clear(),Un.forEach(function(cr){cr()})}function Gi(cr){q(!!cr,"invalid args to regl({...})"),q.type(cr,"object","invalid args to regl({...})");function Xr(ct){var Xe=o({},ct);delete Xe.uniforms,delete Xe.attributes,delete Xe.context,delete Xe.vao,"stencil"in Xe&&Xe.stencil.op&&(Xe.stencil.opBack=Xe.stencil.opFront=Xe.stencil.op,delete Xe.stencil.op);function Ge(Qe){if(Qe in Xe){var Ee=Xe[Qe];delete Xe[Qe],Object.keys(Ee).forEach(function(Ue){Xe[Qe+"."+Ue]=Ee[Ue]})}}return Ge("blend"),Ge("depth"),Ge("cull"),Ge("stencil"),Ge("polygonOffset"),Ge("scissor"),Ge("sample"),"vao"in ct&&(Xe.vao=ct.vao),Xe}function Nr(ct,Xe){var Ge={},Qe={};return Object.keys(ct).forEach(function(Ee){var Ue=ct[Ee];if(Tt.isDynamic(Ue)){Qe[Ee]=Tt.unbox(Ue,Ee);return}else if(Xe&&Array.isArray(Ue)){for(var be=0;be<Ue.length;++be)if(Tt.isDynamic(Ue[be])){Qe[Ee]=Tt.unbox(Ue,Ee);return}}Ge[Ee]=Ue}),{dynamic:Qe,static:Ge}}var fi=Nr(cr.context||{},!0),$s=Nr(cr.uniforms||{},!0),yi=Nr(cr.attributes||{},!1),Te=Nr(Xr(cr),!1),Et={gpuTime:0,cpuTime:0,count:0},_t=ar.compile(Te,yi,$s,fi,Et),Ln=_t.draw,Gr=_t.batch,xe=_t.scope,de=[];function We(ct){for(;de.length<ct;)de.push(null);return de}function tt(ct,Xe){var Ge;if(Dt&&q.raise("context lost"),typeof ct=="function")return xe.call(this,null,ct,0);if(typeof Xe=="function")if(typeof ct=="number")for(Ge=0;Ge<ct;++Ge)xe.call(this,null,Xe,Ge);else if(Array.isArray(ct))for(Ge=0;Ge<ct.length;++Ge)xe.call(this,ct[Ge],Xe,Ge);else return xe.call(this,ct,Xe,0);else if(typeof ct=="number"){if(ct>0)return Gr.call(this,We(ct|0),ct|0)}else if(Array.isArray(ct)){if(ct.length)return Gr.call(this,ct,ct.length)}else return Ln.call(this,ct)}return o(tt,{stats:Et,destroy:function(){_t.destroy()}})}var Ko=xn.setFBO=Gi({framebuffer:Tt.define.call(null,Uf,"framebuffer")});function Pi(cr,Xr){var Nr=0;ar.procs.poll();var fi=Xr.color;fi&&(Ie.clearColor(+fi[0]||0,+fi[1]||0,+fi[2]||0,+fi[3]||0),Nr|=Oi),"depth"in Xr&&(Ie.clearDepth(+Xr.depth),Nr|=nl),"stencil"in Xr&&(Ie.clearStencil(Xr.stencil|0),Nr|=mv),q(!!Nr,"called regl.clear with no buffer specified"),Ie.clear(Nr)}function $i(cr){if(q(typeof cr=="object"&&cr,"regl.clear() takes an object as input"),"framebuffer"in cr)if(cr.framebuffer&&cr.framebuffer_reglType==="framebufferCube")for(var Xr=0;Xr<6;++Xr)Ko(o({framebuffer:cr.framebuffer.faces[Xr]},cr),Pi);else Ko(cr,Pi);else Pi(null,cr)}function Qi(cr){q.type(cr,"function","regl.frame() callback must be a function"),Ht.push(cr);function Xr(){var Nr=Jp(Ht,cr);q(Nr>=0,"cannot cancel a frame twice");function fi(){var $s=Jp(Ht,fi);Ht[$s]=Ht[Ht.length-1],Ht.length-=1,Ht.length<=0&&Qr()}Ht[Nr]=fi}return Fr(),{cancel:Xr}}function la(){var cr=on.viewport,Xr=on.scissor_box;cr[0]=cr[1]=Xr[0]=Xr[1]=0,rn.viewportWidth=rn.framebufferWidth=rn.drawingBufferWidth=cr[2]=Xr[2]=Ie.drawingBufferWidth,rn.viewportHeight=rn.framebufferHeight=rn.drawingBufferHeight=cr[3]=Xr[3]=Ie.drawingBufferHeight}function zi(){rn.tick+=1,rn.time=Cr(),la(),ar.procs.poll()}function di(){_n.refresh(),la(),ar.procs.refresh(),nn&&nn.update()}function Cr(){return(Zn()-Mt)/1e3}di();function sa(cr,Xr){q.type(Xr,"function","listener callback must be a function");var Nr;switch(cr){case"frame":return Qi(Xr);case"lost":Nr=fr;break;case"restore":Nr=Dr;break;case"destroy":Nr=Un;break;default:q.raise("invalid event, must be one of frame,lost,restore,destroy")}return Nr.push(Xr),{cancel:function(){for(var fi=0;fi<Nr.length;++fi)if(Nr[fi]===Xr){Nr[fi]=Nr[Nr.length-1],Nr.pop();return}}}}var co=o(Gi,{clear:$i,prop:Tt.define.bind(null,Uf),context:Tt.define.bind(null,Ni),this:Tt.define.bind(null,Bi),draw:Gi({}),buffer:function(cr){return ln.create(cr,Ea,!1,!1)},elements:function(cr){return kn.create(cr,!1)},texture:_n.create2D,cube:_n.createCube,renderbuffer:Yt.create,framebuffer:xn.create,framebufferCube:xn.createCube,vao:An.createVAO,attributes:wt,frame:Qi,on:sa,limits:St,hasExtension:function(cr){return St.extensions.indexOf(cr.toLowerCase())>=0},read:xr,destroy:jr,_gl:Ie,_refresh:di,poll:function(){zi(),nn&&nn.update()},now:Cr,stats:tn});return me.onDone(null,co),co}return gv}))})(sw)),sw.exports}Pme();var ep,Uy,tp,Wu,Vy,uh,Wy,W0,jd,Rv,Pl,Ld,Id,G0;ep={},Fn(ep,jn.POINTS,"points"),Fn(ep,jn.LINES,"lines"),Fn(ep,jn.LINE_LOOP,"line loop"),Fn(ep,jn.LINE_STRIP,"line strip"),Fn(ep,jn.TRIANGLES,"triangles"),Fn(ep,jn.TRIANGLE_FAN,"triangle fan"),Fn(ep,jn.TRIANGLE_STRIP,"triangle strip");Uy={},Fn(Uy,jn.STATIC_DRAW,"static"),Fn(Uy,jn.DYNAMIC_DRAW,"dynamic"),Fn(Uy,jn.STREAM_DRAW,"stream");tp={},Fn(tp,jn.BYTE,"int8"),Fn(tp,jn.UNSIGNED_INT,"int16"),Fn(tp,jn.INT,"int32"),Fn(tp,jn.UNSIGNED_BYTE,"uint8"),Fn(tp,jn.UNSIGNED_SHORT,"uint16"),Fn(tp,jn.UNSIGNED_INT,"uint32"),Fn(tp,jn.FLOAT,"float");Wu={},Fn(Wu,jn.ALPHA,"alpha"),Fn(Wu,jn.LUMINANCE,"luminance"),Fn(Wu,jn.LUMINANCE_ALPHA,"luminance alpha"),Fn(Wu,jn.RGB,"rgb"),Fn(Wu,jn.RGBA,"rgba"),Fn(Wu,jn.RGBA4,"rgba4"),Fn(Wu,jn.RGB5_A1,"rgb5 a1"),Fn(Wu,jn.RGB565,"rgb565"),Fn(Wu,jn.DEPTH_COMPONENT,"depth"),Fn(Wu,jn.DEPTH_STENCIL,"depth stencil");Vy={},Fn(Vy,jn.DONT_CARE,"dont care"),Fn(Vy,jn.NICEST,"nice"),Fn(Vy,jn.FASTEST,"fast");uh={},Fn(uh,jn.NEAREST,"nearest"),Fn(uh,jn.LINEAR,"linear"),Fn(uh,jn.LINEAR_MIPMAP_LINEAR,"mipmap"),Fn(uh,jn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Fn(uh,jn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Fn(uh,jn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest");Wy={},Fn(Wy,jn.REPEAT,"repeat"),Fn(Wy,jn.CLAMP_TO_EDGE,"clamp"),Fn(Wy,jn.MIRRORED_REPEAT,"mirror");W0={},Fn(W0,jn.NONE,"none"),Fn(W0,jn.BROWSER_DEFAULT_WEBGL,"browser");jd={},Fn(jd,jn.NEVER,"never"),Fn(jd,jn.ALWAYS,"always"),Fn(jd,jn.LESS,"less"),Fn(jd,jn.LEQUAL,"lequal"),Fn(jd,jn.GREATER,"greater"),Fn(jd,jn.GEQUAL,"gequal"),Fn(jd,jn.EQUAL,"equal"),Fn(jd,jn.NOTEQUAL,"notequal");Rv={},Fn(Rv,jn.FUNC_ADD,"add"),Fn(Rv,jn.MIN_EXT,"min"),Fn(Rv,jn.MAX_EXT,"max"),Fn(Rv,jn.FUNC_SUBTRACT,"subtract"),Fn(Rv,jn.FUNC_REVERSE_SUBTRACT,"reverse subtract");Pl={},Fn(Pl,jn.ZERO,"zero"),Fn(Pl,jn.ONE,"one"),Fn(Pl,jn.SRC_COLOR,"src color"),Fn(Pl,jn.ONE_MINUS_SRC_COLOR,"one minus src color"),Fn(Pl,jn.SRC_ALPHA,"src alpha"),Fn(Pl,jn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Fn(Pl,jn.DST_COLOR,"dst color"),Fn(Pl,jn.ONE_MINUS_DST_COLOR,"one minus dst color"),Fn(Pl,jn.DST_ALPHA,"dst alpha"),Fn(Pl,jn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Fn(Pl,jn.CONSTANT_COLOR,"constant color"),Fn(Pl,jn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Fn(Pl,jn.CONSTANT_ALPHA,"constant alpha"),Fn(Pl,jn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Fn(Pl,jn.SRC_ALPHA_SATURATE,"src alpha saturate");Ld={},Fn(Ld,jn.NEVER,"never"),Fn(Ld,jn.ALWAYS,"always"),Fn(Ld,jn.LESS,"less"),Fn(Ld,jn.LEQUAL,"lequal"),Fn(Ld,jn.GREATER,"greater"),Fn(Ld,jn.GEQUAL,"gequal"),Fn(Ld,jn.EQUAL,"equal"),Fn(Ld,jn.NOTEQUAL,"notequal");Id={},Fn(Id,jn.ZERO,"zero"),Fn(Id,jn.KEEP,"keep"),Fn(Id,jn.REPLACE,"replace"),Fn(Id,jn.INVERT,"invert"),Fn(Id,jn.INCR,"increment"),Fn(Id,jn.DECR,"decrement"),Fn(Id,jn.INCR_WRAP,"increment wrap"),Fn(Id,jn.DECR_WRAP,"decrement wrap");G0={},Fn(G0,jn.FRONT,"front"),Fn(G0,jn.BACK,"back");var aA,sj;function Rme(){if(sj)return aA;sj=1;function t(e,n){return function(o){return e(n(o))}}return aA=t,aA}var lA,uj;function Dme(){if(uj)return lA;uj=1;var t=Rme(),e=t(Object.getPrototypeOf,Object);return lA=e,lA}var sA,cj;function jme(){if(cj)return sA;cj=1;var t=F2(),e=Dme(),n=B2(),o="[object Object]",r=Function.prototype,i=Object.prototype,a=r.toString,s=i.hasOwnProperty,l=a.call(Object);function f(h){if(!n(h)||t(h)!=o)return!1;var v=e(h);if(v===null)return!0;var b=s.call(v,"constructor")&&v.constructor;return typeof b=="function"&&b instanceof b&&a.call(b)==l}return sA=f,sA}jme();class oT{constructor(){hl(this,"lf");hl(this,"option")}render(e){this.lf=e}layout(e={}){var f;const{nodes:n,edges:o,gridSize:r}=this.lf.graphModel;let i=40,a=40;r>20&&(i=r*2,a=r*2),this.option={type:"dagre",rankdir:"LR",align:"DR",nodesep:i,ranksep:a,begin:[120,120],...e},(f=new Wfe(this.option).layout({nodes:n.map(h=>({id:h.id,size:{width:h.width,height:h.height},model:h})),edges:o.map(h=>({source:h.sourceNodeId,target:h.targetNodeId,model:h}))}).nodes)==null||f.forEach(h=>{const{model:v}=h;v.set_position({x:h.x,y:h.y})}),this.lf.fitView()}}hl(oT,"pluginName","dagre");let Fd=null;function dj(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function fj(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(n=>{n.x+=e,n.y+=e}),t.text&&(t.text.x+=e,t.text.y+=e),t}const dg=40;let z0=40;function p5(t,e){const{keyboard:n}=t,{options:{keyboard:o}}=n,r=()=>{var v,b;if(z0=dg,!(o!=null&&o.enabled)||e.textEditElement)return!0;const{guards:s}=t.options,l=e.getSelectElements(!1);if(!(s&&s.beforeClone?s.beforeClone(l):!0)||l.nodes.length===0&&l.edges.length===0)return Fd=null,!0;const h=l.nodes.filter(E=>E.type===kr.Start||E.type===kr.Base);if(h.length>0){Xi(((b=(v=h[0])==null?void 0:v.properties)==null?void 0:b.stepName)+Pt("views.applicationWorkflow.tip.cannotCopy"));return}return Fd=Me.cloneDeep(l),Fd.nodes.forEach(E=>dj(E,dg)),Fd.edges.forEach(E=>fj(E,dg)),Oh(Pt("views.applicationWorkflow.tip.copyError")),!1},i=()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Fd&&(Fd.nodes||Fd.edges)){t.clearSelectElements();const s=t.addElements(Fd,z0);if(!s)return!0;s.nodes.forEach(l=>t.selectElementById(l.id,!0)),s.edges.forEach(l=>t.selectElementById(l.id,!0)),Fd.nodes.forEach(l=>dj(l,dg)),Fd.edges.forEach(l=>fj(l,dg)),z0=z0+dg}return!1},a=()=>{var f;const s=e.getSelectElements(!0);if(t.clearSelectElements(),s.nodes.length==0&&s.edges.length==0)return;if(s.edges.length>0&&s.nodes.length==0){s.edges.filter(h=>!["loop-edge"].includes(h.type||"")).forEach(h=>t.deleteEdge(h.id));return}const l=s.nodes.filter(h=>["start-node","base-node","loop-body-node","loop-start-node"].includes(h.type));if(l.length>0){Xi(`${(f=l[0].properties)==null?void 0:f.stepName}${Pt("views.applicationWorkflow.delete.deleteMessage")}`);return}return L2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;s.edges.forEach(h=>t.deleteEdge(h.id)),s.nodes.forEach(h=>{h.type==="loop-node"&&t.getNodeOutgoingNode(h.id).forEach(b=>{b.type==="loop-body-node"&&t.deleteNode(b.id)}),t.deleteNode(h.id)})}),!1};e.eventCenter.on("copy_node",r),n.on(["cmd + c","ctrl + c"],r),n.on(["cmd + v","ctrl + v"],i),n.on(["cmd + z","ctrl + z"],()=>{}),n.on(["cmd + y","ctrl + y"],()=>!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)),n.on(["backspace"],a)}const Lme={class:"flex-between"},Ime={class:"flex align-center"},Fme={class:"ellipsis-1 break-all"},Bme={class:"title-decoration-1 mb-8 mt-8"},$me=["onMouseenter"],Ume={class:"break-all"},Vme={class:"dialog-footer"},Wme=_r({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",nc.ApplicationLoop);const e=He(),n=He(!1),o=He({title:""}),r=hr({set:O=>{Me.set(h.nodeModel.properties,"showNode",O)},get:()=>h.nodeModel.properties.showNode!==void 0?h.nodeModel.properties.showNode:(Me.set(h.nodeModel.properties,"showNode",!0),!0)}),i=hr(()=>h.nodeModel.properties.status?h.nodeModel.properties.status:200),a=async O=>{O&&await O.validate(w=>{var S;w&&((S=h.nodeModel.graphModel.nodes)!=null&&S.some(M=>M.properties.stepName===o.value.title)?g9.error(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(h.nodeModel.properties,"stepName",o.value.title),n.value=!1,O.resetFields()))})},s=()=>{h.nodeModel.graphModel.clearSelectElements(),Me.set(h.nodeModel,"isSelected",!0),Me.set(h.nodeModel,"isHovered",!0),h.nodeModel.graphModel.toFront(h.nodeModel.id)},l=He(null),f=He(600),h=t,v=hr(()=>{var O;return h.nodeModel.properties.config.fields?(O=h.nodeModel.properties.config.fields)==null?void 0:O.map(S=>({label:S.label,value:S.value,globeLabel:`{{${h.nodeModel.properties.stepName}.${S.value}}}`,globeValue:`{{context['${h.nodeModel.id}'].${S.value}}}`})):[]}),b=He(!1);function E(){if(b.value=!b.value,b.value){h.nodeModel.graphModel.transformModel.focusOn(h.nodeModel.x,h.nodeModel.y,h.nodeModel.width+window.innerWidth-h.nodeModel.width,h.nodeModel.height-30),f.value=(h.nodeModel.graphModel.height-100)/h.nodeModel.graphModel.transformModel.SCALE_Y;const O=window.innerWidth/h.nodeModel.graphModel.transformModel.SCALE_X;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}else{f.value=600;const O=1920;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}}return(O,w)=>{var V;const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-alert"),$=ne("el-tooltip"),D=ne("el-collapse-transition"),P=ne("el-input"),B=ne("el-form-item"),F=ne("el-form"),I=ne("el-dialog");return Ne(),mn("div",{onMousedown:s,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gs(["step-container app-card p-16",{isSelected:h.nodeModel.isSelected,error:i.value!==200}]),style:{overflow:"visible",background:"#fff"}},[ee("div",null,[ee("div",Lme,[ee("div",Ime,[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(V=t.nodeModel)==null?void 0:V.properties.node_data},null,8,["item"])),ee("h4",Fme,_e(t.nodeModel.properties.stepName),1)]),k(M,{link:"",onClick:E},{default:j(()=>[k(S,{iconName:b.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),k(D,null,{default:j(()=>[Ql(ee("div",{onMousedown:w[1]||(w[1]=gn(()=>{},["stop"])),onKeydown:w[2]||(w[2]=gn(()=>{},["stop"])),onClick:w[3]||(w[3]=gn(()=>{},["stop"])),class:"mt-16"},[i.value!=200?(Ne(),bt(T,{key:0,class:"mb-16",title:h.nodeModel.type==="application-node"?O.$t("views.applicationWorkflow.tip.applicationNodeError"):O.$t("views.applicationWorkflow.tip.functionNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):Bn("",!0),ee("div",{style:Rj(`height:${f.value}px`)},[Dj(O.$slots,"default",{},void 0,!0)],4),v.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",Bme,_e(O.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(v.value,(z,X)=>(Ne(),mn("div",{key:X,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:Y=>l.value=X,onMouseleave:w[0]||(w[0]=Y=>l.value=null)},[ee("span",Ume,_e(z.label)+" "+_e("{"+z.value+"}"),1),l.value===X?(Ne(),bt($,{key:0,effect:"dark",content:O.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(M,{link:"",onClick:Y=>Wn(x_)(z.globeLabel),style:{padding:"0"}},{default:j(()=>[k(S,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,$me))),128))],64)):Bn("",!0)],544),[[Eh,r.value]])]),_:3})])],2),k(I,{title:O.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":w[8]||(w[8]=z=>n.value=z),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:w[9]||(w[9]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",Vme,[k(M,{onClick:w[6]||(w[6]=gn(z=>n.value=!1,["prevent"]))},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:w[7]||(w[7]=z=>a(e.value))},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(F,{"label-position":"top",ref_key:"titleFormRef",ref:e,model:o.value},{default:j(()=>[k(B,{prop:"title",rules:[{required:!0,message:O.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(P,{modelValue:o.value.title,"onUpdate:modelValue":w[4]||(w[4]=z=>o.value.title=z),onBlur:w[5]||(w[5]=z=>o.value.title=o.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),Gme=Ph(Wme,[["__scopeId","data-v-cdf21a30"]]),zme=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VideoUnderstandNode,kr.VariableAssignNode],Hme=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.VideoUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VariableAssignNode],pj={[nc.Application]:zme,[nc.ApplicationLoop]:Hme};class C2{constructor(e,n){hl(this,"nodes");hl(this,"edges");hl(this,"workFlowNodes");hl(this,"workflowModel");this.nodes=e.nodes,this.edges=e.edges,this.workFlowNodes=[],this.workflowModel=n||nc.Application}is_valid_start_node(){const e=this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id));if(e.length==0)throw Pt("views.applicationWorkflow.validate.startNodeRequired");if(e.length>1)throw Pt("views.applicationWorkflow.validate.startNodeOnly")}is_valid_base_node(){const e=this.nodes.filter(n=>n.id===kr.Base);if(e.length==0)throw Pt("views.applicationWorkflow.validate.baseNodeRequired");if(e.length>1)throw Pt("views.applicationWorkflow.validate.baseNodeOnly")}is_valid(){this.is_valid_start_node(),this.is_valid_base_node(),this.is_valid_work_flow(),this.is_valid_nodes()}is_loop_valid(){this.is_valid_start_node(),this.is_valid_work_flow(),this.is_valid_nodes()}get_start_node(){return this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id))[0]}get_base_node(){return this.nodes.filter(n=>n.id===kr.Base)[0]}exist_break_node(){return this.nodes.some(e=>e.type===kr.LoopBreakNode)}_is_valid_work_flow(e){e||(e=this.get_start_node()),this.workFlowNodes.push(e),this.is_valid_node(e);const n=this.get_next_nodes(e);for(const o of n)this._is_valid_work_flow(o)}is_valid_work_flow(){this.workFlowNodes=[],this._is_valid_work_flow();const e=this.nodes.filter(n=>n.id!==kr.Start&&n.id!==kr.Base).filter(n=>!this.workFlowNodes.includes(n));if(e.length>0)throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${e.map(n=>n.properties.stepName).join(",")}`;this.workFlowNodes=[]}get_next_nodes(e){const o=this.edges.filter(i=>i.sourceNodeId==e.id).map(i=>this.nodes.filter(a=>a.id==i.targetNodeId)).reduce((i,a)=>[...i,...a],[]),r=pj[this.workflowModel];if(o.length==0&&!r.includes(e.type))throw Pt("views.applicationWorkflow.validate.noNextNode");return o}is_valid_nodes(){for(const e of this.nodes)if(e.type!==kr.Base&&e.type!==kr.Start&&e.type!==kr.LoopStartNode&&!this.edges.some(n=>n.targetNodeId===e.id))throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${e.properties.stepName}`}is_valid_node(e){if(e.properties.status&&e.properties.status===500)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`;if(e.type===kr.Condition){const n=e.properties.node_data.branch;for(const o of n){const r=`${e.id}_${o.id}_right`;if(this.edges.filter(a=>a.sourceAnchorId==r).length==0)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.needConnect1")}${o.type}${Pt("views.applicationWorkflow.validate.needConnect2")}`}}else{const n=this.edges.filter(r=>r.sourceNodeId==e.id),o=pj[this.workflowModel];if(n.length==0&&!o.includes(e.type))throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.cannotEndNode")}`}if(e.properties.status&&e.properties.status!==200)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`}}const Xme=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":r8,"/src/workflow/nodes/application-node/index.ts":o8,"/src/workflow/nodes/base-node/index.ts":_8,"/src/workflow/nodes/condition-node/index.ts":b8,"/src/workflow/nodes/document-extract-node/index.ts":w8,"/src/workflow/nodes/form-node/index.ts":E8,"/src/workflow/nodes/image-generate/index.ts":x8,"/src/workflow/nodes/image-to-video/index.ts":O8,"/src/workflow/nodes/image-understand/index.ts":S8,"/src/workflow/nodes/intent-classify-node/index.ts":A8,"/src/workflow/nodes/loop-body-node/index.ts":qj,"/src/workflow/nodes/loop-break-node/index.ts":M8,"/src/workflow/nodes/loop-continue-node/index.ts":T8,"/src/workflow/nodes/loop-node/index.ts":C8,"/src/workflow/nodes/loop-start-node/index.ts":N8,"/src/workflow/nodes/mcp-node/index.ts":k8,"/src/workflow/nodes/parameter-extraction-node/index.ts":P8,"/src/workflow/nodes/question-node/index.ts":R8,"/src/workflow/nodes/reply-node/index.ts":D8,"/src/workflow/nodes/reranker-node/index.ts":j8,"/src/workflow/nodes/search-document-node/index.ts":L8,"/src/workflow/nodes/search-knowledge-node/index.ts":I8,"/src/workflow/nodes/speech-to-text-node/index.ts":F8,"/src/workflow/nodes/start-node/index.ts":B8,"/src/workflow/nodes/text-to-speech-node/index.ts":$8,"/src/workflow/nodes/text-to-video/index.ts":U8,"/src/workflow/nodes/tool-lib-node/index.ts":V8,"/src/workflow/nodes/tool-node/index.ts":W8,"/src/workflow/nodes/variable-aggregation-node/index.ts":G8,"/src/workflow/nodes/variable-assign-node/index.ts":z8,"/src/workflow/nodes/variable-splitting/index.ts":H8,"/src/workflow/nodes/video-understand/index.ts":X8}),n=t,o=He(),r=()=>{const f=new C2(s.value.getGraphData(),nc.ApplicationLoop);return Promise.all(s.value.graphModel.nodes.map(h=>{var v;return(v=h==null?void 0:h.validate)==null?void 0:v.call(h)})).then(()=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);try{return f.is_loop_valid(),v.properties.node_data.loop_type=="LOOP"&&!f.exist_break_node()?Promise.reject({node:v,errMessage:Pt("views.applicationWorkflow.validate.loopNodeBreakNodeRequired")}):Promise.resolve({})}catch(b){return Promise.reject({node:v,errMessage:b})}}).catch(h=>{throw n.nodeModel.graphModel.selectNodeById(n.nodeModel.id),n.nodeModel.graphModel.transformModel.focusOn(n.nodeModel.x,n.nodeModel.y,n.nodeModel.width,n.nodeModel.height),h})},i=()=>{const f=n.nodeModel.properties.loop_node_id,h=n.nodeModel.graphModel.getNodeModelById(f);h.properties.node_data.loop={x:n.nodeModel.x,y:n.nodeModel.y},h.properties.node_data.loop_body=s.value.getGraphData()},a=f=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);v&&(v.properties.config.fields=f)},s=He(),l=f=>{const h=o.value;if(h){let v=function(b){let E=s.value.graphModel.transformModel.SCALE_X,O=s.value.graphModel.transformModel.SCALE_Y,w=s.value.graphModel.transformModel.TRANSLATE_X,S=s.value.graphModel.transformModel.TRANSLATE_Y;const[M,T]=b;return n.nodeModel.graphModel.transformModel,E*=n.nodeModel.graphModel.transformModel.SCALE_X,O*=n.nodeModel.graphModel.transformModel.SCALE_Y,w*=n.nodeModel.graphModel.transformModel.SCALE_X,S*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(M-w)/E,(T-S)/O]};s.value=new e8({plugins:[oT],textEdit:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:h}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.graphModel.transformModel.HtmlPointToCanvasPoint=v.bind(s.value.graphModel.transformModel),p5(s.value,s.value.graphModel),s.value.graphModel.refresh_loop_fields=a,s.value.graphModel.get_parent_nodes=()=>n.nodeModel.graphModel.nodes,s.value.graphModel.get_up_node_field_list=n.nodeModel.get_up_node_field_list,s.value.batchRegister([...Object.keys(e).map(b=>e[b].default),Y8]),s.value.setDefaultEdgeType("app-edge"),s.value.render(f||{}),s.value.graphModel.eventCenter.on("delete_edge",b=>{b.forEach(E=>{s.value.deleteEdge(E)})}),s.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),s.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var b;(b=s.value)==null||b.fitView()},500)}};return bo(()=>{l(Me.cloneDeep(n.nodeModel.properties.workflow)),Me.set(n.nodeModel,"validate",r),Me.set(n.nodeModel,"set_loop_body",i)}),Ij(()=>{Bne(s.value.graphModel.flowId),s.value=null}),(f,h)=>(Ne(),bt(Gme,{nodeModel:t.nodeModel},{default:j(()=>[ee("div",{ref_key:"containerRef",ref:o,onWheel:h[0]||(h[0]=gn(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class Yme extends ai{constructor(e){super(e,Xme)}getNodeName(){return Pt("views.applicationWorkflow.nodes.loopBodyNode.label")}get_up_node_field_list(e,n){const o=this.props.model.properties.loop_node_id;if(typeof o=="string"){const r=this.props.graphModel.getNodeModelById(o);if(r&&typeof r.get_up_node_field_list=="function")return r.get_up_node_field_list(e,n)}return[]}}class qme extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i}=this;this.properties.showNode===void 0||this.properties.showNode;const a=[];return a.push({edgeAddable:!1,x:n,y:o-i/2+10,id:`${e}_children`,type:"children"}),a}setHeight(e){this.properties.height=e,this.outgoing.edges.forEach(n=>{n.updatePathByAnchor()}),this.incoming.edges.forEach(n=>{n.updatePathByAnchor()})}}const Kme={type:"loop-body-node",model:qme,view:Yme};class Zme extends Hu.BezierEdgeModel{getArrowStyle(){const e=super.getArrowStyle();return e.offset=0,e.verticalLength=0,e}getEdgeStyle(){const e=super.getEdgeStyle();return e.strokeWidth=2,e.stroke="#BBBFC4",e.offset=0,e}getData(){const e=super.getData();return e&&(e.sourceAnchorId=this.sourceAnchorId,e.targetAnchorId=this.targetAnchorId),e}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y-10};this.updateStartPoint(i);const a={x:r.x,y:r.y+3};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}}const Jme={type:"loop-edge",view:Hu.BezierEdge,model:Zme},Qme=_r({__name:"NodeControl",props:{lf:Object||String||null},setup(t){const e=t,n=He(!1);function o(){var h;(h=e.lf)==null||h.zoom(!0,[0,0])}function r(){var h;(h=e.lf)==null||h.zoom(!1,[0,0])}function i(){var h,v,b;(h=e.lf)==null||h.resetZoom(),(v=e.lf)==null||v.resetTranslate(),(b=e.lf)==null||b.fitView()}const a=()=>{var h;(h=e.lf)==null||h.extension.dagre.layout()},s=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!1})},l=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!0})},f=h=>{var b,E,O;const v=document.querySelector(".lf-drag-able");n.value=h,h?(v.style.cursor="default",(b=e.lf)==null||b.openSelectionSelect(),(E=e.lf)==null||E.extension.selectionSelect.setSelectionSense(!0,!1)):(v.style.cursor="pointer",(O=e.lf)==null||O.closeSelectionSelect())};return(h,v)=>{const b=ne("Position"),E=ne("el-icon"),O=ne("el-button"),w=ne("AppIcon"),S=ne("el-divider"),M=ne("ZoomOut"),T=ne("el-tooltip"),$=ne("ZoomIn"),D=ne("el-card");return Ne(),bt(D,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:j(()=>[k(O,{onClick:v[0]||(v[0]=P=>f(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Gs({"is-drag-active":n.value})},{default:j(()=>[k(E,{size:16},{default:j(()=>[k(b)]),_:1})]),_:1},8,["class"]),k(O,{onClick:v[1]||(v[1]=P=>f(!1)),style:{border:"none",padding:"4px",height:"24px","margin-left":"8px"},class:Gs({"is-drag-active":!n.value})},{default:j(()=>[k(w,{iconName:"app-raisehand",size:16})]),_:1},8,["class"]),k(S,{direction:"vertical"}),k(O,{link:"",onClick:r,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomOut")},{default:j(()=>[k(M)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:o,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomIn")},{default:j(()=>[k($)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:i,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:j(()=>[k(w,{iconName:"app-fitview",title:h.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{direction:"vertical"}),k(O,{link:"",onClick:s,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-retract",title:h.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:l,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-extend",title:h.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:a,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-beautify",title:h.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),ege=Ph(Qme,[["__scopeId","data-v-510558f4"]]),tge=_r({name:"WorkFlow"}),nge=_r({...tge,props:{data:Object||null},setup(t,{expose:e}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":r8,"./nodes/application-node/index.ts":o8,"./nodes/base-node/index.ts":_8,"./nodes/condition-node/index.ts":b8,"./nodes/document-extract-node/index.ts":w8,"./nodes/form-node/index.ts":E8,"./nodes/image-generate/index.ts":x8,"./nodes/image-to-video/index.ts":O8,"./nodes/image-understand/index.ts":S8,"./nodes/intent-classify-node/index.ts":A8,"./nodes/loop-body-node/index.ts":qj,"./nodes/loop-break-node/index.ts":M8,"./nodes/loop-continue-node/index.ts":T8,"./nodes/loop-node/index.ts":C8,"./nodes/loop-start-node/index.ts":N8,"./nodes/mcp-node/index.ts":k8,"./nodes/parameter-extraction-node/index.ts":P8,"./nodes/question-node/index.ts":R8,"./nodes/reply-node/index.ts":D8,"./nodes/reranker-node/index.ts":j8,"./nodes/search-document-node/index.ts":L8,"./nodes/search-knowledge-node/index.ts":I8,"./nodes/speech-to-text-node/index.ts":F8,"./nodes/start-node/index.ts":B8,"./nodes/text-to-speech-node/index.ts":$8,"./nodes/text-to-video/index.ts":U8,"./nodes/tool-lib-node/index.ts":V8,"./nodes/tool-node/index.ts":W8,"./nodes/variable-aggregation-node/index.ts":G8,"./nodes/variable-assign-node/index.ts":z8,"./nodes/variable-splitting/index.ts":H8,"./nodes/video-understand/index.ts":X8}),o=ml("workflowMode")||nc.Application,r=ml("loopWorkflowMode")||nc.Application,i=Une(),a=He(""),s=He();bo(()=>{f()}),Ij(()=>{$ne()});const l=w=>{s.value.render(w)},f=w=>{const S=document.querySelector("#container");S&&(s.value=new e8({plugins:[oT,Cne],textEdit:!1,adjustEdge:!0,adjustEdgeStartAndEnd:!0,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:S,dnd:{enabled:!0},connector:{startActive:!0,endActive:!0}}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.on("graph:rendered",()=>{a.value=s.value.graphModel.flowId}),p5(s.value,s.value.graphModel),s.value.batchRegister([...Object.keys(n).map(M=>n[M].default),Y8,Jme]),s.value.setDefaultEdgeType("app-edge"),s.value.render(w||{}),s.value.graphModel.get_provide=(M,T)=>({getNode:()=>M,getGraph:()=>T,workflowMode:o,loopWorkflowMode:r}),s.value.graphModel.eventCenter.on("delete_edge",M=>{M.forEach(T=>{s.value.deleteEdge(T)})}),s.value.graphModel.eventCenter.on("anchor:drop",M=>{M.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var M,T,$;((M=s.value.graphModel)==null?void 0:M.nodes.length)>1?(T=s.value)==null||T.fitView():($=s.value)==null||$.translateCenter()},500))};return e({onmousedown:w=>{w.type&&s.value.dnd.startDrag({type:w.type,properties:{...w.properties}}),w.callback&&w.callback(s.value)},validate:()=>Promise.all(s.value.graphModel.nodes.map(w=>{var S;return(S=w==null?void 0:w.validate)==null?void 0:S.call(w)})),getGraphData:()=>{const w=s.value.getGraphData();w.nodes.forEach(M=>{M.type==="loop-body-node"&&s.value.getNodeModelById(M.id).set_loop_body()});const S=s.value.getGraphData();return S.nodes=S.nodes.filter(M=>M.type!=="loop-body-node"),S.edges=w.edges.filter(M=>M.type!=="loop-edge"),S},addNode:w=>{s.value.clearSelectElements();const{virtualRectCenterPositionX:S,virtualRectCenterPositionY:M}=s.value.graphModel.getVirtualRectSize(),T=s.value.graphModel.addNode({type:w.type,properties:w.properties,x:S,y:M-s.value.graphModel.height/2});T.isSelected=!0,T.isHovered=!0,s.value.toFront(T.id)},clearGraphData:()=>s.value.clearData(),renderGraphData:f,render:l}),(w,S)=>(Ne(),mn(Ir,null,[S[0]||(S[0]=ee("div",{className:"workflow-app",id:"container"},null,-1)),s.value?(Ne(),bt(ege,{key:0,class:"workflow-control",lf:s.value},null,8,["lf"])):Bn("",!0),k(Wn(i),{"flow-id":a.value},null,8,["flow-id"])],64))}}),rge={class:"workflow-publish-history border-l white-bg"},oge={class:"border-b p-16-24"},ige={class:"list-height pt-0"},age={class:"p-8 pt-0"},lge={class:"flex-between"},sge={style:{"max-width":"80%"}},uge={class:"text-center"},cge=_r({__name:"PublishHistory",emits:["click","refreshVersion"],setup(t,{emit:e}){const n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(!1),s=He([]),l=He("");function f(S){l.value=S.id}function h(S){i("click",S)}function v(S){i("refreshVersion",S)}function b(S){S.writeStatus=!0}function E(S){S.writeStatus=!1}function O(S,M){if(S){const T={name:S};oi({type:"workflowVersion",systemType:r.value}).putWorkFlowVersion(o,M.id,T,a).then(()=>{Oh(Pt("common.modifySuccess")),M.writeStatus=!1,w()})}else Xi(Pt("views.applicationWorkflow.tip.nameMessage"))}function w(){oi({type:"workflowVersion",systemType:r.value}).getWorkFlowVersion(o,a).then(S=>{s.value=S.data})}return bo(()=>{w()}),(S,M)=>{const T=ne("ReadWrite"),$=ne("el-tag"),D=ne("UserFilled"),P=ne("el-icon"),B=ne("el-avatar"),F=ne("el-text"),I=ne("AppIcon"),V=ne("el-button"),z=ne("el-dropdown-item"),X=ne("RefreshLeft"),Y=ne("el-dropdown-menu"),W=ne("el-dropdown"),Q=ne("common-list"),J=ne("el-scrollbar"),ie=Rg("loading");return Ne(),mn("div",rge,[ee("h4",oge,_e(S.$t("views.applicationWorkflow.setting.releaseHistory")),1),ee("div",ige,[k(J,null,{default:j(()=>[ee("div",age,[Ql((Ne(),bt(Q,{data:s.value,class:"mt-8",onClick:h,onMouseenter:f,onMouseleave:M[1]||(M[1]=Se=>l.value="")},{default:j(({row:Se,index:Ae})=>[ee("div",lge,[ee("div",sge,[ee("h5",{class:Gs([Ae===0?"primary":"","flex align-center"])},[k(T,{onChange:Pe=>O(Pe,Se),data:Se.name||Wn(dA)(Se.update_time),trigger:"manual",write:Se.writeStatus,onClose:Pe=>E(Se)},null,8,["onChange","data","write","onClose"]),Ae===0?(Ne(),bt($,{key:0,class:"default-tag ml-4"},{default:j(()=>[ft(_e(S.$t("views.applicationWorkflow.setting.latestRelease")),1)]),_:1})):Bn("",!0)],2),k(F,{type:"info",class:"color-secondary flex align-center mt-8"},{default:j(()=>[k(B,{size:20,class:"avatar-grey mr-4"},{default:j(()=>[k(P,null,{default:j(()=>[k(D)]),_:1})]),_:1}),ft(" "+_e(Se.publish_user_name),1)]),_:2},1024)]),Ql(ee("div",{onClick:M[0]||(M[0]=gn(()=>{},["stop"]))},[k(W,{trigger:"click",teleported:!1},{dropdown:j(()=>[k(Y,null,{default:j(()=>[k(z,{onClick:gn(Pe=>b(Se),["stop"])},{default:j(()=>[k(I,{iconName:"app-edit",class:"color-secondary"}),ft(" "+_e(S.$t("common.edit")),1)]),_:1},8,["onClick"]),k(z,{onClick:Pe=>v(Se)},{default:j(()=>[k(P,{class:"color-secondary"},{default:j(()=>[k(X)]),_:1}),ft(" "+_e(S.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:j(()=>[k(V,{text:""},{default:j(()=>[k(I,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Eh,l.value===Se.id]])])]),empty:j(()=>[ee("div",uge,[k(F,{type:"info"},{default:j(()=>[ft(_e(S.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[ie,a.value]])])]),_:1})])])}}}),dge=Ph(cge,[["__scopeId","data-v-85be1165"]]),fge={class:"application-workflow"},pge={class:"header border-b flex-between p-12-24 white-bg"},hge={class:"flex align-center"},vge=["title"],mge={key:0},gge={key:0},yge={key:1},_ge=["href"],bge={class:"ml-4"},wge={class:"flex-between"},Ege={class:"flex align-center"},xge={class:"mr-12 ml-24 flex"},Oge=["src"],Sge=["title"],Age={class:"mr-16"},Mge={class:"scrollbar-height"},Xge=_r({__name:"index",setup(t){O_("getApplicationDetail",()=>E),O_("workflowMode",nc.Application);const{theme:e}=kj(),n=y9(),o=ja(),{params:{id:r,from:i}}=o,a=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),s=hr(()=>Pj.application[a.value]),l=hr(()=>e.isDefaultTheme());let f;const h=He(),v=He(),b=He(!1),E=He(null),O=He(!1),w=He(!1),S=He(!1),M=He(""),T=He(!1),$=He(!1),D=He(!1),P=He({}),B=He(null),F=He([]),I=hr(()=>UN(F.value)?"?"+UN(F.value):""),V=hr(()=>{var $e;return`${window.location.origin}/chat/`+(($e=E.value)==null?void 0:$e.access_token)+I.value});function z(){JSON.stringify(B.value)!==JSON.stringify(Be())?L2(Pt("common.tip"),Pt("views.applicationWorkflow.tip.saveMessage"),{confirmButtonText:Pt("views.applicationWorkflow.setting.exitSave"),cancelButtonText:Pt("views.applicationWorkflow.setting.exit"),distinguishCancelAndClose:!0}).then(()=>{gt(!0,!0)}).catch($e=>{$e==="cancel"&&le()}):le()}function X(){D.value||($.value=!1,D.value=!1)}function Y($e){$e&&Q($e),$.value=!1,D.value=!1}function W($e){D.value=!0,P.value=$e,Q($e),we()}function Q($e){var rt;$e.work_flow.nodes.map(pt=>{pt.properties.noRender=!0}),E.value.work_flow=$e.work_flow,M.value=$e==null?void 0:$e.update_time,(rt=h.value)==null||rt.clearGraphData(),xh(()=>{var pt;(pt=h.value)==null||pt.render($e.work_flow)})}function J(){Je(),T.value&&se(),$.value=!1,D.value=!1}function ie(){$.value=!0}function Se($e){$e?se():we(),localStorage.setItem("workflowAutoSave",$e.toString())}function Ae($e){O.value=!1}function Pe($e){O.value=!1}function De(){O.value=!1}const ze=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{const rt=Be(),pt=new C2(rt);try{pt.is_valid()}catch(Lt){Xi(Lt.toString());return}oi({type:"application",systemType:a.value}).putApplication(r,{work_flow:rt},b).then(()=>oi({type:"application",systemType:a.value}).publish(r,{},b)).then(Lt=>{var Jt,en;E.value.name=Lt.data.name,(en=(Jt=Lt.data.work_flow)==null?void 0:Jt.nodes)==null||en.filter(zt=>zt.id==="base-node").map(zt=>{F.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),Oh(Pt("views.application.tip.publishSuccess"))}).catch(Lt=>{var zt,it,ae,re;const Jt=Lt.node,en=Lt.errMessage;if(typeof en=="string")Xi(((zt=Lt.node.properties)==null?void 0:zt.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+en.toLowerCase());else{const je=Object.keys(en);Xi(((it=Jt.properties)==null?void 0:it.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+((re=(ae=en[je[0]])==null?void 0:ae[0])==null?void 0:re.message.toLowerCase()))}})}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})},Ye=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{var Lt;const rt=Be(),pt=new C2(rt);try{pt.is_valid(),E.value={...E.value,type:"WORK_FLOW",...(Lt=pt.get_base_node())==null?void 0:Lt.properties.node_data,work_flow:Be()},w.value=!0}catch(Jt){Xi(Jt.toString())}}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})};function Be(){var $e;return($e=h.value)==null?void 0:$e.getGraphData()}function Je(){oi({type:"application",systemType:a.value}).getApplicationDetail(r).then($e=>{var rt,pt,Lt,Jt,en;(rt=$e.data)==null||rt.work_flow.nodes.map(zt=>{zt.properties.noRender=!0}),E.value=$e.data,E.value.stt_model_id=$e.data.stt_model,E.value.tts_model_id=$e.data.tts_model,E.value.tts_type=$e.data.tts_type,M.value=(pt=$e.data)==null?void 0:pt.update_time,(Jt=(Lt=E.value.work_flow)==null?void 0:Lt.nodes)==null||Jt.filter(zt=>zt.id==="base-node").map(zt=>{F.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),oi({type:"application",systemType:a.value}).getAccessToken(r,b).then(zt=>{E.value={...E.value,...zt.data}}),(en=h.value)==null||en.clearGraphData(),xh(()=>{var zt;(zt=h.value)==null||zt.render(E.value.work_flow),B.value=Be()}),Qf([Vs.IS_EE,Vs.IS_PE],"OR")&&oi({type:"application",systemType:a.value}).getApplicationSetting(r).then(zt=>{E.value={...E.value,...zt.data}})})}function gt($e,rt){const pt={work_flow:Be()};b.value=rt||!1,oi({type:"application",systemType:a.value}).putApplication(r,pt).then(()=>{M.value=new Date,$e&&(B.value=Be(),Oh(Pt("common.saveSuccess")),rt&&le())}).catch(()=>{b.value=!1})}const le=()=>o.path.includes("workspace")?n.push({path:pe()}):n.push({path:Ze()}),Ze=()=>Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",pe=()=>Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Bc.WORKSPACE_MANAGE.getWorkspaceRole,Yl.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new sh([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new sh([],[Yl.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new sh([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new sh([],[Yl.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Yl.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/application",se=()=>{f=setInterval(()=>{gt()},6e4)},we=()=>{f&&clearInterval(f)};return bo(()=>{Je();const $e=localStorage.getItem("workflowAutoSave");T.value=$e==="true",T.value&&se()}),_9(()=>{var $e;we(),($e=h.value)==null||$e.clearGraphData()}),($e,rt)=>{var ke,Ke,Le;const pt=ne("back-button"),Lt=ne("el-text"),Jt=ne("el-button"),en=ne("el-divider"),zt=ne("Close"),it=ne("el-icon"),ae=ne("AppIcon"),re=ne("el-dropdown-item"),je=ne("el-switch"),vt=ne("el-dropdown-menu"),q=ne("el-dropdown"),kt=ne("el-collapse-transition"),Rt=ne("el-avatar"),Gt=ne("LogoIcon"),Pn=ne("AiChat"),qt=Rg("click-outside"),On=Rg("loading");return Ql((Ne(),mn("div",fge,[ee("div",pge,[ee("div",hge,[k(pt,{onClick:z}),ee("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(ke=E.value)==null?void 0:ke.name},_e((Ke=E.value)==null?void 0:Ke.name),9,vge),$.value&&D.value?(Ne(),mn("div",mge,[k(Lt,{type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.previewVersion"))+" "+_e(P.value.name||Wn(dA)(P.value.update_time)),1)]),_:1})])):M.value?(Ne(),bt(Lt,{key:1,type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.saveTime"))+_e(Wn(dA)(M.value)),1)]),_:1})):Bn("",!0)]),$.value&&D.value?(Ne(),mn("div",gge,[k(Jt,{type:"primary",class:"mr-8",onClick:rt[0]||(rt[0]=dt=>Y())},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.setting.restoreVersion")),1)]),_:1}),k(en,{direction:"vertical"}),k(Jt,{text:"",onClick:J},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):(Ne(),mn("div",yge,[k(Jt,{onClick:rt[1]||(rt[1]=dt=>O.value=!O.value)},{default:j(()=>[k(ae,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.addComponent")),1)]),_:1}),s.value.debug(Wn(r))?(Ne(),bt(Jt,{key:0,onClick:Ye,disabled:w.value},{default:j(()=>[k(ae,{iconName:"app-debug-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.debug")),1)]),_:1},8,["disabled"])):Bn("",!0),s.value.edit(Wn(r))?(Ne(),bt(Jt,{key:1,onClick:rt[2]||(rt[2]=dt=>gt(!0))},{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"mr-4"}),ft(" "+_e($e.$t("common.save")),1)]),_:1})):Bn("",!0),s.value.edit(Wn(r))?(Ne(),bt(Jt,{key:2,type:"primary",onClick:ze},{default:j(()=>[ft(_e($e.$t("views.application.operation.publish")),1)]),_:1})):Bn("",!0),k(q,{trigger:"click"},{dropdown:j(()=>[k(vt,null,{default:j(()=>[ee("a",{href:V.value,target:"_blank"},[k(re,null,{default:j(()=>[k(ae,{iconName:"app-create-chat",class:"color-secondary"}),ft(" "+_e($e.$t("views.application.operation.toChat")),1)]),_:1})],8,_ge),k(re,{onClick:ie},{default:j(()=>[k(ae,{iconName:"app-history-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.releaseHistory")),1)]),_:1}),k(re,null,{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.autoSave"))+" ",1),ee("div",bge,[k(je,{size:"small",modelValue:T.value,"onUpdate:modelValue":rt[4]||(rt[4]=dt=>T.value=dt),onChange:Se},null,8,["modelValue"])])]),_:1})]),_:1})]),default:j(()=>[k(Jt,{text:"",onClick:rt[3]||(rt[3]=gn(()=>{},["stop"])),class:"ml-8 mt-4"},{default:j(()=>[k(ae,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),k(kt,null,{default:j(()=>[Ql(k(g3,{show:O.value,id:Wn(r),onClickNodes:Ae,onOnmousedown:Pe,workflowRef:h.value},null,8,["show","id","workflowRef"]),[[qt,De]])]),_:1}),ee("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:v},[E.value?(Ne(),bt(nge,{key:0,ref_key:"workflowRef",ref:h,data:(Le=E.value)==null?void 0:Le.work_flow},null,8,["data"])):Bn("",!0)],512),k(kt,null,{default:j(()=>{var dt,At,Tt;return[w.value?(Ne(),mn("div",{key:0,class:Gs(["workflow-debug-container",S.value?"enlarge":""])},[ee("div",{class:Gs(["workflow-debug-header",l.value?"":"custom-header"])},[ee("div",wge,[ee("div",Ege,[ee("div",xge,[Wn(cA)((dt=E.value)==null?void 0:dt.icon)?(Ne(),bt(Rt,{key:0,shape:"square",size:32,style:{background:"none"}},{default:j(()=>{var En;return[ee("img",{src:Wn(mh)((En=E.value)==null?void 0:En.icon),alt:""},null,8,Oge)]}),_:1})):(Ne(),bt(Gt,{key:1,height:"32px"}))]),ee("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(At=E.value)==null?void 0:At.name},_e(((Tt=E.value)==null?void 0:Tt.name)||$e.$t("views.application.form.appName.label")),9,Sge)]),ee("div",Age,[k(Jt,{link:"",onClick:rt[5]||(rt[5]=En=>S.value=!S.value)},{default:j(()=>[k(ae,{iconName:S.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1}),k(Jt,{link:"",onClick:rt[6]||(rt[6]=En=>w.value=!1)},{default:j(()=>[k(it,{size:20,class:"color-secondary"},{default:j(()=>[k(zt)]),_:1})]),_:1})])])],2),ee("div",Mge,[k(Pn,{"application-details":E.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):Bn("",!0)]}),_:1}),$.value?Ql((Ne(),bt(dge,{key:0,onClick:W,onRefreshVersion:Y},null,512)),[[qt,X]]):Bn("",!0)])),[[On,b.value]])}}});export{Xge as default};
|