202 lines
1.3 MiB
202 lines
1.3 MiB
var _8=Object.defineProperty;var b8=(e,t,n)=>t in e?_8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fa=(e,t,n)=>b8(e,typeof t!="symbol"?t+"":t,n);import{dr as Sv,eP as Eu,dn as io,eQ as Rx,db as oh,eR as Gm,eS as Uf,eT as ih,eU as NM,eV as js,ef as dc,dc as pa,eW as w8,dd as fc,ea as PM,eX as E8,eY as zm,eZ as Ds,e6 as o_,e8 as Vw,dk as ah,au as pc,e_ as CM,e$ as lh,eg as Rv,f0 as Uw,di as ao,f1 as i_,dM as a_,ee as kd,dS as Bo,f2 as Av,dj as Yf,f3 as jv,f4 as Hm,dR as hc,dh as dl,df as Ao,f5 as O8,f6 as RM,eE as Ou,ed as Na,f7 as x8,f8 as S8,f9 as Dv,fa as l_,fb as jM,dL as sh,fc as DM,bL as Ww,dg as Xm,at as Iv,dQ as Dm,dO as eh,e9 as A8,ec as jx,eb as M8,as as IM,fd as LM,fe as k8,dm as s_,de as T8,ei as Ag,ff as N8,fg as $M,fh as FM,fi as P8,fj as BM,fk as C8,dp as R8,fl as j8,fm as D8,fn as I8,fo as Mg,fp as L8,el as $8,fq as VM,dN as UM,eh as Gw,fr as WM,fs as zw,ft as F8,dl as qm,fu as GM,fv as B8,fw as zM,fx as HM,fy as V8,fz as U8,fA as W8,em as Im,eC as G8,fB as z8,fC as H8,aw as X8,fD as q8,fE as Y8,fF as K8,fG as Z8,fH as J8,fI as Q8,fJ as eD,ai as tD,eF as nD,fK as rD,ax as oD,fL as iD,fM as aD,fN as lD,fO as sD,fP as uD,fQ as cD,av as dD,fR as fD,eG as pD,fS as hD,eD as vD,fT as mD,fU as yD,fV as gD,fW as _D,ay as Vn,aB as Re,aV as Ym,aD as J,aE as be,aW as Ht,aX as ar,aH as k,aI as Y,aY as Gr,aF as at,aG as P,b2 as _n,c$ as sw,bX as Bf,dw as Dx,aJ as de,bY as Hw,aK as et,b1 as pn,aS as rn,cf as Kf,fX as ha,aQ as Li,aA as XM,aO as $n,aP as qM,b6 as Ir,b8 as Ga,bc as YM,cg as Wf,cq as kg,fY as Tg,bW as tg,aT as po,aN as Is,aZ as ge,b7 as Mv,ce as Cl,cF as KM,ci as Lm,c1 as ei,aC as yt,c0 as Xw,aM as nr,fZ as $m,ch as cl,d5 as bD,bB as kv,aU as Zf,f_ as wD,f$ as ED,g0 as ZM,g1 as JM,g2 as OD,g3 as xD,g4 as SD,g5 as AD,g6 as MD,g7 as oo,du as qw,dv as kD,cu as TD,bD as Gf,dJ as ND,b3 as zf,g8 as is,cJ as PD,g9 as Ix,ga as Zp,gb as CD,gc as Yw,gd as Kw,ge as RD,gf as jD,b4 as QM,bZ as uw,az as DD,er as Lx,cY as ID,bG as Od,bH as Nl,bI as _u,bK as Ua,bJ as If}from"./admin-DgPvPHD7.js";import{t as $x,a as Fx,g as LD,i as vc,n as $D,c as Zw,l as ng,d as FD}from"./data-CRwDCy2p.js";import{_ as Pd}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-B62TecnF.js";import{G as Jw,d as BD,e as VD,f as UD,_ as ek,c as tk,b as WD,a as GD}from"./ToolDialog.vue_vue_type_style_index_0_lang-ewLcFQb8.js";import{d as nk,c as uh,v as Km,e as zD,g as rk,f as HD,a as XD,r as qD}from"./reduce-Cl4okoTU.js";import{c as Qw,b as u_,i as eE,p as ok,n as tE,a as YD,d as nE,e as KD,f as ZD,g as JD,h as QD,u as eI,j as tI,k as nI,l as rI,m as oI,r as iI,o as aI,q as lI,s as sI,t as uI}from"./uniqBy--yaca0vR.js";import{c as cI,a as dI,b as fI,e as pI,f as hI,m as vI,d as mI,h as yI}from"./min-DkVNHWJH.js";import{d as ik,e as gI,g as _I,h as bI,i as wI,z as EI,s as OI,m as xI,a as SI,b as AI,f as MI,c as kI,r as TI,u as NI}from"./zipObject-BfXmd17x.js";import{l as ak,_ as lk}from"./vue-draggable-plus-bMgZGhSz.js";import{_ as PI}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-D7Bq1Igx.js";import{_ as fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const sk=Object.freeze(Object.defineProperty({__proto__:null,get default(){return jne}},Symbol.toStringTag,{value:"Module"}));var CI=NaN;function Bx(e){return typeof e=="number"?e:Sv(e)?CI:+e}function c_(e,t){return function(n,a){var r;if(n===void 0&&a===void 0)return t;if(n!==void 0&&(r=n),a!==void 0){if(r===void 0)return a;typeof n=="string"||typeof a=="string"?(n=Eu(n),a=Eu(a)):(n=Bx(n),a=Bx(a)),r=e(n,a)}return r}}var RI=c_(function(e,t){return e+t},0),jI="Expected a function";function DI(e,t){if(typeof t!="function")throw new TypeError(jI);return e=io(e),function(){if(--e<1)return t.apply(this,arguments)}}var Ng=Rx&&new Rx,uk=Ng?function(e,t){return Ng.set(e,t),e}:oh;function Fm(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Gm(e.prototype),a=e.apply(n,t);return Uf(a)?a:n}}var II=1;function LI(e,t,n){var a=t&II,r=Fm(e);function s(){var c=this&&this!==ih&&this instanceof s?r:e;return c.apply(a?n:this,arguments)}return s}var $I=Math.max;function ck(e,t,n,a){for(var r=-1,s=e.length,c=n.length,v=-1,f=t.length,g=$I(s-c,0),_=Array(f+g),b=!a;++v<f;)_[v]=t[v];for(;++r<c;)(b||r<s)&&(_[n[r]]=e[r]);for(;g--;)_[v++]=e[r++];return _}var FI=Math.max;function dk(e,t,n,a){for(var r=-1,s=e.length,c=-1,v=n.length,f=-1,g=t.length,_=FI(s-v,0),b=Array(_+g),x=!a;++r<_;)b[r]=e[r];for(var S=r;++f<g;)b[S+f]=t[f];for(;++c<v;)(x||r<s)&&(b[S+n[c]]=e[r++]);return b}function BI(e,t){for(var n=e.length,a=0;n--;)e[n]===t&&++a;return a}function d_(){}var VI=4294967295;function eo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=VI,this.__views__=[]}eo.prototype=Gm(d_.prototype);eo.prototype.constructor=eo;var rE=Ng?function(e){return Ng.get(e)}:NM,yv={},UI=Object.prototype,WI=UI.hasOwnProperty;function hg(e){for(var t=e.name+"",n=yv[t],a=WI.call(yv,t)?n.length:0;a--;){var r=n[a],s=r.func;if(s==null||s==e)return r.name}return t}function Ls(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Ls.prototype=Gm(d_.prototype);Ls.prototype.constructor=Ls;function fk(e){if(e instanceof eo)return e.clone();var t=new Ls(e.__wrapped__,e.__chain__);return t.__actions__=js(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var GI=Object.prototype,zI=GI.hasOwnProperty;function ce(e){if(dc(e)&&!pa(e)&&!(e instanceof eo)){if(e instanceof Ls)return e;if(zI.call(e,"__wrapped__"))return fk(e)}return new Ls(e)}ce.prototype=d_.prototype;ce.prototype.constructor=ce;function cw(e){var t=hg(e),n=ce[t];if(typeof n!="function"||!(t in eo.prototype))return!1;if(e===n)return!0;var a=rE(n);return!!a&&e===a[0]}var pk=w8(uk),HI=/\{\n\/\* \[wrapped with (.+)\] \*/,XI=/,? & /;function qI(e){var t=e.match(HI);return t?t[1].split(XI):[]}var YI=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function KI(e,t){var n=t.length;if(!n)return e;var a=n-1;return t[a]=(n>1?"& ":"")+t[a],t=t.join(n>2?", ":" "),e.replace(YI,`{
|
||
/* [wrapped with `+t+`] */
|
||
`)}var ZI=1,JI=2,QI=8,e4=16,t4=32,n4=64,r4=128,o4=256,i4=512,a4=[["ary",r4],["bind",ZI],["bindKey",JI],["curry",QI],["curryRight",e4],["flip",i4],["partial",t4],["partialRight",n4],["rearg",o4]];function l4(e,t){return fc(a4,function(n){var a="_."+n[0];t&n[1]&&!PM(e,a)&&e.push(a)}),e.sort()}function hk(e,t,n){var a=t+"";return E8(e,KI(a,l4(qI(a),n)))}var s4=4,u4=8,Vx=32,Ux=64;function vk(e,t,n,a,r,s,c,v,f,g){var _=t&u4,b=_?c:void 0,x=_?void 0:c,S=_?s:void 0,A=_?void 0:s;t|=_?Vx:Ux,t&=~(_?Ux:Vx),t&s4||(t&=-4);var E=[e,t,r,S,b,A,x,v,f,g],T=n.apply(void 0,E);return cw(e)&&pk(T,E),T.placeholder=a,hk(T,e,t)}function Lv(e){var t=e;return t.placeholder}var c4=Math.min;function d4(e,t){for(var n=e.length,a=c4(t.length,n),r=js(e);a--;){var s=t[a];e[a]=zm(s,n)?r[s]:void 0}return e}var Wx="__lodash_placeholder__";function Hf(e,t){for(var n=-1,a=e.length,r=0,s=[];++n<a;){var c=e[n];(c===t||c===Wx)&&(e[n]=Wx,s[r++]=n)}return s}var f4=1,p4=2,h4=8,v4=16,m4=128,y4=512;function f_(e,t,n,a,r,s,c,v,f,g){var _=t&m4,b=t&f4,x=t&p4,S=t&(h4|v4),A=t&y4,E=x?void 0:Fm(e);function T(){for(var I=arguments.length,R=Array(I),U=I;U--;)R[U]=arguments[U];if(S)var D=Lv(T),L=BI(R,D);if(a&&(R=ck(R,a,r,S)),s&&(R=dk(R,s,c,S)),I-=L,S&&I<g){var W=Hf(R,D);return vk(e,t,f_,T.placeholder,n,R,W,v,f,g-I)}var H=b?n:this,B=x?H[e]:e;return I=R.length,v?R=d4(R,v):A&&I>1&&R.reverse(),_&&f<I&&(R.length=f),this&&this!==ih&&this instanceof T&&(B=E||Fm(B)),B.apply(H,R)}return T}function g4(e,t,n){var a=Fm(e);function r(){for(var s=arguments.length,c=Array(s),v=s,f=Lv(r);v--;)c[v]=arguments[v];var g=s<3&&c[0]!==f&&c[s-1]!==f?[]:Hf(c,f);if(s-=g.length,s<n)return vk(e,t,f_,r.placeholder,void 0,c,g,void 0,void 0,n-s);var _=this&&this!==ih&&this instanceof r?a:e;return Ds(_,this,c)}return r}var _4=1;function b4(e,t,n,a){var r=t&_4,s=Fm(e);function c(){for(var v=-1,f=arguments.length,g=-1,_=a.length,b=Array(_+f),x=this&&this!==ih&&this instanceof c?s:e;++g<_;)b[g]=a[g];for(;f--;)b[g++]=arguments[++v];return Ds(x,r?n:this,b)}return c}var Gx="__lodash_placeholder__",g1=1,w4=2,E4=4,zx=8,vm=128,Hx=256,O4=Math.min;function x4(e,t){var n=e[1],a=t[1],r=n|a,s=r<(g1|w4|vm),c=a==vm&&n==zx||a==vm&&n==Hx&&e[7].length<=t[8]||a==(vm|Hx)&&t[7].length<=t[8]&&n==zx;if(!(s||c))return e;a&g1&&(e[2]=t[2],r|=n&g1?0:E4);var v=t[3];if(v){var f=e[3];e[3]=f?ck(f,v,t[4]):v,e[4]=f?Hf(e[3],Gx):t[4]}return v=t[5],v&&(f=e[5],e[5]=f?dk(f,v,t[6]):v,e[6]=f?Hf(e[5],Gx):t[6]),v=t[7],v&&(e[7]=v),a&vm&&(e[8]=e[8]==null?t[8]:O4(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e}var S4="Expected a function",Xx=1,A4=2,qx=8,Yx=16,Kx=32,M4=64,Zx=Math.max;function Cd(e,t,n,a,r,s,c,v){var f=t&A4;if(!f&&typeof e!="function")throw new TypeError(S4);var g=a?a.length:0;if(g||(t&=-97,a=r=void 0),c=c===void 0?c:Zx(io(c),0),v=v===void 0?v:io(v),g-=r?r.length:0,t&M4){var _=a,b=r;a=r=void 0}var x=f?void 0:rE(e),S=[e,t,n,a,r,_,b,s,c,v];if(x&&x4(S,x),e=S[0],t=S[1],n=S[2],a=S[3],r=S[4],v=S[9]=S[9]===void 0?f?0:e.length:Zx(S[9]-g,0),!v&&t&(qx|Yx)&&(t&=-25),!t||t==Xx)var A=LI(e,t,n);else t==qx||t==Yx?A=g4(e,t,v):(t==Kx||t==(Xx|Kx))&&!r.length?A=b4(e,t,n,a):A=f_.apply(void 0,S);var E=x?uk:pk;return hk(E(A,S),e,t)}var k4=128;function mk(e,t,n){return t=n?void 0:t,t=e&&t==null?e.length:t,Cd(e,k4,void 0,void 0,void 0,void 0,t)}var T4=o_(function(e,t){Vw(t,ah(t),e)}),dw=o_(function(e,t,n,a){Vw(t,ah(t),e,a)}),N4=o_(function(e,t,n,a){Vw(t,pc(t),e,a)});function oE(e,t){for(var n=-1,a=t.length,r=Array(a),s=e==null;++n<a;)r[n]=s?void 0:CM(e,t[n]);return r}var P4=lh(oE),C4="[object DOMException]",R4="[object Error]";function iE(e){if(!dc(e))return!1;var t=Rv(e);return t==R4||t==C4||typeof e.message=="string"&&typeof e.name=="string"&&!Uw(e)}var yk=ao(function(e,t){try{return Ds(e,void 0,t)}catch(n){return iE(n)?n:new Error(n)}}),j4="Expected a function";function gk(e,t){var n;if(typeof t!="function")throw new TypeError(j4);return e=io(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var D4=1,I4=32,p_=ao(function(e,t,n){var a=D4;if(n.length){var r=Hf(n,Lv(p_));a|=I4}return Cd(e,a,t,n,r)});p_.placeholder={};var L4=lh(function(e,t){return fc(t,function(n){n=i_(n),a_(e,n,p_(e[n],e))}),e}),$4=1,F4=2,B4=32,aE=ao(function(e,t,n){var a=$4|F4;if(n.length){var r=Hf(n,Lv(aE));a|=B4}return Cd(t,a,e,n,r)});aE.placeholder={};function Jf(e,t,n){var a=e.length;return n=n===void 0?a:n,!t&&n>=a?e:kd(e,t,n)}var V4="\\ud800-\\udfff",U4="\\u0300-\\u036f",W4="\\ufe20-\\ufe2f",G4="\\u20d0-\\u20ff",z4=U4+W4+G4,H4="\\ufe0e\\ufe0f",X4="\\u200d",q4=RegExp("["+X4+V4+z4+H4+"]");function $v(e){return q4.test(e)}function Y4(e){return e.split("")}var _k="\\ud800-\\udfff",K4="\\u0300-\\u036f",Z4="\\ufe20-\\ufe2f",J4="\\u20d0-\\u20ff",Q4=K4+Z4+J4,eL="\\ufe0e\\ufe0f",tL="["+_k+"]",fw="["+Q4+"]",pw="\\ud83c[\\udffb-\\udfff]",nL="(?:"+fw+"|"+pw+")",bk="[^"+_k+"]",wk="(?:\\ud83c[\\udde6-\\uddff]){2}",Ek="[\\ud800-\\udbff][\\udc00-\\udfff]",rL="\\u200d",Ok=nL+"?",xk="["+eL+"]?",oL="(?:"+rL+"(?:"+[bk,wk,Ek].join("|")+")"+xk+Ok+")*",iL=xk+Ok+oL,aL="(?:"+[bk+fw+"?",fw,wk,Ek,tL].join("|")+")",lL=RegExp(pw+"(?="+pw+")|"+aL+iL,"g");function sL(e){return e.match(lL)||[]}function xu(e){return $v(e)?sL(e):Y4(e)}function Sk(e){return function(t){t=Bo(t);var n=$v(t)?xu(t):void 0,a=n?n[0]:t.charAt(0),r=n?Jf(n,1).join(""):t.slice(1);return a[e]()+r}}var lE=Sk("toUpperCase");function Ak(e){return lE(Bo(e).toLowerCase())}function sE(e){return function(t){return e==null?void 0:e[t]}}var uL={À:"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"},cL=sE(uL),dL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fL="\\u0300-\\u036f",pL="\\ufe20-\\ufe2f",hL="\\u20d0-\\u20ff",vL=fL+pL+hL,mL="["+vL+"]",yL=RegExp(mL,"g");function Mk(e){return e=Bo(e),e&&e.replace(dL,cL).replace(yL,"")}var gL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function _L(e){return e.match(gL)||[]}var bL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function wL(e){return bL.test(e)}var kk="\\ud800-\\udfff",EL="\\u0300-\\u036f",OL="\\ufe20-\\ufe2f",xL="\\u20d0-\\u20ff",SL=EL+OL+xL,Tk="\\u2700-\\u27bf",Nk="a-z\\xdf-\\xf6\\xf8-\\xff",AL="\\xac\\xb1\\xd7\\xf7",ML="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kL="\\u2000-\\u206f",TL=" \\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",Pk="A-Z\\xc0-\\xd6\\xd8-\\xde",NL="\\ufe0e\\ufe0f",Ck=AL+ML+kL+TL,Rk="['’]",Jx="["+Ck+"]",PL="["+SL+"]",jk="\\d+",CL="["+Tk+"]",Dk="["+Nk+"]",Ik="[^"+kk+Ck+jk+Tk+Nk+Pk+"]",RL="\\ud83c[\\udffb-\\udfff]",jL="(?:"+PL+"|"+RL+")",DL="[^"+kk+"]",Lk="(?:\\ud83c[\\udde6-\\uddff]){2}",$k="[\\ud800-\\udbff][\\udc00-\\udfff]",sv="["+Pk+"]",IL="\\u200d",Qx="(?:"+Dk+"|"+Ik+")",LL="(?:"+sv+"|"+Ik+")",eS="(?:"+Rk+"(?:d|ll|m|re|s|t|ve))?",tS="(?:"+Rk+"(?:D|LL|M|RE|S|T|VE))?",Fk=jL+"?",Bk="["+NL+"]?",$L="(?:"+IL+"(?:"+[DL,Lk,$k].join("|")+")"+Bk+Fk+")*",FL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",BL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",VL=Bk+Fk+$L,UL="(?:"+[CL,Lk,$k].join("|")+")"+VL,WL=RegExp([sv+"?"+Dk+"+"+eS+"(?="+[Jx,sv,"$"].join("|")+")",LL+"+"+tS+"(?="+[Jx,sv+Qx,"$"].join("|")+")",sv+"?"+Qx+"+"+eS,sv+"+"+tS,BL,FL,jk,UL].join("|"),"g");function GL(e){return e.match(WL)||[]}function Vk(e,t,n){return e=Bo(e),t=n?void 0:t,t===void 0?wL(e)?GL(e):_L(e):e.match(t)||[]}var zL="['’]",HL=RegExp(zL,"g");function Fv(e){return function(t){return nk(Vk(Mk(t).replace(HL,"")),e,"")}}var XL=Fv(function(e,t,n){return t=t.toLowerCase(),e+(n?Ak(t):t)}),qL=ih.isFinite,YL=Math.min;function uE(e){var t=Math[e];return function(n,a){if(n=Av(n),a=a==null?0:YL(io(a),292),a&&qL(n)){var r=(Bo(n)+"e").split("e"),s=t(r[0]+"e"+(+r[1]+a));return r=(Bo(s)+"e").split("e"),+(r[0]+"e"+(+r[1]-a))}return t(n)}}var KL=uE("ceil");function Uk(e){var t=ce(e);return t.__chain__=!0,t}var ZL=Math.ceil,JL=Math.max;function QL(e,t,n){(n?Yf(e,t,n):t===void 0)?t=1:t=JL(io(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var r=0,s=0,c=Array(ZL(a/t));r<a;)c[s++]=kd(e,r,r+=t);return c}var e6=1,t6=4;function n6(e,t){return t=typeof t=="function"?t:void 0,jv(e,e6|t6,t)}var r6=4;function o6(e,t){return t=typeof t=="function"?t:void 0,jv(e,r6,t)}function i6(){return new Ls(this.value(),this.__chain__)}function a6(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],a=e;a--;)t[a-1]=arguments[a];return Hm(pa(n)?js(n):[n],hc(t,1))}var l6="Expected a function";function s6(e){var t=e==null?0:e.length,n=Ao;return e=t?dl(e,function(a){if(typeof a[1]!="function")throw new TypeError(l6);return[n(a[0]),a[1]]}):[],ao(function(a){for(var r=-1;++r<t;){var s=e[r];if(Ds(s[0],this,a))return Ds(s[1],this,a)}})}function Wk(e,t,n){var a=n.length;if(e==null)return!a;for(e=Object(e);a--;){var r=n[a],s=t[r],c=e[r];if(c===void 0&&!(r in e)||!s(c))return!1}return!0}function u6(e){var t=pc(e);return function(n){return Wk(n,e,t)}}var c6=1;function d6(e){return u6(jv(e,c6))}function f6(e,t){return t==null||Wk(e,t,pc(t))}var p6=Object.prototype,h6=p6.hasOwnProperty,v6=Qw(function(e,t,n){h6.call(e,n)?++e[n]:a_(e,n,1)});function m6(e,t){var n=Gm(e);return t==null?n:O8(n,t)}var y6=8;function cE(e,t,n){t=n?void 0:t;var a=Cd(e,y6,void 0,void 0,void 0,void 0,void 0,t);return a.placeholder=cE.placeholder,a}cE.placeholder={};var g6=16;function dE(e,t,n){t=n?void 0:t;var a=Cd(e,g6,void 0,void 0,void 0,void 0,void 0,t);return a.placeholder=dE.placeholder,a}dE.placeholder={};function _6(e,t){return e==null||e!==e?t:e}function Gk(e,t,n,a,r,s){return Uf(e)&&Uf(t)&&(s.set(t,e),RM(e,t,void 0,Gk,s),s.delete(t)),e}var zk=o_(function(e,t,n,a){RM(e,t,n,a)}),b6=ao(function(e){return e.push(void 0,Gk),Ds(zk,void 0,e)}),w6="Expected a function";function Hk(e,t,n){if(typeof e!="function")throw new TypeError(w6);return setTimeout(function(){e.apply(void 0,n)},t)}var E6=ao(function(e,t){return Hk(e,1,t)}),O6=ao(function(e,t,n){return Hk(e,Av(t)||0,n)}),x6=ao(function(e,t){var n=Ou(t);return Na(n)&&(n=void 0),Na(e)?u_(e,hc(t,1,Na,!0),Ao(n)):[]}),S6=ao(function(e,t){var n=Ou(t);return Na(n)&&(n=void 0),Na(e)?u_(e,hc(t,1,Na,!0),void 0,n):[]}),A6=c_(function(e,t){return e/t},1);function h_(e,t,n,a){for(var r=e.length,s=a?r:-1;(a?s--:++s<r)&&t(e[s],s,e););return n?kd(e,a?0:s,a?s+1:r):kd(e,a?s+1:0,a?r:s)}function M6(e,t){return e&&e.length?h_(e,Ao(t),!0,!0):[]}function k6(e,t){return e&&e.length?h_(e,Ao(t),!0):[]}function T6(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}var Xk=x8(!0);function fE(e,t){return e&&Xk(e,t,pc)}var qk=S8(fE,!0);function N6(e,t){var n=pa(e)?T6:qk;return n(e,uh(t))}function P6(e,t,n){e=Bo(e),t=Eu(t);var a=e.length;n=n===void 0?a:Dv(io(n),0,a);var r=n;return n-=t.length,n>=0&&e.slice(n,r)==t}function C6(e,t){return dl(t,function(n){return[n,e[n]]})}function R6(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=[a,a]}),n}var j6="[object Map]",D6="[object Set]";function Yk(e){return function(t){var n=l_(t);return n==j6?jM(t):n==D6?R6(t):C6(t,e(t))}}var I6=Yk(pc),L6=Yk(ah),$6={"&":"&","<":"<",">":">",'"':""","'":"'"},F6=sE($6),Kk=/[&<>"']/g,B6=RegExp(Kk.source);function Zk(e){return e=Bo(e),e&&B6.test(e)?e.replace(Kk,F6):e}var Jk=/[\\^$.*+?()[\]{}|]/g,V6=RegExp(Jk.source);function U6(e){return e=Bo(e),e&&V6.test(e)?e.replace(Jk,"\\$&"):e}var W6=4294967295;function Qk(e){return e?Dv(io(e),0,W6):0}function G6(e,t,n,a){var r=e.length;for(n=io(n),n<0&&(n=-n>r?0:r+n),a=a===void 0||a>r?r:io(a),a<0&&(a+=r),a=n>a?0:Qk(a);n<a;)e[n++]=t;return e}function z6(e,t,n,a){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&Yf(e,t,n)&&(n=0,a=r),G6(e,t,n,a)):[]}function eT(e,t,n){var a;return n(e,function(r,s,c){if(t(r,s,c))return a=s,!1}),a}function H6(e,t){return eT(e,Ao(t),sh)}var X6=cI(DM);function q6(e,t){return eT(e,Ao(t),fE)}var Y6=1/0;function K6(e,t){return hc(Ww(e,t),Y6)}function Z6(e,t,n){return n=n===void 0?1:io(n),hc(Ww(e,t),n)}function J6(e,t){var n=e==null?0:e.length;return n?(t=t===void 0?1:io(t),hc(e,t)):[]}var Q6=512;function e5(e){return Cd(e,Q6)}var t5=uE("floor"),n5="Expected a function",r5=8,o5=32,i5=128,a5=256;function tT(e){return lh(function(t){var n=t.length,a=n,r=Ls.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!="function")throw new TypeError(n5);if(r&&!c&&hg(s)=="wrapper")var c=new Ls([],!0)}for(a=c?a:n;++a<n;){s=t[a];var v=hg(s),f=v=="wrapper"?rE(s):void 0;f&&cw(f[0])&&f[1]==(i5|r5|o5|a5)&&!f[4].length&&f[9]==1?c=c[hg(f[0])].apply(c,f[3]):c=s.length==1&&cw(s)?c[v]():c.thru(s)}return function(){var g=arguments,_=g[0];if(c&&g.length==1&&pa(_))return c.plant(_).value();for(var b=0,x=n?t[b].apply(this,g):_;++b<n;)x=t[b].call(this,x);return x}})}var l5=tT(),s5=tT(!0);function u5(e,t){return e==null?e:Xk(e,uh(t),ah)}function c5(e,t){return e&&fE(e,uh(t))}function v_(e,t){return Xm(t,function(n){return Iv(e[n])})}function d5(e){return e==null?[]:v_(e,pc(e))}function f5(e){return e==null?[]:v_(e,ah(e))}function m_(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Av(t),n=Av(n)),e(t,n)}}var p5=m_(ik),h5=m_(function(e,t){return e>=t}),v5=Math.max,m5=Math.min;function y5(e,t,n){return e>=m5(t,n)&&e<v5(t,n)}function g5(e,t,n){return t=Dm(t),n===void 0?(n=t,t=0):n=Dm(n),e=Av(e),y5(e,t,n)}function _5(e){var t=e==null?0:e.length;return t?kd(e,0,-1):[]}var b5=Math.min;function pE(e,t,n){for(var a=n?M8:PM,r=e[0].length,s=e.length,c=s,v=Array(s),f=1/0,g=[];c--;){var _=e[c];c&&t&&(_=dl(_,eh(t))),f=b5(_.length,f),v[c]=!n&&(t||r>=120&&_.length>=120)?new A8(c&&_):void 0}_=e[0];var b=-1,x=v[0];e:for(;++b<r&&g.length<f;){var S=_[b],A=t?t(S):S;if(S=n||S!==0?S:0,!(x?jx(x,A):a(g,A,n))){for(c=s;--c;){var E=v[c];if(!(E?jx(E,A):a(e[c],A,n)))continue e}x&&x.push(A),g.push(S)}}return g}function hE(e){return Na(e)?e:[]}var w5=ao(function(e){var t=dl(e,hE);return t.length&&t[0]===e[0]?pE(t):[]}),E5=ao(function(e){var t=Ou(e),n=dl(e,hE);return t===Ou(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?pE(n,Ao(t)):[]}),O5=ao(function(e){var t=Ou(e),n=dl(e,hE);return t=typeof t=="function"?t:void 0,t&&n.pop(),n.length&&n[0]===e[0]?pE(n,void 0,t):[]});function x5(e,t,n,a){return sh(e,function(r,s,c){t(a,n(r),s,c)}),a}function nT(e,t){return function(n,a){return x5(n,e,t(a),{})}}var S5=Object.prototype,A5=S5.toString,M5=nT(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=A5.call(t)),e[t]=n},IM(oh)),rT=Object.prototype,k5=rT.hasOwnProperty,T5=rT.toString,N5=nT(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=T5.call(t)),k5.call(e,t)?e[t].push(n):e[t]=[n]},Ao);function Zm(e,t,n){t=LM(t,e),e=k8(e,t);var a=e==null?e:e[i_(Ou(t))];return a==null?void 0:Ds(a,e,n)}var P5=ao(Zm),C5=ao(function(e,t,n){var a=-1,r=typeof t=="function",s=s_(e)?Array(e.length):[];return T8(e,function(c){s[++a]=r?Ds(t,c,n):Zm(c,t,n)}),s}),R5="[object ArrayBuffer]";function j5(e){return dc(e)&&Rv(e)==R5}var nS=Ag&&Ag.isArrayBuffer,D5=nS?eh(nS):j5,I5="[object Boolean]";function L5(e){return e===!0||e===!1||dc(e)&&Rv(e)==I5}var $5="[object Date]";function F5(e){return dc(e)&&Rv(e)==$5}var rS=Ag&&Ag.isDate,B5=rS?eh(rS):F5;function V5(e){return dc(e)&&e.nodeType===1&&!Uw(e)}function U5(e,t,n){n=typeof n=="function"?n:void 0;var a=n?n(e,t):void 0;return a===void 0?N8(e,t,void 0,n):!!a}var W5=ih.isFinite;function G5(e){return typeof e=="number"&&W5(e)}function oT(e){return typeof e=="number"&&e==io(e)}function z5(e,t){return e===t||$M(e,t,FM(t))}function H5(e,t,n){return n=typeof n=="function"?n:void 0,$M(e,t,FM(t),n)}var X5="[object Number]";function iT(e){return typeof e=="number"||dc(e)&&Rv(e)==X5}function q5(e){return iT(e)&&e!=+e}var Y5=P8?Iv:BM,K5="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function Z5(e){if(Y5(e))throw new Error(K5);return C8(e)}var oS=9007199254740991;function J5(e){return oT(e)&&e>=-oS&&e<=oS}var Q5="[object WeakMap]";function e$(e){return dc(e)&&l_(e)==Q5}var t$="[object WeakSet]";function n$(e){return dc(e)&&Rv(e)==t$}var r$=1;function o$(e){return Ao(typeof e=="function"?e:jv(e,r$))}var i$=Array.prototype,a$=i$.join;function l$(e,t){return e==null?"":a$.call(e,t)}var s$=Fv(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),u$=Qw(function(e,t,n){a_(e,n,t)});function c$(e,t,n){for(var a=n+1;a--;)if(e[a]===t)return a;return a}var d$=Math.max,f$=Math.min;function p$(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var r=a;return n!==void 0&&(r=io(n),r=r<0?d$(a+r,0):f$(r,a-1)),t===t?c$(e,t,r):R8(e,j8,r,!0)}var h$=Fv(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),v$=Sk("toLowerCase"),m$=m_(dI),y$=m_(function(e,t){return e<=t});function g$(e,t){var n={};return t=Ao(t),sh(e,function(a,r,s){a_(n,t(a,r,s),a)}),n}var _$=1;function b$(e){return D8(jv(e,_$))}var w$=1;function E$(e,t){return I8(e,jv(t,w$))}function O$(e,t){return e&&e.length?fI(e,Ao(t),ik):void 0}function vE(e,t){for(var n,a=-1,r=e.length;++a<r;){var s=t(e[a]);s!==void 0&&(n=n===void 0?s:n+s)}return n}var x$=NaN;function aT(e,t){var n=e==null?0:e.length;return n?vE(e,t)/n:x$}function S$(e){return aT(e,oh)}function A$(e,t){return aT(e,Ao(t))}var M$=ao(function(e,t){return function(n){return Zm(n,e,t)}}),k$=ao(function(e,t){return function(n){return Zm(e,n,t)}});function T$(e,t,n){var a=pc(t),r=v_(t,a),s=!(Uf(n)&&"chain"in n)||!!n.chain,c=Iv(e);return fc(r,function(v){var f=t[v];e[v]=f,c&&(e.prototype[v]=function(){var g=this.__chain__;if(s||g){var _=e(this.__wrapped__),b=_.__actions__=js(this.__actions__);return b.push({func:f,args:arguments,thisArg:e}),_.__chain__=g,_}return f.apply(e,Hm([this.value()],arguments))})}),e}var N$=c_(function(e,t){return e*t},1);function P$(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}var C$="[object Map]",R$="[object Set]",_1=Mg?Mg.iterator:void 0;function lT(e){if(!e)return[];if(s_(e))return eE(e)?xu(e):js(e);if(_1&&e[_1])return P$(e[_1]());var t=l_(e),n=t==C$?jM:t==R$?L8:Km;return n(e)}function j$(){this.__values__===void 0&&(this.__values__=lT(this.value()));var e=this.__index__>=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}}function sT(e,t){var n=e.length;if(n)return t+=t<0?n:0,zm(t,n)?e[t]:void 0}function D$(e,t){return e&&e.length?sT(e,io(t)):void 0}function I$(e){return e=io(e),ao(function(t){return sT(t,e)})}function L$(e,t){return ok(e,tE(Ao(t)))}function $$(e){return gk(2,e)}function F$(e,t,n,a){return e==null?[]:(pa(t)||(t=t==null?[]:[t]),n=a?void 0:n,pa(n)||(n=n==null?[]:[n]),gI(e,t,n))}function mE(e){return lh(function(t){return t=dl(t,eh(Ao)),ao(function(n){var a=this;return e(t,function(r){return Ds(r,a,n)})})})}var B$=mE(dl),V$=ao,U$=Math.min,W$=V$(function(e,t){t=t.length==1&&pa(t[0])?dl(t[0],eh(Ao)):dl(hc(t,1),eh(Ao));var n=t.length;return ao(function(a){for(var r=-1,s=U$(a.length,n);++r<s;)a[r]=t[r].call(this,a[r]);return Ds(e,this,a)})}),G$=mE(YD),z$=mE($8),H$=9007199254740991,X$=Math.floor;function hw(e,t){var n="";if(!e||t<1||t>H$)return n;do t%2&&(n+=e),t=X$(t/2),t&&(e+=e);while(t);return n}var q$=VM("length"),uT="\\ud800-\\udfff",Y$="\\u0300-\\u036f",K$="\\ufe20-\\ufe2f",Z$="\\u20d0-\\u20ff",J$=Y$+K$+Z$,Q$="\\ufe0e\\ufe0f",eF="["+uT+"]",vw="["+J$+"]",mw="\\ud83c[\\udffb-\\udfff]",tF="(?:"+vw+"|"+mw+")",cT="[^"+uT+"]",dT="(?:\\ud83c[\\udde6-\\uddff]){2}",fT="[\\ud800-\\udbff][\\udc00-\\udfff]",nF="\\u200d",pT=tF+"?",hT="["+Q$+"]?",rF="(?:"+nF+"(?:"+[cT,dT,fT].join("|")+")"+hT+pT+")*",oF=hT+pT+rF,iF="(?:"+[cT+vw+"?",vw,dT,fT,eF].join("|")+")",iS=RegExp(mw+"(?="+mw+")|"+iF+oF,"g");function aF(e){for(var t=iS.lastIndex=0;iS.test(e);)++t;return t}function Bv(e){return $v(e)?aF(e):q$(e)}var lF=Math.ceil;function Pg(e,t){t=t===void 0?" ":Eu(t);var n=t.length;if(n<2)return n?hw(t,e):t;var a=hw(t,lF(e/Bv(t)));return $v(t)?Jf(xu(a),0,e).join(""):a.slice(0,e)}var sF=Math.ceil,uF=Math.floor;function cF(e,t,n){e=Bo(e),t=io(t);var a=t?Bv(e):0;if(!t||a>=t)return e;var r=(t-a)/2;return Pg(uF(r),n)+e+Pg(sF(r),n)}function dF(e,t,n){e=Bo(e),t=io(t);var a=t?Bv(e):0;return t&&a<t?e+Pg(t-a,n):e}function fF(e,t,n){e=Bo(e),t=io(t);var a=t?Bv(e):0;return t&&a<t?Pg(t-a,n)+e:e}var pF=/^\s+/,hF=ih.parseInt;function vF(e,t,n){return n||t==null?t=0:t&&(t=+t),hF(Bo(e).replace(pF,""),t||0)}var mF=32,y_=ao(function(e,t){var n=Hf(t,Lv(y_));return Cd(e,mF,void 0,t,n)});y_.placeholder={};var yF=64,yE=ao(function(e,t){var n=Hf(t,Lv(yE));return Cd(e,yF,void 0,t,n)});yE.placeholder={};var gF=Qw(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function _F(e){for(var t,n=this;n instanceof d_;){var a=fk(n);a.__index__=0,a.__values__=void 0,t?r.__wrapped__=a:t=a;var r=a;n=n.__wrapped__}return r.__wrapped__=e,t}function bF(e){return function(t){return e==null?void 0:UM(e,t)}}function wF(e,t,n,a){for(var r=n-1,s=e.length;++r<s;)if(a(e[r],t))return r;return-1}var EF=Array.prototype,aS=EF.splice;function gE(e,t,n,a){var r=a?wF:Gw,s=-1,c=t.length,v=e;for(e===t&&(t=js(t)),n&&(v=dl(e,eh(n)));++s<c;)for(var f=0,g=t[s],_=n?n(g):g;(f=r(v,_,f,a))>-1;)v!==e&&aS.call(v,f,1),aS.call(e,f,1);return e}function vT(e,t){return e&&e.length&&t&&t.length?gE(e,t):e}var OF=ao(vT);function xF(e,t,n){return e&&e.length&&t&&t.length?gE(e,t,Ao(n)):e}function SF(e,t,n){return e&&e.length&&t&&t.length?gE(e,t,void 0,n):e}var AF=Array.prototype,MF=AF.splice;function mT(e,t){for(var n=e?t.length:0,a=n-1;n--;){var r=t[n];if(n==a||r!==s){var s=r;zm(r)?MF.call(e,r,1):WM(e,r)}}return e}var kF=lh(function(e,t){var n=e==null?0:e.length,a=oE(e,t);return mT(e,dl(t,function(r){return zm(r,n)?+r:r}).sort(_I)),a}),TF=Math.floor,NF=Math.random;function _E(e,t){return e+TF(NF()*(t-e+1))}var PF=parseFloat,CF=Math.min,RF=Math.random;function jF(e,t,n){if(n&&typeof n!="boolean"&&Yf(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=Dm(e),t===void 0?(t=e,e=0):t=Dm(t)),e>t){var a=e;e=t,t=a}if(n||e%1||t%1){var r=RF();return CF(e+r*(t-e+PF("1e-"+((r+"").length-1))),t)}return _E(e,t)}var DF=bI(!0),IF=256,LF=lh(function(e,t){return Cd(e,IF,void 0,void 0,void 0,t)});function $F(e,t,n,a){var r=e==null?0:e.length;for(a&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function FF(e,t,n){var a=pa(e)?$F:zD,r=arguments.length<3;return a(e,Ao(t),n,r,qk)}function BF(e,t){var n=[];if(!(e&&e.length))return n;var a=-1,r=[],s=e.length;for(t=Ao(t);++a<s;){var c=e[a];t(c,a,e)&&(n.push(c),r.push(a))}return mT(e,r),n}function VF(e,t,n){return(n?Yf(e,t,n):t===void 0)?t=1:t=io(t),hw(Bo(e),t)}function UF(){var e=arguments,t=Bo(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var WF="Expected a function";function GF(e,t){if(typeof e!="function")throw new TypeError(WF);return t=t===void 0?t:io(t),ao(e,t)}function zF(e,t,n){t=LM(t,e);var a=-1,r=t.length;for(r||(r=1,e=void 0);++a<r;){var s=e==null?void 0:e[i_(t[a])];s===void 0&&(a=r,s=n),e=Iv(s)?s.call(e):s}return e}var HF=Array.prototype,XF=HF.reverse;function yw(e){return e==null?e:XF.call(e)}var qF=uE("round");function yT(e){var t=e.length;return t?e[_E(0,t-1)]:void 0}function YF(e){return yT(Km(e))}function KF(e){var t=pa(e)?yT:YF;return t(e)}function g_(e,t){var n=-1,a=e.length,r=a-1;for(t=t===void 0?a:t;++n<t;){var s=_E(n,r),c=e[s];e[s]=e[n],e[n]=c}return e.length=t,e}function ZF(e,t){return g_(js(e),Dv(t,0,e.length))}function JF(e,t){var n=Km(e);return g_(n,Dv(t,0,n.length))}function QF(e,t,n){(n?Yf(e,t,n):t===void 0)?t=1:t=io(t);var a=pa(e)?ZF:JF;return a(e,t)}function e9(e,t,n,a){return a=typeof a=="function"?a:void 0,e==null?e:zw(e,t,n,a)}function t9(e){return g_(js(e))}function n9(e){return g_(Km(e))}function r9(e){var t=pa(e)?t9:n9;return t(e)}var o9="[object Map]",i9="[object Set]";function a9(e){if(e==null)return 0;if(s_(e))return eE(e)?Bv(e):e.length;var t=l_(e);return t==o9||t==i9?e.size:F8(e).length}function l9(e,t,n){var a=e==null?0:e.length;return a?(n&&typeof n!="number"&&Yf(e,t,n)?(t=0,n=a):(t=t==null?0:io(t),n=n===void 0?a:io(n)),kd(e,t,n)):[]}var s9=Fv(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),u9=4294967295,c9=u9-1,d9=Math.floor,f9=Math.min;function bE(e,t,n,a){var r=0,s=e==null?0:e.length;if(s===0)return 0;t=n(t);for(var c=t!==t,v=t===null,f=Sv(t),g=t===void 0;r<s;){var _=d9((r+s)/2),b=n(e[_]),x=b!==void 0,S=b===null,A=b===b,E=Sv(b);if(c)var T=a||A;else g?T=A&&(a||x):v?T=A&&x&&(a||!S):f?T=A&&x&&!S&&(a||!E):S||E?T=!1:T=a?b<=t:b<t;T?r=_+1:s=_}return f9(s,c9)}var p9=4294967295,h9=p9>>>1;function __(e,t,n){var a=0,r=e==null?a:e.length;if(typeof t=="number"&&t===t&&r<=h9){for(;a<r;){var s=a+r>>>1,c=e[s];c!==null&&!Sv(c)&&(n?c<=t:c<t)?a=s+1:r=s}return r}return bE(e,t,oh,n)}function v9(e,t){return __(e,t)}function m9(e,t,n){return bE(e,t,Ao(n))}function y9(e,t){var n=e==null?0:e.length;if(n){var a=__(e,t);if(a<n&&qm(e[a],t))return a}return-1}function g9(e,t){return __(e,t,!0)}function _9(e,t,n){return bE(e,t,Ao(n),!0)}function b9(e,t){var n=e==null?0:e.length;if(n){var a=__(e,t,!0)-1;if(qm(e[a],t))return a}return-1}function gT(e,t){for(var n=-1,a=e.length,r=0,s=[];++n<a;){var c=e[n],v=t?t(c):c;if(!n||!qm(v,f)){var f=v;s[r++]=c===0?0:c}}return s}function w9(e){return e&&e.length?gT(e):[]}function E9(e,t){return e&&e.length?gT(e,Ao(t)):[]}var O9=4294967295;function x9(e,t,n){return n&&typeof n!="number"&&Yf(e,t,n)&&(t=n=void 0),n=n===void 0?O9:n>>>0,n?(e=Bo(e),e&&(typeof t=="string"||t!=null&&!nE(t))&&(t=Eu(t),!t&&$v(e))?Jf(xu(e),0,n):e.split(t,n)):[]}var S9="Expected a function",A9=Math.max;function M9(e,t){if(typeof e!="function")throw new TypeError(S9);return t=t==null?0:A9(io(t),0),ao(function(n){var a=n[t],r=Jf(n,0,t);return a&&Hm(r,a),Ds(e,this,r)})}var k9=Fv(function(e,t,n){return e+(n?" ":"")+lE(t)});function T9(e,t,n){return e=Bo(e),n=n==null?0:Dv(io(n),0,e.length),t=Eu(t),e.slice(n,n+t.length)==t}function N9(){return{}}function P9(){return""}function C9(){return!0}var R9=c_(function(e,t){return e-t},0);function j9(e){return e&&e.length?vE(e,oh):0}function D9(e,t){return e&&e.length?vE(e,Ao(t)):0}function I9(e){var t=e==null?0:e.length;return t?kd(e,1,t):[]}function L9(e,t,n){return e&&e.length?(t=n||t===void 0?1:io(t),kd(e,0,t<0?0:t)):[]}function $9(e,t,n){var a=e==null?0:e.length;return a?(t=n||t===void 0?1:io(t),t=a-t,kd(e,t<0?0:t,a)):[]}function F9(e,t){return e&&e.length?h_(e,Ao(t),!1,!0):[]}function B9(e,t){return e&&e.length?h_(e,Ao(t)):[]}function V9(e,t){return t(e),e}var _T=Object.prototype,U9=_T.hasOwnProperty;function lS(e,t,n,a){return e===void 0||qm(e,_T[n])&&!U9.call(a,n)?t:e}var W9={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function G9(e){return"\\"+W9[e]}var bT=/<%=([\s\S]+?)%>/g,z9=/<%-([\s\S]+?)%>/g,H9=/<%([\s\S]+?)%>/g,gw={escape:z9,evaluate:H9,interpolate:bT,variable:"",imports:{_:{escape:Zk}}},X9="Invalid `variable` option passed into `_.template`",q9=/\b__p \+= '';/g,Y9=/\b(__p \+=) '' \+/g,K9=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z9=/[()=,{}\[\]\/\s]/,J9=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rg=/($^)/,Q9=/['\n\r\u2028\u2029\\]/g,e7=Object.prototype,sS=e7.hasOwnProperty;function t7(e,t,n){var a=gw.imports._.templateSettings||gw;n&&Yf(e,t,n)&&(t=void 0),e=Bo(e),t=dw({},t,a,lS);var r=dw({},t.imports,a.imports,lS),s=pc(r),c=rk(r,s),v,f,g=0,_=t.interpolate||rg,b="__p += '",x=RegExp((t.escape||rg).source+"|"+_.source+"|"+(_===bT?J9:rg).source+"|"+(t.evaluate||rg).source+"|$","g"),S=sS.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+`
|
||
`:"";e.replace(x,function(T,I,R,U,D,L){return R||(R=U),b+=e.slice(g,L).replace(Q9,G9),I&&(v=!0,b+=`' +
|
||
__e(`+I+`) +
|
||
'`),D&&(f=!0,b+=`';
|
||
`+D+`;
|
||
__p += '`),R&&(b+=`' +
|
||
((__t = (`+R+`)) == null ? '' : __t) +
|
||
'`),g=L+T.length,T}),b+=`';
|
||
`;var A=sS.call(t,"variable")&&t.variable;if(!A)b=`with (obj) {
|
||
`+b+`
|
||
}
|
||
`;else if(Z9.test(A))throw new Error(X9);b=(f?b.replace(q9,""):b).replace(Y9,"$1").replace(K9,"$1;"),b="function("+(A||"obj")+`) {
|
||
`+(A?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(v?", __e = _.escape":"")+(f?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+b+`return __p
|
||
}`;var E=yk(function(){return Function(s,S+"return "+b).apply(void 0,c)});if(E.source=b,iE(E))throw E;return E}function b_(e,t){return t(e)}var n7=9007199254740991,b1=4294967295,r7=Math.min;function o7(e,t){if(e=io(e),e<1||e>n7)return[];var n=b1,a=r7(e,b1);t=uh(t),e-=b1;for(var r=GM(a,t);++n<e;)t(n);return r}function i7(){return this}function wT(e,t){var n=e;return n instanceof eo&&(n=n.value()),nk(t,function(a,r){return r.func.apply(r.thisArg,Hm([a],r.args))},n)}function a7(){return wT(this.__wrapped__,this.__actions__)}function l7(e){return Bo(e).toLowerCase()}function s7(e){return pa(e)?dl(e,i_):Sv(e)?[e]:js(B8(Bo(e)))}var uS=9007199254740991;function u7(e){return e?Dv(io(e),-uS,uS):e===0?e:0}function c7(e){return Bo(e).toUpperCase()}function d7(e,t,n){var a=pa(e),r=a||zM(e)||HM(e);if(t=Ao(t),n==null){var s=e&&e.constructor;r?n=a?new s:[]:Uf(e)?n=Iv(s)?Gm(V8(e)):{}:n={}}return(r?fc:sh)(e,function(c,v,f){return t(n,c,v,f)}),n}function ET(e,t){for(var n=e.length;n--&&Gw(t,e[n],0)>-1;);return n}function OT(e,t){for(var n=-1,a=e.length;++n<a&&Gw(t,e[n],0)>-1;);return n}function f7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return U8(e);if(!e||!(t=Eu(t)))return e;var a=xu(e),r=xu(t),s=OT(a,r),c=ET(a,r)+1;return Jf(a,s,c).join("")}function p7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return e.slice(0,W8(e)+1);if(!e||!(t=Eu(t)))return e;var a=xu(e),r=ET(a,xu(t))+1;return Jf(a,0,r).join("")}var h7=/^\s+/;function v7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return e.replace(h7,"");if(!e||!(t=Eu(t)))return e;var a=xu(e),r=OT(a,xu(t));return Jf(a,r).join("")}var m7=30,y7="...",g7=/\w*$/;function _7(e,t){var n=m7,a=y7;if(Uf(t)){var r="separator"in t?t.separator:r;n="length"in t?io(t.length):n,a="omission"in t?Eu(t.omission):a}e=Bo(e);var s=e.length;if($v(e)){var c=xu(e);s=c.length}if(n>=s)return e;var v=n-Bv(a);if(v<1)return a;var f=c?Jf(c,0,v).join(""):e.slice(0,v);if(r===void 0)return f+a;if(c&&(v+=f.length-v),nE(r)){if(e.slice(v).search(r)){var g,_=f;for(r.global||(r=RegExp(r.source,Bo(g7.exec(r))+"g")),r.lastIndex=0;g=r.exec(_);)var b=g.index;f=f.slice(0,b===void 0?v:b)}}else if(e.indexOf(Eu(r),v)!=v){var x=f.lastIndexOf(r);x>-1&&(f=f.slice(0,x))}return f+a}function b7(e){return mk(e,1)}var w7={"&":"&","<":"<",">":">",""":'"',"'":"'"},E7=sE(w7),xT=/&(?:amp|lt|gt|quot|#39);/g,O7=RegExp(xT.source);function x7(e){return e=Bo(e),e&&O7.test(e)?e.replace(xT,E7):e}var S7=ao(function(e){var t=Ou(e);return Na(t)&&(t=void 0),Im(hc(e,1,Na,!0),Ao(t))}),A7=ao(function(e){var t=Ou(e);return t=typeof t=="function"?t:void 0,Im(hc(e,1,Na,!0),void 0,t)});function M7(e,t){return t=typeof t=="function"?t:void 0,e&&e.length?Im(e,void 0,t):[]}function k7(e,t){return e==null?!0:WM(e,t)}var T7=Math.max;function wE(e){if(!(e&&e.length))return[];var t=0;return e=Xm(e,function(n){if(Na(n))return t=T7(n.length,t),!0}),GM(t,function(n){return dl(e,VM(n))})}function ST(e,t){if(!(e&&e.length))return[];var n=wE(e);return t==null?n:dl(n,function(a){return Ds(t,void 0,a)})}function AT(e,t,n,a){return zw(e,t,n(UM(e,t)),a)}function N7(e,t,n){return e==null?e:AT(e,t,uh(n))}function P7(e,t,n,a){return a=typeof a=="function"?a:void 0,e==null?e:AT(e,t,uh(n),a)}var C7=Fv(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()});function R7(e){return e==null?[]:rk(e,ah(e))}var j7=ao(function(e,t){return Na(e)?u_(e,t):[]});function D7(e,t){return y_(uh(t),e)}var I7=lh(function(e){var t=e.length,n=t?e[0]:0,a=this.__wrapped__,r=function(s){return oE(s,e)};return t>1||this.__actions__.length||!(a instanceof eo)||!zm(n)?this.thru(r):(a=a.slice(n,+n+(t?1:0)),a.__actions__.push({func:b_,args:[r],thisArg:void 0}),new Ls(a,this.__chain__).thru(function(s){return t&&!s.length&&s.push(void 0),s}))});function L7(){return Uk(this)}function $7(){var e=this.__wrapped__;if(e instanceof eo){var t=e;return this.__actions__.length&&(t=new eo(this)),t=t.reverse(),t.__actions__.push({func:b_,args:[yw],thisArg:void 0}),new Ls(t,this.__chain__)}return this.thru(yw)}function EE(e,t,n){var a=e.length;if(a<2)return a?Im(e[0]):[];for(var r=-1,s=Array(a);++r<a;)for(var c=e[r],v=-1;++v<a;)v!=r&&(s[r]=u_(s[r]||c,e[v],t,n));return Im(hc(s,1),t,n)}var F7=ao(function(e){return EE(Xm(e,Na))}),B7=ao(function(e){var t=Ou(e);return Na(t)&&(t=void 0),EE(Xm(e,Na),Ao(t))}),V7=ao(function(e){var t=Ou(e);return t=typeof t=="function"?t:void 0,EE(Xm(e,Na),void 0,t)}),U7=ao(wE);function W7(e,t){return wI(e||[],t||[],zw)}var G7=ao(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n=typeof n=="function"?(e.pop(),n):void 0,ST(e,n)});const Bn={chunk:QL,compact:KD,concat:a6,difference:ZD,differenceBy:x6,differenceWith:S6,drop:JD,dropRight:QD,dropRightWhile:M6,dropWhile:k6,fill:z6,findIndex:pI,findLastIndex:DM,flatten:G8,flattenDeep:z8,flattenDepth:J6,fromPairs:H8,head:nI,indexOf:rI,initial:_5,intersection:w5,intersectionBy:E5,intersectionWith:O5,join:l$,lastIndexOf:p$,nth:D$,pull:OF,pullAll:vT,pullAllBy:xF,pullAllWith:SF,pullAt:kF,remove:BF,reverse:yw,slice:l9,sortedIndex:v9,sortedIndexBy:m9,sortedIndexOf:y9,sortedLastIndex:g9,sortedLastIndexBy:_9,sortedLastIndexOf:b9,sortedUniq:w9,sortedUniqBy:E9,tail:I9,take:L9,takeRight:$9,takeRightWhile:F9,takeWhile:B9,union:X8,unionBy:S7,unionWith:A7,uniq:eI,uniqBy:tI,uniqWith:M7,unzip:wE,unzipWith:ST,without:j7,xor:F7,xorBy:B7,xorWith:V7,zip:U7,zipObject:EI,zipObjectDeep:W7,zipWith:G7},Vo={countBy:v6,every:aI,filter:HD,find:hI,findLast:X6,flatMap:q8,flatMapDeep:K6,flatMapDepth:Z6,forEach:XD,forEachRight:N6,groupBy:oI,includes:lI,invokeMap:C5,keyBy:u$,map:Ww,orderBy:F$,partition:gF,reduce:qD,reduceRight:FF,reject:iI,sample:KF,sampleSize:QF,shuffle:r9,size:a9,some:sI,sortBy:OI},z7={now:Y8},Ri={after:DI,ary:mk,before:gk,bind:p_,bindKey:aE,curry:cE,curryRight:dE,debounce:K8,defer:E6,delay:O6,flip:e5,memoize:Z8,once:$$,overArgs:W$,partial:y_,partialRight:yE,rearg:LF,rest:GF,spread:M9,throttle:J8,unary:b7,wrap:D7},fr={castArray:Q8,clone:tD,cloneDeep:nD,cloneDeepWith:n6,cloneWith:o6,conformsTo:f6,eq:qm,gt:p5,gte:h5,isArguments:rD,isArrayBuffer:D5,isArrayLike:s_,isArrayLikeObject:Na,isBoolean:L5,isBuffer:zM,isDate:B5,isElement:V5,isEmpty:oD,isEqual:iD,isEqualWith:U5,isError:iE,isFinite:G5,isFunction:Iv,isInteger:oT,isLength:aD,isMap:lD,isMatch:z5,isMatchWith:H5,isNaN:q5,isNative:Z5,isNil:sD,isNull:uD,isNumber:iT,isObjectLike:dc,isPlainObject:Uw,isRegExp:nE,isSafeInteger:J5,isSet:cD,isString:eE,isSymbol:Sv,isTypedArray:HM,isUndefined:dD,isWeakMap:e$,isWeakSet:n$,lt:m$,lte:y$,toArray:lT,toFinite:Dm,toLength:Qk,toNumber:Av,toPlainObject:eD,toSafeInteger:u7,toString:Bo},pl={add:RI,ceil:KL,divide:A6,floor:t5,max:xI,maxBy:O$,mean:S$,meanBy:A$,min:vI,minBy:SI,multiply:N$,round:qF,subtract:R9,sum:j9,sumBy:D9},OE={clamp:fD,inRange:g5,random:jF},Ar={assign:uI,assignIn:T4,assignInWith:dw,assignWith:N4,at:P4,create:m6,defaults:mI,defaultsDeep:b6,findKey:H6,findLastKey:q6,forIn:MI,forInRight:u5,forOwn:kI,forOwnRight:c5,functions:d5,functionsIn:f5,get:CM,has:yI,hasIn:yD,invert:M5,invertBy:N5,invoke:P5,keysIn:ah,mapKeys:g$,mapValues:AI,merge:pD,mergeWith:zk,omit:hD,omitBy:L$,pick:vD,pickBy:ok,result:zF,set:mD,setWith:e9,toPairs:I6,toPairsIn:L6,transform:d7,unset:k7,update:N7,updateWith:P7,values:Km,valuesIn:R7},mc={at:I7,chain:Uk,commit:i6,next:j$,plant:_F,reverse:$7,tap:V9,toIterator:i7,value:a7,wrapperChain:L7},bo={camelCase:XL,capitalize:Ak,deburr:Mk,endsWith:P6,escape:Zk,escapeRegExp:U6,kebabCase:s$,lowerCase:h$,lowerFirst:v$,pad:cF,padEnd:dF,padStart:fF,parseInt:vF,repeat:VF,replace:UF,snakeCase:s9,split:x9,startCase:k9,startsWith:T9,template:t7,templateSettings:gw,toLower:l7,toUpper:c7,trim:f7,trimEnd:p7,trimStart:v7,truncate:_7,unescape:x7,upperCase:C7,upperFirst:lE,words:Vk},Mo={attempt:yk,bindAll:L4,cond:s6,conforms:d6,constant:IM,defaultTo:_6,flow:l5,flowRight:s5,iteratee:o$,matches:b$,matchesProperty:E$,method:M$,methodOf:k$,noop:NM,nthArg:I$,over:B$,overEvery:G$,overSome:z$,property:gD,propertyOf:bF,range:TI,rangeRight:DF,stubArray:_D,stubFalse:BM,stubObject:N9,stubString:P9,stubTrue:C9,times:o7,toPath:s7,uniqueId:NI};function H7(){var e=new eo(this.__wrapped__);return e.__actions__=js(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=js(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=js(this.__views__),e}function X7(){if(this.__filtered__){var e=new eo(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}var q7=Math.max,Y7=Math.min;function K7(e,t,n){for(var a=-1,r=n.length;++a<r;){var s=n[a],c=s.size;switch(s.type){case"drop":e+=c;break;case"dropRight":t-=c;break;case"take":t=Y7(t,e+c);break;case"takeRight":e=q7(e,t-c);break}}return{start:e,end:t}}var Z7=1,J7=2,Q7=Math.min;function eB(){var e=this.__wrapped__.value(),t=this.__dir__,n=pa(e),a=t<0,r=n?e.length:0,s=K7(0,r,this.__views__),c=s.start,v=s.end,f=v-c,g=a?v:c-1,_=this.__iteratees__,b=_.length,x=0,S=Q7(f,this.__takeCount__);if(!n||!a&&r==f&&S==f)return wT(e,this.__actions__);var A=[];e:for(;f--&&x<S;){g+=t;for(var E=-1,T=e[g];++E<b;){var I=_[E],R=I.iteratee,U=I.type,D=R(T);if(U==J7)T=D;else if(!D){if(U==Z7)continue e;break e}}A[x++]=T}return A}/**
|
||
* @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 tB="4.17.23",nB=2,rB=1,oB=3,MT=4294967295,iB=Array.prototype,aB=Object.prototype,kT=aB.hasOwnProperty,cS=Mg?Mg.iterator:void 0,lB=Math.max,dS=Math.min,xE=(function(e){return function(t,n,a){if(a==null){var r=Uf(n),s=r&&pc(n),c=s&&s.length&&v_(n,s);(c?c.length:r)||(a=n,n=t,t=this)}return e(t,n,a)}})(T$);ce.after=Ri.after;ce.ary=Ri.ary;ce.assign=Ar.assign;ce.assignIn=Ar.assignIn;ce.assignInWith=Ar.assignInWith;ce.assignWith=Ar.assignWith;ce.at=Ar.at;ce.before=Ri.before;ce.bind=Ri.bind;ce.bindAll=Mo.bindAll;ce.bindKey=Ri.bindKey;ce.castArray=fr.castArray;ce.chain=mc.chain;ce.chunk=Bn.chunk;ce.compact=Bn.compact;ce.concat=Bn.concat;ce.cond=Mo.cond;ce.conforms=Mo.conforms;ce.constant=Mo.constant;ce.countBy=Vo.countBy;ce.create=Ar.create;ce.curry=Ri.curry;ce.curryRight=Ri.curryRight;ce.debounce=Ri.debounce;ce.defaults=Ar.defaults;ce.defaultsDeep=Ar.defaultsDeep;ce.defer=Ri.defer;ce.delay=Ri.delay;ce.difference=Bn.difference;ce.differenceBy=Bn.differenceBy;ce.differenceWith=Bn.differenceWith;ce.drop=Bn.drop;ce.dropRight=Bn.dropRight;ce.dropRightWhile=Bn.dropRightWhile;ce.dropWhile=Bn.dropWhile;ce.fill=Bn.fill;ce.filter=Vo.filter;ce.flatMap=Vo.flatMap;ce.flatMapDeep=Vo.flatMapDeep;ce.flatMapDepth=Vo.flatMapDepth;ce.flatten=Bn.flatten;ce.flattenDeep=Bn.flattenDeep;ce.flattenDepth=Bn.flattenDepth;ce.flip=Ri.flip;ce.flow=Mo.flow;ce.flowRight=Mo.flowRight;ce.fromPairs=Bn.fromPairs;ce.functions=Ar.functions;ce.functionsIn=Ar.functionsIn;ce.groupBy=Vo.groupBy;ce.initial=Bn.initial;ce.intersection=Bn.intersection;ce.intersectionBy=Bn.intersectionBy;ce.intersectionWith=Bn.intersectionWith;ce.invert=Ar.invert;ce.invertBy=Ar.invertBy;ce.invokeMap=Vo.invokeMap;ce.iteratee=Mo.iteratee;ce.keyBy=Vo.keyBy;ce.keys=pc;ce.keysIn=Ar.keysIn;ce.map=Vo.map;ce.mapKeys=Ar.mapKeys;ce.mapValues=Ar.mapValues;ce.matches=Mo.matches;ce.matchesProperty=Mo.matchesProperty;ce.memoize=Ri.memoize;ce.merge=Ar.merge;ce.mergeWith=Ar.mergeWith;ce.method=Mo.method;ce.methodOf=Mo.methodOf;ce.mixin=xE;ce.negate=tE;ce.nthArg=Mo.nthArg;ce.omit=Ar.omit;ce.omitBy=Ar.omitBy;ce.once=Ri.once;ce.orderBy=Vo.orderBy;ce.over=Mo.over;ce.overArgs=Ri.overArgs;ce.overEvery=Mo.overEvery;ce.overSome=Mo.overSome;ce.partial=Ri.partial;ce.partialRight=Ri.partialRight;ce.partition=Vo.partition;ce.pick=Ar.pick;ce.pickBy=Ar.pickBy;ce.property=Mo.property;ce.propertyOf=Mo.propertyOf;ce.pull=Bn.pull;ce.pullAll=Bn.pullAll;ce.pullAllBy=Bn.pullAllBy;ce.pullAllWith=Bn.pullAllWith;ce.pullAt=Bn.pullAt;ce.range=Mo.range;ce.rangeRight=Mo.rangeRight;ce.rearg=Ri.rearg;ce.reject=Vo.reject;ce.remove=Bn.remove;ce.rest=Ri.rest;ce.reverse=Bn.reverse;ce.sampleSize=Vo.sampleSize;ce.set=Ar.set;ce.setWith=Ar.setWith;ce.shuffle=Vo.shuffle;ce.slice=Bn.slice;ce.sortBy=Vo.sortBy;ce.sortedUniq=Bn.sortedUniq;ce.sortedUniqBy=Bn.sortedUniqBy;ce.split=bo.split;ce.spread=Ri.spread;ce.tail=Bn.tail;ce.take=Bn.take;ce.takeRight=Bn.takeRight;ce.takeRightWhile=Bn.takeRightWhile;ce.takeWhile=Bn.takeWhile;ce.tap=mc.tap;ce.throttle=Ri.throttle;ce.thru=b_;ce.toArray=fr.toArray;ce.toPairs=Ar.toPairs;ce.toPairsIn=Ar.toPairsIn;ce.toPath=Mo.toPath;ce.toPlainObject=fr.toPlainObject;ce.transform=Ar.transform;ce.unary=Ri.unary;ce.union=Bn.union;ce.unionBy=Bn.unionBy;ce.unionWith=Bn.unionWith;ce.uniq=Bn.uniq;ce.uniqBy=Bn.uniqBy;ce.uniqWith=Bn.uniqWith;ce.unset=Ar.unset;ce.unzip=Bn.unzip;ce.unzipWith=Bn.unzipWith;ce.update=Ar.update;ce.updateWith=Ar.updateWith;ce.values=Ar.values;ce.valuesIn=Ar.valuesIn;ce.without=Bn.without;ce.words=bo.words;ce.wrap=Ri.wrap;ce.xor=Bn.xor;ce.xorBy=Bn.xorBy;ce.xorWith=Bn.xorWith;ce.zip=Bn.zip;ce.zipObject=Bn.zipObject;ce.zipObjectDeep=Bn.zipObjectDeep;ce.zipWith=Bn.zipWith;ce.entries=Ar.toPairs;ce.entriesIn=Ar.toPairsIn;ce.extend=Ar.assignIn;ce.extendWith=Ar.assignInWith;xE(ce,ce);ce.add=pl.add;ce.attempt=Mo.attempt;ce.camelCase=bo.camelCase;ce.capitalize=bo.capitalize;ce.ceil=pl.ceil;ce.clamp=OE.clamp;ce.clone=fr.clone;ce.cloneDeep=fr.cloneDeep;ce.cloneDeepWith=fr.cloneDeepWith;ce.cloneWith=fr.cloneWith;ce.conformsTo=fr.conformsTo;ce.deburr=bo.deburr;ce.defaultTo=Mo.defaultTo;ce.divide=pl.divide;ce.endsWith=bo.endsWith;ce.eq=fr.eq;ce.escape=bo.escape;ce.escapeRegExp=bo.escapeRegExp;ce.every=Vo.every;ce.find=Vo.find;ce.findIndex=Bn.findIndex;ce.findKey=Ar.findKey;ce.findLast=Vo.findLast;ce.findLastIndex=Bn.findLastIndex;ce.findLastKey=Ar.findLastKey;ce.floor=pl.floor;ce.forEach=Vo.forEach;ce.forEachRight=Vo.forEachRight;ce.forIn=Ar.forIn;ce.forInRight=Ar.forInRight;ce.forOwn=Ar.forOwn;ce.forOwnRight=Ar.forOwnRight;ce.get=Ar.get;ce.gt=fr.gt;ce.gte=fr.gte;ce.has=Ar.has;ce.hasIn=Ar.hasIn;ce.head=Bn.head;ce.identity=oh;ce.includes=Vo.includes;ce.indexOf=Bn.indexOf;ce.inRange=OE.inRange;ce.invoke=Ar.invoke;ce.isArguments=fr.isArguments;ce.isArray=pa;ce.isArrayBuffer=fr.isArrayBuffer;ce.isArrayLike=fr.isArrayLike;ce.isArrayLikeObject=fr.isArrayLikeObject;ce.isBoolean=fr.isBoolean;ce.isBuffer=fr.isBuffer;ce.isDate=fr.isDate;ce.isElement=fr.isElement;ce.isEmpty=fr.isEmpty;ce.isEqual=fr.isEqual;ce.isEqualWith=fr.isEqualWith;ce.isError=fr.isError;ce.isFinite=fr.isFinite;ce.isFunction=fr.isFunction;ce.isInteger=fr.isInteger;ce.isLength=fr.isLength;ce.isMap=fr.isMap;ce.isMatch=fr.isMatch;ce.isMatchWith=fr.isMatchWith;ce.isNaN=fr.isNaN;ce.isNative=fr.isNative;ce.isNil=fr.isNil;ce.isNull=fr.isNull;ce.isNumber=fr.isNumber;ce.isObject=Uf;ce.isObjectLike=fr.isObjectLike;ce.isPlainObject=fr.isPlainObject;ce.isRegExp=fr.isRegExp;ce.isSafeInteger=fr.isSafeInteger;ce.isSet=fr.isSet;ce.isString=fr.isString;ce.isSymbol=fr.isSymbol;ce.isTypedArray=fr.isTypedArray;ce.isUndefined=fr.isUndefined;ce.isWeakMap=fr.isWeakMap;ce.isWeakSet=fr.isWeakSet;ce.join=Bn.join;ce.kebabCase=bo.kebabCase;ce.last=Ou;ce.lastIndexOf=Bn.lastIndexOf;ce.lowerCase=bo.lowerCase;ce.lowerFirst=bo.lowerFirst;ce.lt=fr.lt;ce.lte=fr.lte;ce.max=pl.max;ce.maxBy=pl.maxBy;ce.mean=pl.mean;ce.meanBy=pl.meanBy;ce.min=pl.min;ce.minBy=pl.minBy;ce.stubArray=Mo.stubArray;ce.stubFalse=Mo.stubFalse;ce.stubObject=Mo.stubObject;ce.stubString=Mo.stubString;ce.stubTrue=Mo.stubTrue;ce.multiply=pl.multiply;ce.nth=Bn.nth;ce.noop=Mo.noop;ce.now=z7.now;ce.pad=bo.pad;ce.padEnd=bo.padEnd;ce.padStart=bo.padStart;ce.parseInt=bo.parseInt;ce.random=OE.random;ce.reduce=Vo.reduce;ce.reduceRight=Vo.reduceRight;ce.repeat=bo.repeat;ce.replace=bo.replace;ce.result=Ar.result;ce.round=pl.round;ce.sample=Vo.sample;ce.size=Vo.size;ce.snakeCase=bo.snakeCase;ce.some=Vo.some;ce.sortedIndex=Bn.sortedIndex;ce.sortedIndexBy=Bn.sortedIndexBy;ce.sortedIndexOf=Bn.sortedIndexOf;ce.sortedLastIndex=Bn.sortedLastIndex;ce.sortedLastIndexBy=Bn.sortedLastIndexBy;ce.sortedLastIndexOf=Bn.sortedLastIndexOf;ce.startCase=bo.startCase;ce.startsWith=bo.startsWith;ce.subtract=pl.subtract;ce.sum=pl.sum;ce.sumBy=pl.sumBy;ce.template=bo.template;ce.times=Mo.times;ce.toFinite=fr.toFinite;ce.toInteger=io;ce.toLength=fr.toLength;ce.toLower=bo.toLower;ce.toNumber=fr.toNumber;ce.toSafeInteger=fr.toSafeInteger;ce.toString=fr.toString;ce.toUpper=bo.toUpper;ce.trim=bo.trim;ce.trimEnd=bo.trimEnd;ce.trimStart=bo.trimStart;ce.truncate=bo.truncate;ce.unescape=bo.unescape;ce.uniqueId=Mo.uniqueId;ce.upperCase=bo.upperCase;ce.upperFirst=bo.upperFirst;ce.each=Vo.forEach;ce.eachRight=Vo.forEachRight;ce.first=Bn.head;xE(ce,(function(){var e={};return sh(ce,function(t,n){kT.call(ce.prototype,n)||(e[n]=t)}),e})(),{chain:!1});ce.VERSION=tB;(ce.templateSettings=bo.templateSettings).imports._=ce;fc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){ce[e].placeholder=ce});fc(["drop","take"],function(e,t){eo.prototype[e]=function(n){n=n===void 0?1:lB(io(n),0);var a=this.__filtered__&&!t?new eo(this):this.clone();return a.__filtered__?a.__takeCount__=dS(n,a.__takeCount__):a.__views__.push({size:dS(n,MT),type:e+(a.__dir__<0?"Right":"")}),a},eo.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}});fc(["filter","map","takeWhile"],function(e,t){var n=t+1,a=n==rB||n==oB;eo.prototype[e]=function(r){var s=this.clone();return s.__iteratees__.push({iteratee:Ao(r),type:n}),s.__filtered__=s.__filtered__||a,s}});fc(["head","last"],function(e,t){var n="take"+(t?"Right":"");eo.prototype[e]=function(){return this[n](1).value()[0]}});fc(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");eo.prototype[e]=function(){return this.__filtered__?new eo(this):this[n](1)}});eo.prototype.compact=function(){return this.filter(oh)};eo.prototype.find=function(e){return this.filter(e).head()};eo.prototype.findLast=function(e){return this.reverse().find(e)};eo.prototype.invokeMap=ao(function(e,t){return typeof e=="function"?new eo(this):this.map(function(n){return Zm(n,e,t)})});eo.prototype.reject=function(e){return this.filter(tE(Ao(e)))};eo.prototype.slice=function(e,t){e=io(e);var n=this;return n.__filtered__&&(e>0||t<0)?new eo(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==void 0&&(t=io(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)};eo.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};eo.prototype.toArray=function(){return this.take(MT)};sh(eo.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),r=ce[a?"take"+(t=="last"?"Right":""):t],s=a||/^find/.test(t);r&&(ce.prototype[t]=function(){var c=this.__wrapped__,v=a?[1]:arguments,f=c instanceof eo,g=v[0],_=f||pa(c),b=function(I){var R=r.apply(ce,Hm([I],v));return a&&x?R[0]:R};_&&n&&typeof g=="function"&&g.length!=1&&(f=_=!1);var x=this.__chain__,S=!!this.__actions__.length,A=s&&!x,E=f&&!S;if(!s&&_){c=E?c:new eo(this);var T=e.apply(c,v);return T.__actions__.push({func:b_,args:[b],thisArg:void 0}),new Ls(T,x)}return A&&E?e.apply(this,v):(T=this.thru(b),A?a?T.value()[0]:T.value():T)})});fc(["pop","push","shift","sort","splice","unshift"],function(e){var t=iB[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);ce.prototype[e]=function(){var r=arguments;if(a&&!this.__chain__){var s=this.value();return t.apply(pa(s)?s:[],r)}return this[n](function(c){return t.apply(pa(c)?c:[],r)})}});sh(eo.prototype,function(e,t){var n=ce[t];if(n){var a=n.name+"";kT.call(yv,a)||(yv[a]=[]),yv[a].push({name:t,func:n})}});yv[f_(void 0,nB).name]=[{name:"wrapper",func:void 0}];eo.prototype.clone=H7;eo.prototype.reverse=X7;eo.prototype.value=eB;ce.prototype.at=mc.at;ce.prototype.chain=mc.wrapperChain;ce.prototype.commit=mc.commit;ce.prototype.next=mc.next;ce.prototype.plant=mc.plant;ce.prototype.reverse=mc.reverse;ce.prototype.toJSON=ce.prototype.valueOf=ce.prototype.value=mc.value;ce.prototype.first=ce.prototype.head;cS&&(ce.prototype[cS]=mc.toIterator);const sB="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",uB="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",cB={class:"list flex-wrap"},dB=["onClick","onMousedown"],fB=["src"],pB=["title"],hB={class:"flex-between"},vB={class:"flex align-center"},mB=["src"],yB=["title"],gB={key:0,class:"status-tag",style:{"margin-left":"auto"}},_B=Vn({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(e,{emit:t}){const n=e,a=t,r=Re(""),s=Re([]);function c(v,f){return f.length?v.filter(g=>g.name.toLowerCase().includes(f.toLowerCase())):v}return Ym([()=>r.value,()=>n.list],()=>{s.value=c(n.list,r.value)}),(v,f)=>{const g=J("el-input"),_=J("el-avatar"),b=J("el-tag"),x=J("el-text"),S=J("el-popover"),A=J("el-empty");return be(),Ht(ar,null,[k(g,{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=E=>r.value=E),modelModifiers:{trim:!0},placeholder:v.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),Y("div",cB,[s.value.length?(be(!0),Ht(ar,{key:0},Gr(s.value,E=>(be(),at(S,{key:E.id,placement:"right",width:280,"show-after":500},{reference:P(()=>[Y("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:rn(T=>a("clickNodes",E),["stop"]),onMousedown:T=>a("onmousedown",E,T)},[_n(sw)(E==null?void 0:E.icon)?(be(),at(_,{key:0,shape:"square",size:20,style:{background:"none"}},{default:P(()=>[Y("img",{src:_n(Bf)(E==null?void 0:E.icon,_n(Bf)("./favicon.ico")),alt:""},null,8,fB)]),_:2},1024)):(be(),at(_,{key:1,class:"avatar-green",shape:"square",size:20},{default:P(()=>[...f[1]||(f[1]=[Y("img",{src:Dx,style:{width:"58%"},alt:""},null,-1)])]),_:1})),Y("span",{class:"ml-8 ellipsis",title:E.name},de(E.name),9,pB)],40,dB)]),default:P(()=>[Y("div",hB,[Y("div",vB,[_n(sw)(E==null?void 0:E.icon)?(be(),at(_,{key:0,shape:"square",size:20,style:{background:"none"}},{default:P(()=>[Y("img",{src:_n(Bf)(E==null?void 0:E.icon,_n(Bf)("./favicon.ico")),alt:""},null,8,mB)]),_:2},1024)):(be(),at(_,{key:1,class:"avatar-green",shape:"square",size:20},{default:P(()=>[...f[2]||(f[2]=[Y("img",{src:Dx,style:{width:"58%"},alt:""},null,-1)])]),_:1})),Y("span",{class:"font-medium ml-8 break-all",title:E.name},de(E.name),9,yB)]),E.type?(be(),Ht("div",gB,[_n(Hw)(E.type)?(be(),at(b,{key:0,class:"warning-tag"},{default:P(()=>[et(de(v.$t("views.application.workflow")),1)]),_:1})):(be(),at(b,{key:1,class:"blue-tag"},{default:P(()=>[et(de(v.$t("views.application.simple")),1)]),_:1}))])):pn("",!0)]),k(x,{type:"info",size:"small",class:"mt-4"},{default:P(()=>[et(de(E.desc),1)]),_:2},1024)]),_:2},1024))),128)):(be(),at(A,{key:1,description:v.$t("common.noData")},null,8,["description"]))])],64)}}}),fS=Kf(_B,[["__scopeId","data-v-e3b58159"]]),bB={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},wB={key:0},EB={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},OB=["onClick","onMousedown"],xB={class:"lighter"},SB={class:"flex align-center mb-8"},AB={class:"lighter color-text-primary"},MB={key:1,class:"ml-16 mt-8"},kB=Vn({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(e,{emit:t}){const n=ha("workflowMode"),a=Li(),{user:r,folder:s}=XM(),c=LD(n||Is.Application),v=Re(""),f=e,g=t,_=$n(()=>a.path.includes("resource-management")?"systemManage":"workspace"),b=$n(()=>qM.tool[_.value]),x=Re(!1),S=Re("base"),A=$n(()=>{if(!v.value)return c||[];const K=v.value.toLowerCase();return(c||[]).reduce((X,ee)=>{const ue=ee.list.filter(ae=>ae.label.toLowerCase().includes(K));return ue.length&&X.push({...ee,list:ue}),X},[])});function E(K,X,ee){var ue;X&&(K.properties.stepName=X.name,ee=="tool"&&(K.properties.node_data={...X,tool_lib_id:X.id,input_field_list:X.input_field_list.map(ae=>({...ae,value:ae.source=="reference"?[]:""}))}),ee=="application"&&(K.properties.node_data={name:X.name,icon:X.icon,application_id:X.id})),(ue=f.workflowRef)==null||ue.addNode(K),g("clickNodes",K)}function T(K,X,ee,ue){var ae;X&&(K.properties.stepName=X.name,ee=="tool"&&(K.properties.node_data={...X,tool_lib_id:X.id,input_field_list:X.input_field_list.map(we=>({...we,value:we.source=="reference"?[]:""}))}),ee=="application"&&(Hw(X.type)?(X.work_flow.nodes[0].properties.node_data.file_upload_setting,K.properties.node_data={name:X.name,icon:X.icon,application_id:X.id}):K.properties.node_data={name:X.name,icon:X.icon,application_id:X.id})),(ae=f.workflowRef)==null||ae.onmousedown(K,ue),g("onmousedown",K)}const I=Re([]),R=Re([]);async function U(){var X;const K=await s.asyncGetFolder(tg.TOOL,{},x);I.value=K.data,s.setCurrentFolder(((X=K.data)==null?void 0:X[0])||{})}async function D(){var X,ee,ue,ae;const K=await po({type:"tool",isShared:((X=s.currentFolder)==null?void 0:X.id)==="share",systemType:"workspace"}).getToolList({folder_id:((ee=s.currentFolder)==null?void 0:ee.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});R.value=((ue=K.data)==null?void 0:ue.tools)||K.data||[],R.value=(ae=R.value)==null?void 0:ae.filter(we=>we.is_active)}const L=Re([]),W=Re([]);function H(){s.asyncGetFolder(tg.APPLICATION,{},x).then(K=>{var X;L.value=K.data,s.setCurrentFolder(((X=K.data)==null?void 0:X[0])||{})})}async function B(){var X;const K=await po({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((X=s.currentFolder)==null?void 0:X.id)||r.getWorkspaceId()});W.value=K.data.filter(ee=>ee.resource_type==="application"&&ee.id!==f.id&&ee.is_publish)}function F(K){s.setCurrentFolder(K),S.value==="tool"?D():B()}async function q(K){console.log(K),K==="tool"?(await U(),D()):K==="application"&&(H(),B())}return Ir(()=>{}),(K,X)=>{const ee=J("search"),ue=J("el-icon"),ae=J("el-input"),we=J("el-text"),je=J("el-popover"),Te=J("el-scrollbar"),Me=J("el-tab-pane"),Ne=J("folder-tree"),rt=J("LayoutContainer"),tt=J("el-tabs");return Ga((be(),Ht("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:YM({width:S.value==="base"?"400px":"640px"})},[k(tt,{modelValue:S.value,"onUpdate:modelValue":X[5]||(X[5]=Be=>S.value=Be),class:"workflow-dropdown-tabs",onTabChange:q},{default:P(()=>[Ga(Y("div",bB,[k(ae,{modelValue:v.value,"onUpdate:modelValue":X[0]||(X[0]=Be=>v.value=Be),class:"mr-12 ml-12",placeholder:K.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:P(()=>[k(ue,{class:"el-input__icon"},{default:P(()=>[k(ee)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Wf,S.value==="base"]]),k(Me,{label:K.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:P(()=>[k(Te,{height:"400"},{default:P(()=>[A.value.length>0?(be(),Ht("div",wB,[(be(!0),Ht(ar,null,Gr(A.value,(Be,lt)=>(be(),Ht(ar,{key:lt},[k(we,{type:"info",size:"small",class:"color-secondary ml-12"},{default:P(()=>[et(de(Be.label),1)]),_:2},1024),Y("div",EB,[(be(!0),Ht(ar,null,Gr(Be.list,(St,He)=>(be(),at(je,{key:He,placement:"right",width:280,"show-after":500},{reference:P(()=>[Y("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:rn(Jt=>E(St),["stop"]),onMousedown:Jt=>T(St,void 0,void 0,Jt)},[(be(),at(kg(_n(Tg)(`${St.type}-icon`)),{class:"mr-8",size:20})),Y("div",xB,de(St.label),1)],40,OB)]),default:P(()=>[Y("div",SB,[(be(),at(kg(_n(Tg)(`${St.type}-icon`)),{class:"mr-8",size:32})),Y("div",AB,de(St.label),1)]),k(we,{type:"info",size:"small",class:"color-secondary lighter"},{default:P(()=>[et(de(St.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(be(),Ht("div",MB,[k(we,{type:"info"},{default:P(()=>[et(de(K.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Me,{label:K.$t("views.tool.title"),name:"tool"},{default:P(()=>[k(rt,null,{left:P(()=>{var Be;return[k(Ne,{source:_n(tg).TOOL,data:I.value,currentNodeKey:(Be=_n(s).currentFolder)==null?void 0:Be.id,onHandleNodeClick:F,shareTitle:K.$t("views.shared.shared_tool"),showShared:b.value.is_share(),canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey","shareTitle","showShared"])]}),default:P(()=>[k(Te,{height:"450"},{default:P(()=>[k(fS,{list:R.value,onClickNodes:X[1]||(X[1]=Be=>E(_n($x),Be,"tool")),onOnmousedown:X[2]||(X[2]=(Be,lt)=>T(_n($x),Be,"tool",lt))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Me,{label:K.$t("views.application.title"),name:"application"},{default:P(()=>[k(rt,null,{left:P(()=>{var Be;return[k(Ne,{source:_n(tg).APPLICATION,data:L.value,currentNodeKey:(Be=_n(s).currentFolder)==null?void 0:Be.id,onHandleNodeClick:F,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:P(()=>[k(Te,{height:"450"},{default:P(()=>[k(fS,{list:W.value,onClickNodes:X[3]||(X[3]=Be=>E(_n(Fx),Be,"application")),onOnmousedown:X[4]||(X[4]=(Be,lt)=>T(_n(Fx),Be,"application",lt))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Wf,e.show]])}}}),TT=Kf(kB,[["__scopeId","data-v-1b5d2506"]]),TB={class:"workflow-node-container p-16",style:{overflow:"visible"}},NB={class:"flex-between"},PB={class:"flex align-center",style:{width:"69%"}},CB={class:"ellipsis-1 break-all"},RB={key:0,src:sB,alt:""},jB={key:1,src:uB,alt:""},DB={style:{width:"280px"},class:"p-12-16"},IB={class:"mt-8 lighter"},LB={class:"mt-16"},$B={class:"title-decoration-1 mb-8 mt-8"},FB=["onMouseenter"],BB={class:"break-all"},VB={class:"dialog-footer"},UB=Vn({__name:"NodeContainer",props:{nodeModel:{}},setup(e){$m("workflowMode",Is.Application);const t=Li(),{params:{id:n}}=t,a=Re({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=Re(!1),s=Re(),c=Re(),v=Re(!1),f=Re({title:""}),g=$n({set:F=>{ge.set(D.nodeModel.properties,"condition",F)},get:()=>D.nodeModel.properties.condition?D.nodeModel.properties.condition:(ge.set(D.nodeModel.properties,"condition","AND"),!0)}),_=$n({set:F=>{ge.set(D.nodeModel.properties,"showNode",F)},get:()=>D.nodeModel.properties.showNode!==void 0?D.nodeModel.properties.showNode:(ge.set(D.nodeModel.properties,"showNode",!0),!0)}),b=F=>{F.ctrlKey||F.metaKey||F.stopPropagation()},x=$n(()=>D.nodeModel.properties.status?D.nodeModel.properties.status:200);function S(){f.value.title=D.nodeModel.properties.stepName,v.value=!0}const A=async F=>{F&&await F.validate(q=>{var K;q&&((K=D.nodeModel.graphModel.nodes.filter(X=>X.id!==D.nodeModel.id))!=null&&K.some(X=>X.properties.stepName===f.value.title)?ei(yt("views.applicationWorkflow.tip.repeatedNodeError")):(ge.set(D.nodeModel.properties,"stepName",f.value.title),v.value=!1,F.resetFields()))})},E=Re(null),T=()=>{D.nodeModel.graphModel.clearSelectElements();const F=D.nodeModel.graphModel.cloneNode(D.nodeModel.id);ge.set(F,"isSelected",!0),ge.set(F,"isHovered",!0),D.nodeModel.graphModel.toFront(F.id)},I=()=>{Xw(yt("common.tip"),yt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:yt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{D.nodeModel.type===nr.LoopNode&&D.nodeModel.graphModel.getNodeOutgoingNode(D.nodeModel.id).forEach(q=>{q.type==="loop-body-node"&&D.nodeModel.graphModel.deleteNode(q.id)}),D.nodeModel.graphModel.deleteNode(D.nodeModel.id)}),D.nodeModel.graphModel.eventCenter.emit("delete_node")},R=F=>{F.height&&(D.nodeModel.virtual||(a.value.stepContainerHeight=F.height,D.nodeModel.setHeight(a.value.stepContainerHeight)))};function U(F){var X,ee,ue;const q=F.properties.width?F.properties.width:214,K=D.nodeModel.graphModel.addNode({type:F.type,properties:F.properties,x:((X=s.value)==null?void 0:X.x)+q/2+200,y:((ee=s.value)==null?void 0:ee.y)-F.height});D.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:D.nodeModel.id,sourceAnchorId:(ue=s.value)==null?void 0:ue.id,targetNodeId:K.id,targetAnchorId:K.id+"_left"}),B()}const D=e,L=$n(()=>{var F;return D.nodeModel.properties.config.fields?(F=D.nodeModel.properties.config.fields)==null?void 0:F.map(K=>({label:K.label,value:K.value,globeLabel:`{{${D.nodeModel.properties.stepName}.${K.value}}}`,globeValue:`{{context['${D.nodeModel.id}'].${K.value}}}`})):[]});function W(F){return![nr.Start,nr.Base,nr.LoopStartNode.toString()].includes(F)}const H=F=>{r.value=!0,s.value=F},B=()=>{r.value=!1,s.value=void 0};return Ir(()=>{ge.set(D.nodeModel,"openNodeMenu",F=>{r.value?B():H(F)})}),(F,q)=>{var Fe;const K=J("ArrowDownBold"),X=J("el-icon"),ee=J("el-button"),ue=J("el-option"),ae=J("el-select"),we=J("el-dropdown"),je=J("AppIcon"),Te=J("el-dropdown-item"),Me=J("el-dropdown-menu"),Ne=J("el-alert"),rt=J("el-tooltip"),tt=J("el-collapse-transition"),Be=J("el-input"),lt=J("el-form-item"),St=J("el-form"),He=J("el-dialog"),Jt=Mv("resize");return be(),Ht("div",TB,[Y("div",{class:Cl(["step-container app-card p-16",{isSelected:D.nodeModel.isSelected,error:x.value!==200}]),style:{overflow:"visible"}},[Ga((be(),Ht("div",null,[Y("div",NB,[Y("div",PB,[(be(),at(kg(_n(Tg)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(Fe=e.nodeModel)==null?void 0:Fe.properties.node_data},null,8,["item"])),Y("h4",CB,de(e.nodeModel.properties.stepName),1)]),Y("div",null,[k(ee,{text:"",onClick:q[0]||(q[0]=me=>_.value=!_.value)},{default:P(()=>[k(X,{class:Cl(["arrow-icon color-secondary",_.value?"rotate-180":""])},{default:P(()=>[k(K)]),_:1},8,["class"])]),_:1}),W(e.nodeModel.type)?(be(),at(we,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:P(()=>[Y("div",DB,[Y("h5",null,de(F.$t("views.applicationWorkflow.condition.title")),1),Y("p",IB,[Y("span",null,de(F.$t("views.applicationWorkflow.condition.front")),1),k(ae,{modelValue:g.value,"onUpdate:modelValue":q[1]||(q[1]=me=>g.value=me),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(ue,{label:F.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(ue,{label:F.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),Y("span",null,de(F.$t("views.applicationWorkflow.condition.text")),1)])])]),default:P(()=>[k(ee,{text:""},{default:P(()=>[g.value==="OR"?(be(),Ht("img",RB)):pn("",!0),g.value==="AND"?(be(),Ht("img",jB)):pn("",!0)]),_:1})]),_:1})):pn("",!0),W(e.nodeModel.type)?(be(),at(we,{key:1,teleported:!1,trigger:"click"},{dropdown:P(()=>[k(Me,{style:{"min-width":"80px"}},{default:P(()=>[k(Te,{onClick:S,class:"p-8"},{default:P(()=>[et(de(F.$t("common.rename")),1)]),_:1}),k(Te,{onClick:T,class:"p-8"},{default:P(()=>[et(de(F.$t("common.copy")),1)]),_:1}),k(Te,{onClick:I,class:"border-t p-8"},{default:P(()=>[et(de(F.$t("common.delete")),1)]),_:1})]),_:1})]),default:P(()=>[k(ee,{text:""},{default:P(()=>[k(je,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):pn("",!0)])]),k(tt,null,{default:P(()=>[Ga(Y("div",LB,[x.value!=200?(be(),at(Ne,{key:0,class:"mb-16",title:D.nodeModel.type==="application-node"?F.$t("views.applicationWorkflow.tip.applicationNodeError"):F.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):pn("",!0),KM(F.$slots,"default",{},void 0,!0),L.value.length>0?(be(),Ht(ar,{key:1},[Y("h5",$B,de(F.$t("common.param.outputParam")),1),(be(!0),Ht(ar,null,Gr(L.value,(me,Le)=>(be(),Ht("div",{key:Le,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:Ye=>E.value=Le,onMouseleave:q[2]||(q[2]=Ye=>E.value=null)},[Y("span",BB,de(me.label)+" "+de("{"+me.value+"}"),1),E.value===Le?(be(),at(rt,{key:0,effect:"dark",content:F.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(ee,{link:"",onClick:Ye=>_n(Lm)(me.globeLabel),style:{padding:"0"}},{default:P(()=>[k(je,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],40,FB))),128))],64)):pn("",!0)],512),[[Wf,_.value]])]),_:3})])),[[Jt,R]])],2),k(tt,null,{default:P(()=>[r.value?(be(),at(TT,{key:0,onWheel:b,show:r.value,id:_n(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:U},null,8,["show","id"])):pn("",!0)]),_:1}),k(He,{title:F.$t("views.applicationWorkflow.nodeName"),modelValue:v.value,"onUpdate:modelValue":q[7]||(q[7]=me=>v.value=me),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:q[8]||(q[8]=rn(()=>{},["prevent"]))},{footer:P(()=>[Y("span",VB,[k(ee,{onClick:q[5]||(q[5]=rn(me=>v.value=!1,["prevent"]))},{default:P(()=>[et(de(F.$t("common.cancel")),1)]),_:1}),k(ee,{type:"primary",onClick:q[6]||(q[6]=me=>A(c.value))},{default:P(()=>[et(de(F.$t("common.save")),1)]),_:1})])]),default:P(()=>[k(St,{"label-position":"top",ref_key:"titleFormRef",ref:c,model:f.value},{default:P(()=>[k(lt,{prop:"title",rules:[{required:!0,message:F.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:P(()=>[k(Be,{modelValue:f.value.title,"onUpdate:modelValue":q[3]||(q[3]=me=>f.value.title=me),onBlur:q[4]||(q[4]=me=>f.value.title=f.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])])}}}),wo=Kf(UB,[["__scopeId","data-v-a1db9954"]]),WB={class:"title-decoration-1 mb-8"},GB={class:"flex-between w-full"},zB={class:"flex-between"},HB={class:"flex align-center"},XB={class:"flex align-center"},qB={class:"mr-4"},YB={class:"flex-between"},KB={class:"flex-between mb-16"},ZB={key:0,class:"w-full mb-16"},JB={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},QB={class:"flex align-center",style:{"line-height":"20px"}},eV=["src"],tV=["title"],nV={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},rV={class:"flex align-center",style:{"line-height":"20px"}},oV={class:"ellipsis"},iV={class:"flex-between mb-16"},aV={class:"lighter"},lV={key:2,class:"w-full mb-16"},sV={class:"flex align-center",style:{"line-height":"20px"}},uV=["src"],cV=["title"],dV={class:"flex-between"},fV={class:"mr-4"},pV={class:"flex"},hV={class:"flex-between w-full"},vV={class:"flex align-center"},mV={class:"mr-4"},yV=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function c(Be){ge.set(x.nodeModel.properties.node_data,"system",Be)}function v(Be){ge.set(x.nodeModel.properties.node_data,"prompt",Be)}const f=Be=>{var lt;Be?(lt=E.value)==null||lt.reset_default(Be,a):F({})},_={model_id:"",system:"",prompt:`${yt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}:
|
||
{{${yt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}}
|
||
${yt("views.problem.title")}:
|
||
{{${yt("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}},b=$n({get:()=>x.nodeModel.properties.node_data?(x.nodeModel.properties.node_data.model_setting||ge.set(x.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}),x.nodeModel.properties.node_data):(ge.set(x.nodeModel.properties,"node_data",_),x.nodeModel.properties.node_data),set:Be=>{ge.set(x.nodeModel.properties,"node_data",Be)}}),x=e,S=Re(),A=Re(null),E=Re(),T=Re(),I=()=>{var Be;return(Be=S.value)==null?void 0:Be.validate().catch(lt=>Promise.reject({node:x.nodeModel,errMessage:lt}))},R=t();function U(){var lt;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(lt=R.value)==null?void 0:lt.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:r.value}).getSelectModelList(Be).then(St=>{A.value=ge.groupBy(St==null?void 0:St.data,"provider")})}const D=Be=>{var lt;Be&&((lt=E.value)==null||lt.open(Be,a,b.value.model_params_setting))},L=Re(),W=Be=>{var lt;Be&&((lt=L.value)==null||lt.open(Be,a))},H=Be=>{ge.set(x.nodeModel.properties.node_data,"system",Be)},B=()=>{var Be;(Be=T.value)==null||Be.open(b.value.model_setting)};function F(Be){ge.set(x.nodeModel.properties.node_data,"model_params_setting",Be)}function q(Be){let lt=ge.cloneDeep(x.nodeModel.properties.node_data.model_setting);lt={...lt,...Be},ge.set(x.nodeModel.properties.node_data,"model_setting",lt)}const K=Re();function X(){const Be={mcp_servers:b.value.mcp_servers,mcp_tool_ids:b.value.mcp_tool_ids,mcp_source:b.value.mcp_source};K.value.open(Be,rt.value)}function ee(Be){ge.set(x.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),ge.set(x.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),ge.set(x.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const ue=Re();function ae(){ue.value.open(b.value.tool_ids)}function we(Be){ge.set(x.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function je(Be){const lt=x.nodeModel.properties.node_data.tool_ids.filter(St=>St!==Be);ge.set(x.nodeModel.properties.node_data,"tool_ids",lt)}function Te(Be){const lt=x.nodeModel.properties.node_data.mcp_tool_ids.filter(St=>St!==Be);ge.set(x.nodeModel.properties.node_data,"mcp_tool_ids",lt)}const Me=Re([]);function Ne(){var lt;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(lt=R.value)==null?void 0:lt.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};po({type:"tool",systemType:r.value}).getAllToolList(Be).then(St=>{Me.value=[...St.data.shared_tools,...St.data.tools].filter(He=>He.is_active)})}const rt=Re([]);function tt(){var lt;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(lt=R.value)==null?void 0:lt.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};po({type:"tool",systemType:r.value}).getAllToolList(Be).then(St=>{rt.value=[...St.data.shared_tools,...St.data.tools].filter(He=>He.is_active)})}return Ir(()=>{var Be,lt,St,He;U(),typeof((Be=x.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&vc(x.nodeModel)&&ge.set(x.nodeModel.properties.node_data,"is_result",!0),ge.set(x.nodeModel,"validate",I),b.value.dialogue_type||(b.value.dialogue_type="WORKFLOW"),(lt=x.nodeModel.properties.node_data)!=null&<.mcp_tool_id&&(ge.set(x.nodeModel.properties.node_data,"mcp_tool_ids",[(St=x.nodeModel.properties.node_data)==null?void 0:St.mcp_tool_id]),ge.set(x.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((He=x.nodeModel.properties.node_data)==null?void 0:He.mcp_output_enable)===void 0&&ge.set(x.nodeModel.properties.node_data,"mcp_output_enable",!0),Ne(),tt()}),(Be,lt)=>{const St=J("AppIcon"),He=J("el-button"),Jt=J("ModelSelect"),Fe=J("el-form-item"),me=J("el-tooltip"),Le=J("MdEditorMagnify"),Ye=J("el-option"),Ot=J("el-select"),bt=J("el-input-number"),Ft=J("el-switch"),Qt=J("el-avatar"),on=J("ToolIcon"),Wt=J("Close"),nt=J("el-icon"),sn=J("el-form"),We=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",WB,de(Be.$t("views.applicationWorkflow.nodeSetting")),1),k(We,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(sn,{onSubmit:lt[16]||(lt[16]=rn(()=>{},["prevent"])),model:b.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:S,"hide-required-asterisk":""},{default:P(()=>{var yn,Kn;return[k(Fe,{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:P(()=>[Y("div",GB,[Y("div",null,[Y("span",null,[et(de(Be.$t("views.application.form.aiModel.label")),1),lt[17]||(lt[17]=Y("span",{class:"color-danger"},"*",-1))])]),k(He,{disabled:!b.value.model_id,type:"primary",link:"",onClick:lt[0]||(lt[0]=te=>D(b.value.model_id)),onRefreshForm:F},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(Jt,{onChange:f,onWheel:s,teleported:!1,modelValue:b.value.model_id,"onUpdate:modelValue":lt[1]||(lt[1]=te=>b.value.model_id=te),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:A.value,onSubmitModel:U,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(Fe,null,{label:P(()=>[Y("div",zB,[Y("div",HB,[Y("span",null,de(Be.$t("views.application.form.roleSettings.label")),1),k(me,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:P(()=>[k(St,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(He,{type:"primary",link:"",onClick:lt[2]||(lt[2]=te=>W(b.value.model_id)),disabled:!b.value.model_id},{default:P(()=>[k(St,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:P(()=>[k(Le,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:b.value.system,"onUpdate:modelValue":lt[3]||(lt[3]=te=>b.value.system=te),style:{height:"100px"},onSubmitDialog:c,placeholder:`${_n(yt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(Fe,{label:Be.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:Be.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:P(()=>[Y("div",XB,[Y("div",qB,[Y("span",null,[et(de(Be.$t("views.application.form.prompt.label")),1),lt[18]||(lt[18]=Y("span",{class:"color-danger"},"*",-1))])]),k(me,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(Be.$t("views.application.form.prompt.tooltip")),1)]),default:P(()=>[k(St,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Le,{onWheel:s,title:Be.$t("views.application.form.prompt.label"),modelValue:b.value.prompt,"onUpdate:modelValue":lt[4]||(lt[4]=te=>b.value.prompt=te),style:{height:"150px"},onSubmitDialog:v,placeholder:`${_n(yt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(Fe,{label:Be.$t("views.application.form.historyRecord.label")},{label:P(()=>[Y("div",YB,[Y("div",null,de(Be.$t("views.application.form.historyRecord.label")),1),k(Ot,{modelValue:b.value.dialogue_type,"onUpdate:modelValue":lt[5]||(lt[5]=te=>b.value.dialogue_type=te),type:"small",style:{width:"100px"}},{default:P(()=>[k(Ye,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(Ye,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[k(bt,{modelValue:b.value.dialogue_number,"onUpdate:modelValue":lt[6]||(lt[6]=te=>b.value.dialogue_number=te),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),Y("div",KB,[lt[19]||(lt[19]=Y("div",{class:"lighter"},"MCP",-1)),Y("div",null,[b.value.mcp_enable?(be(),at(He,{key:0,type:"primary",class:"mr-4",link:"",onClick:X,onRefreshForm:F},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1})):pn("",!0),k(Ft,{size:"small",modelValue:b.value.mcp_enable,"onUpdate:modelValue":lt[7]||(lt[7]=te=>b.value.mcp_enable=te)},null,8,["modelValue"])])]),((yn=b.value.mcp_tool_ids)==null?void 0:yn.length)>0?(be(),Ht("div",ZB,[(be(!0),Ht(ar,null,Gr(b.value.mcp_tool_ids,(te,Gn)=>{var br,Dr,zr;return be(),Ht(ar,{key:Gn},[_n(cl)(rt.value,te,"id")?(be(),Ht("div",JB,[Y("div",QB,[(br=_n(cl)(rt.value,te,"id"))!=null&&br.icon?(be(),at(Qt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>{var jn;return[Y("img",{src:_n(Bf)((jn=_n(cl)(rt.value,te,"id"))==null?void 0:jn.icon),alt:""},null,8,eV)]}),_:2},1024)):(be(),at(on,{key:1,type:"MCP",class:"mr-8",size:20})),Y("div",{class:"ellipsis",title:(Dr=_n(cl)(rt.value,te,"id"))==null?void 0:Dr.name},de(((zr=_n(cl)(rt.value,te,"id"))==null?void 0:zr.name)||Be.$t("common.custom")+" MCP"),9,tV)]),k(He,{text:"",onClick:jn=>Te(te)},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1},8,["onClick"])])):pn("",!0)],64)}),128))])):pn("",!0),b.value.mcp_servers&&b.value.mcp_servers.length>0?(be(),Ht("div",nV,[Y("div",rV,[k(on,{type:"MCP",class:"mr-8",size:20}),Y("div",oV,de(Be.$t("common.custom")+" MCP"),1)]),k(He,{text:"",onClick:lt[8]||(lt[8]=te=>b.value.mcp_servers="")},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1})])):pn("",!0),Y("div",iV,[Y("div",aV,de(Be.$t("views.tool.title")),1),Y("div",null,[b.value.tool_enable?(be(),at(He,{key:0,type:"primary",class:"mr-4",link:"",onClick:ae,onRefreshForm:F},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1})):pn("",!0),k(Ft,{size:"small",modelValue:b.value.tool_enable,"onUpdate:modelValue":lt[9]||(lt[9]=te=>b.value.tool_enable=te)},null,8,["modelValue"])])]),((Kn=b.value.tool_ids)==null?void 0:Kn.length)>0?(be(),Ht("div",lV,[(be(!0),Ht(ar,null,Gr(b.value.tool_ids,(te,Gn)=>{var br,Dr,zr;return be(),Ht("div",{key:Gn,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[Y("div",sV,[(br=_n(cl)(Me.value,te,"id"))!=null&&br.icon?(be(),at(Qt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>{var jn;return[Y("img",{src:_n(Bf)((jn=_n(cl)(Me.value,te,"id"))==null?void 0:jn.icon),alt:""},null,8,uV)]}),_:2},1024)):(be(),at(on,{key:1,class:"mr-8",size:20})),Y("div",{class:"ellipsis",title:(Dr=_n(cl)(Me.value,te,"id"))==null?void 0:Dr.name},de((zr=_n(cl)(Me.value,te,"id"))==null?void 0:zr.name),9,cV)]),k(He,{text:"",onClick:jn=>je(te)},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1},8,["onClick"])])}),128))])):pn("",!0),b.value.mcp_enable||b.value.tool_enable?(be(),at(Fe,{key:3,onClick:lt[11]||(lt[11]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",dV,[Y("span",fV,de(Be.$t("views.application.form.mcp_output_enable")),1),Y("div",pV,[k(Ft,{class:"ml-8",size:"small",modelValue:b.value.mcp_output_enable,"onUpdate:modelValue":lt[10]||(lt[10]=te=>b.value.mcp_output_enable=te)},null,8,["modelValue"])])])]),_:1})):pn("",!0),k(Fe,{onClick:lt[13]||(lt[13]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",hV,[Y("div",null,[Y("span",null,de(Be.$t("views.application.form.reasoningContent.label")),1)]),Y("div",null,[b.value.model_setting.reasoning_content_enable?(be(),at(He,{key:0,type:"primary",link:"",onClick:B,onRefreshForm:F,class:"mr-4"},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1})):pn("",!0),k(Ft,{size:"small",modelValue:b.value.model_setting.reasoning_content_enable,"onUpdate:modelValue":lt[12]||(lt[12]=te=>b.value.model_setting.reasoning_content_enable=te)},null,8,["modelValue"])])])]),_:1}),k(Fe,{onClick:lt[15]||(lt[15]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",vV,[Y("div",mV,[Y("span",null,de(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(me,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(St,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Ft,{size:"small",modelValue:b.value.is_result,"onUpdate:modelValue":lt[14]||(lt[14]=te=>b.value.is_result=te)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:E,onRefresh:F},null,512),k(Jw,{onReplace:H,ref_key:"GeneratePromptDialogRef",ref:L},null,512),k(BD,{ref_key:"ReasoningParamSettingDialogRef",ref:T,onRefresh:q},null,512),k(VD,{ref_key:"mcpServersDialogRef",ref:K,onRefresh:ee},null,512),k(UD,{ref_key:"toolDialogRef",ref:ue,onRefresh:we},null,512)]),_:1},8,["nodeModel"])}}});var og={exports:{}},pS;function gV(){return pS||(pS=1,(function(e,t){(function(n,a){e.exports=a()})(window,(function(){return(function(n){var a={};function r(s){if(a[s])return a[s].exports;var c=a[s]={i:s,l:!1,exports:{}};return n[s].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=n,r.c=a,r.d=function(s,c,v){r.o(s,c)||Object.defineProperty(s,c,{enumerable:!0,get:v})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,c){if(1&c&&(s=r(s)),8&c||4&c&&typeof s=="object"&&s&&s.__esModule)return s;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:s}),2&c&&typeof s!="string")for(var f in s)r.d(v,f,(function(g){return s[g]}).bind(null,f));return v},r.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(c,"a",c),c},r.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},r.p="",r(r.s=222)})([function(n,a,r){r.d(a,"a",(function(){return L})),r.d(a,"b",(function(){return D})),r.d(a,"c",(function(){return He})),r.d(a,"d",(function(){return Jt})),r.d(a,"e",(function(){return I})),r.d(a,"f",(function(){return U})),r.d(a,"g",(function(){return I})),r.d(a,"h",(function(){return St})),r.d(a,"i",(function(){return c})),r.d(a,"j",(function(){return lt})),r.d(a,"k",(function(){return X}));var s,c,v,f,g,_,b,x={},S=[],A=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function E(Fe,me){for(var Le in me)Fe[Le]=me[Le];return Fe}function T(Fe){var me=Fe.parentNode;me&&me.removeChild(Fe)}function I(Fe,me,Le){var Ye,Ot,bt,Ft={};for(bt in me)bt=="key"?Ye=me[bt]:bt=="ref"?Ot=me[bt]:Ft[bt]=me[bt];if(arguments.length>2&&(Ft.children=arguments.length>3?s.call(arguments,2):Le),typeof Fe=="function"&&Fe.defaultProps!=null)for(bt in Fe.defaultProps)Ft[bt]===void 0&&(Ft[bt]=Fe.defaultProps[bt]);return R(Fe,Ft,Ye,Ot,null)}function R(Fe,me,Le,Ye,Ot){var bt={type:Fe,props:me,key:Le,ref:Ye,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:Ot??++v};return Ot==null&&c.vnode!=null&&c.vnode(bt),bt}function U(){return{current:null}}function D(Fe){return Fe.children}function L(Fe,me){this.props=Fe,this.context=me}function W(Fe,me){if(me==null)return Fe.__?W(Fe.__,Fe.__.__k.indexOf(Fe)+1):null;for(var Le;me<Fe.__k.length;me++)if((Le=Fe.__k[me])!=null&&Le.__e!=null)return Le.__e;return typeof Fe.type=="function"?W(Fe):null}function H(Fe){var me,Le;if((Fe=Fe.__)!=null&&Fe.__c!=null){for(Fe.__e=Fe.__c.base=null,me=0;me<Fe.__k.length;me++)if((Le=Fe.__k[me])!=null&&Le.__e!=null){Fe.__e=Fe.__c.base=Le.__e;break}return H(Fe)}}function B(Fe){(!Fe.__d&&(Fe.__d=!0)&&f.push(Fe)&&!F.__r++||_!==c.debounceRendering)&&((_=c.debounceRendering)||g)(F)}function F(){for(var Fe;F.__r=f.length;)Fe=f.sort((function(me,Le){return me.__v.__b-Le.__v.__b})),f=[],Fe.some((function(me){var Le,Ye,Ot,bt,Ft,Qt;me.__d&&(Ft=(bt=(Le=me).__v).__e,(Qt=Le.__P)&&(Ye=[],(Ot=E({},bt)).__v=bt.__v+1,Te(Qt,bt,Ot,Le.__n,Qt.ownerSVGElement!==void 0,bt.__h!=null?[Ft]:null,Ye,Ft??W(bt),bt.__h),Me(Ye,bt),bt.__e!=Ft&&H(bt)))}))}function q(Fe,me,Le,Ye,Ot,bt,Ft,Qt,on,Wt){var nt,sn,We,yn,Kn,te,Gn,br=Ye&&Ye.__k||S,Dr=br.length;for(Le.__k=[],nt=0;nt<me.length;nt++)if((yn=Le.__k[nt]=(yn=me[nt])==null||typeof yn=="boolean"?null:typeof yn=="string"||typeof yn=="number"||typeof yn=="bigint"?R(null,yn,null,null,yn):Array.isArray(yn)?R(D,{children:yn},null,null,null):yn.__b>0?R(yn.type,yn.props,yn.key,null,yn.__v):yn)!=null){if(yn.__=Le,yn.__b=Le.__b+1,(We=br[nt])===null||We&&yn.key==We.key&&yn.type===We.type)br[nt]=void 0;else for(sn=0;sn<Dr;sn++){if((We=br[sn])&&yn.key==We.key&&yn.type===We.type){br[sn]=void 0;break}We=null}Te(Fe,yn,We=We||x,Ot,bt,Ft,Qt,on,Wt),Kn=yn.__e,(sn=yn.ref)&&We.ref!=sn&&(Gn||(Gn=[]),We.ref&&Gn.push(We.ref,null,yn),Gn.push(sn,yn.__c||Kn,yn)),Kn!=null?(te==null&&(te=Kn),typeof yn.type=="function"&&yn.__k===We.__k?yn.__d=on=K(yn,on,Fe):on=ee(Fe,yn,We,br,Kn,on),typeof Le.type=="function"&&(Le.__d=on)):on&&We.__e==on&&on.parentNode!=Fe&&(on=W(We))}for(Le.__e=te,nt=Dr;nt--;)br[nt]!=null&&(typeof Le.type=="function"&&br[nt].__e!=null&&br[nt].__e==Le.__d&&(Le.__d=W(Ye,nt+1)),tt(br[nt],br[nt]));if(Gn)for(nt=0;nt<Gn.length;nt++)rt(Gn[nt],Gn[++nt],Gn[++nt])}function K(Fe,me,Le){for(var Ye,Ot=Fe.__k,bt=0;Ot&&bt<Ot.length;bt++)(Ye=Ot[bt])&&(Ye.__=Fe,me=typeof Ye.type=="function"?K(Ye,me,Le):ee(Le,Ye,Ye,Ot,Ye.__e,me));return me}function X(Fe,me){return me=me||[],Fe==null||typeof Fe=="boolean"||(Array.isArray(Fe)?Fe.some((function(Le){X(Le,me)})):me.push(Fe)),me}function ee(Fe,me,Le,Ye,Ot,bt){var Ft,Qt,on;if(me.__d!==void 0)Ft=me.__d,me.__d=void 0;else if(Le==null||Ot!=bt||Ot.parentNode==null)e:if(bt==null||bt.parentNode!==Fe)Fe.appendChild(Ot),Ft=null;else{for(Qt=bt,on=0;(Qt=Qt.nextSibling)&&on<Ye.length;on+=2)if(Qt==Ot)break e;Fe.insertBefore(Ot,bt),Ft=bt}return Ft!==void 0?Ft:Ot.nextSibling}function ue(Fe,me,Le){me[0]==="-"?Fe.setProperty(me,Le):Fe[me]=Le==null?"":typeof Le!="number"||A.test(me)?Le:Le+"px"}function ae(Fe,me,Le,Ye,Ot){var bt;e:if(me==="style")if(typeof Le=="string")Fe.style.cssText=Le;else{if(typeof Ye=="string"&&(Fe.style.cssText=Ye=""),Ye)for(me in Ye)Le&&me in Le||ue(Fe.style,me,"");if(Le)for(me in Le)Ye&&Le[me]===Ye[me]||ue(Fe.style,me,Le[me])}else if(me[0]==="o"&&me[1]==="n")bt=me!==(me=me.replace(/Capture$/,"")),me=me.toLowerCase()in Fe?me.toLowerCase().slice(2):me.slice(2),Fe.l||(Fe.l={}),Fe.l[me+bt]=Le,Le?Ye||Fe.addEventListener(me,bt?je:we,bt):Fe.removeEventListener(me,bt?je:we,bt);else if(me!=="dangerouslySetInnerHTML"){if(Ot)me=me.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(me!=="href"&&me!=="list"&&me!=="form"&&me!=="tabIndex"&&me!=="download"&&me in Fe)try{Fe[me]=Le??"";break e}catch{}typeof Le=="function"||(Le!=null&&(Le!==!1||me[0]==="a"&&me[1]==="r")?Fe.setAttribute(me,Le):Fe.removeAttribute(me))}}function we(Fe){this.l[Fe.type+!1](c.event?c.event(Fe):Fe)}function je(Fe){this.l[Fe.type+!0](c.event?c.event(Fe):Fe)}function Te(Fe,me,Le,Ye,Ot,bt,Ft,Qt,on){var Wt,nt,sn,We,yn,Kn,te,Gn,br,Dr,zr,jn=me.type;if(me.constructor!==void 0)return null;Le.__h!=null&&(on=Le.__h,Qt=me.__e=Le.__e,me.__h=null,bt=[Qt]),(Wt=c.__b)&&Wt(me);try{e:if(typeof jn=="function"){if(Gn=me.props,br=(Wt=jn.contextType)&&Ye[Wt.__c],Dr=Wt?br?br.props.value:Wt.__:Ye,Le.__c?te=(nt=me.__c=Le.__c).__=nt.__E:("prototype"in jn&&jn.prototype.render?me.__c=nt=new jn(Gn,Dr):(me.__c=nt=new L(Gn,Dr),nt.constructor=jn,nt.render=Be),br&&br.sub(nt),nt.props=Gn,nt.state||(nt.state={}),nt.context=Dr,nt.__n=Ye,sn=nt.__d=!0,nt.__h=[]),nt.__s==null&&(nt.__s=nt.state),jn.getDerivedStateFromProps!=null&&(nt.__s==nt.state&&(nt.__s=E({},nt.__s)),E(nt.__s,jn.getDerivedStateFromProps(Gn,nt.__s))),We=nt.props,yn=nt.state,sn)jn.getDerivedStateFromProps==null&&nt.componentWillMount!=null&&nt.componentWillMount(),nt.componentDidMount!=null&&nt.__h.push(nt.componentDidMount);else{if(jn.getDerivedStateFromProps==null&&Gn!==We&&nt.componentWillReceiveProps!=null&&nt.componentWillReceiveProps(Gn,Dr),!nt.__e&&nt.shouldComponentUpdate!=null&&nt.shouldComponentUpdate(Gn,nt.__s,Dr)===!1||me.__v===Le.__v){nt.props=Gn,nt.state=nt.__s,me.__v!==Le.__v&&(nt.__d=!1),nt.__v=me,me.__e=Le.__e,me.__k=Le.__k,me.__k.forEach((function(ko){ko&&(ko.__=me)})),nt.__h.length&&Ft.push(nt);break e}nt.componentWillUpdate!=null&&nt.componentWillUpdate(Gn,nt.__s,Dr),nt.componentDidUpdate!=null&&nt.__h.push((function(){nt.componentDidUpdate(We,yn,Kn)}))}nt.context=Dr,nt.props=Gn,nt.state=nt.__s,(Wt=c.__r)&&Wt(me),nt.__d=!1,nt.__v=me,nt.__P=Fe,Wt=nt.render(nt.props,nt.state,nt.context),nt.state=nt.__s,nt.getChildContext!=null&&(Ye=E(E({},Ye),nt.getChildContext())),sn||nt.getSnapshotBeforeUpdate==null||(Kn=nt.getSnapshotBeforeUpdate(We,yn)),zr=Wt!=null&&Wt.type===D&&Wt.key==null?Wt.props.children:Wt,q(Fe,Array.isArray(zr)?zr:[zr],me,Le,Ye,Ot,bt,Ft,Qt,on),nt.base=me.__e,me.__h=null,nt.__h.length&&Ft.push(nt),te&&(nt.__E=nt.__=null),nt.__e=!1}else bt==null&&me.__v===Le.__v?(me.__k=Le.__k,me.__e=Le.__e):me.__e=Ne(Le.__e,me,Le,Ye,Ot,bt,Ft,on);(Wt=c.diffed)&&Wt(me)}catch(ko){me.__v=null,(on||bt!=null)&&(me.__e=Qt,me.__h=!!on,bt[bt.indexOf(Qt)]=null),c.__e(ko,me,Le)}}function Me(Fe,me){c.__c&&c.__c(me,Fe),Fe.some((function(Le){try{Fe=Le.__h,Le.__h=[],Fe.some((function(Ye){Ye.call(Le)}))}catch(Ye){c.__e(Ye,Le.__v)}}))}function Ne(Fe,me,Le,Ye,Ot,bt,Ft,Qt){var on,Wt,nt,sn=Le.props,We=me.props,yn=me.type,Kn=0;if(yn==="svg"&&(Ot=!0),bt!=null){for(;Kn<bt.length;Kn++)if((on=bt[Kn])&&"setAttribute"in on==!!yn&&(yn?on.localName===yn:on.nodeType===3)){Fe=on,bt[Kn]=null;break}}if(Fe==null){if(yn===null)return document.createTextNode(We);Fe=Ot?document.createElementNS("http://www.w3.org/2000/svg",yn):document.createElement(yn,We.is&&We),bt=null,Qt=!1}if(yn===null)sn===We||Qt&&Fe.data===We||(Fe.data=We);else{if(bt=bt&&s.call(Fe.childNodes),Wt=(sn=Le.props||x).dangerouslySetInnerHTML,nt=We.dangerouslySetInnerHTML,!Qt){if(bt!=null)for(sn={},Kn=0;Kn<Fe.attributes.length;Kn++)sn[Fe.attributes[Kn].name]=Fe.attributes[Kn].value;(nt||Wt)&&(nt&&(Wt&&nt.__html==Wt.__html||nt.__html===Fe.innerHTML)||(Fe.innerHTML=nt&&nt.__html||""))}if((function(te,Gn,br,Dr,zr){var jn;for(jn in br)jn==="children"||jn==="key"||jn in Gn||ae(te,jn,null,br[jn],Dr);for(jn in Gn)zr&&typeof Gn[jn]!="function"||jn==="children"||jn==="key"||jn==="value"||jn==="checked"||br[jn]===Gn[jn]||ae(te,jn,Gn[jn],br[jn],Dr)})(Fe,We,sn,Ot,Qt),nt)me.__k=[];else if(Kn=me.props.children,q(Fe,Array.isArray(Kn)?Kn:[Kn],me,Le,Ye,Ot&&yn!=="foreignObject",bt,Ft,bt?bt[0]:Le.__k&&W(Le,0),Qt),bt!=null)for(Kn=bt.length;Kn--;)bt[Kn]!=null&&T(bt[Kn]);Qt||("value"in We&&(Kn=We.value)!==void 0&&(Kn!==sn.value||Kn!==Fe.value||yn==="progress"&&!Kn)&&ae(Fe,"value",Kn,sn.value,!1),"checked"in We&&(Kn=We.checked)!==void 0&&Kn!==Fe.checked&&ae(Fe,"checked",Kn,sn.checked,!1))}return Fe}function rt(Fe,me,Le){try{typeof Fe=="function"?Fe(me):Fe.current=me}catch(Ye){c.__e(Ye,Le)}}function tt(Fe,me,Le){var Ye,Ot;if(c.unmount&&c.unmount(Fe),(Ye=Fe.ref)&&(Ye.current&&Ye.current!==Fe.__e||rt(Ye,null,me)),(Ye=Fe.__c)!=null){if(Ye.componentWillUnmount)try{Ye.componentWillUnmount()}catch(bt){c.__e(bt,me)}Ye.base=Ye.__P=null}if(Ye=Fe.__k)for(Ot=0;Ot<Ye.length;Ot++)Ye[Ot]&&tt(Ye[Ot],me,typeof Fe.type!="function");Le||Fe.__e==null||T(Fe.__e),Fe.__e=Fe.__d=void 0}function Be(Fe,me,Le){return this.constructor(Fe,Le)}function lt(Fe,me,Le){var Ye,Ot,bt;c.__&&c.__(Fe,me),Ot=(Ye=typeof Le=="function")?null:Le&&Le.__k||me.__k,bt=[],Te(me,Fe=(!Ye&&Le||me).__k=I(D,null,[Fe]),Ot||x,x,me.ownerSVGElement!==void 0,!Ye&&Le?[Le]:Ot?null:me.firstChild?s.call(me.childNodes):null,bt,!Ye&&Le?Le:Ot?Ot.__e:me.firstChild,Ye),Me(bt,Fe)}function St(Fe,me){lt(Fe,me,St)}function He(Fe,me,Le){var Ye,Ot,bt,Ft=E({},Fe.props);for(bt in me)bt=="key"?Ye=me[bt]:bt=="ref"?Ot=me[bt]:Ft[bt]=me[bt];return arguments.length>2&&(Ft.children=arguments.length>3?s.call(arguments,2):Le),R(Fe.type,Ft,Ye||Fe.key,Ot||Fe.ref,null)}function Jt(Fe,me){var Le={__c:me="__cC"+b++,__:Fe,Consumer:function(Ye,Ot){return Ye.children(Ot)},Provider:function(Ye){var Ot,bt;return this.getChildContext||(Ot=[],(bt={})[me]=this,this.getChildContext=function(){return bt},this.shouldComponentUpdate=function(Ft){this.props.value!==Ft.value&&Ot.some(B)},this.sub=function(Ft){Ot.push(Ft);var Qt=Ft.componentWillUnmount;Ft.componentWillUnmount=function(){Ot.splice(Ot.indexOf(Ft),1),Qt&&Qt.call(Ft)}}),Ye.children}};return Le.Provider.__=Le.Consumer.contextType=Le}s=S.slice,c={__e:function(Fe,me){for(var Le,Ye,Ot;me=me.__;)if((Le=me.__c)&&!Le.__)try{if((Ye=Le.constructor)&&Ye.getDerivedStateFromError!=null&&(Le.setState(Ye.getDerivedStateFromError(Fe)),Ot=Le.__d),Le.componentDidCatch!=null&&(Le.componentDidCatch(Fe),Ot=Le.__d),Ot)return Le.__E=Le}catch(bt){Fe=bt}throw Fe}},v=0,L.prototype.setState=function(Fe,me){var Le;Le=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof Fe=="function"&&(Fe=Fe(E({},Le),this.props)),Fe&&E(Le,Fe),Fe!=null&&this.__v&&(me&&this.__h.push(me),B(this))},L.prototype.forceUpdate=function(Fe){this.__v&&(this.__e=!0,Fe&&this.__h.push(Fe),B(this))},L.prototype.render=D,f=[],g=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,F.__r=0,b=0},function(n,a,r){(function(s,c){r.d(a,"a",(function(){return B})),r.d(a,"b",(function(){return Pc})),r.d(a,"c",(function(){return Ca})),r.d(a,"d",(function(){return Zn})),r.d(a,"e",(function(){return en})),r.d(a,"f",(function(){return an})),r.d(a,"g",(function(){return Un})),r.d(a,"h",(function(){return ji})),r.d(a,"i",(function(){return zr})),r.d(a,"j",(function(){return Nn})),r.d(a,"k",(function(){return gl})),r.d(a,"l",(function(){return Sc})),r.d(a,"m",(function(){return te})),r.d(a,"n",(function(){return ls})),r.d(a,"o",(function(){return K})),r.d(a,"p",(function(){return ip})),r.d(a,"q",(function(){return ya})),r.d(a,"r",(function(){return ss})),r.d(a,"s",(function(){return aa})),r.d(a,"t",(function(){return Uo})),r.d(a,"u",(function(){return ku})),r.d(a,"v",(function(){return Wd})),r.d(a,"w",(function(){return Mc})),r.d(a,"x",(function(){return si})),r.d(a,"y",(function(){return ba})),r.d(a,"z",(function(){return Ko})),r.d(a,"A",(function(){return ci})),r.d(a,"B",(function(){return ga})),r.d(a,"C",(function(){return Wt})),r.d(a,"D",(function(){return Gd})),r.d(a,"E",(function(){return Xr})),r.d(a,"F",(function(){return Kr})),r.d(a,"G",(function(){return Oc})),r.d(a,"H",(function(){return Ec})),r.d(a,"I",(function(){return kc})),r.d(a,"J",(function(){return ui})),r.d(a,"K",(function(){return Qe})),r.d(a,"L",(function(){return lo})),r.d(a,"M",(function(){return Pu}));var v=[];Object.freeze(v);var f={};function g(){return++Rn.mobxGuid}function _(N){throw b(!1,N),"X"}function b(N,C){if(!N)throw new Error("[mobx] "+(C||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(f);function x(N){var C=!1;return function(){if(!C)return C=!0,N.apply(this,arguments)}}var S=function(){};function A(N){return N!==null&&typeof N=="object"}function E(N){if(N===null||typeof N!="object")return!1;var C=Object.getPrototypeOf(N);return C===Object.prototype||C===null}function T(N,C,z){Object.defineProperty(N,C,{enumerable:!1,writable:!0,configurable:!0,value:z})}function I(N,C){var z="isMobX"+N;return C.prototype[z]=!0,function(ie){return A(ie)&&ie[z]===!0}}function R(N){return N instanceof Map}function U(N){return N instanceof Set}function D(N){var C=new Set;for(var z in N)C.add(z);return Object.getOwnPropertySymbols(N).forEach((function(ie){Object.getOwnPropertyDescriptor(N,ie).enumerable&&C.add(ie)})),Array.from(C)}function L(N){return N&&N.toString?N.toString():new String(N).toString()}function W(N){return N===null?null:typeof N=="object"?""+N:N}var H=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:Object.getOwnPropertyNames,B=Symbol("mobx administration"),F=(function(){function N(C){C===void 0&&(C="Atom@"+g()),this.name=C,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=sn.NOT_TRACKING}return N.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(C){return C()}))},N.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(C){return C()}))},N.prototype.reportObserved=function(){return Mu(this)},N.prototype.reportChanged=function(){Ki(),(function(C){C.lowestObserverState!==sn.STALE&&(C.lowestObserverState=sn.STALE,C.observers.forEach((function(z){z.dependenciesState===sn.UP_TO_DATE&&(z.isTracing!==We.NONE&&Pa(z,C),z.onBecomeStale()),z.dependenciesState=sn.STALE})))})(this),oa()},N.prototype.toString=function(){return this.name},N})(),q=I("Atom",F);function K(N,C,z){C===void 0&&(C=S),z===void 0&&(z=S);var ie,Ee=new F(N);return C!==S&&Vd("onBecomeObserved",Ee,C,ie),z!==S&&Xr(Ee,z),Ee}var X={structural:function(N,C){return Vt(N,C)},default:function(N,C){return Object.is(N,C)}},ee=function(N,C){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,ie){z.__proto__=ie}||function(z,ie){for(var Ee in ie)ie.hasOwnProperty(Ee)&&(z[Ee]=ie[Ee])},ee(N,C)};/*! *****************************************************************************
|
||
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 ue=function(){return ue=Object.assign||function(N){for(var C,z=1,ie=arguments.length;z<ie;z++)for(var Ee in C=arguments[z])Object.prototype.hasOwnProperty.call(C,Ee)&&(N[Ee]=C[Ee]);return N},ue.apply(this,arguments)};function ae(N){var C=typeof Symbol=="function"&&N[Symbol.iterator],z=0;return C?C.call(N):{next:function(){return N&&z>=N.length&&(N=void 0),{value:N&&N[z++],done:!N}}}}function we(N,C){var z=typeof Symbol=="function"&&N[Symbol.iterator];if(!z)return N;var ie,Ee,Ke=z.call(N),wt=[];try{for(;(C===void 0||C-- >0)&&!(ie=Ke.next()).done;)wt.push(ie.value)}catch(Yt){Ee={error:Yt}}finally{try{ie&&!ie.done&&(z=Ke.return)&&z.call(Ke)}finally{if(Ee)throw Ee.error}}return wt}function je(){for(var N=[],C=0;C<arguments.length;C++)N=N.concat(we(arguments[C]));return N}var Te=Symbol("mobx did run lazy initializers"),Me=Symbol("mobx pending decorators"),Ne={},rt={};function tt(N,C){var z=C?Ne:rt;return z[N]||(z[N]={configurable:!0,enumerable:C,get:function(){return Be(this),this[N]},set:function(ie){Be(this),this[N]=ie}})}function Be(N){var C,z;if(N[Te]!==!0){var ie=N[Me];if(ie){T(N,Te,!0);var Ee=je(Object.getOwnPropertySymbols(ie),Object.keys(ie));try{for(var Ke=ae(Ee),wt=Ke.next();!wt.done;wt=Ke.next()){var Yt=ie[wt.value];Yt.propertyCreator(N,Yt.prop,Yt.descriptor,Yt.decoratorTarget,Yt.decoratorArguments)}}catch(Sn){C={error:Sn}}finally{try{wt&&!wt.done&&(z=Ke.return)&&z.call(Ke)}finally{if(C)throw C.error}}}}}function lt(N,C){return function(){var z,ie=function(Ee,Ke,wt,Yt){if(Yt===!0)return C(Ee,Ke,wt,Ee,z),null;if(!Object.prototype.hasOwnProperty.call(Ee,Me)){var Sn=Ee[Me];T(Ee,Me,ue({},Sn))}return Ee[Me][Ke]={prop:Ke,propertyCreator:C,descriptor:wt,decoratorTarget:Ee,decoratorArguments:z},tt(Ke,N)};return St(arguments)?(z=v,ie.apply(null,arguments)):(z=Array.prototype.slice.call(arguments),ie)}}function St(N){return(N.length===2||N.length===3)&&(typeof N[1]=="string"||typeof N[1]=="symbol")||N.length===4&&N[3]===!0}function He(N,C,z){return si(N)?N:Array.isArray(N)?Wt.array(N,{name:z}):E(N)?Wt.object(N,void 0,{name:z}):R(N)?Wt.map(N,{name:z}):U(N)?Wt.set(N,{name:z}):N}function Jt(N){return N}function Fe(N){b(N);var C=lt(!0,(function(ie,Ee,Ke,wt,Yt){var Sn=Ke?Ke.initializer?Ke.initializer.call(ie):Ke.value:void 0;ia(ie).addObservableProp(Ee,Sn,N)})),z=(s!==void 0&&s.env,C);return z.enhancer=N,z}var me={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function Le(N){return N==null?me:typeof N=="string"?{name:N,deep:!0,proxy:!0}:N}Object.freeze(me);var Ye=Fe(He),Ot=Fe((function(N,C,z){return N==null||ci(N)||ba(N)||Ko(N)||ni(N)?N:Array.isArray(N)?Wt.array(N,{name:z,deep:!1}):E(N)?Wt.object(N,void 0,{name:z,deep:!1}):R(N)?Wt.map(N,{name:z,deep:!1}):U(N)?Wt.set(N,{name:z,deep:!1}):_(!1)})),bt=Fe(Jt),Ft=Fe((function(N,C,z){return Vt(N,C)?C:N}));function Qt(N){return N.defaultDecorator?N.defaultDecorator.enhancer:N.deep===!1?Jt:He}var on={box:function(N,C){arguments.length>2&&nt("box");var z=Le(C);return new Lr(N,Qt(z),z.name,!0,z.equals)},array:function(N,C){arguments.length>2&&nt("array");var z=Le(C);return Fl(N,Qt(z),z.name)},map:function(N,C){arguments.length>2&&nt("map");var z=Le(C);return new Pc(N,Qt(z),z.name)},set:function(N,C){arguments.length>2&&nt("set");var z=Le(C);return new qa(N,Qt(z),z.name)},object:function(N,C,z){typeof arguments[1]=="string"&&nt("object");var ie=Le(z);if(ie.proxy===!1)return ya({},N,C,ie);var Ee=Tu(ie),Ke=ya({},void 0,void 0,ie),wt=us(Ke);return Ud(wt,N,C,Ee),wt},ref:bt,shallow:Ot,deep:Ye,struct:Ft},Wt=function(N,C,z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return Ye.apply(null,arguments);if(si(N))return N;var ie=E(N)?Wt.object(N,C,z):Array.isArray(N)?Wt.array(N,C):R(N)?Wt.map(N,C):U(N)?Wt.set(N,C):N;if(ie!==N)return ie;_(!1)};function nt(N){_("Expected one or two arguments to observable."+N+". Did you accidentally try to use observable."+N+" as decorator?")}Object.keys(on).forEach((function(N){return Wt[N]=on[N]}));var sn,We,yn=lt(!1,(function(N,C,z,ie,Ee){var Ke=z.get,wt=z.set,Yt=Ee[0]||{};ia(N).addComputedProp(N,C,ue({get:Ke,set:wt,context:N},Yt))})),Kn=yn({equals:X.structural}),te=function(N,C,z){if(typeof C=="string"||N!==null&&typeof N=="object"&&arguments.length===1)return yn.apply(null,arguments);var ie=typeof C=="object"?C:{};return ie.get=N,ie.set=typeof C=="function"?C:ie.set,ie.name=ie.name||N.name||"",new za(ie)};te.struct=Kn,(function(N){N[N.NOT_TRACKING=-1]="NOT_TRACKING",N[N.UP_TO_DATE=0]="UP_TO_DATE",N[N.POSSIBLY_STALE=1]="POSSIBLY_STALE",N[N.STALE=2]="STALE"})(sn||(sn={})),(function(N){N[N.NONE=0]="NONE",N[N.LOG=1]="LOG",N[N.BREAK=2]="BREAK"})(We||(We={}));var Gn=function(N){this.cause=N};function br(N){return N instanceof Gn}function Dr(N){switch(N.dependenciesState){case sn.UP_TO_DATE:return!1;case sn.NOT_TRACKING:case sn.STALE:return!0;case sn.POSSIBLY_STALE:for(var C=an(!0),z=$e(),ie=N.observing,Ee=ie.length,Ke=0;Ke<Ee;Ke++){var wt=ie[Ke];if(yl(wt)){if(Rn.disableErrorBoundaries)wt.get();else try{wt.get()}catch{return st(z),en(C),!0}if(N.dependenciesState===sn.STALE)return st(z),en(C),!0}}return Tn(N),st(z),en(C),!1}}function zr(){return Rn.trackingDerivation!==null}function jn(N){var C=N.observers.size>0;Rn.computationDepth>0&&C&&_(!1),Rn.allowStateChanges||!C&&Rn.enforceActions!=="strict"||_(!1)}function ko(N,C,z){var ie=an(!0);Tn(N),N.newObserving=new Array(N.observing.length+100),N.unboundDepsCount=0,N.runId=++Rn.runId;var Ee,Ke=Rn.trackingDerivation;if(Rn.trackingDerivation=N,Rn.disableErrorBoundaries===!0)Ee=C.call(z);else try{Ee=C.call(z)}catch(wt){Ee=new Gn(wt)}return Rn.trackingDerivation=Ke,(function(wt){for(var Yt=wt.observing,Sn=wt.observing=wt.newObserving,Or=sn.UP_TO_DATE,vn=0,qr=wt.unboundDepsCount,gr=0;gr<qr;gr++)(Fr=Sn[gr]).diffValue===0&&(Fr.diffValue=1,vn!==gr&&(Sn[vn]=Fr),vn++),Fr.dependenciesState>Or&&(Or=Fr.dependenciesState);for(Sn.length=vn,wt.newObserving=null,qr=Yt.length;qr--;)(Fr=Yt[qr]).diffValue===0&&Eo(Fr,wt),Fr.diffValue=0;for(;vn--;){var Fr;(Fr=Sn[vn]).diffValue===1&&(Fr.diffValue=0,Id(Fr,wt))}Or!==sn.UP_TO_DATE&&(wt.dependenciesState=Or,wt.onBecomeStale())})(N),en(ie),Ee}function Se(N){var C=N.observing;N.observing=[];for(var z=C.length;z--;)Eo(C[z],N);N.dependenciesState=sn.NOT_TRACKING}function Qe(N){var C=$e();try{return N()}finally{st(C)}}function $e(){var N=Rn.trackingDerivation;return Rn.trackingDerivation=null,N}function st(N){Rn.trackingDerivation=N}function an(N){var C=Rn.allowStateReads;return Rn.allowStateReads=N,C}function en(N){Rn.allowStateReads=N}function Tn(N){if(N.dependenciesState!==sn.UP_TO_DATE){N.dependenciesState=sn.UP_TO_DATE;for(var C=N.observing,z=C.length;z--;)C[z].lowestObserverState=sn.UP_TO_DATE}}var Sr=0,li=1,Ei=Object.getOwnPropertyDescriptor((function(){}),"name");Ei&&Ei.configurable;function Yo(N,C,z){var ie=function(){return ti(N,C,z||this,arguments)};return ie.isMobxAction=!0,ie}function ti(N,C,z,ie){var Ee=Nn();try{return C.apply(z,ie)}catch(Ke){throw Ee.error=Ke,Ke}finally{Un(Ee)}}function Nn(N,C,z){var ie=0,Ee=$e();Ki();var Ke={prevDerivation:Ee,prevAllowStateChanges:ur(!0),prevAllowStateReads:an(!0),notifySpy:!1,startTime:ie,actionId:li++,parentActionId:Sr};return Sr=Ke.actionId,Ke}function Un(N){Sr!==N.actionId&&_("invalid action stack. did you forget to finish an action?"),Sr=N.parentActionId,N.error!==void 0&&(Rn.suppressReactionErrors=!0),to(N.prevAllowStateChanges),en(N.prevAllowStateReads),oa(),st(N.prevDerivation),N.notifySpy,Rn.suppressReactionErrors=!1}function Zn(N,C){var z,ie=ur(N);try{z=C()}finally{to(ie)}return z}function ur(N){var C=Rn.allowStateChanges;return Rn.allowStateChanges=N,C}function to(N){Rn.allowStateChanges=N}var Lr=(function(N){function C(z,ie,Ee,Ke,wt){Ee===void 0&&(Ee="ObservableValue@"+g()),wt===void 0&&(wt=X.default);var Yt=N.call(this,Ee)||this;return Yt.enhancer=ie,Yt.name=Ee,Yt.equals=wt,Yt.hasUnreportedChange=!1,Yt.value=ie(z,void 0,Ee),Yt}return(function(z,ie){function Ee(){this.constructor=z}ee(z,ie),z.prototype=ie===null?Object.create(ie):(Ee.prototype=ie.prototype,new Ee)})(C,N),C.prototype.dehanceValue=function(z){return this.dehancer!==void 0?this.dehancer(z):z},C.prototype.set=function(z){this.value,(z=this.prepareNewValue(z))!==Rn.UNCHANGED&&this.setNewValue(z)},C.prototype.prepareNewValue=function(z){if(jn(this),Ji(this)){var ie=Cr(this,{object:this,type:"update",newValue:z});if(!ie)return Rn.UNCHANGED;z=ie.newValue}return z=this.enhancer(z,this.value,this.name),this.equals(this.value,z)?Rn.UNCHANGED:z},C.prototype.setNewValue=function(z){var ie=this.value;this.value=z,this.reportChanged(),Ui(this)&&mi(this,{type:"update",object:this,newValue:z,oldValue:ie})},C.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},C.prototype.intercept=function(z){return _a(this,z)},C.prototype.observe=function(z,ie){return ie&&z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ra(this,z)},C.prototype.toJSON=function(){return this.get()},C.prototype.toString=function(){return this.name+"["+this.value+"]"},C.prototype.valueOf=function(){return W(this.get())},C.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},C})(F),ml=I("ObservableValue",Lr),za=(function(){function N(C){this.dependenciesState=sn.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=sn.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+g(),this.value=new Gn(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=We.NONE,b(C.get,"missing option for computed: get"),this.derivation=C.get,this.name=C.name||"ComputedValue@"+g(),C.set&&(this.setter=Yo(this.name+"-setter",C.set)),this.equals=C.equals||(C.compareStructural||C.struct?X.structural:X.default),this.scope=C.context,this.requiresReaction=!!C.requiresReaction,this.keepAlive=!!C.keepAlive}return N.prototype.onBecomeStale=function(){(function(C){C.lowestObserverState===sn.UP_TO_DATE&&(C.lowestObserverState=sn.POSSIBLY_STALE,C.observers.forEach((function(z){z.dependenciesState===sn.UP_TO_DATE&&(z.dependenciesState=sn.POSSIBLY_STALE,z.isTracing!==We.NONE&&Pa(z,C),z.onBecomeStale())})))})(this)},N.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(C){return C()}))},N.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(C){return C()}))},N.prototype.get=function(){this.isComputing&&_("Cycle detected in computation "+this.name+": "+this.derivation),Rn.inBatch!==0||this.observers.size!==0||this.keepAlive?(Mu(this),Dr(this)&&this.trackAndCompute()&&(function(z){z.lowestObserverState!==sn.STALE&&(z.lowestObserverState=sn.STALE,z.observers.forEach((function(ie){ie.dependenciesState===sn.POSSIBLY_STALE?ie.dependenciesState=sn.STALE:ie.dependenciesState===sn.UP_TO_DATE&&(z.lowestObserverState=sn.UP_TO_DATE)})))})(this)):Dr(this)&&(this.warnAboutUntrackedRead(),Ki(),this.value=this.computeValue(!1),oa());var C=this.value;if(br(C))throw C.cause;return C},N.prototype.peek=function(){var C=this.computeValue(!1);if(br(C))throw C.cause;return C},N.prototype.set=function(C){if(this.setter){b(!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,C)}finally{this.isRunningSetter=!1}}else b(!1,!1)},N.prototype.trackAndCompute=function(){var C=this.value,z=this.dependenciesState===sn.NOT_TRACKING,ie=this.computeValue(!0),Ee=z||br(C)||br(ie)||!this.equals(C,ie);return Ee&&(this.value=ie),Ee},N.prototype.computeValue=function(C){var z;if(this.isComputing=!0,Rn.computationDepth++,C)z=ko(this,this.derivation,this.scope);else if(Rn.disableErrorBoundaries===!0)z=this.derivation.call(this.scope);else try{z=this.derivation.call(this.scope)}catch(ie){z=new Gn(ie)}return Rn.computationDepth--,this.isComputing=!1,z},N.prototype.suspend=function(){this.keepAlive||(Se(this),this.value=void 0)},N.prototype.observe=function(C,z){var ie=this,Ee=!0,Ke=void 0;return Sc((function(){var wt=ie.get();if(!Ee||z){var Yt=$e();C({type:"update",object:ie,newValue:wt,oldValue:Ke}),st(Yt)}Ee=!1,Ke=wt}))},N.prototype.warnAboutUntrackedRead=function(){},N.prototype.toJSON=function(){return this.get()},N.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},N.prototype.valueOf=function(){return W(this.get())},N.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},N})(),yl=I("ComputedValue",za),as=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},np={};function gc(){return typeof window<"u"?window:c!==void 0?c:typeof self<"u"?self:np}var va=!0,Fs=!1,Rn=(function(){var N=gc();return N.__mobxInstanceCount>0&&!N.__mobxGlobals&&(va=!1),N.__mobxGlobals&&N.__mobxGlobals.version!==new as().version&&(va=!1),va?N.__mobxGlobals?(N.__mobxInstanceCount+=1,N.__mobxGlobals.UNCHANGED||(N.__mobxGlobals.UNCHANGED={}),N.__mobxGlobals):(N.__mobxInstanceCount=1,N.__mobxGlobals=new as):(setTimeout((function(){Fs||_("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new as)})();function Id(N,C){N.observers.add(C),N.lowestObserverState>C.dependenciesState&&(N.lowestObserverState=C.dependenciesState)}function Eo(N,C){N.observers.delete(C),N.observers.size===0&&_c(N)}function _c(N){N.isPendingUnobservation===!1&&(N.isPendingUnobservation=!0,Rn.pendingUnobservations.push(N))}function Ki(){Rn.inBatch++}function oa(){if(--Rn.inBatch==0){wc();for(var N=Rn.pendingUnobservations,C=0;C<N.length;C++){var z=N[C];z.isPendingUnobservation=!1,z.observers.size===0&&(z.isBeingObserved&&(z.isBeingObserved=!1,z.onBecomeUnobserved()),z instanceof za&&z.suspend())}Rn.pendingUnobservations=[]}}function Mu(N){var C=Rn.trackingDerivation;return C!==null?(C.runId!==N.lastAccessedBy&&(N.lastAccessedBy=C.runId,C.newObserving[C.unboundDepsCount++]=N,N.isBeingObserved||(N.isBeingObserved=!0,N.onBecomeObserved())),!0):(N.observers.size===0&&Rn.inBatch>0&&_c(N),!1)}function Pa(N,C){if(N.isTracing===We.BREAK){var z=[];ma(Uo(N),z,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+N.name+`'
|
||
|
||
You are entering this break point because derivation '`+N.name+"' is being traced and '"+C.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.
|
||
|
||
`+(N instanceof za?N.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+z.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function ma(N,C,z){C.length>=1e3?C.push("(and many more)"):(C.push(""+new Array(z).join(" ")+N.name),N.dependencies&&N.dependencies.forEach((function(ie){return ma(ie,C,z+1)})))}var Ca=(function(){function N(C,z,ie,Ee){C===void 0&&(C="Reaction@"+g()),Ee===void 0&&(Ee=!1),this.name=C,this.onInvalidate=z,this.errorHandler=ie,this.requiresObservable=Ee,this.observing=[],this.newObserving=[],this.dependenciesState=sn.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+g(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=We.NONE}return N.prototype.onBecomeStale=function(){this.schedule()},N.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Rn.pendingReactions.push(this),wc())},N.prototype.isScheduled=function(){return this._isScheduled},N.prototype.runReaction=function(){if(!this.isDisposed){if(Ki(),this._isScheduled=!1,Dr(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(C){this.reportExceptionInDerivation(C)}}oa()}},N.prototype.track=function(C){if(!this.isDisposed){Ki(),this._isRunning=!0;var z=ko(this,C,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Se(this),br(z)&&this.reportExceptionInDerivation(z.cause),oa()}},N.prototype.reportExceptionInDerivation=function(C){var z=this;if(this.errorHandler)this.errorHandler(C,this);else{if(Rn.disableErrorBoundaries)throw C;Rn.suppressReactionErrors,Rn.globalReactionErrorHandlers.forEach((function(ie){return ie(C,z)}))}},N.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ki(),Se(this),oa()))},N.prototype.getDisposer=function(){var C=this.dispose.bind(this);return C[B]=this,C},N.prototype.toString=function(){return"Reaction["+this.name+"]"},N.prototype.trace=function(C){C===void 0&&(C=!1),(function(){for(var z=[],ie=0;ie<arguments.length;ie++)z[ie]=arguments[ie];var Ee=!1;typeof z[z.length-1]=="boolean"&&(Ee=z.pop());var Ke=Vr(z);if(!Ke)return _(!1);Ke.isTracing,We.NONE,Ke.isTracing=Ee?We.BREAK:We.LOG})(this,C)},N})(),bc=function(N){return N()};function wc(){Rn.inBatch>0||Rn.isRunningReactions||bc(Ld)}function Ld(){Rn.isRunningReactions=!0;for(var N=Rn.pendingReactions,C=0;N.length>0;){++C==100&&N.splice(0);for(var z=N.splice(0),ie=0,Ee=z.length;ie<Ee;ie++)z[ie].runReaction()}Rn.isRunningReactions=!1}var Bs=I("Reaction",Ca);function $d(N){var C=bc;bc=function(z){return N((function(){return C(z)}))}}function Ec(N){return function(){}}function rp(){_(!1)}function Il(N){return function(C,z,ie){if(ie){if(ie.value)return{value:Yo(N,ie.value),enumerable:!1,configurable:!0,writable:!0};var Ee=ie.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Yo(N,Ee.call(this))}}}return Fd(N).apply(this,arguments)}}function Fd(N){return function(C,z,ie){Object.defineProperty(C,z,{configurable:!0,enumerable:!1,get:function(){},set:function(Ee){T(this,z,gl(N,Ee))}})}}var gl=function(N,C,z,ie){return arguments.length===1&&typeof N=="function"?Yo(N.name||"<unnamed action>",N):arguments.length===2&&typeof C=="function"?Yo(N,C):arguments.length===1&&typeof N=="string"?Il(N):ie!==!0?Il(C).apply(null,arguments):void T(N,C,Yo(N.name||C,z.value,this))};function Oc(N,C){return ti(typeof N=="string"?N:N.name||"<unnamed action>",typeof N=="function"?N:C,this,void 0)}function ku(N){return typeof N=="function"&&N.isMobxAction===!0}function xc(N,C,z){T(N,C,Yo(C,z.bind(N)))}function Sc(N,C){C===void 0&&(C=f);var z,ie=C&&C.name||N.name||"Autorun@"+g();if(!C.scheduler&&!C.delay)z=new Ca(ie,(function(){this.track(wt)}),C.onError,C.requiresObservable);else{var Ee=Bd(C),Ke=!1;z=new Ca(ie,(function(){Ke||(Ke=!0,Ee((function(){Ke=!1,z.isDisposed||z.track(wt)})))}),C.onError,C.requiresObservable)}function wt(){N(z)}return z.schedule(),z.getDisposer()}gl.bound=function(N,C,z,ie){return ie===!0?(xc(N,C,z.value),null):z?{configurable:!0,enumerable:!1,get:function(){return xc(this,C,z.value||z.initializer.call(this)),this[C]},set:rp}:{enumerable:!1,configurable:!0,set:function(Ee){xc(this,C,Ee)},get:function(){}}};var op=function(N){return N()};function Bd(N){return N.scheduler?N.scheduler:N.delay?function(C){return setTimeout(C,N.delay)}:op}function Kr(N,C,z){z===void 0&&(z=f);var ie,Ee,Ke,wt=z.name||"Reaction@"+g(),Yt=gl(wt,z.onError?(ie=z.onError,Ee=C,function(){try{return Ee.apply(this,arguments)}catch(To){ie.call(this,To)}}):C),Sn=!z.scheduler&&!z.delay,Or=Bd(z),vn=!0,qr=!1,gr=z.compareStructural?X.structural:z.equals||X.default,Fr=new Ca(wt,(function(){vn||Sn?la():qr||(qr=!0,Or(la))}),z.onError,z.requiresObservable);function la(){if(qr=!1,!Fr.isDisposed){var To=!1;Fr.track((function(){var ea=N(Fr);To=vn||!gr(Ke,ea),Ke=ea})),vn&&z.fireImmediately&&Yt(Ke,Fr),vn||To!==!0||Yt(Ke,Fr),vn&&(vn=!1)}}return Fr.schedule(),Fr.getDisposer()}function Xr(N,C,z){return Vd("onBecomeUnobserved",N,C,z)}function Vd(N,C,z,ie){var Ee=typeof ie=="function"?aa(C,z):aa(C),Ke=typeof ie=="function"?ie:z,wt=N+"Listeners";return Ee[wt]?Ee[wt].add(Ke):Ee[wt]=new Set([Ke]),typeof Ee[N]!="function"?_(!1):function(){var Yt=Ee[wt];Yt&&(Yt.delete(Ke),Yt.size===0&&delete Ee[wt])}}function ls(N){var C=N.enforceActions,z=N.computedRequiresReaction,ie=N.computedConfigurable,Ee=N.disableErrorBoundaries,Ke=N.reactionScheduler,wt=N.reactionRequiresObservable,Yt=N.observableRequiresReaction;if(N.isolateGlobalState===!0&&((Rn.pendingReactions.length||Rn.inBatch||Rn.isRunningReactions)&&_("isolateGlobalState should be called before MobX is running any reactions"),Fs=!0,va&&(--gc().__mobxInstanceCount==0&&(gc().__mobxGlobals=void 0),Rn=new as)),C!==void 0){var Sn=void 0;switch(C){case!0:case"observed":Sn=!0;break;case!1:case"never":Sn=!1;break;case"strict":case"always":Sn="strict";break;default:_("Invalid value for 'enforceActions': '"+C+"', expected 'never', 'always' or 'observed'")}Rn.enforceActions=Sn,Rn.allowStateChanges=Sn!==!0&&Sn!=="strict"}z!==void 0&&(Rn.computedRequiresReaction=!!z),wt!==void 0&&(Rn.reactionRequiresObservable=!!wt),Yt!==void 0&&(Rn.observableRequiresReaction=!!Yt,Rn.allowStateReads=!Rn.observableRequiresReaction),ie!==void 0&&(Rn.computedConfigurable=!!ie),Ee!==void 0&&(Rn.disableErrorBoundaries=!!Ee),Ke&&$d(Ke)}function ya(N,C,z,ie){var Ee=Tu(ie=Le(ie));return Be(N),ia(N,ie.name,Ee.enhancer),C&&Ud(N,C,z,Ee),N}function Tu(N){return N.defaultDecorator||(N.deep===!1?bt:Ye)}function Ud(N,C,z,ie){var Ee,Ke;Ki();try{var wt=H(C);try{for(var Yt=ae(wt),Sn=Yt.next();!Sn.done;Sn=Yt.next()){var Or=Sn.value,vn=Object.getOwnPropertyDescriptor(C,Or),qr=(z&&Or in z?z[Or]:vn.get?yn:ie)(N,Or,vn,!0);qr&&Object.defineProperty(N,Or,qr)}}catch(gr){Ee={error:gr}}finally{try{Sn&&!Sn.done&&(Ke=Yt.return)&&Ke.call(Yt)}finally{if(Ee)throw Ee.error}}}finally{oa()}}function Uo(N,C){return Ll(aa(N,C))}function Ll(N){var C,z,ie={name:N.name};return N.observing&&N.observing.length>0&&(ie.dependencies=(C=N.observing,z=[],C.forEach((function(Ee){z.indexOf(Ee)===-1&&z.push(Ee)})),z).map(Ll)),ie}var $l=0;function Nu(){this.message="FLOW_CANCELLED"}function ss(N){arguments.length!==1&&_("Flow expects 1 argument and cannot be used as decorator");var C=N.name||"<unnamed flow>";return function(){var z,ie=this,Ee=arguments,Ke=++$l,wt=gl(C+" - runid: "+Ke+" - init",N).apply(ie,Ee),Yt=void 0,Sn=new Promise((function(Or,vn){var qr=0;function gr(To){var ea;Yt=void 0;try{ea=gl(C+" - runid: "+Ke+" - yield "+qr++,wt.next).call(wt,To)}catch(_l){return vn(_l)}la(ea)}function Fr(To){var ea;Yt=void 0;try{ea=gl(C+" - runid: "+Ke+" - yield "+qr++,wt.throw).call(wt,To)}catch(_l){return vn(_l)}la(ea)}function la(To){if(!To||typeof To.then!="function")return To.done?Or(To.value):(Yt=Promise.resolve(To.value)).then(gr,Fr);To.then(la,vn)}z=vn,gr(void 0)}));return Sn.cancel=gl(C+" - runid: "+Ke+" - cancel",(function(){try{Yt&&Oi(Yt);var Or=wt.return(void 0),vn=Promise.resolve(Or.value);vn.then(S,S),Oi(vn),z(new Nu)}catch(qr){z(qr)}})),Sn}}function Oi(N){typeof N.cancel=="function"&&N.cancel()}function Ac(N,C){if(N==null)return!1;if(C!==void 0){if(ci(N)===!1||!N[B].values.has(C))return!1;var z=aa(N,C);return yl(z)}return yl(N)}function Wd(N){return arguments.length>1?_(!1):Ac(N)}function Mc(N,C){return typeof C!="string"?_(!1):Ac(N,C)}function $i(N,C){return N!=null&&(C!==void 0?!!ci(N)&&N[B].values.has(C):ci(N)||!!N[B]||q(N)||Bs(N)||yl(N))}function si(N){return arguments.length!==1&&_(!1),$i(N)}function ga(N){return ci(N)?N[B].getKeys():Ko(N)||ni(N)?Array.from(N.keys()):ba(N)?N.map((function(C,z){return z})):_(!1)}function lo(N){return ci(N)?ga(N).map((function(C){return N[C]})):Ko(N)?ga(N).map((function(C){return N.get(C)})):ni(N)?Array.from(N.values()):ba(N)?N.slice():_(!1)}function ip(N){return ci(N)?ga(N).map((function(C){return[C,N[C]]})):Ko(N)?ga(N).map((function(C){return[C,N.get(C)]})):ni(N)?Array.from(N.entries()):ba(N)?N.map((function(C,z){return[z,C]})):_(!1)}function Fi(N,C,z){if(arguments.length!==2||ni(N))if(ci(N)){var ie=N[B],Ee=ie.values.get(C);Ee?ie.write(C,z):ie.addObservableProp(C,z,ie.defaultEnhancer)}else if(Ko(N))N.set(C,z);else if(ni(N))N.add(C);else{if(!ba(N))return _(!1);typeof C!="number"&&(C=parseInt(C,10)),b(C>=0,"Not a valid index: '"+C+"'"),Ki(),C>=N.length&&(N.length=C+1),N[C]=z,oa()}else{Ki();var Ke=C;try{for(var wt in Ke)Fi(N,wt,Ke[wt])}finally{oa()}}}function Gd(N,C,z,ie){return typeof z=="function"?(function(Ee,Ke,wt,Yt){return ji(Ee,Ke).observe(wt,Yt)})(N,C,z,ie):(function(Ee,Ke,wt){return ji(Ee).observe(Ke,wt)})(N,C,z)}Nu.prototype=Object.create(Error.prototype);var zd={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Bi(N,C,z,ie){return ie.detectCycles&&N.set(C,z),z}function Zi(N,C,z){if(!C.recurseEverything&&!si(N)||typeof N!="object")return N;if(N===null)return null;if(N instanceof Date)return N;if(ml(N))return Zi(N.get(),C,z);if(si(N)&&ga(N),C.detectCycles===!0&&N!==null&&z.has(N))return z.get(N);if(ba(N)||Array.isArray(N)){var ie=Bi(z,N,[],C),Ee=N.map((function(gr){return Zi(gr,C,z)}));ie.length=Ee.length;for(var Ke=0,wt=Ee.length;Ke<wt;Ke++)ie[Ke]=Ee[Ke];return ie}if(ni(N)||Object.getPrototypeOf(N)===Set.prototype){if(C.exportMapsAsObjects===!1){var Yt=Bi(z,N,new Set,C);return N.forEach((function(gr){Yt.add(Zi(gr,C,z))})),Yt}var Sn=Bi(z,N,[],C);return N.forEach((function(gr){Sn.push(Zi(gr,C,z))})),Sn}if(Ko(N)||Object.getPrototypeOf(N)===Map.prototype){if(C.exportMapsAsObjects===!1){var Or=Bi(z,N,new Map,C);return N.forEach((function(gr,Fr){Or.set(Fr,Zi(gr,C,z))})),Or}var vn=Bi(z,N,{},C);return N.forEach((function(gr,Fr){vn[Fr]=Zi(gr,C,z)})),vn}var qr=Bi(z,N,{},C);return D(N).forEach((function(gr){qr[gr]=Zi(N[gr],C,z)})),qr}function kc(N,C){var z;return typeof C=="boolean"&&(C={detectCycles:C}),C||(C=zd),C.detectCycles=C.detectCycles===void 0?C.recurseEverything===!0:C.detectCycles===!0,C.detectCycles&&(z=new Map),Zi(N,C,z)}function Vr(N){switch(N.length){case 0:return Rn.trackingDerivation;case 1:return aa(N[0]);case 2:return aa(N[0],N[1])}}function ui(N,C){C===void 0&&(C=void 0),Ki();try{return N.apply(C)}finally{oa()}}function Pu(N,C,z){return arguments.length===1||C&&typeof C=="object"?Tc(N,C):Hd(N,C,z||{})}function Hd(N,C,z){var ie;typeof z.timeout=="number"&&(ie=setTimeout((function(){if(!Ke[B].isDisposed){Ke();var wt=new Error("WHEN_TIMEOUT");if(!z.onError)throw wt;z.onError(wt)}}),z.timeout)),z.name=z.name||"When@"+g();var Ee=Yo(z.name+"-effect",C),Ke=Sc((function(wt){N()&&(wt.dispose(),ie&&clearTimeout(ie),Ee())}),z);return Ke}function Tc(N,C){var z,ie=new Promise((function(Ee,Ke){var wt=Hd(N,Ee,ue(ue({},C),{onError:Ke}));z=function(){wt(),Ke("WHEN_CANCELLED")}}));return ie.cancel=z,ie}function Cu(N){return N[B]}function Ha(N){return typeof N=="string"||typeof N=="number"||typeof N=="symbol"}var Vi={has:function(N,C){if(C===B||C==="constructor"||C===Te)return!0;var z=Cu(N);return Ha(C)?z.has(C):C in N},get:function(N,C){if(C===B||C==="constructor"||C===Te)return N[C];var z=Cu(N),ie=z.values.get(C);if(ie instanceof F){var Ee=ie.get();return Ee===void 0&&z.has(C),Ee}return Ha(C)&&z.has(C),N[C]},set:function(N,C,z){return!!Ha(C)&&(Fi(N,C,z),!0)},deleteProperty:function(N,C){return!!Ha(C)&&(Cu(N).remove(C),!0)},ownKeys:function(N){return Cu(N).keysAtom.reportObserved(),Reflect.ownKeys(N)},preventExtensions:function(N){return _("Dynamic observable objects cannot be frozen"),!1}};function us(N){var C=new Proxy(N,Vi);return N[B].proxy=C,C}function Ji(N){return N.interceptors!==void 0&&N.interceptors.length>0}function _a(N,C){var z=N.interceptors||(N.interceptors=[]);return z.push(C),x((function(){var ie=z.indexOf(C);ie!==-1&&z.splice(ie,1)}))}function Cr(N,C){var z=$e();try{for(var ie=je(N.interceptors||[]),Ee=0,Ke=ie.length;Ee<Ke&&(b(!(C=ie[Ee](C))||C.type,"Intercept handlers should return nothing or a change object"),C);Ee++);return C}finally{st(z)}}function Ui(N){return N.changeListeners!==void 0&&N.changeListeners.length>0}function Ra(N,C){var z=N.changeListeners||(N.changeListeners=[]);return z.push(C),x((function(){var ie=z.indexOf(C);ie!==-1&&z.splice(ie,1)}))}function mi(N,C){var z=$e(),ie=N.changeListeners;if(ie){for(var Ee=0,Ke=(ie=ie.slice()).length;Ee<Ke;Ee++)ie[Ee](C);st(z)}}var cs={get:function(N,C){return C===B?N[B]:C==="length"?N[B].getArrayLength():typeof C=="number"?mo.get.call(N,C):typeof C!="string"||isNaN(C)?mo.hasOwnProperty(C)?mo[C]:N[C]:mo.get.call(N,parseInt(C))},set:function(N,C,z){return C==="length"&&N[B].setArrayLength(z),typeof C=="number"&&mo.set.call(N,C,z),typeof C=="symbol"||isNaN(C)?N[C]=z:mo.set.call(N,parseInt(C),z),!0},preventExtensions:function(N){return _("Observable arrays cannot be frozen"),!1}};function Fl(N,C,z,ie){z===void 0&&(z="ObservableArray@"+g()),ie===void 0&&(ie=!1);var Ee,Ke,wt,Yt=new ja(z,C,ie);Ee=Yt.values,Ke=B,wt=Yt,Object.defineProperty(Ee,Ke,{enumerable:!1,writable:!1,configurable:!0,value:wt});var Sn=new Proxy(Yt.values,cs);if(Yt.proxy=Sn,N&&N.length){var Or=ur(!0);Yt.spliceWithArray(0,0,N),to(Or)}return Sn}var ja=(function(){function N(C,z,ie){this.owned=ie,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new F(C||"ObservableArray@"+g()),this.enhancer=function(Ee,Ke){return z(Ee,Ke,C+"[..]")}}return N.prototype.dehanceValue=function(C){return this.dehancer!==void 0?this.dehancer(C):C},N.prototype.dehanceValues=function(C){return this.dehancer!==void 0&&C.length>0?C.map(this.dehancer):C},N.prototype.intercept=function(C){return _a(this,C)},N.prototype.observe=function(C,z){return z===void 0&&(z=!1),z&&C({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ra(this,C)},N.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},N.prototype.setArrayLength=function(C){if(typeof C!="number"||C<0)throw new Error("[mobx.array] Out of range: "+C);var z=this.values.length;if(C!==z)if(C>z){for(var ie=new Array(C-z),Ee=0;Ee<C-z;Ee++)ie[Ee]=void 0;this.spliceWithArray(z,0,ie)}else this.spliceWithArray(C,z-C)},N.prototype.updateArrayLength=function(C,z){if(C!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=z},N.prototype.spliceWithArray=function(C,z,ie){var Ee=this;jn(this.atom);var Ke=this.values.length;if(C===void 0?C=0:C>Ke?C=Ke:C<0&&(C=Math.max(0,Ke+C)),z=arguments.length===1?Ke-C:z==null?0:Math.max(0,Math.min(z,Ke-C)),ie===void 0&&(ie=v),Ji(this)){var wt=Cr(this,{object:this.proxy,type:"splice",index:C,removedCount:z,added:ie});if(!wt)return v;z=wt.removedCount,ie=wt.added}ie=ie.length===0?ie:ie.map((function(Sn){return Ee.enhancer(Sn,void 0)}));var Yt=this.spliceItemsIntoValues(C,z,ie);return z===0&&ie.length===0||this.notifyArraySplice(C,ie,Yt),this.dehanceValues(Yt)},N.prototype.spliceItemsIntoValues=function(C,z,ie){var Ee;if(ie.length<1e4)return(Ee=this.values).splice.apply(Ee,je([C,z],ie));var Ke=this.values.slice(C,C+z);return this.values=this.values.slice(0,C).concat(ie,this.values.slice(C+z)),Ke},N.prototype.notifyArrayChildUpdate=function(C,z,ie){var Ee=!this.owned&&!1,Ke=Ui(this),wt=Ke||Ee?{object:this.proxy,type:"update",index:C,newValue:z,oldValue:ie}:null;this.atom.reportChanged(),Ke&&mi(this,wt)},N.prototype.notifyArraySplice=function(C,z,ie){var Ee=!this.owned&&!1,Ke=Ui(this),wt=Ke||Ee?{object:this.proxy,type:"splice",index:C,removed:ie,added:z,removedCount:ie.length,addedCount:z.length}:null;this.atom.reportChanged(),Ke&&mi(this,wt)},N})(),mo={intercept:function(N){return this[B].intercept(N)},observe:function(N,C){return C===void 0&&(C=!1),this[B].observe(N,C)},clear:function(){return this.splice(0)},replace:function(N){var C=this[B];return C.spliceWithArray(0,C.values.length,N)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(N,C){for(var z=[],ie=2;ie<arguments.length;ie++)z[ie-2]=arguments[ie];var Ee=this[B];switch(arguments.length){case 0:return[];case 1:return Ee.spliceWithArray(N);case 2:return Ee.spliceWithArray(N,C)}return Ee.spliceWithArray(N,C,z)},spliceWithArray:function(N,C,z){return this[B].spliceWithArray(N,C,z)},push:function(){for(var N=[],C=0;C<arguments.length;C++)N[C]=arguments[C];var z=this[B];return z.spliceWithArray(z.values.length,0,N),z.values.length},pop:function(){return this.splice(Math.max(this[B].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var N=[],C=0;C<arguments.length;C++)N[C]=arguments[C];var z=this[B];return z.spliceWithArray(0,0,N),z.values.length},reverse:function(){var N=this.slice();return N.reverse.apply(N,arguments)},sort:function(N){var C=this.slice();return C.sort.apply(C,arguments)},remove:function(N){var C=this[B],z=C.dehanceValues(C.values).indexOf(N);return z>-1&&(this.splice(z,1),!0)},get:function(N){var C=this[B];if(C&&N<C.values.length)return C.atom.reportObserved(),C.dehanceValue(C.values[N])},set:function(N,C){var z=this[B],ie=z.values;if(N<ie.length){jn(z.atom);var Ee=ie[N];if(Ji(z)){var Ke=Cr(z,{type:"update",object:z.proxy,index:N,newValue:C});if(!Ke)return;C=Ke.newValue}(C=z.enhancer(C,Ee))!==Ee&&(ie[N]=C,z.notifyArrayChildUpdate(N,C,Ee))}else{if(N!==ie.length)throw new Error("[mobx.array] Index out of bounds, "+N+" is larger than "+ie.length);z.spliceWithArray(N,0,[C])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(N){typeof Array.prototype[N]=="function"&&(mo[N]=function(){var C=this[B];C.atom.reportObserved();var z=C.dehanceValues(C.values);return z[N].apply(z,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(N){typeof Array.prototype[N]=="function"&&(mo[N]=function(C,z){var ie=this,Ee=this[B];return Ee.atom.reportObserved(),Ee.dehanceValues(Ee.values)[N]((function(Ke,wt){return C.call(z,Ke,wt,ie)}),z)})})),["reduce","reduceRight"].forEach((function(N){mo[N]=function(){var C=this,z=this[B];z.atom.reportObserved();var ie=arguments[0];return arguments[0]=function(Ee,Ke,wt){return Ke=z.dehanceValue(Ke),ie(Ee,Ke,wt,C)},z.values[N].apply(z.values,arguments)}}));var Vs,Xa=I("ObservableArrayAdministration",ja);function ba(N){return A(N)&&Xa(N[B])}var Nc,ap={},Pc=(function(){function N(C,z,ie){if(z===void 0&&(z=He),ie===void 0&&(ie="ObservableMap@"+g()),this.enhancer=z,this.name=ie,this[Vs]=ap,this._keysAtom=K(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(C)}return N.prototype._has=function(C){return this._data.has(C)},N.prototype.has=function(C){var z=this;if(!Rn.trackingDerivation)return this._has(C);var ie=this._hasMap.get(C);if(!ie){var Ee=ie=new Lr(this._has(C),Jt,this.name+"."+L(C)+"?",!1);this._hasMap.set(C,Ee),Xr(Ee,(function(){return z._hasMap.delete(C)}))}return ie.get()},N.prototype.set=function(C,z){var ie=this._has(C);if(Ji(this)){var Ee=Cr(this,{type:ie?"update":"add",object:this,newValue:z,name:C});if(!Ee)return this;z=Ee.newValue}return ie?this._updateValue(C,z):this._addValue(C,z),this},N.prototype.delete=function(C){var z=this;if(jn(this._keysAtom),Ji(this)&&!(Ee=Cr(this,{type:"delete",object:this,name:C})))return!1;if(this._has(C)){var ie=Ui(this),Ee=ie?{type:"delete",object:this,oldValue:this._data.get(C).value,name:C}:null;return ui((function(){z._keysAtom.reportChanged(),z._updateHasMapEntry(C,!1),z._data.get(C).setNewValue(void 0),z._data.delete(C)})),ie&&mi(this,Ee),!0}return!1},N.prototype._updateHasMapEntry=function(C,z){var ie=this._hasMap.get(C);ie&&ie.setNewValue(z)},N.prototype._updateValue=function(C,z){var ie=this._data.get(C);if((z=ie.prepareNewValue(z))!==Rn.UNCHANGED){var Ee=Ui(this),Ke=Ee?{type:"update",object:this,oldValue:ie.value,name:C,newValue:z}:null;ie.setNewValue(z),Ee&&mi(this,Ke)}},N.prototype._addValue=function(C,z){var ie=this;jn(this._keysAtom),ui((function(){var wt=new Lr(z,ie.enhancer,ie.name+"."+L(C),!1);ie._data.set(C,wt),z=wt.value,ie._updateHasMapEntry(C,!0),ie._keysAtom.reportChanged()}));var Ee=Ui(this),Ke=Ee?{type:"add",object:this,name:C,newValue:z}:null;Ee&&mi(this,Ke)},N.prototype.get=function(C){return this.has(C)?this.dehanceValue(this._data.get(C).get()):this.dehanceValue(void 0)},N.prototype.dehanceValue=function(C){return this.dehancer!==void 0?this.dehancer(C):C},N.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},N.prototype.values=function(){var C=this,z=this.keys();return Rr({next:function(){var ie=z.next(),Ee=ie.done,Ke=ie.value;return{done:Ee,value:Ee?void 0:C.get(Ke)}}})},N.prototype.entries=function(){var C=this,z=this.keys();return Rr({next:function(){var ie=z.next(),Ee=ie.done,Ke=ie.value;return{done:Ee,value:Ee?void 0:[Ke,C.get(Ke)]}}})},N.prototype[Vs=B,Symbol.iterator]=function(){return this.entries()},N.prototype.forEach=function(C,z){var ie,Ee;try{for(var Ke=ae(this),wt=Ke.next();!wt.done;wt=Ke.next()){var Yt=we(wt.value,2),Sn=Yt[0],Or=Yt[1];C.call(z,Or,Sn,this)}}catch(vn){ie={error:vn}}finally{try{wt&&!wt.done&&(Ee=Ke.return)&&Ee.call(Ke)}finally{if(ie)throw ie.error}}},N.prototype.merge=function(C){var z=this;return Ko(C)&&(C=C.toJS()),ui((function(){var ie=ur(!0);try{E(C)?D(C).forEach((function(Ee){return z.set(Ee,C[Ee])})):Array.isArray(C)?C.forEach((function(Ee){var Ke=we(Ee,2),wt=Ke[0],Yt=Ke[1];return z.set(wt,Yt)})):R(C)?(C.constructor!==Map&&_("Cannot initialize from classes that inherit from Map: "+C.constructor.name),C.forEach((function(Ee,Ke){return z.set(Ke,Ee)}))):C!=null&&_("Cannot initialize map from "+C)}finally{to(ie)}})),this},N.prototype.clear=function(){var C=this;ui((function(){Qe((function(){var z,ie;try{for(var Ee=ae(C.keys()),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=Ke.value;C.delete(wt)}}catch(Yt){z={error:Yt}}finally{try{Ke&&!Ke.done&&(ie=Ee.return)&&ie.call(Ee)}finally{if(z)throw z.error}}}))}))},N.prototype.replace=function(C){var z=this;return ui((function(){var ie,Ee,Ke,wt,Yt=(function(ri){if(R(ri)||Ko(ri))return ri;if(Array.isArray(ri))return new Map(ri);if(E(ri)){var Vl=new Map;for(var wl in ri)Vl.set(wl,ri[wl]);return Vl}return _("Cannot convert to map from '"+ri+"'")})(C),Sn=new Map,Or=!1;try{for(var vn=ae(z._data.keys()),qr=vn.next();!qr.done;qr=vn.next()){var gr=qr.value;if(!Yt.has(gr))if(z.delete(gr))Or=!0;else{var Fr=z._data.get(gr);Sn.set(gr,Fr)}}}catch(ri){ie={error:ri}}finally{try{qr&&!qr.done&&(Ee=vn.return)&&Ee.call(vn)}finally{if(ie)throw ie.error}}try{for(var la=ae(Yt.entries()),To=la.next();!To.done;To=la.next()){var ea=we(To.value,2),_l=(gr=ea[0],Fr=ea[1],z._data.has(gr));if(z.set(gr,Fr),z._data.has(gr)){var bl=z._data.get(gr);Sn.set(gr,bl),_l||(Or=!0)}}}catch(ri){Ke={error:ri}}finally{try{To&&!To.done&&(wt=la.return)&&wt.call(la)}finally{if(Ke)throw Ke.error}}if(!Or)if(z._data.size!==Sn.size)z._keysAtom.reportChanged();else for(var Bl=z._data.keys(),ds=Sn.keys(),Ya=Bl.next(),fs=ds.next();!Ya.done;){if(Ya.value!==fs.value){z._keysAtom.reportChanged();break}Ya=Bl.next(),fs=ds.next()}z._data=Sn})),this},Object.defineProperty(N.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),N.prototype.toPOJO=function(){var C,z,ie={};try{for(var Ee=ae(this),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=we(Ke.value,2),Yt=wt[0],Sn=wt[1];ie[typeof Yt=="symbol"?Yt:L(Yt)]=Sn}}catch(Or){C={error:Or}}finally{try{Ke&&!Ke.done&&(z=Ee.return)&&z.call(Ee)}finally{if(C)throw C.error}}return ie},N.prototype.toJS=function(){return new Map(this)},N.prototype.toJSON=function(){return this.toPOJO()},N.prototype.toString=function(){var C=this;return this.name+"[{ "+Array.from(this.keys()).map((function(z){return L(z)+": "+C.get(z)})).join(", ")+" }]"},N.prototype.observe=function(C,z){return Ra(this,C)},N.prototype.intercept=function(C){return _a(this,C)},N})(),Ko=I("ObservableMap",Pc),Us={},qa=(function(){function N(C,z,ie){if(z===void 0&&(z=He),ie===void 0&&(ie="ObservableSet@"+g()),this.name=ie,this[Nc]=Us,this._data=new Set,this._atom=K(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(Ee,Ke){return z(Ee,Ke,ie)},C&&this.replace(C)}return N.prototype.dehanceValue=function(C){return this.dehancer!==void 0?this.dehancer(C):C},N.prototype.clear=function(){var C=this;ui((function(){Qe((function(){var z,ie;try{for(var Ee=ae(C._data.values()),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=Ke.value;C.delete(wt)}}catch(Yt){z={error:Yt}}finally{try{Ke&&!Ke.done&&(ie=Ee.return)&&ie.call(Ee)}finally{if(z)throw z.error}}}))}))},N.prototype.forEach=function(C,z){var ie,Ee;try{for(var Ke=ae(this),wt=Ke.next();!wt.done;wt=Ke.next()){var Yt=wt.value;C.call(z,Yt,Yt,this)}}catch(Sn){ie={error:Sn}}finally{try{wt&&!wt.done&&(Ee=Ke.return)&&Ee.call(Ke)}finally{if(ie)throw ie.error}}},Object.defineProperty(N.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),N.prototype.add=function(C){var z=this;if(jn(this._atom),Ji(this)&&!(Ee=Cr(this,{type:"add",object:this,newValue:C})))return this;if(!this.has(C)){ui((function(){z._data.add(z.enhancer(C,void 0)),z._atom.reportChanged()}));var ie=Ui(this),Ee=ie?{type:"add",object:this,newValue:C}:null;ie&&mi(this,Ee)}return this},N.prototype.delete=function(C){var z=this;if(Ji(this)&&!(Ee=Cr(this,{type:"delete",object:this,oldValue:C})))return!1;if(this.has(C)){var ie=Ui(this),Ee=ie?{type:"delete",object:this,oldValue:C}:null;return ui((function(){z._atom.reportChanged(),z._data.delete(C)})),ie&&mi(this,Ee),!0}return!1},N.prototype.has=function(C){return this._atom.reportObserved(),this._data.has(this.dehanceValue(C))},N.prototype.entries=function(){var C=0,z=Array.from(this.keys()),ie=Array.from(this.values());return Rr({next:function(){var Ee=C;return C+=1,Ee<ie.length?{value:[z[Ee],ie[Ee]],done:!1}:{done:!0}}})},N.prototype.keys=function(){return this.values()},N.prototype.values=function(){this._atom.reportObserved();var C=this,z=0,ie=Array.from(this._data.values());return Rr({next:function(){return z<ie.length?{value:C.dehanceValue(ie[z++]),done:!1}:{done:!0}}})},N.prototype.replace=function(C){var z=this;return ni(C)&&(C=C.toJS()),ui((function(){var ie=ur(!0);try{Array.isArray(C)||U(C)?(z.clear(),C.forEach((function(Ee){return z.add(Ee)}))):C!=null&&_("Cannot initialize set from "+C)}finally{to(ie)}})),this},N.prototype.observe=function(C,z){return Ra(this,C)},N.prototype.intercept=function(C){return _a(this,C)},N.prototype.toJS=function(){return new Set(this)},N.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},N.prototype[Nc=B,Symbol.iterator]=function(){return this.values()},N})(),ni=I("ObservableSet",qa),Cc=(function(){function N(C,z,ie,Ee){z===void 0&&(z=new Map),this.target=C,this.values=z,this.name=ie,this.defaultEnhancer=Ee,this.keysAtom=new F(ie+".keys")}return N.prototype.read=function(C){return this.values.get(C).get()},N.prototype.write=function(C,z){var ie=this.target,Ee=this.values.get(C);if(Ee instanceof za)Ee.set(z);else{if(Ji(this)){if(!(wt=Cr(this,{type:"update",object:this.proxy||ie,name:C,newValue:z})))return;z=wt.newValue}if((z=Ee.prepareNewValue(z))!==Rn.UNCHANGED){var Ke=Ui(this),wt=Ke?{type:"update",object:this.proxy||ie,oldValue:Ee.value,name:C,newValue:z}:null;Ee.setNewValue(z),Ke&&mi(this,wt)}}},N.prototype.has=function(C){var z=this.pendingKeys||(this.pendingKeys=new Map),ie=z.get(C);if(ie)return ie.get();var Ee=!!this.values.get(C);return ie=new Lr(Ee,Jt,this.name+"."+L(C)+"?",!1),z.set(C,ie),ie.get()},N.prototype.addObservableProp=function(C,z,ie){ie===void 0&&(ie=this.defaultEnhancer);var Ee=this.target;if(Ji(this)){var Ke=Cr(this,{object:this.proxy||Ee,name:C,type:"add",newValue:z});if(!Ke)return;z=Ke.newValue}var wt=new Lr(z,ie,this.name+"."+L(C),!1);this.values.set(C,wt),z=wt.value,Object.defineProperty(Ee,C,(function(Yt){return wa[Yt]||(wa[Yt]={configurable:!0,enumerable:!0,get:function(){return this[B].read(Yt)},set:function(Sn){this[B].write(Yt,Sn)}})})(C)),this.notifyPropertyAddition(C,z)},N.prototype.addComputedProp=function(C,z,ie){var Ee,Ke,wt,Yt=this.target;ie.name=ie.name||this.name+"."+L(z),this.values.set(z,new za(ie)),(C===Yt||(Ee=C,Ke=z,!(wt=Object.getOwnPropertyDescriptor(Ee,Ke))||wt.configurable!==!1&&wt.writable!==!1))&&Object.defineProperty(C,z,(function(Sn){return Ru[Sn]||(Ru[Sn]={configurable:Rn.computedConfigurable,enumerable:!1,get:function(){return Wi(this).read(Sn)},set:function(Or){Wi(this).write(Sn,Or)}})})(z))},N.prototype.remove=function(C){if(this.values.has(C)){var z=this.target;if(Ji(this)&&!(Sn=Cr(this,{object:this.proxy||z,name:C,type:"remove"})))return;try{Ki();var ie=Ui(this),Ee=!1,Ke=this.values.get(C),wt=Ke&&Ke.get();if(Ke&&Ke.set(void 0),this.keysAtom.reportChanged(),this.values.delete(C),this.pendingKeys){var Yt=this.pendingKeys.get(C);Yt&&Yt.set(!1)}delete this.target[C];var Sn=ie?{type:"remove",object:this.proxy||z,oldValue:wt,name:C}:null;ie&&mi(this,Sn)}finally{oa()}}},N.prototype.illegalAccess=function(C,z){},N.prototype.observe=function(C,z){return Ra(this,C)},N.prototype.intercept=function(C){return _a(this,C)},N.prototype.notifyPropertyAddition=function(C,z){var ie=Ui(this),Ee=ie?{type:"add",object:this.proxy||this.target,name:C,newValue:z}:null;if(ie&&mi(this,Ee),this.pendingKeys){var Ke=this.pendingKeys.get(C);Ke&&Ke.set(!0)}this.keysAtom.reportChanged()},N.prototype.getKeys=function(){var C,z;this.keysAtom.reportObserved();var ie=[];try{for(var Ee=ae(this.values),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=we(Ke.value,2),Yt=wt[0];wt[1]instanceof Lr&&ie.push(Yt)}}catch(Sn){C={error:Sn}}finally{try{Ke&&!Ke.done&&(z=Ee.return)&&z.call(Ee)}finally{if(C)throw C.error}}return ie},N})();function ia(N,C,z){if(C===void 0&&(C=""),z===void 0&&(z=He),Object.prototype.hasOwnProperty.call(N,B))return N[B];E(N)||(C=(N.constructor.name||"ObservableObject")+"@"+g()),C||(C="ObservableObject@"+g());var ie=new Cc(N,new Map,L(C),z);return T(N,B,ie),ie}var wa=Object.create(null),Ru=Object.create(null);function Wi(N){var C=N[B];return C||(Be(N),N[B])}var Qi=I("ObservableObjectAdministration",Cc);function ci(N){return!!A(N)&&(Be(N),Qi(N[B]))}function aa(N,C){if(typeof N=="object"&&N!==null){if(ba(N))return C!==void 0&&_(!1),N[B].atom;if(ni(N))return N[B];if(Ko(N)){var z=N;return C===void 0?z._keysAtom:((ie=z._data.get(C)||z._hasMap.get(C))||_(!1),ie)}var ie;if(Be(N),C&&!N[B]&&N[C],ci(N))return C?((ie=N[B].values.get(C))||_(!1),ie):_(!1);if(q(N)||yl(N)||Bs(N))return N}else if(typeof N=="function"&&Bs(N[B]))return N[B];return _(!1)}function ji(N,C){return N||_("Expecting some object"),C!==void 0?ji(aa(N,C)):q(N)||yl(N)||Bs(N)||Ko(N)||ni(N)?N:(Be(N),N[B]?N[B]:void _(!1))}var vt=Object.prototype.toString;function Vt(N,C,z){return z===void 0&&(z=-1),Ut(N,C,z)}function Ut(N,C,z,ie,Ee){if(N===C)return N!==0||1/N==1/C;if(N==null||C==null)return!1;if(N!=N)return C!=C;var Ke=typeof N;if(Ke!=="function"&&Ke!=="object"&&typeof C!="object")return!1;var wt=vt.call(N);if(wt!==vt.call(C))return!1;switch(wt){case"[object RegExp]":case"[object String]":return""+N==""+C;case"[object Number]":return+N!=+N?+C!=+C:+N==0?1/+N==1/C:+N==+C;case"[object Date]":case"[object Boolean]":return+N==+C;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(N)===Symbol.valueOf.call(C);case"[object Map]":case"[object Set]":z>=0&&z++}N=bn(N),C=bn(C);var Yt=wt==="[object Array]";if(!Yt){if(typeof N!="object"||typeof C!="object")return!1;var Sn=N.constructor,Or=C.constructor;if(Sn!==Or&&!(typeof Sn=="function"&&Sn instanceof Sn&&typeof Or=="function"&&Or instanceof Or)&&"constructor"in N&&"constructor"in C)return!1}if(z===0)return!1;z<0&&(z=-1),Ee=Ee||[];for(var vn=(ie=ie||[]).length;vn--;)if(ie[vn]===N)return Ee[vn]===C;if(ie.push(N),Ee.push(C),Yt){if((vn=N.length)!==C.length)return!1;for(;vn--;)if(!Ut(N[vn],C[vn],z-1,ie,Ee))return!1}else{var qr=Object.keys(N),gr=void 0;if(vn=qr.length,Object.keys(C).length!==vn)return!1;for(;vn--;)if(!pr(C,gr=qr[vn])||!Ut(N[gr],C[gr],z-1,ie,Ee))return!1}return ie.pop(),Ee.pop(),!0}function bn(N){return ba(N)?N.slice():R(N)||Ko(N)||U(N)||ni(N)?Array.from(N.entries()):N}function pr(N,C){return Object.prototype.hasOwnProperty.call(N,C)}function Rr(N){return N[Symbol.iterator]=yo,N}function yo(){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:Ec,extras:{getDebugName:function(N,C){return(C!==void 0?aa(N,C):ci(N)||Ko(N)||ni(N)?ji(N):aa(N)).name}},$mobx:B})}).call(this,r(163),r(68))},function(n,a,r){var s=r(113),c=r(42),v=r(179);s||c(Object.prototype,"toString",v,{unsafe:!0})},function(n,a,r){var s=r(41),c=r(100),v=r(80),f=r(58),g=r(116),_="Array Iterator",b=f.set,x=f.getterFor(_);n.exports=g(Array,"Array",(function(S,A){b(this,{type:_,target:s(S),index:0,kind:A})}),(function(){var S=x(this),A=S.target,E=S.kind,T=S.index++;return!A||T>=A.length?(S.target=void 0,{value:void 0,done:!0}):E=="keys"?{value:T,done:!1}:E=="values"?{value:A[T],done:!1}:{value:[T,A[T]],done:!1}}),"values"),v.Arguments=v.Array,c("keys"),c("values"),c("entries")},function(n,a,r){var s=r(16),c=r(7),v=r(46),f=r(76),g=r(34),_=r(15),b=r(71),x=r(36),S=r(108),A=r(18),E=r(35),T=r(96),I=r(30),R=r(33),U=r(54),D=r(87),L=r(32),W=r(40),H=r(41),B=r(86),F=r(39),q=r(69),K=r(60),X=r(77),ee=r(74),ue=r(139),ae=r(112),we=r(50),je=r(38),Te=r(84),Me=r(98),Ne=r(42),rt=r(89),tt=r(93),Be=r(72),lt=r(90),St=r(28),He=r(140),Jt=r(141),Fe=r(78),me=r(58),Le=r(79).forEach,Ye=tt("hidden"),Ot="Symbol",bt=St("toPrimitive"),Ft=me.set,Qt=me.getterFor(Ot),on=Object.prototype,Wt=c.Symbol,nt=Wt&&Wt.prototype,sn=c.TypeError,We=c.QObject,yn=v("JSON","stringify"),Kn=we.f,te=je.f,Gn=ue.f,br=Te.f,Dr=_([].push),zr=rt("symbols"),jn=rt("op-symbols"),ko=rt("string-to-symbol-registry"),Se=rt("symbol-to-string-registry"),Qe=rt("wks"),$e=!We||!We.prototype||!We.prototype.findChild,st=x&&A((function(){return K(te({},"a",{get:function(){return te(this,"a",{value:7}).a}})).a!=7}))?function(Nn,Un,Zn){var ur=Kn(on,Un);ur&&delete on[Un],te(Nn,Un,Zn),ur&&Nn!==on&&te(on,Un,ur)}:te,an=function(Nn,Un){var Zn=zr[Nn]=K(nt);return Ft(Zn,{type:Ot,tag:Nn,description:Un}),x||(Zn.description=Un),Zn},en=function(Nn,Un,Zn){Nn===on&&en(jn,Un,Zn),L(Nn);var ur=B(Un);return L(Zn),E(zr,ur)?(Zn.enumerable?(E(Nn,Ye)&&Nn[Ye][ur]&&(Nn[Ye][ur]=!1),Zn=K(Zn,{enumerable:q(0,!1)})):(E(Nn,Ye)||te(Nn,Ye,q(1,{})),Nn[Ye][ur]=!0),st(Nn,ur,Zn)):te(Nn,ur,Zn)},Tn=function(Nn,Un){L(Nn);var Zn=H(Un),ur=X(Zn).concat(Yo(Zn));return Le(ur,(function(to){x&&!g(Sr,Zn,to)||en(Nn,to,Zn[to])})),Nn},Sr=function(Nn){var Un=B(Nn),Zn=g(br,this,Un);return!(this===on&&E(zr,Un)&&!E(jn,Un))&&(!(Zn||!E(this,Un)||!E(zr,Un)||E(this,Ye)&&this[Ye][Un])||Zn)},li=function(Nn,Un){var Zn=H(Nn),ur=B(Un);if(Zn!==on||!E(zr,ur)||E(jn,ur)){var to=Kn(Zn,ur);return!to||!E(zr,ur)||E(Zn,Ye)&&Zn[Ye][ur]||(to.enumerable=!0),to}},Ei=function(Nn){var Un=Gn(H(Nn)),Zn=[];return Le(Un,(function(ur){E(zr,ur)||E(Be,ur)||Dr(Zn,ur)})),Zn},Yo=function(Nn){var Un=Nn===on,Zn=Gn(Un?jn:H(Nn)),ur=[];return Le(Zn,(function(to){!E(zr,to)||Un&&!E(on,to)||Dr(ur,zr[to])})),ur};if(S||(Wt=function(){if(U(nt,this))throw sn("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?F(arguments[0]):void 0,Un=lt(Nn),Zn=function(ur){this===on&&g(Zn,jn,ur),E(this,Ye)&&E(this[Ye],Un)&&(this[Ye][Un]=!1),st(this,Un,q(1,ur))};return x&&$e&&st(on,Un,{configurable:!0,set:Zn}),an(Un,Nn)},Ne(nt=Wt.prototype,"toString",(function(){return Qt(this).tag})),Ne(Wt,"withoutSetter",(function(Nn){return an(lt(Nn),Nn)})),Te.f=Sr,je.f=en,we.f=li,ee.f=ue.f=Ei,ae.f=Yo,He.f=function(Nn){return an(St(Nn),Nn)},x&&(te(nt,"description",{configurable:!0,get:function(){return Qt(this).description}}),b||Ne(on,"propertyIsEnumerable",Sr,{unsafe:!0}))),s({global:!0,wrap:!0,forced:!S,sham:!S},{Symbol:Wt}),Le(X(Qe),(function(Nn){Jt(Nn)})),s({target:Ot,stat:!0,forced:!S},{for:function(Nn){var Un=F(Nn);if(E(ko,Un))return ko[Un];var Zn=Wt(Un);return ko[Un]=Zn,Se[Zn]=Un,Zn},keyFor:function(Nn){if(!D(Nn))throw sn(Nn+" is not a symbol");if(E(Se,Nn))return Se[Nn]},useSetter:function(){$e=!0},useSimple:function(){$e=!1}}),s({target:"Object",stat:!0,forced:!S,sham:!x},{create:function(Nn,Un){return Un===void 0?K(Nn):Tn(K(Nn),Un)},defineProperty:en,defineProperties:Tn,getOwnPropertyDescriptor:li}),s({target:"Object",stat:!0,forced:!S},{getOwnPropertyNames:Ei,getOwnPropertySymbols:Yo}),s({target:"Object",stat:!0,forced:A((function(){ae.f(1)}))},{getOwnPropertySymbols:function(Nn){return ae.f(W(Nn))}}),yn&&s({target:"JSON",stat:!0,forced:!S||A((function(){var Nn=Wt();return yn([Nn])!="[null]"||yn({a:Nn})!="{}"||yn(Object(Nn))!="{}"}))},{stringify:function(Nn,Un,Zn){var ur=Me(arguments),to=Un;if((R(Un)||Nn!==void 0)&&!D(Nn))return T(Un)||(Un=function(Lr,ml){if(I(to)&&(ml=g(to,this,Lr,ml)),!D(ml))return ml}),ur[1]=Un,f(yn,null,ur)}}),!nt[bt]){var ti=nt.valueOf;Ne(nt,bt,(function(Nn){return g(ti,this)}))}Fe(Wt,Ot),Be[Ye]=!0},function(n,a,r){var s=r(7),c=r(152),v=r(153),f=r(3),g=r(57),_=r(28),b=_("iterator"),x=_("toStringTag"),S=f.values,A=function(T,I){if(T){if(T[b]!==S)try{g(T,b,S)}catch{T[b]=S}if(T[x]||g(T,x,I),c[I]){for(var R in f)if(T[R]!==f[R])try{g(T,R,f[R])}catch{T[R]=f[R]}}}};for(var E in c)A(s[E]&&s[E].prototype,E);A(v,"DOMTokenList")},function(n,a,r){var s=r(151).charAt,c=r(39),v=r(58),f=r(116),g="String Iterator",_=v.set,b=v.getterFor(g);f(String,"String",(function(x){_(this,{type:g,string:c(x),index:0})}),(function(){var x,S=b(this),A=S.string,E=S.index;return E>=A.length?{value:void 0,done:!0}:(x=s(A,E),S.index+=x.length,{value:x,done:!1})}))},function(n,a,r){(function(s){var c=function(v){return v&&v.Math==Math&&v};n.exports=c(typeof globalThis=="object"&&globalThis)||c(typeof window=="object"&&window)||c(typeof self=="object"&&self)||c(typeof s=="object"&&s)||(function(){return this})()||Function("return this")()}).call(this,r(68))},function(n,a,r){var s=r(16),c=r(36),v=r(7),f=r(15),g=r(35),_=r(30),b=r(54),x=r(39),S=r(38).f,A=r(134),E=v.Symbol,T=E&&E.prototype;if(c&&_(E)&&(!("description"in T)||E().description!==void 0)){var I={},R=function(){var F=arguments.length<1||arguments[0]===void 0?void 0:x(arguments[0]),q=b(T,this)?new E(F):F===void 0?E():E(F);return F===""&&(I[q]=!0),q};A(R,E),R.prototype=T,T.constructor=R;var U=String(E("test"))=="Symbol(test)",D=f(T.toString),L=f(T.valueOf),W=/^Symbol\((.*)\)[^)]+$/,H=f("".replace),B=f("".slice);S(T,"description",{configurable:!0,get:function(){var F=L(this),q=D(F);if(g(I,F))return"";var K=U?B(q,7,-1):H(q,W,"$1");return K===""?void 0:K}}),s({global:!0,forced:!0},{Symbol:R})}},function(n,a,r){r(141)("iterator")},function(n,a,r){r.d(a,"a",(function(){return f.a})),r.d(a,"c",(function(){return f.e})),r.d(a,"h",(function(){return W})),r.d(a,"i",(function(){return U})),r.d(a,"j",(function(){return I})),r.d(a,"b",(function(){return we})),r.d(a,"e",(function(){return Ne})),r.d(a,"f",(function(){return je})),r.d(a,"g",(function(){return zr}));var s,c,v,f=r(0),g=0,_=[],b=f.i.__b,x=f.i.__r,S=f.i.diffed,A=f.i.__c,E=f.i.unmount;function T(Se,Qe){f.i.__h&&f.i.__h(c,Se,g||Qe),g=0;var $e=c.__H||(c.__H={__:[],__h:[]});return Se>=$e.__.length&&$e.__.push({}),$e.__[Se]}function I(Se){return g=1,R(ee,Se)}function R(Se,Qe,$e){var st=T(s++,2);return st.t=Se,st.__c||(st.__=[$e?$e(Qe):ee(void 0,Qe),function(an){var en=st.t(st.__[0],an);st.__[0]!==en&&(st.__=[en,st.__[1]],st.__c.setState({}))}],st.__c=c),st.__}function U(Se,Qe){var $e=T(s++,3);!f.i.__s&&X($e.__H,Qe)&&($e.__=Se,$e.__H=Qe,c.__H.__h.push($e))}function D(Se,Qe){var $e=T(s++,4);!f.i.__s&&X($e.__H,Qe)&&($e.__=Se,$e.__H=Qe,c.__h.push($e))}function L(Se,Qe){var $e=T(s++,7);return X($e.__H,Qe)&&($e.__=Se(),$e.__H=Qe,$e.__h=Se),$e.__}function W(Se,Qe){return g=8,L((function(){return Se}),Qe)}function H(){var Se;for(_.sort((function(Qe,$e){return Qe.__v.__b-$e.__v.__b}));Se=_.pop();)if(Se.__P)try{Se.__H.__h.forEach(q),Se.__H.__h.forEach(K),Se.__H.__h=[]}catch(Qe){Se.__H.__h=[],f.i.__e(Qe,Se.__v)}}f.i.__b=function(Se){c=null,b&&b(Se)},f.i.__r=function(Se){x&&x(Se),s=0;var Qe=(c=Se.__c).__H;Qe&&(Qe.__h.forEach(q),Qe.__h.forEach(K),Qe.__h=[])},f.i.diffed=function(Se){S&&S(Se);var Qe=Se.__c;Qe&&Qe.__H&&Qe.__H.__h.length&&(_.push(Qe)!==1&&v===f.i.requestAnimationFrame||((v=f.i.requestAnimationFrame)||F)(H)),c=null},f.i.__c=function(Se,Qe){Qe.some((function($e){try{$e.__h.forEach(q),$e.__h=$e.__h.filter((function(st){return!st.__||K(st)}))}catch(st){Qe.some((function(an){an.__h&&(an.__h=[])})),Qe=[],f.i.__e(st,$e.__v)}})),A&&A(Se,Qe)},f.i.unmount=function(Se){E&&E(Se);var Qe,$e=Se.__c;$e&&$e.__H&&($e.__H.__.forEach((function(st){try{q(st)}catch(an){Qe=an}})),Qe&&f.i.__e(Qe,$e.__v))};var B=typeof requestAnimationFrame=="function";function F(Se){var Qe,$e=function(){clearTimeout(st),B&&cancelAnimationFrame(Qe),setTimeout(Se)},st=setTimeout($e,100);B&&(Qe=requestAnimationFrame($e))}function q(Se){var Qe=c,$e=Se.__c;typeof $e=="function"&&(Se.__c=void 0,$e()),c=Qe}function K(Se){var Qe=c;Se.__c=Se.__(),c=Qe}function X(Se,Qe){return!Se||Se.length!==Qe.length||Qe.some((function($e,st){return $e!==Se[st]}))}function ee(Se,Qe){return typeof Qe=="function"?Qe(Se):Qe}function ue(Se,Qe){for(var $e in Qe)Se[$e]=Qe[$e];return Se}function ae(Se,Qe){for(var $e in Se)if($e!=="__source"&&!($e in Qe))return!0;for(var st in Qe)if(st!=="__source"&&Se[st]!==Qe[st])return!0;return!1}function we(Se){this.props=Se}function je(Se,Qe){function $e(an){var en=this.props.ref,Tn=en==an.ref;return!Tn&&en&&(en.call?en(null):en.current=null),Qe?!Qe(this.props,an)||!Tn:ae(this.props,an)}function st(an){return this.shouldComponentUpdate=$e,Object(f.e)(Se,an)}return st.displayName="Memo("+(Se.displayName||Se.name)+")",st.prototype.isReactComponent=!0,st.__f=!0,st}(we.prototype=new f.a).isPureReactComponent=!0,we.prototype.shouldComponentUpdate=function(Se,Qe){return ae(this.props,Se)||ae(this.state,Qe)};var Te=f.i.__b;f.i.__b=function(Se){Se.type&&Se.type.__f&&Se.ref&&(Se.props.ref=Se.ref,Se.ref=null),Te&&Te(Se)};var Me=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ne(Se){function Qe($e,st){var an=ue({},$e);return delete an.ref,Se(an,!(st=$e.ref||st)||typeof st=="object"&&!("current"in st)?null:st)}return Qe.$$typeof=Me,Qe.render=Qe,Qe.prototype.isReactComponent=Qe.__f=!0,Qe.displayName="ForwardRef("+(Se.displayName||Se.name)+")",Qe}var rt=function(Se,Qe){return Se==null?null:Object(f.k)(Object(f.k)(Se).map(Qe))},tt={map:rt,forEach:rt,count:function(Se){return Se?Object(f.k)(Se).length:0},only:function(Se){var Qe=Object(f.k)(Se);if(Qe.length!==1)throw"Children.only";return Qe[0]},toArray:f.k},Be=f.i.__e;f.i.__e=function(Se,Qe,$e){if(Se.then){for(var st,an=Qe;an=an.__;)if((st=an.__c)&&st.__c)return Qe.__e==null&&(Qe.__e=$e.__e,Qe.__k=$e.__k),st.__c(Se,Qe)}Be(Se,Qe,$e)};var lt=f.i.unmount;function St(Se,Qe,$e){return Se&&(Se.__c&&Se.__c.__H&&(Se.__c.__H.__.forEach((function(st){typeof st.__c=="function"&&st.__c()})),Se.__c.__H=null),(Se=ue({},Se)).__c!=null&&(Se.__c.__P===$e&&(Se.__c.__P=Qe),Se.__c=null),Se.__k=Se.__k&&Se.__k.map((function(st){return St(st,Qe,$e)}))),Se}function He(Se,Qe,$e){return Se&&(Se.__v=null,Se.__k=Se.__k&&Se.__k.map((function(st){return He(st,Qe,$e)})),Se.__c&&Se.__c.__P===Qe&&(Se.__e&&$e.insertBefore(Se.__e,Se.__d),Se.__c.__e=!0,Se.__c.__P=$e)),Se}function Jt(){this.__u=0,this.t=null,this.__b=null}function Fe(Se){var Qe=Se.__.__c;return Qe&&Qe.__e&&Qe.__e(Se)}function me(){this.u=null,this.o=null}f.i.unmount=function(Se){var Qe=Se.__c;Qe&&Qe.__R&&Qe.__R(),Qe&&Se.__h===!0&&(Se.type=null),lt&<(Se)},(Jt.prototype=new f.a).__c=function(Se,Qe){var $e=Qe.__c,st=this;st.t==null&&(st.t=[]),st.t.push($e);var an=Fe(st.__v),en=!1,Tn=function(){en||(en=!0,$e.__R=null,an?an(Sr):Sr())};$e.__R=Tn;var Sr=function(){if(!--st.__u){if(st.state.__e){var Ei=st.state.__e;st.__v.__k[0]=He(Ei,Ei.__c.__P,Ei.__c.__O)}var Yo;for(st.setState({__e:st.__b=null});Yo=st.t.pop();)Yo.forceUpdate()}},li=Qe.__h===!0;st.__u++||li||st.setState({__e:st.__b=st.__v.__k[0]}),Se.then(Tn,Tn)},Jt.prototype.componentWillUnmount=function(){this.t=[]},Jt.prototype.render=function(Se,Qe){if(this.__b){if(this.__v.__k){var $e=document.createElement("div"),st=this.__v.__k[0].__c;this.__v.__k[0]=St(this.__b,$e,st.__O=st.__P)}this.__b=null}var an=Qe.__e&&Object(f.e)(f.b,null,Se.fallback);return an&&(an.__h=null),[Object(f.e)(f.b,null,Qe.__e?null:Se.children),an]};var Le=function(Se,Qe,$e){if(++$e[1]===$e[0]&&Se.o.delete(Qe),Se.props.revealOrder&&(Se.props.revealOrder[0]!=="t"||!Se.o.size))for($e=Se.u;$e;){for(;$e.length>3;)$e.pop()();if($e[1]<$e[0])break;Se.u=$e=$e[2]}};function Ye(Se){return this.getChildContext=function(){return Se.context},Se.children}function Ot(Se){var Qe=this,$e=Se.i;Qe.componentWillUnmount=function(){Object(f.j)(null,Qe.l),Qe.l=null,Qe.i=null},Qe.i&&Qe.i!==$e&&Qe.componentWillUnmount(),Se.__v?(Qe.l||(Qe.i=$e,Qe.l={nodeType:1,parentNode:$e,childNodes:[],appendChild:function(st){this.childNodes.push(st),Qe.i.appendChild(st)},insertBefore:function(st,an){this.childNodes.push(st),Qe.i.appendChild(st)},removeChild:function(st){this.childNodes.splice(this.childNodes.indexOf(st)>>>1,1),Qe.i.removeChild(st)}}),Object(f.j)(Object(f.e)(Ye,{context:Qe.context},Se.__v),Qe.l)):Qe.l&&Qe.componentWillUnmount()}(me.prototype=new f.a).__e=function(Se){var Qe=this,$e=Fe(Qe.__v),st=Qe.o.get(Se);return st[0]++,function(an){var en=function(){Qe.props.revealOrder?(st.push(an),Le(Qe,Se,st)):an()};$e?$e(en):en()}},me.prototype.render=function(Se){this.u=null,this.o=new Map;var Qe=Object(f.k)(Se.children);Se.revealOrder&&Se.revealOrder[0]==="b"&&Qe.reverse();for(var $e=Qe.length;$e--;)this.o.set(Qe[$e],this.u=[1,0,this.u]);return Se.children},me.prototype.componentDidUpdate=me.prototype.componentDidMount=function(){var Se=this;this.o.forEach((function(Qe,$e){Le(Se,$e,Qe)}))};var bt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Ft=/^(?: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]/,Qt=typeof document<"u",on=function(Se){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(Se)};f.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(Se){Object.defineProperty(f.a.prototype,Se,{configurable:!0,get:function(){return this["UNSAFE_"+Se]},set:function(Qe){Object.defineProperty(this,Se,{configurable:!0,writable:!0,value:Qe})}})}));var Wt=f.i.event;function nt(){}function sn(){return this.cancelBubble}function We(){return this.defaultPrevented}f.i.event=function(Se){return Wt&&(Se=Wt(Se)),Se.persist=nt,Se.isPropagationStopped=sn,Se.isDefaultPrevented=We,Se.nativeEvent=Se};var yn,Kn={configurable:!0,get:function(){return this.class}},te=f.i.vnode;f.i.vnode=function(Se){var Qe=Se.type,$e=Se.props,st=$e;if(typeof Qe=="string"){var an=Qe.indexOf("-")===-1;for(var en in st={},$e){var Tn=$e[en];Qt&&en==="children"&&Qe==="noscript"||en==="value"&&"defaultValue"in $e&&Tn==null||(en==="defaultValue"&&"value"in $e&&$e.value==null?en="value":en==="download"&&Tn===!0?Tn="":/ondoubleclick/i.test(en)?en="ondblclick":/^onchange(textarea|input)/i.test(en+Qe)&&!on($e.type)?en="oninput":/^onfocus$/i.test(en)?en="onfocusin":/^onblur$/i.test(en)?en="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(en)?en=en.toLowerCase():an&&Ft.test(en)?en=en.replace(/[A-Z0-9]/,"-$&").toLowerCase():Tn===null&&(Tn=void 0),st[en]=Tn)}Qe=="select"&&st.multiple&&Array.isArray(st.value)&&(st.value=Object(f.k)($e.children).forEach((function(Sr){Sr.props.selected=st.value.indexOf(Sr.props.value)!=-1}))),Qe=="select"&&st.defaultValue!=null&&(st.value=Object(f.k)($e.children).forEach((function(Sr){Sr.props.selected=st.multiple?st.defaultValue.indexOf(Sr.props.value)!=-1:st.defaultValue==Sr.props.value}))),Se.props=st,$e.class!=$e.className&&(Kn.enumerable="className"in $e,$e.className!=null&&(st.class=$e.className),Object.defineProperty(st,"className",Kn))}Se.$$typeof=bt,te&&te(Se)};var Gn=f.i.__r;f.i.__r=function(Se){Gn&&Gn(Se),yn=Se.__c};var br={ReactCurrentDispatcher:{current:{readContext:function(Se){return yn.__n[Se.__c].props.value}}}};function Dr(Se){return!!Se&&Se.$$typeof===bt}var zr=function(Se,Qe){return Se(Qe)},jn=f.b,ko={useState:I,useReducer:R,useEffect:U,useLayoutEffect:D,useRef:function(Se){return g=5,L((function(){return{current:Se}}),[])},useImperativeHandle:function(Se,Qe,$e){g=6,D((function(){typeof Se=="function"?Se(Qe()):Se&&(Se.current=Qe())}),$e==null?$e:$e.concat(Se))},useMemo:L,useCallback:W,useContext:function(Se){var Qe=c.context[Se.__c],$e=T(s++,9);return $e.c=Se,Qe?($e.__==null&&($e.__=!0,Qe.sub(c)),Qe.props.value):Se.__},useDebugValue:function(Se,Qe){f.i.useDebugValue&&f.i.useDebugValue(Qe?Qe(Se):Se)},version:"17.0.2",Children:tt,render:function(Se,Qe,$e){return Qe.__k==null&&(Qe.textContent=""),Object(f.j)(Se,Qe),typeof $e=="function"&&$e(),Se?Se.__c:null},hydrate:function(Se,Qe,$e){return Object(f.h)(Se,Qe),typeof $e=="function"&&$e(),Se?Se.__c:null},unmountComponentAtNode:function(Se){return!!Se.__k&&(Object(f.j)(null,Se),!0)},createPortal:function(Se,Qe){return Object(f.e)(Ot,{__v:Se,i:Qe})},createElement:f.e,createContext:f.d,createFactory:function(Se){return f.e.bind(null,Se)},cloneElement:function(Se){return Dr(Se)?f.c.apply(null,arguments):Se},createRef:f.f,Fragment:f.b,isValidElement:Dr,findDOMNode:function(Se){return Se&&(Se.base||Se.nodeType===1&&Se)||null},Component:f.a,PureComponent:we,memo:je,forwardRef:Ne,flushSync:function(Se,Qe){return Se(Qe)},unstable_batchedUpdates:zr,StrictMode:jn,Suspense:Jt,SuspenseList:me,lazy:function(Se){var Qe,$e,st;function an(en){if(Qe||(Qe=Se()).then((function(Tn){$e=Tn.default||Tn}),(function(Tn){st=Tn})),st)throw st;if(!$e)throw Qe;return Object(f.e)($e,en)}return an.displayName="Lazy",an.__f=!0,an},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:br};a.d=ko},function(n,a,r){var s=r(7),c=r(152),v=r(153),f=r(187),g=r(57),_=function(x){if(x&&x.forEach!==f)try{g(x,"forEach",f)}catch{x.forEach=f}};for(var b in c)c[b]&&_(s[b]&&s[b].prototype);_(v)},function(n,a,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,a,r){var s=r(16),c=r(18),v=r(40),f=r(101),g=r(143);s({target:"Object",stat:!0,forced:c((function(){f(1)})),sham:!g},{getPrototypeOf:function(_){return f(v(_))}})},function(n,a,r){var s=r(16),c=r(46),v=r(76),f=r(203),g=r(165),_=r(32),b=r(33),x=r(60),S=r(18),A=c("Reflect","construct"),E=Object.prototype,T=[].push,I=S((function(){function D(){}return!(A((function(){}),[],D)instanceof D)})),R=!S((function(){A((function(){}))})),U=I||R;s({target:"Reflect",stat:!0,forced:U,sham:U},{construct:function(D,L){g(D),_(L);var W=arguments.length<3?D:g(arguments[2]);if(R&&!I)return A(D,L,W);if(D==W){switch(L.length){case 0:return new D;case 1:return new D(L[0]);case 2:return new D(L[0],L[1]);case 3:return new D(L[0],L[1],L[2]);case 4:return new D(L[0],L[1],L[2],L[3])}var H=[null];return v(T,H,L),new(v(f,D,H))}var B=W.prototype,F=x(b(B)?B:E),q=v(D,F,L);return b(q)?q:F}})},function(n,a){var r=Function.prototype,s=r.bind,c=r.call,v=s&&s.bind(c);n.exports=s?function(f){return f&&v(c,f)}:function(f){return f&&function(){return c.apply(f,arguments)}}},function(n,a,r){var s=r(7),c=r(50).f,v=r(57),f=r(42),g=r(110),_=r(134),b=r(95);n.exports=function(x,S){var A,E,T,I,R,U=x.target,D=x.global,L=x.stat;if(A=D?s:L?s[U]||g(U,{}):(s[U]||{}).prototype)for(E in S){if(I=S[E],T=x.noTargetGet?(R=c(A,E))&&R.value:A[E],!b(D?E:U+(L?".":"#")+E,x.forced)&&T!==void 0){if(typeof I==typeof T)continue;_(I,T)}(x.sham||T&&T.sham)&&v(I,"sham",!0),f(A,E,I,x)}}},function(n,a,r){var s=r(16),c=r(7),v=r(96),f=r(99),g=r(33),_=r(75),b=r(45),x=r(41),S=r(63),A=r(28),E=r(81),T=r(98),I=E("slice"),R=A("species"),U=c.Array,D=Math.max;s({target:"Array",proto:!0,forced:!I},{slice:function(L,W){var H,B,F,q=x(this),K=b(q),X=_(L,K),ee=_(W===void 0?K:W,K);if(v(q)&&(H=q.constructor,(f(H)&&(H===U||v(H.prototype))||g(H)&&(H=H[R])===null)&&(H=void 0),H===U||H===void 0))return T(q,X,ee);for(B=new(H===void 0?U:H)(D(ee-X,0)),F=0;X<ee;X++,F++)X in q&&S(B,F,q[X]);return B.length=F,B}})},function(n,a){n.exports=function(r){try{return!!r()}catch{return!0}}},function(n,a,r){var s=r(16),c=r(103);s({target:"RegExp",proto:!0,forced:/./.exec!==c},{exec:c})},function(n,a,r){var s=r(16),c=r(40),v=r(77);s({target:"Object",stat:!0,forced:r(18)((function(){v(1)}))},{keys:function(f){return v(c(f))}})},function(n,a,r){var s=r(36),c=r(73).EXISTS,v=r(15),f=r(38).f,g=Function.prototype,_=v(g.toString),b=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,x=v(b.exec);s&&!c&&f(g,"name",{configurable:!0,get:function(){try{return x(b,_(this))[1]}catch{return""}}})},function(n,a,r){var s=r(16),c=r(18),v=r(41),f=r(50).f,g=r(36),_=c((function(){f(1)}));s({target:"Object",stat:!0,forced:!g||_,sham:!g},{getOwnPropertyDescriptor:function(b,x){return f(v(b),x)}})},function(n,a,r){var s=r(16),c=r(188);s({target:"Array",stat:!0,forced:!r(120)((function(v){Array.from(v)}))},{from:c})},function(n,a,r){var s=r(16),c=r(79).filter;s({target:"Array",proto:!0,forced:!r(81)("filter")},{filter:function(v){return c(this,v,arguments.length>1?arguments[1]:void 0)}})},function(n,a,r){var s=r(16),c=r(36),v=r(135),f=r(41),g=r(50),_=r(63);s({target:"Object",stat:!0,sham:!c},{getOwnPropertyDescriptors:function(b){for(var x,S,A=f(b),E=g.f,T=v(A),I={},R=0;T.length>R;)(S=E(A,x=T[R++]))!==void 0&&_(I,x,S);return I}})},,function(n,a,r){var s=r(16),c=r(7),v=r(18),f=r(96),g=r(33),_=r(40),b=r(45),x=r(63),S=r(115),A=r(81),E=r(28),T=r(70),I=E("isConcatSpreadable"),R=9007199254740991,U="Maximum allowed index exceeded",D=c.TypeError,L=T>=51||!v((function(){var B=[];return B[I]=!1,B.concat()[0]!==B})),W=A("concat"),H=function(B){if(!g(B))return!1;var F=B[I];return F!==void 0?!!F:f(B)};s({target:"Array",proto:!0,forced:!L||!W},{concat:function(B){var F,q,K,X,ee,ue=_(this),ae=S(ue,0),we=0;for(F=-1,K=arguments.length;F<K;F++)if(H(ee=F===-1?ue:arguments[F])){if(we+(X=b(ee))>R)throw D(U);for(q=0;q<X;q++,we++)q in ee&&x(ae,we,ee[q])}else{if(we>=R)throw D(U);x(ae,we++,ee)}return ae.length=we,ae}})},function(n,a,r){var s=r(7),c=r(89),v=r(35),f=r(90),g=r(108),_=r(132),b=c("wks"),x=s.Symbol,S=x&&x.for,A=_?x:x&&x.withoutSetter||f;n.exports=function(E){if(!v(b,E)||!g&&typeof b[E]!="string"){var T="Symbol."+E;g&&v(x,E)?b[E]=x[E]:b[E]=_&&S?S(T):A(T)}return b[E]}},function(n,a,r){var s=r(16),c=r(202);s({target:"Object",stat:!0,forced:Object.assign!==c},{assign:c})},function(n,a){n.exports=function(r){return typeof r=="function"}},function(n,a,r){var s=r(106),c=typeof self=="object"&&self&&self.Object===Object&&self,v=s.a||c||Function("return this")();a.a=v},function(n,a,r){var s=r(7),c=r(33),v=s.String,f=s.TypeError;n.exports=function(g){if(c(g))return g;throw f(v(g)+" is not an object")}},function(n,a,r){var s=r(30);n.exports=function(c){return typeof c=="object"?c!==null:s(c)}},function(n,a){var r=Function.prototype.call;n.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(n,a,r){var s=r(15),c=r(40),v=s({}.hasOwnProperty);n.exports=Object.hasOwn||function(f,g){return v(c(f),g)}},function(n,a,r){var s=r(18);n.exports=!s((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}))},function(n,a,r){var s=r(16),c=r(79).map;s({target:"Array",proto:!0,forced:!r(81)("map")},{map:function(v){return c(this,v,arguments.length>1?arguments[1]:void 0)}})},function(n,a,r){var s=r(7),c=r(36),v=r(133),f=r(32),g=r(86),_=s.TypeError,b=Object.defineProperty;a.f=c?b:function(x,S,A){if(f(x),S=g(S),f(A),v)try{return b(x,S,A)}catch{}if("get"in A||"set"in A)throw _("Accessors not supported");return"value"in A&&(x[S]=A.value),x}},function(n,a,r){var s=r(7),c=r(97),v=s.String;n.exports=function(f){if(c(f)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return v(f)}},function(n,a,r){var s=r(7),c=r(44),v=s.Object;n.exports=function(f){return v(c(f))}},function(n,a,r){var s=r(85),c=r(44);n.exports=function(v){return s(c(v))}},function(n,a,r){var s=r(7),c=r(30),v=r(35),f=r(57),g=r(110),_=r(92),b=r(58),x=r(73).CONFIGURABLE,S=b.get,A=b.enforce,E=String(String).split("String");(n.exports=function(T,I,R,U){var D,L=!!U&&!!U.unsafe,W=!!U&&!!U.enumerable,H=!!U&&!!U.noTargetGet,B=U&&U.name!==void 0?U.name:I;c(R)&&(String(B).slice(0,7)==="Symbol("&&(B="["+String(B).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!v(R,"name")||x&&R.name!==B)&&f(R,"name",B),(D=A(R)).source||(D.source=E.join(typeof B=="string"?B:""))),T!==s?(L?!H&&T[I]&&(W=!0):delete T[I],W?T[I]=R:f(T,I,R)):W?T[I]=R:g(I,R)})(Function.prototype,"toString",(function(){return c(this)&&S(this).source||_(this)}))},function(n,a,r){(function(s){r.d(a,"d",(function(){return f})),r.d(a,"c",(function(){return g})),r.d(a,"b",(function(){return _})),r.d(a,"a",(function(){return x}));var c=r(10),v=function(S,A){var E=typeof Symbol=="function"&&S[Symbol.iterator];if(!E)return S;var T,I,R=E.call(S),U=[];try{for(;(A===void 0||A-- >0)&&!(T=R.next()).done;)U.push(T.value)}catch(D){I={error:D}}finally{try{T&&!T.done&&(E=R.return)&&E.call(R)}finally{if(I)throw I.error}}return U};function f(){var S=v(Object(c.j)(0),2)[1];return Object(c.h)((function(){S((function(A){return A+1}))}),[])}function g(S){if(!S||typeof S!="object")return!1;var A=Object.getPrototypeOf(S);return!A||A===Object.prototype}function _(S){return typeof Symbol=="function"?Symbol.for(S):"__$mobx-react "+S+"__"}var b={};function x(){return typeof window<"u"?window:s!==void 0?s:typeof self<"u"?self:b}}).call(this,r(68))},function(n,a,r){var s=r(7).TypeError;n.exports=function(c){if(c==null)throw s("Can't call method on "+c);return c}},function(n,a,r){var s=r(94);n.exports=function(c){return s(c.length)}},function(n,a,r){var s=r(7),c=r(30),v=function(f){return c(f)?f:void 0};n.exports=function(f,g){return arguments.length<2?v(s[f]):s[f]&&s[f][g]}},function(n,a,r){var s=r(16),c=r(34),v=r(33),f=r(32),g=r(204),_=r(50),b=r(101);s({target:"Reflect",stat:!0},{get:function x(S,A){var E,T,I=arguments.length<3?S:arguments[2];return f(S)===I?S[A]:(E=_.f(S,A))?g(E)?E.value:E.get===void 0?void 0:c(E.get,I):v(T=b(S))?x(T,A,I):void 0}})},function(n,a,r){(function(s){var c=r(31),v=r(171),f=t&&!t.nodeType&&t,g=f&&typeof s=="object"&&s&&!s.nodeType&&s,_=g&&g.exports===f?c.a.Buffer:void 0,b=(_?_.isBuffer:void 0)||v.a;a.a=b}).call(this,r(122)(n))},function(n,a,r){(function(s){var c=r(106),v=t&&!t.nodeType&&t,f=v&&typeof s=="object"&&s&&!s.nodeType&&s,g=f&&f.exports===v&&c.a.process,_=(function(){try{var b=f&&f.require&&f.require("util").types;return b||g&&g.binding&&g.binding("util")}catch{}})();a.a=_}).call(this,r(122)(n))},function(n,a,r){var s=r(36),c=r(34),v=r(84),f=r(69),g=r(41),_=r(86),b=r(35),x=r(133),S=Object.getOwnPropertyDescriptor;a.f=s?S:function(A,E){if(A=g(A),E=_(E),x)try{return S(A,E)}catch{}if(b(A,E))return f(!c(v.f,A,E),A[E])}},function(n,a,r){var s=r(15),c=s({}.toString),v=s("".slice);n.exports=function(f){return v(c(f),8,-1)}},function(n,a,r){r(182)("Map",(function(s){return function(){return s(this,arguments.length?arguments[0]:void 0)}}),r(186))},function(n,a,r){var s=r(16),c=r(220).entries;s({target:"Object",stat:!0},{entries:function(v){return c(v)}})},function(n,a,r){var s=r(15);n.exports=s({}.isPrototypeOf)},function(n,a,r){var s=r(46);n.exports=s("navigator","userAgent")||""},function(n,a,r){var s=r(7),c=r(30),v=r(88),f=s.TypeError;n.exports=function(g){if(c(g))return g;throw f(v(g)+" is not a function")}},function(n,a,r){var s=r(36),c=r(38),v=r(69);n.exports=s?function(f,g,_){return c.f(f,g,v(1,_))}:function(f,g,_){return f[g]=_,f}},function(n,a,r){var s,c,v,f=r(175),g=r(7),_=r(15),b=r(33),x=r(57),S=r(35),A=r(109),E=r(93),T=r(72),I="Object already initialized",R=g.TypeError,U=g.WeakMap;if(f||A.state){var D=A.state||(A.state=new U),L=_(D.get),W=_(D.has),H=_(D.set);s=function(F,q){if(W(D,F))throw new R(I);return q.facade=F,H(D,F,q),q},c=function(F){return L(D,F)||{}},v=function(F){return W(D,F)}}else{var B=E("state");T[B]=!0,s=function(F,q){if(S(F,B))throw new R(I);return q.facade=F,x(F,B,q),q},c=function(F){return S(F,B)?F[B]:{}},v=function(F){return S(F,B)}}n.exports={set:s,get:c,has:v,enforce:function(F){return v(F)?c(F):s(F,{})},getterFor:function(F){return function(q){var K;if(!b(q)||(K=c(q)).type!==F)throw R("Incompatible receiver, "+F+" required");return K}}}},function(n,a){var r=Math.ceil,s=Math.floor;n.exports=function(c){var v=+c;return v!=v||v===0?0:(v>0?s:r)(v)}},function(n,a,r){var s,c=r(32),v=r(176),f=r(111),g=r(72),_=r(138),b=r(91),x=r(93),S=x("IE_PROTO"),A=function(){},E=function(R){return"<script>"+R+"<\/script>"},T=function(R){R.write(E("")),R.close();var U=R.parentWindow.Object;return R=null,U},I=function(){try{s=new ActiveXObject("htmlfile")}catch{}var R,U;I=typeof document<"u"?document.domain&&s?T(s):((U=b("iframe")).style.display="none",_.appendChild(U),U.src="javascript:",(R=U.contentWindow.document).open(),R.write(E("document.F=Object")),R.close(),R.F):T(s);for(var D=f.length;D--;)delete I.prototype[f[D]];return I()};g[S]=!0,n.exports=Object.create||function(R,U){var D;return R!==null?(A.prototype=c(R),D=new A,A.prototype=null,D[S]=R):D=I(),U===void 0?D:v(D,U)}},function(n,a,r){var s=r(36),c=r(7),v=r(15),f=r(95),g=r(42),_=r(35),b=r(148),x=r(54),S=r(87),A=r(131),E=r(18),T=r(74).f,I=r(50).f,R=r(38).f,U=r(160),D=r(161).trim,L="Number",W=c.Number,H=W.prototype,B=c.TypeError,F=v("".slice),q=v("".charCodeAt),K=function(je){var Te=A(je,"number");return typeof Te=="bigint"?Te:X(Te)},X=function(je){var Te,Me,Ne,rt,tt,Be,lt,St,He=A(je,"number");if(S(He))throw B("Cannot convert a Symbol value to a number");if(typeof He=="string"&&He.length>2){if(He=D(He),(Te=q(He,0))===43||Te===45){if((Me=q(He,2))===88||Me===120)return NaN}else if(Te===48){switch(q(He,1)){case 66:case 98:Ne=2,rt=49;break;case 79:case 111:Ne=8,rt=55;break;default:return+He}for(Be=(tt=F(He,2)).length,lt=0;lt<Be;lt++)if((St=q(tt,lt))<48||St>rt)return NaN;return parseInt(tt,Ne)}}return+He};if(f(L,!W(" 0o1")||!W("0b1")||W("+0x1"))){for(var ee,ue=function(je){var Te=arguments.length<1?0:W(K(je)),Me=this;return x(H,Me)&&E((function(){U(Me)}))?b(Object(Te),Me,ue):Te},ae=s?T(W):"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(","),we=0;ae.length>we;we++)_(W,ee=ae[we])&&!_(ue,ee)&&R(ue,ee,I(W,ee));ue.prototype=H,H.constructor=ue,g(c,L,ue)}},function(n,a,r){var s=r(56);n.exports=function(c,v){var f=c[v];return f==null?void 0:s(f)}},function(n,a,r){var s=r(86),c=r(38),v=r(69);n.exports=function(f,g,_){var b=s(g);b in f?c.f(f,b,v(0,_)):f[b]=_}},function(n,a,r){var s=r(15),c=r(56),v=s(s.bind);n.exports=function(f,g){return c(f),g===void 0?f:v?v(f,g):function(){return f.apply(g,arguments)}}},function(n,a,r){var s=r(16),c=r(15),v=r(85),f=r(41),g=r(121),_=c([].join),b=v!=Object,x=g("join",",");s({target:"Array",proto:!0,forced:b||!x},{join:function(S){return _(f(this),S===void 0?",":S)}})},function(n,a,r){var s=r(15),c=r(73).PROPER,v=r(42),f=r(32),g=r(54),_=r(39),b=r(18),x=r(154),S="toString",A=RegExp.prototype,E=A.toString,T=s(x),I=b((function(){return E.call({source:"a",flags:"b"})!="/a/b"})),R=c&&E.name!=S;(I||R)&&v(RegExp.prototype,S,(function(){var U=f(this),D=_(U.source),L=U.flags;return"/"+D+"/"+_(L===void 0&&g(A,U)&&!("flags"in A)?T(U):L)}),{unsafe:!0})},function(n,a,r){var s=r(16),c=r(217),v=r(100);s({target:"Array",proto:!0},{fill:c}),v("fill")},function(n,a){var r;r=(function(){return this})();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}n.exports=r},function(n,a){n.exports=function(r,s){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:s}}},function(n,a,r){var s,c,v=r(7),f=r(55),g=v.process,_=v.Deno,b=g&&g.versions||_&&_.version,x=b&&b.v8;x&&(c=(s=x.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!c&&f&&(!(s=f.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=f.match(/Chrome\/(\d+)/))&&(c=+s[1]),n.exports=c},function(n,a){n.exports=!1},function(n,a){n.exports={}},function(n,a,r){var s=r(36),c=r(35),v=Function.prototype,f=s&&Object.getOwnPropertyDescriptor,g=c(v,"name"),_=g&&(function(){}).name==="something",b=g&&(!s||s&&f(v,"name").configurable);n.exports={EXISTS:g,PROPER:_,CONFIGURABLE:b}},function(n,a,r){var s=r(136),c=r(111).concat("length","prototype");a.f=Object.getOwnPropertyNames||function(v){return s(v,c)}},function(n,a,r){var s=r(59),c=Math.max,v=Math.min;n.exports=function(f,g){var _=s(f);return _<0?c(_+g,0):v(_,g)}},function(n,a){var r=Function.prototype,s=r.apply,c=r.bind,v=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(c?v.bind(s):function(){return v.apply(s,arguments)})},function(n,a,r){var s=r(136),c=r(111);n.exports=Object.keys||function(v){return s(v,c)}},function(n,a,r){var s=r(38).f,c=r(35),v=r(28)("toStringTag");n.exports=function(f,g,_){f&&!c(f=_?f:f.prototype,v)&&s(f,v,{configurable:!0,value:g})}},function(n,a,r){var s=r(64),c=r(15),v=r(85),f=r(40),g=r(45),_=r(115),b=c([].push),x=function(S){var A=S==1,E=S==2,T=S==3,I=S==4,R=S==6,U=S==7,D=S==5||R;return function(L,W,H,B){for(var F,q,K=f(L),X=v(K),ee=s(W,H),ue=g(X),ae=0,we=B||_,je=A?we(L,ue):E||U?we(L,0):void 0;ue>ae;ae++)if((D||ae in X)&&(q=ee(F=X[ae],ae,K),S))if(A)je[ae]=q;else if(q)switch(S){case 3:return!0;case 5:return F;case 6:return ae;case 2:b(je,F)}else switch(S){case 4:return!1;case 7:b(je,F)}return R?-1:T||I?I:je}};n.exports={forEach:x(0),map:x(1),filter:x(2),some:x(3),every:x(4),find:x(5),findIndex:x(6),filterReject:x(7)}},function(n,a){n.exports={}},function(n,a,r){var s=r(18),c=r(28),v=r(70),f=c("species");n.exports=function(g){return v>=51||!s((function(){var _=[];return(_.constructor={})[f]=function(){return{foo:1}},_[g](Boolean).foo!==1}))}},function(n,a,r){var s=r(76),c=r(34),v=r(15),f=r(123),g=r(159),_=r(32),b=r(44),x=r(164),S=r(124),A=r(94),E=r(39),T=r(62),I=r(114),R=r(125),U=r(103),D=r(155),L=r(18),W=D.UNSUPPORTED_Y,H=4294967295,B=Math.min,F=[].push,q=v(/./.exec),K=v(F),X=v("".slice),ee=!L((function(){var ue=/(?:)/,ae=ue.exec;ue.exec=function(){return ae.apply(this,arguments)};var we="ab".split(ue);return we.length!==2||we[0]!=="a"||we[1]!=="b"}));f("split",(function(ue,ae,we){var je;return je="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(Te,Me){var Ne=E(b(this)),rt=Me===void 0?H:Me>>>0;if(rt===0)return[];if(Te===void 0)return[Ne];if(!g(Te))return c(ae,Ne,Te,rt);for(var tt,Be,lt,St=[],He=(Te.ignoreCase?"i":"")+(Te.multiline?"m":"")+(Te.unicode?"u":"")+(Te.sticky?"y":""),Jt=0,Fe=new RegExp(Te.source,He+"g");(tt=c(U,Fe,Ne))&&!((Be=Fe.lastIndex)>Jt&&(K(St,X(Ne,Jt,tt.index)),tt.length>1&&tt.index<Ne.length&&s(F,St,I(tt,1)),lt=tt[0].length,Jt=Be,St.length>=rt));)Fe.lastIndex===tt.index&&Fe.lastIndex++;return Jt===Ne.length?!lt&&q(Fe,"")||K(St,""):K(St,X(Ne,Jt)),St.length>rt?I(St,0,rt):St}:"0".split(void 0,0).length?function(Te,Me){return Te===void 0&&Me===0?[]:c(ae,this,Te,Me)}:ae,[function(Te,Me){var Ne=b(this),rt=Te==null?void 0:T(Te,ue);return rt?c(rt,Te,Ne,Me):c(je,E(Ne),Te,Me)},function(Te,Me){var Ne=_(this),rt=E(Te),tt=we(je,Ne,rt,Me,je!==ae);if(tt.done)return tt.value;var Be=x(Ne,RegExp),lt=Ne.unicode,St=(Ne.ignoreCase?"i":"")+(Ne.multiline?"m":"")+(Ne.unicode?"u":"")+(W?"g":"y"),He=new Be(W?"^(?:"+Ne.source+")":Ne,St),Jt=Me===void 0?H:Me>>>0;if(Jt===0)return[];if(rt.length===0)return R(He,rt)===null?[rt]:[];for(var Fe=0,me=0,Le=[];me<rt.length;){He.lastIndex=W?0:me;var Ye,Ot=R(He,W?X(rt,me):rt);if(Ot===null||(Ye=B(A(He.lastIndex+(W?me:0)),rt.length))===Fe)me=S(rt,me,lt);else{if(K(Le,X(rt,Fe,me)),Le.length===Jt)return Le;for(var bt=1;bt<=Ot.length-1;bt++)if(K(Le,Ot[bt]),Le.length===Jt)return Le;me=Fe=Ye}}return K(Le,X(rt,Fe)),Le}]}),!ee,W)},function(n,a,r){r(16)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(n,a,r){var s={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,v=c&&!s.call({1:2},1);a.f=v?function(f){var g=c(this,f);return!!g&&g.enumerable}:s},function(n,a,r){var s=r(7),c=r(15),v=r(18),f=r(51),g=s.Object,_=c("".split);n.exports=v((function(){return!g("z").propertyIsEnumerable(0)}))?function(b){return f(b)=="String"?_(b,""):g(b)}:g},function(n,a,r){var s=r(131),c=r(87);n.exports=function(v){var f=s(v,"string");return c(f)?f:f+""}},function(n,a,r){var s=r(7),c=r(46),v=r(30),f=r(54),g=r(132),_=s.Object;n.exports=g?function(b){return typeof b=="symbol"}:function(b){var x=c("Symbol");return v(x)&&f(x.prototype,_(b))}},function(n,a,r){var s=r(7).String;n.exports=function(c){try{return s(c)}catch{return"Object"}}},function(n,a,r){var s=r(71),c=r(109);(n.exports=function(v,f){return c[v]||(c[v]=f!==void 0?f:{})})("versions",[]).push({version:"3.19.3",mode:s?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(n,a,r){var s=r(15),c=0,v=Math.random(),f=s(1 .toString);n.exports=function(g){return"Symbol("+(g===void 0?"":g)+")_"+f(++c+v,36)}},function(n,a,r){var s=r(7),c=r(33),v=s.document,f=c(v)&&c(v.createElement);n.exports=function(g){return f?v.createElement(g):{}}},function(n,a,r){var s=r(15),c=r(30),v=r(109),f=s(Function.toString);c(v.inspectSource)||(v.inspectSource=function(g){return f(g)}),n.exports=v.inspectSource},function(n,a,r){var s=r(89),c=r(90),v=s("keys");n.exports=function(f){return v[f]||(v[f]=c(f))}},function(n,a,r){var s=r(59),c=Math.min;n.exports=function(v){return v>0?c(s(v),9007199254740991):0}},function(n,a,r){var s=r(18),c=r(30),v=/#|\.prototype\./,f=function(S,A){var E=_[g(S)];return E==x||E!=b&&(c(A)?s(A):!!A)},g=f.normalize=function(S){return String(S).replace(v,".").toLowerCase()},_=f.data={},b=f.NATIVE="N",x=f.POLYFILL="P";n.exports=f},function(n,a,r){var s=r(51);n.exports=Array.isArray||function(c){return s(c)=="Array"}},function(n,a,r){var s=r(7),c=r(113),v=r(30),f=r(51),g=r(28)("toStringTag"),_=s.Object,b=f((function(){return arguments})())=="Arguments";n.exports=c?f:function(x){var S,A,E;return x===void 0?"Undefined":x===null?"Null":typeof(A=(function(T,I){try{return T[I]}catch{}})(S=_(x),g))=="string"?A:b?f(S):(E=f(S))=="Object"&&v(S.callee)?"Arguments":E}},function(n,a,r){var s=r(15);n.exports=s([].slice)},function(n,a,r){var s=r(15),c=r(18),v=r(30),f=r(97),g=r(46),_=r(92),b=function(){},x=[],S=g("Reflect","construct"),A=/^\s*(?:class|function)\b/,E=s(A.exec),T=!A.exec(b),I=function(R){if(!v(R))return!1;try{return S(b,x,R),!0}catch{return!1}};n.exports=!S||c((function(){var R;return I(I.call)||!I(Object)||!I((function(){R=!0}))||R}))?function(R){if(!v(R))return!1;switch(f(R)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return T||!!E(A,_(R))}:I},function(n,a,r){var s=r(28),c=r(60),v=r(38),f=s("unscopables"),g=Array.prototype;g[f]==null&&v.f(g,f,{configurable:!0,value:c(null)}),n.exports=function(_){g[f][_]=!0}},function(n,a,r){var s=r(7),c=r(35),v=r(30),f=r(40),g=r(93),_=r(143),b=g("IE_PROTO"),x=s.Object,S=x.prototype;n.exports=_?x.getPrototypeOf:function(A){var E=f(A);if(c(E,b))return E[b];var T=E.constructor;return v(T)&&E instanceof T?T.prototype:E instanceof x?S:null}},function(n,a,r){var s=r(15),c=r(32),v=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var f,g=!1,_={};try{(f=s(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(_,[]),g=_ instanceof Array}catch{}return function(b,x){return c(b),v(x),g?f(b,x):b.__proto__=x,b}})():void 0)},function(n,a,r){var s,c,v=r(34),f=r(15),g=r(39),_=r(154),b=r(155),x=r(89),S=r(60),A=r(58).get,E=r(190),T=r(191),I=x("native-string-replace",String.prototype.replace),R=RegExp.prototype.exec,U=R,D=f("".charAt),L=f("".indexOf),W=f("".replace),H=f("".slice),B=(c=/b*/g,v(R,s=/a/,"a"),v(R,c,"a"),s.lastIndex!==0||c.lastIndex!==0),F=b.BROKEN_CARET,q=/()??/.exec("")[1]!==void 0;(B||q||F||E||T)&&(U=function(K){var X,ee,ue,ae,we,je,Te,Me=this,Ne=A(Me),rt=g(K),tt=Ne.raw;if(tt)return tt.lastIndex=Me.lastIndex,X=v(U,tt,rt),Me.lastIndex=tt.lastIndex,X;var Be=Ne.groups,lt=F&&Me.sticky,St=v(_,Me),He=Me.source,Jt=0,Fe=rt;if(lt&&(St=W(St,"y",""),L(St,"g")===-1&&(St+="g"),Fe=H(rt,Me.lastIndex),Me.lastIndex>0&&(!Me.multiline||Me.multiline&&D(rt,Me.lastIndex-1)!==`
|
||
`)&&(He="(?: "+He+")",Fe=" "+Fe,Jt++),ee=new RegExp("^(?:"+He+")",St)),q&&(ee=new RegExp("^"+He+"$(?!\\s)",St)),B&&(ue=Me.lastIndex),ae=v(R,lt?ee:Me,Fe),lt?ae?(ae.input=H(ae.input,Jt),ae[0]=H(ae[0],Jt),ae.index=Me.lastIndex,Me.lastIndex+=ae[0].length):Me.lastIndex=0:B&&ae&&(Me.lastIndex=Me.global?ae.index+ae[0].length:ue),q&&ae&&ae.length>1&&v(I,ae[0],ee,(function(){for(we=1;we<arguments.length-2;we++)arguments[we]===void 0&&(ae[we]=void 0)})),ae&&Be)for(ae.groups=je=S(null),we=0;we<Be.length;we++)je[(Te=Be[we])[0]]=ae[Te[1]];return ae}),n.exports=U},function(n,a,r){var s=r(16),c=r(7),v=r(75),f=r(59),g=r(45),_=r(40),b=r(115),x=r(63),S=r(81)("splice"),A=c.TypeError,E=Math.max,T=Math.min,I=9007199254740991,R="Maximum allowed length exceeded";s({target:"Array",proto:!0,forced:!S},{splice:function(U,D){var L,W,H,B,F,q,K=_(this),X=g(K),ee=v(U,X),ue=arguments.length;if(ue===0?L=W=0:ue===1?(L=0,W=X-ee):(L=ue-2,W=T(E(f(D),0),X-ee)),X+L-W>I)throw A(R);for(H=b(K,W),B=0;B<W;B++)(F=ee+B)in K&&x(H,B,K[F]);if(H.length=W,L<W){for(B=ee;B<X-W;B++)q=B+L,(F=B+W)in K?K[q]=K[F]:delete K[q];for(B=X;B>X-W+L;B--)delete K[B-1]}else if(L>W)for(B=X-W;B>ee;B--)q=B+L-1,(F=B+W-1)in K?K[q]=K[F]:delete K[q];for(B=0;B<L;B++)K[B+ee]=arguments[B+2];return K.length=X-W+L,H}})},function(n,a,r){var s=r(16),c=r(205);s({target:"String",proto:!0,forced:r(206)("anchor")},{anchor:function(v){return c(this,"a","name",v)}})},function(n,a,r){(function(s){var c=typeof s=="object"&&s&&s.Object===Object&&s;a.a=c}).call(this,r(68))},function(n,a,r){(function(s){var c=r(31),v=t&&!t.nodeType&&t,f=v&&typeof s=="object"&&s&&!s.nodeType&&s,g=f&&f.exports===v?c.a.Buffer:void 0,_=g?g.allocUnsafe:void 0;a.a=function(b,x){if(x)return b.slice();var S=b.length,A=_?_(S):new b.constructor(S);return b.copy(A),A}}).call(this,r(122)(n))},function(n,a,r){var s=r(70),c=r(18);n.exports=!!Object.getOwnPropertySymbols&&!c((function(){var v=Symbol();return!String(v)||!(Object(v)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},function(n,a,r){var s=r(7),c=r(110),v="__core-js_shared__",f=s[v]||c(v,{});n.exports=f},function(n,a,r){var s=r(7),c=Object.defineProperty;n.exports=function(v,f){try{c(s,v,{value:f,configurable:!0,writable:!0})}catch{s[v]=f}return f}},function(n,a){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(n,a){a.f=Object.getOwnPropertySymbols},function(n,a,r){var s={};s[r(28)("toStringTag")]="z",n.exports=String(s)==="[object z]"},function(n,a,r){var s=r(7),c=r(75),v=r(45),f=r(63),g=s.Array,_=Math.max;n.exports=function(b,x,S){for(var A=v(b),E=c(x,A),T=c(S===void 0?A:S,A),I=g(_(T-E,0)),R=0;E<T;E++,R++)f(I,R,b[E]);return I.length=R,I}},function(n,a,r){var s=r(178);n.exports=function(c,v){return new(s(c))(v===0?0:v)}},function(n,a,r){var s=r(16),c=r(34),v=r(71),f=r(73),g=r(30),_=r(180),b=r(101),x=r(102),S=r(78),A=r(57),E=r(42),T=r(28),I=r(80),R=r(142),U=f.PROPER,D=f.CONFIGURABLE,L=R.IteratorPrototype,W=R.BUGGY_SAFARI_ITERATORS,H=T("iterator"),B="keys",F="values",q="entries",K=function(){return this};n.exports=function(X,ee,ue,ae,we,je,Te){_(ue,ee,ae);var Me,Ne,rt,tt=function(me){if(me===we&&Jt)return Jt;if(!W&&me in St)return St[me];switch(me){case B:case F:case q:return function(){return new ue(this,me)}}return function(){return new ue(this)}},Be=ee+" Iterator",lt=!1,St=X.prototype,He=St[H]||St["@@iterator"]||we&&St[we],Jt=!W&&He||tt(we),Fe=ee=="Array"&&St.entries||He;if(Fe&&(Me=b(Fe.call(new X)))!==Object.prototype&&Me.next&&(v||b(Me)===L||(x?x(Me,L):g(Me[H])||E(Me,H,K)),S(Me,Be,!0,!0),v&&(I[Be]=K)),U&&we==F&&He&&He.name!==F&&(!v&&D?A(St,"name",F):(lt=!0,Jt=function(){return c(He,this)})),we)if(Ne={values:tt(F),keys:je?Jt:tt(B),entries:tt(q)},Te)for(rt in Ne)(W||lt||!(rt in St))&&E(St,rt,Ne[rt]);else s({target:ee,proto:!0,forced:W||lt},Ne);return v&&!Te||St[H]===Jt||E(St,H,Jt,{name:we}),I[ee]=Jt,Ne}},function(n,a,r){var s=r(7),c=r(64),v=r(34),f=r(32),g=r(88),_=r(145),b=r(45),x=r(54),S=r(146),A=r(118),E=r(147),T=s.TypeError,I=function(U,D){this.stopped=U,this.result=D},R=I.prototype;n.exports=function(U,D,L){var W,H,B,F,q,K,X,ee=L&&L.that,ue=!(!L||!L.AS_ENTRIES),ae=!(!L||!L.IS_ITERATOR),we=!(!L||!L.INTERRUPTED),je=c(D,ee),Te=function(Ne){return W&&E(W,"normal",Ne),new I(!0,Ne)},Me=function(Ne){return ue?(f(Ne),we?je(Ne[0],Ne[1],Te):je(Ne[0],Ne[1])):we?je(Ne,Te):je(Ne)};if(ae)W=U;else{if(!(H=A(U)))throw T(g(U)+" is not iterable");if(_(H)){for(B=0,F=b(U);F>B;B++)if((q=Me(U[B]))&&x(R,q))return q;return new I(!1)}W=S(U,H)}for(K=W.next;!(X=v(K,W)).done;){try{q=Me(X.value)}catch(Ne){E(W,"throw",Ne)}if(typeof q=="object"&&q&&x(R,q))return q}return new I(!1)}},function(n,a,r){var s=r(97),c=r(62),v=r(80),f=r(28)("iterator");n.exports=function(g){if(g!=null)return c(g,f)||c(g,"@@iterator")||v[s(g)]}},function(n,a,r){var s=r(7),c=r(54),v=s.TypeError;n.exports=function(f,g){if(c(g,f))return f;throw v("Incorrect invocation")}},function(n,a,r){var s=r(28)("iterator"),c=!1;try{var v=0,f={next:function(){return{done:!!v++}},return:function(){c=!0}};f[s]=function(){return this},Array.from(f,(function(){throw 2}))}catch{}n.exports=function(g,_){if(!_&&!c)return!1;var b=!1;try{var x={};x[s]=function(){return{next:function(){return{done:b=!0}}}},g(x)}catch{}return b}},function(n,a,r){var s=r(18);n.exports=function(c,v){var f=[][c];return!!f&&s((function(){f.call(null,v||function(){throw 1},1)}))}},function(n,a){n.exports=function(r){if(!r.webpackPolyfill){var s=Object.create(r);s.children||(s.children=[]),Object.defineProperty(s,"loaded",{enumerable:!0,get:function(){return s.l}}),Object.defineProperty(s,"id",{enumerable:!0,get:function(){return s.i}}),Object.defineProperty(s,"exports",{enumerable:!0}),s.webpackPolyfill=1}return s}},function(n,a,r){r(19);var s=r(15),c=r(42),v=r(103),f=r(18),g=r(28),_=r(57),b=g("species"),x=RegExp.prototype;n.exports=function(S,A,E,T){var I=g(S),R=!f((function(){var W={};return W[I]=function(){return 7},""[S](W)!=7})),U=R&&!f((function(){var W=!1,H=/a/;return S==="split"&&((H={}).constructor={},H.constructor[b]=function(){return H},H.flags="",H[I]=/./[I]),H.exec=function(){return W=!0,null},H[I](""),!W}));if(!R||!U||E){var D=s(/./[I]),L=A(I,""[S],(function(W,H,B,F,q){var K=s(W),X=H.exec;return X===v||X===x.exec?R&&!q?{done:!0,value:D(H,B,F)}:{done:!0,value:K(B,H,F)}:{done:!1}}));c(String.prototype,S,L[0]),c(x,I,L[1])}T&&_(x[I],"sham",!0)}},function(n,a,r){var s=r(151).charAt;n.exports=function(c,v,f){return v+(f?s(c,v).length:1)}},function(n,a,r){var s=r(7),c=r(34),v=r(32),f=r(30),g=r(51),_=r(103),b=s.TypeError;n.exports=function(x,S){var A=x.exec;if(f(A)){var E=c(A,x,S);return E!==null&&v(E),E}if(g(x)==="RegExp")return c(_,x,S);throw b("RegExp#exec called on incompatible receiver")}},function(n,a,r){var s=r(76),c=r(34),v=r(15),f=r(123),g=r(18),_=r(32),b=r(30),x=r(59),S=r(94),A=r(39),E=r(44),T=r(124),I=r(62),R=r(201),U=r(125),D=r(28)("replace"),L=Math.max,W=Math.min,H=v([].concat),B=v([].push),F=v("".indexOf),q=v("".slice),K="a".replace(/./,"$0")==="$0",X=!!/./[D]&&/./[D]("a","$0")==="";f("replace",(function(ee,ue,ae){var we=X?"$":"$0";return[function(je,Te){var Me=E(this),Ne=je==null?void 0:I(je,D);return Ne?c(Ne,je,Me,Te):c(ue,A(Me),je,Te)},function(je,Te){var Me=_(this),Ne=A(je);if(typeof Te=="string"&&F(Te,we)===-1&&F(Te,"$<")===-1){var rt=ae(ue,Me,Ne,Te);if(rt.done)return rt.value}var tt=b(Te);tt||(Te=A(Te));var Be=Me.global;if(Be){var lt=Me.unicode;Me.lastIndex=0}for(var St=[];;){var He=U(Me,Ne);if(He===null||(B(St,He),!Be))break;A(He[0])===""&&(Me.lastIndex=T(Ne,S(Me.lastIndex),lt))}for(var Jt,Fe="",me=0,Le=0;Le<St.length;Le++){for(var Ye=A((He=St[Le])[0]),Ot=L(W(x(He.index),Ne.length),0),bt=[],Ft=1;Ft<He.length;Ft++)B(bt,(Jt=He[Ft])===void 0?Jt:String(Jt));var Qt=He.groups;if(tt){var on=H([Ye],bt,Ot,Ne);Qt!==void 0&&B(on,Qt);var Wt=A(s(Te,void 0,on))}else Wt=R(Ye,Ne,Ot,bt,Qt,Te);Ot>=me&&(Fe+=q(Ne,me,Ot)+Wt,me=Ot+Ye.length)}return Fe+q(Ne,me)}]}),!!g((function(){var ee=/./;return ee.exec=function(){var ue=[];return ue.groups={a:"7"},ue},"".replace(ee,"$<a>")!=="7"}))||!K||X)},function(n,a,r){var s=r(16),c=Math.hypot,v=Math.abs,f=Math.sqrt;s({target:"Math",stat:!0,forced:!!c&&c(1/0,NaN)!==1/0},{hypot:function(g,_){for(var b,x,S=0,A=0,E=arguments.length,T=0;A<E;)T<(b=v(arguments[A++]))?(S=S*(x=T/b)*x+1,T=b):S+=b>0?(x=b/T)*x:b;return T===1/0?1/0:T*f(S)}})},function(n,a,r){var s=r(51),c=r(7);n.exports=s(c.process)=="process"},function(n,a,r){r(16)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(n,a,r){(function(s,c){var v;/**
|
||
* @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 f,g="Expected a function",_="__lodash_hash_undefined__",b="__lodash_placeholder__",x=16,S=32,A=64,E=128,T=256,I=1/0,R=9007199254740991,U=NaN,D=4294967295,L=[["ary",E],["bind",1],["bindKey",2],["curry",8],["curryRight",x],["flip",512],["partial",S],["partialRight",A],["rearg",T]],W="[object Arguments]",H="[object Array]",B="[object Boolean]",F="[object Date]",q="[object Error]",K="[object Function]",X="[object GeneratorFunction]",ee="[object Map]",ue="[object Number]",ae="[object Object]",we="[object Promise]",je="[object RegExp]",Te="[object Set]",Me="[object String]",Ne="[object Symbol]",rt="[object WeakMap]",tt="[object ArrayBuffer]",Be="[object DataView]",lt="[object Float32Array]",St="[object Float64Array]",He="[object Int8Array]",Jt="[object Int16Array]",Fe="[object Int32Array]",me="[object Uint8Array]",Le="[object Uint8ClampedArray]",Ye="[object Uint16Array]",Ot="[object Uint32Array]",bt=/\b__p \+= '';/g,Ft=/\b(__p \+=) '' \+/g,Qt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,on=/&(?:amp|lt|gt|quot|#39);/g,Wt=/[&<>"']/g,nt=RegExp(on.source),sn=RegExp(Wt.source),We=/<%-([\s\S]+?)%>/g,yn=/<%([\s\S]+?)%>/g,Kn=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gn=/^\w*$/,br=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/[\\^$.*+?()[\]{}|]/g,zr=RegExp(Dr.source),jn=/^\s+/,ko=/\s/,Se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qe=/\{\n\/\* \[wrapped with (.+)\] \*/,$e=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,en=/\\(\\)?/g,Tn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sr=/\w*$/,li=/^[-+]0x[0-9a-f]+$/i,Ei=/^0b[01]+$/i,Yo=/^\[object .+?Constructor\]$/,ti=/^0o[0-7]+$/i,Nn=/^(?:0|[1-9]\d*)$/,Un=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zn=/($^)/,ur=/['\n\r\u2028\u2029\\]/g,to="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Lr="\\u2700-\\u27bf",ml="a-z\\xdf-\\xf6\\xf8-\\xff",za="A-Z\\xc0-\\xd6\\xd8-\\xde",yl="\\ufe0e\\ufe0f",as="\\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",np="['’]",gc="[\\ud800-\\udfff]",va="["+as+"]",Fs="["+to+"]",Rn="\\d+",Id="[\\u2700-\\u27bf]",Eo="["+ml+"]",_c="[^\\ud800-\\udfff"+as+Rn+Lr+ml+za+"]",Ki="\\ud83c[\\udffb-\\udfff]",oa="[^\\ud800-\\udfff]",Mu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pa="[\\ud800-\\udbff][\\udc00-\\udfff]",ma="["+za+"]",Ca="(?:"+Eo+"|"+_c+")",bc="(?:"+ma+"|"+_c+")",wc="(?:['’](?:d|ll|m|re|s|t|ve))?",Ld="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bs="(?:"+Fs+"|"+Ki+")?",$d="[\\ufe0e\\ufe0f]?",Ec=$d+Bs+("(?:\\u200d(?:"+[oa,Mu,Pa].join("|")+")"+$d+Bs+")*"),rp="(?:"+[Id,Mu,Pa].join("|")+")"+Ec,Il="(?:"+[oa+Fs+"?",Fs,Mu,Pa,gc].join("|")+")",Fd=RegExp(np,"g"),gl=RegExp(Fs,"g"),Oc=RegExp(Ki+"(?="+Ki+")|"+Il+Ec,"g"),ku=RegExp([ma+"?"+Eo+"+"+wc+"(?="+[va,ma,"$"].join("|")+")",bc+"+"+Ld+"(?="+[va,ma+Ca,"$"].join("|")+")",ma+"?"+Ca+"+"+wc,ma+"+"+Ld,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rn,rp].join("|"),"g"),xc=RegExp("[\\u200d\\ud800-\\udfff"+to+yl+"]"),Sc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,op=["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"],Bd=-1,Kr={};Kr[lt]=Kr[St]=Kr[He]=Kr[Jt]=Kr[Fe]=Kr[me]=Kr[Le]=Kr[Ye]=Kr[Ot]=!0,Kr[W]=Kr[H]=Kr[tt]=Kr[B]=Kr[Be]=Kr[F]=Kr[q]=Kr[K]=Kr[ee]=Kr[ue]=Kr[ae]=Kr[je]=Kr[Te]=Kr[Me]=Kr[rt]=!1;var Xr={};Xr[W]=Xr[H]=Xr[tt]=Xr[Be]=Xr[B]=Xr[F]=Xr[lt]=Xr[St]=Xr[He]=Xr[Jt]=Xr[Fe]=Xr[ee]=Xr[ue]=Xr[ae]=Xr[je]=Xr[Te]=Xr[Me]=Xr[Ne]=Xr[me]=Xr[Le]=Xr[Ye]=Xr[Ot]=!0,Xr[q]=Xr[K]=Xr[rt]=!1;var Vd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ls=parseFloat,ya=parseInt,Tu=typeof s=="object"&&s&&s.Object===Object&&s,Ud=typeof self=="object"&&self&&self.Object===Object&&self,Uo=Tu||Ud||Function("return this")(),Ll=a&&!a.nodeType&&a,$l=Ll&&typeof c=="object"&&c&&!c.nodeType&&c,Nu=$l&&$l.exports===Ll,ss=Nu&&Tu.process,Oi=(function(){try{var vt=$l&&$l.require&&$l.require("util").types;return vt||ss&&ss.binding&&ss.binding("util")}catch{}})(),Ac=Oi&&Oi.isArrayBuffer,Wd=Oi&&Oi.isDate,Mc=Oi&&Oi.isMap,$i=Oi&&Oi.isRegExp,si=Oi&&Oi.isSet,ga=Oi&&Oi.isTypedArray;function lo(vt,Vt,Ut){switch(Ut.length){case 0:return vt.call(Vt);case 1:return vt.call(Vt,Ut[0]);case 2:return vt.call(Vt,Ut[0],Ut[1]);case 3:return vt.call(Vt,Ut[0],Ut[1],Ut[2])}return vt.apply(Vt,Ut)}function ip(vt,Vt,Ut,bn){for(var pr=-1,Rr=vt==null?0:vt.length;++pr<Rr;){var yo=vt[pr];Vt(bn,yo,Ut(yo),vt)}return bn}function Fi(vt,Vt){for(var Ut=-1,bn=vt==null?0:vt.length;++Ut<bn&&Vt(vt[Ut],Ut,vt)!==!1;);return vt}function Gd(vt,Vt){for(var Ut=vt==null?0:vt.length;Ut--&&Vt(vt[Ut],Ut,vt)!==!1;);return vt}function zd(vt,Vt){for(var Ut=-1,bn=vt==null?0:vt.length;++Ut<bn;)if(!Vt(vt[Ut],Ut,vt))return!1;return!0}function Bi(vt,Vt){for(var Ut=-1,bn=vt==null?0:vt.length,pr=0,Rr=[];++Ut<bn;){var yo=vt[Ut];Vt(yo,Ut,vt)&&(Rr[pr++]=yo)}return Rr}function Zi(vt,Vt){return!!(vt!=null&&vt.length)&&us(vt,Vt,0)>-1}function kc(vt,Vt,Ut){for(var bn=-1,pr=vt==null?0:vt.length;++bn<pr;)if(Ut(Vt,vt[bn]))return!0;return!1}function Vr(vt,Vt){for(var Ut=-1,bn=vt==null?0:vt.length,pr=Array(bn);++Ut<bn;)pr[Ut]=Vt(vt[Ut],Ut,vt);return pr}function ui(vt,Vt){for(var Ut=-1,bn=Vt.length,pr=vt.length;++Ut<bn;)vt[pr+Ut]=Vt[Ut];return vt}function Pu(vt,Vt,Ut,bn){var pr=-1,Rr=vt==null?0:vt.length;for(bn&&Rr&&(Ut=vt[++pr]);++pr<Rr;)Ut=Vt(Ut,vt[pr],pr,vt);return Ut}function Hd(vt,Vt,Ut,bn){var pr=vt==null?0:vt.length;for(bn&&pr&&(Ut=vt[--pr]);pr--;)Ut=Vt(Ut,vt[pr],pr,vt);return Ut}function Tc(vt,Vt){for(var Ut=-1,bn=vt==null?0:vt.length;++Ut<bn;)if(Vt(vt[Ut],Ut,vt))return!0;return!1}var Cu=Ui("length");function Ha(vt,Vt,Ut){var bn;return Ut(vt,(function(pr,Rr,yo){if(Vt(pr,Rr,yo))return bn=Rr,!1})),bn}function Vi(vt,Vt,Ut,bn){for(var pr=vt.length,Rr=Ut+(bn?1:-1);bn?Rr--:++Rr<pr;)if(Vt(vt[Rr],Rr,vt))return Rr;return-1}function us(vt,Vt,Ut){return Vt==Vt?(function(bn,pr,Rr){for(var yo=Rr-1,N=bn.length;++yo<N;)if(bn[yo]===pr)return yo;return-1})(vt,Vt,Ut):Vi(vt,_a,Ut)}function Ji(vt,Vt,Ut,bn){for(var pr=Ut-1,Rr=vt.length;++pr<Rr;)if(bn(vt[pr],Vt))return pr;return-1}function _a(vt){return vt!=vt}function Cr(vt,Vt){var Ut=vt==null?0:vt.length;return Ut?cs(vt,Vt)/Ut:U}function Ui(vt){return function(Vt){return Vt==null?f:Vt[vt]}}function Ra(vt){return function(Vt){return vt==null?f:vt[Vt]}}function mi(vt,Vt,Ut,bn,pr){return pr(vt,(function(Rr,yo,N){Ut=bn?(bn=!1,Rr):Vt(Ut,Rr,yo,N)})),Ut}function cs(vt,Vt){for(var Ut,bn=-1,pr=vt.length;++bn<pr;){var Rr=Vt(vt[bn]);Rr!==f&&(Ut=Ut===f?Rr:Ut+Rr)}return Ut}function Fl(vt,Vt){for(var Ut=-1,bn=Array(vt);++Ut<vt;)bn[Ut]=Vt(Ut);return bn}function ja(vt){return vt&&vt.slice(0,ci(vt)+1).replace(jn,"")}function mo(vt){return function(Vt){return vt(Vt)}}function Vs(vt,Vt){return Vr(Vt,(function(Ut){return vt[Ut]}))}function Xa(vt,Vt){return vt.has(Vt)}function ba(vt,Vt){for(var Ut=-1,bn=vt.length;++Ut<bn&&us(Vt,vt[Ut],0)>-1;);return Ut}function Nc(vt,Vt){for(var Ut=vt.length;Ut--&&us(Vt,vt[Ut],0)>-1;);return Ut}function ap(vt,Vt){for(var Ut=vt.length,bn=0;Ut--;)vt[Ut]===Vt&&++bn;return bn}var Pc=Ra({À:"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"}),Ko=Ra({"&":"&","<":"<",">":">",'"':""","'":"'"});function Us(vt){return"\\"+Vd[vt]}function qa(vt){return xc.test(vt)}function ni(vt){var Vt=-1,Ut=Array(vt.size);return vt.forEach((function(bn,pr){Ut[++Vt]=[pr,bn]})),Ut}function Cc(vt,Vt){return function(Ut){return vt(Vt(Ut))}}function ia(vt,Vt){for(var Ut=-1,bn=vt.length,pr=0,Rr=[];++Ut<bn;){var yo=vt[Ut];yo!==Vt&&yo!==b||(vt[Ut]=b,Rr[pr++]=Ut)}return Rr}function wa(vt){var Vt=-1,Ut=Array(vt.size);return vt.forEach((function(bn){Ut[++Vt]=bn})),Ut}function Ru(vt){var Vt=-1,Ut=Array(vt.size);return vt.forEach((function(bn){Ut[++Vt]=[bn,bn]})),Ut}function Wi(vt){return qa(vt)?(function(Vt){for(var Ut=Oc.lastIndex=0;Oc.test(Vt);)++Ut;return Ut})(vt):Cu(vt)}function Qi(vt){return qa(vt)?(function(Vt){return Vt.match(Oc)||[]})(vt):(function(Vt){return Vt.split("")})(vt)}function ci(vt){for(var Vt=vt.length;Vt--&&ko.test(vt.charAt(Vt)););return Vt}var aa=Ra({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ji=(function vt(Vt){var Ut,bn=(Vt=Vt==null?Uo:ji.defaults(Uo.Object(),Vt,ji.pick(Uo,op))).Array,pr=Vt.Date,Rr=Vt.Error,yo=Vt.Function,N=Vt.Math,C=Vt.Object,z=Vt.RegExp,ie=Vt.String,Ee=Vt.TypeError,Ke=bn.prototype,wt=yo.prototype,Yt=C.prototype,Sn=Vt["__core-js_shared__"],Or=wt.toString,vn=Yt.hasOwnProperty,qr=0,gr=(Ut=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||""))?"Symbol(src)_1."+Ut:"",Fr=Yt.toString,la=Or.call(C),To=Uo._,ea=z("^"+Or.call(vn).replace(Dr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_l=Nu?Vt.Buffer:f,bl=Vt.Symbol,Bl=Vt.Uint8Array,ds=_l?_l.allocUnsafe:f,Ya=Cc(C.getPrototypeOf,C),fs=C.create,ri=Yt.propertyIsEnumerable,Vl=Ke.splice,wl=bl?bl.isConcatSpreadable:f,Ka=bl?bl.iterator:f,Za=bl?bl.toStringTag:f,Ws=(function(){try{var p=ol(C,"defineProperty");return p({},"",{}),p}catch{}})(),hh=Vt.clearTimeout!==Uo.clearTimeout&&Vt.clearTimeout,vh=pr&&pr.now!==Uo.Date.now&&pr.now,lp=Vt.setTimeout!==Uo.setTimeout&&Vt.setTimeout,Rc=N.ceil,Gs=N.floor,Xd=C.getOwnPropertySymbols,mh=_l?_l.isBuffer:f,zs=Vt.isFinite,jc=Ke.join,qd=Cc(C.keys,C),Wo=N.max,Gi=N.min,Yd=pr.now,Kd=Vt.parseInt,ju=N.random,zv=Ke.reverse,Du=ol(Vt,"DataView"),Iu=ol(Vt,"Map"),Dc=ol(Vt,"Promise"),Hs=ol(Vt,"Set"),ps=ol(Vt,"WeakMap"),Lu=ol(C,"create"),Ic=ps&&new ps,hs={},Hv=Es(Du),Lc=Es(Iu),Xv=Es(Dc),qv=Es(Hs),yh=Es(ps),Zd=bl?bl.prototype:f,Di=Zd?Zd.valueOf:f,gh=Zd?Zd.toString:f;function le(p){if(Xo(p)&&!wr(p)&&!(p instanceof jr)){if(p instanceof Da)return p;if(vn.call(p,"__wrapped__"))return wf(p)}return new Da(p)}var Xs=(function(){function p(){}return function(y){if(!Lo(y))return{};if(fs)return fs(y);p.prototype=y;var O=new p;return p.prototype=f,O}})();function Ul(){}function Da(p,y){this.__wrapped__=p,this.__actions__=[],this.__chain__=!!y,this.__index__=0,this.__values__=f}function jr(p){this.__wrapped__=p,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function xi(p){var y=-1,O=p==null?0:p.length;for(this.clear();++y<O;){var $=p[y];this.set($[0],$[1])}}function Ur(p){var y=-1,O=p==null?0:p.length;for(this.clear();++y<O;){var $=p[y];this.set($[0],$[1])}}function Ja(p){var y=-1,O=p==null?0:p.length;for(this.clear();++y<O;){var $=p[y];this.set($[0],$[1])}}function Wl(p){var y=-1,O=p==null?0:p.length;for(this.__data__=new Ja;++y<O;)this.add(p[y])}function Ea(p){var y=this.__data__=new Ur(p);this.size=y.size}function Jd(p,y){var O=wr(p),$=!O&&cu(p),Z=!O&&!$&&na(p),re=!O&&!$&&!Z&&ot(p),ve=O||$||Z||re,xe=ve?Fl(p.length,ie):[],Ue=xe.length;for(var _t in p)!y&&!vn.call(p,_t)||ve&&(_t=="length"||Z&&(_t=="offset"||_t=="parent")||re&&(_t=="buffer"||_t=="byteLength"||_t=="byteOffset")||Ii(_t,Ue))||xe.push(_t);return xe}function Qd(p){var y=p.length;return y?p[gp(0,y-1)]:f}function sp(p,y){return Ml(yi(p),vs(y,0,p.length))}function _h(p){return Ml(yi(p))}function Gl(p,y,O){(O!==f&&!Fa(p[y],O)||O===f&&!(y in p))&&Qa(p,y,O)}function Go(p,y,O){var $=p[y];vn.call(p,y)&&Fa($,O)&&(O!==f||y in p)||Qa(p,y,O)}function $u(p,y){for(var O=p.length;O--;)if(Fa(p[O][0],y))return O;return-1}function up(p,y,O,$){return Oo(p,(function(Z,re,ve){y($,Z,O(Z),ve)})),$}function zl(p,y){return p&&tl(y,It(y),p)}function Qa(p,y,O){y=="__proto__"&&Ws?Ws(p,y,{configurable:!0,enumerable:!0,value:O,writable:!0}):p[y]=O}function $c(p,y){for(var O=-1,$=y.length,Z=bn($),re=p==null;++O<$;)Z[O]=re?f:qt(p,y[O]);return Z}function vs(p,y,O){return p==p&&(O!==f&&(p=p<=O?p:O),y!==f&&(p=p>=y?p:y)),p}function Oa(p,y,O,$,Z,re){var ve,xe=1&y,Ue=2&y,_t=4&y;if(O&&(ve=Z?O(p,$,Z,re):O(p)),ve!==f)return ve;if(!Lo(p))return p;var xt=wr(p);if(xt){if(ve=(function(Lt){var nn=Lt.length,sr=new Lt.constructor(nn);return nn&&typeof Lt[0]=="string"&&vn.call(Lt,"index")&&(sr.index=Lt.index,sr.input=Lt.input),sr})(p),!xe)return yi(p,ve)}else{var Xt=Do(p),xn=Xt==K||Xt==X;if(na(p))return Mh(p,xe);if(Xt==ae||Xt==W||xn&&!Z){if(ve=Ue||xn?{}:ta(p),!xe)return Ue?(function(Lt,nn){return tl(Lt,nu(Lt),nn)})(p,(function(Lt,nn){return Lt&&tl(nn,Pt(nn),Lt)})(ve,p)):(function(Lt,nn){return tl(Lt,di(Lt),nn)})(p,zl(ve,p))}else{if(!Xr[Xt])return Z?p:{};ve=(function(Lt,nn,sr){var Pn=Lt.constructor;switch(nn){case tt:return Ks(Lt);case B:case F:return new Pn(+Lt);case Be:return(function(yr,Br){var Jn=Br?Ks(yr.buffer):yr.buffer;return new yr.constructor(Jn,yr.byteOffset,yr.byteLength)})(Lt,sr);case lt:case St:case He:case Jt:case Fe:case me:case Le:case Ye:case Ot:return kh(Lt,sr);case ee:return new Pn;case ue:case Me:return new Pn(Lt);case je:return(function(yr){var Br=new yr.constructor(yr.source,Sr.exec(yr));return Br.lastIndex=yr.lastIndex,Br})(Lt);case Te:return new Pn;case Ne:return qe=Lt,Di?C(Di.call(qe)):{}}var qe})(p,Xt,xe)}}re||(re=new Ea);var An=re.get(p);if(An)return An;re.set(p,ve),Oe(p)?p.forEach((function(Lt){ve.add(Oa(Lt,y,O,Lt,p,re))})):Af(p)&&p.forEach((function(Lt,nn){ve.set(nn,Oa(Lt,y,O,nn,p,re))}));var qn=xt?f:(_t?Ue?mf:Xc:Ue?Pt:It)(p);return Fi(qn||p,(function(Lt,nn){qn&&(Lt=p[nn=Lt]),Go(ve,nn,Oa(Lt,y,O,nn,p,re))})),ve}function cp(p,y,O){var $=O.length;if(p==null)return!$;for(p=C(p);$--;){var Z=O[$],re=y[Z],ve=p[Z];if(ve===f&&!(Z in p)||!re(ve))return!1}return!0}function dp(p,y,O){if(typeof p!="function")throw new Ee(g);return iu((function(){p.apply(f,O)}),y)}function el(p,y,O,$){var Z=-1,re=Zi,ve=!0,xe=p.length,Ue=[],_t=y.length;if(!xe)return Ue;O&&(y=Vr(y,mo(O))),$?(re=kc,ve=!1):y.length>=200&&(re=Xa,ve=!1,y=new Wl(y));e:for(;++Z<xe;){var xt=p[Z],Xt=O==null?xt:O(xt);if(xt=$||xt!==0?xt:0,ve&&Xt==Xt){for(var xn=_t;xn--;)if(y[xn]===Xt)continue e;Ue.push(xt)}else re(y,Xt,$)||Ue.push(xt)}return Ue}le.templateSettings={escape:We,evaluate:yn,interpolate:Kn,variable:"",imports:{_:le}},le.prototype=Ul.prototype,le.prototype.constructor=le,Da.prototype=Xs(Ul.prototype),Da.prototype.constructor=Da,jr.prototype=Xs(Ul.prototype),jr.prototype.constructor=jr,xi.prototype.clear=function(){this.__data__=Lu?Lu(null):{},this.size=0},xi.prototype.delete=function(p){var y=this.has(p)&&delete this.__data__[p];return this.size-=y?1:0,y},xi.prototype.get=function(p){var y=this.__data__;if(Lu){var O=y[p];return O===_?f:O}return vn.call(y,p)?y[p]:f},xi.prototype.has=function(p){var y=this.__data__;return Lu?y[p]!==f:vn.call(y,p)},xi.prototype.set=function(p,y){var O=this.__data__;return this.size+=this.has(p)?0:1,O[p]=Lu&&y===f?_:y,this},Ur.prototype.clear=function(){this.__data__=[],this.size=0},Ur.prototype.delete=function(p){var y=this.__data__,O=$u(y,p);return!(O<0)&&(O==y.length-1?y.pop():Vl.call(y,O,1),--this.size,!0)},Ur.prototype.get=function(p){var y=this.__data__,O=$u(y,p);return O<0?f:y[O][1]},Ur.prototype.has=function(p){return $u(this.__data__,p)>-1},Ur.prototype.set=function(p,y){var O=this.__data__,$=$u(O,p);return $<0?(++this.size,O.push([p,y])):O[$][1]=y,this},Ja.prototype.clear=function(){this.size=0,this.__data__={hash:new xi,map:new(Iu||Ur),string:new xi}},Ja.prototype.delete=function(p){var y=Hu(this,p).delete(p);return this.size-=y?1:0,y},Ja.prototype.get=function(p){return Hu(this,p).get(p)},Ja.prototype.has=function(p){return Hu(this,p).has(p)},Ja.prototype.set=function(p,y){var O=Hu(this,p),$=O.size;return O.set(p,y),this.size+=O.size==$?0:1,this},Wl.prototype.add=Wl.prototype.push=function(p){return this.__data__.set(p,_),this},Wl.prototype.has=function(p){return this.__data__.has(p)},Ea.prototype.clear=function(){this.__data__=new Ur,this.size=0},Ea.prototype.delete=function(p){var y=this.__data__,O=y.delete(p);return this.size=y.size,O},Ea.prototype.get=function(p){return this.__data__.get(p)},Ea.prototype.has=function(p){return this.__data__.has(p)},Ea.prototype.set=function(p,y){var O=this.__data__;if(O instanceof Ur){var $=O.__data__;if(!Iu||$.length<199)return $.push([p,y]),this.size=++O.size,this;O=this.__data__=new Ja($)}return O.set(p,y),this.size=O.size,this};var Oo=Qs(Dn),bh=Qs(fo,!0);function fp(p,y){var O=!0;return Oo(p,(function($,Z,re){return O=!!y($,Z,re)})),O}function zo(p,y,O){for(var $=-1,Z=p.length;++$<Z;){var re=p[$],ve=y(re);if(ve!=null&&(xe===f?ve==ve&&!gt(ve):O(ve,xe)))var xe=ve,Ue=re}return Ue}function Zr(p,y){var O=[];return Oo(p,(function($,Z,re){y($,Z,re)&&O.push($)})),O}function oi(p,y,O,$,Z){var re=-1,ve=p.length;for(O||(O=Yc),Z||(Z=[]);++re<ve;){var xe=p[re];y>0&&O(xe)?y>1?oi(xe,y-1,O,$,Z):ui(Z,xe):$||(Z[Z.length]=xe)}return Z}var Mr=eu(),co=eu(!0);function Dn(p,y){return p&&Mr(p,y,It)}function fo(p,y){return p&&co(p,y,It)}function Fc(p,y){return Bi(y,(function(O){return Aa(p[O])}))}function El(p,y){for(var O=0,$=(y=Yr(y,p)).length;p!=null&&O<$;)p=p[il(y[O++])];return O&&O==$?p:f}function ef(p,y,O){var $=y(p);return wr(p)?$:ui($,O(p))}function No(p){return p==null?p===f?"[object Undefined]":"[object Null]":Za&&Za in C(p)?(function(y){var O=vn.call(y,Za),$=y[Za];try{y[Za]=f;var Z=!0}catch{}var re=Fr.call(y);return Z&&(O?y[Za]=$:delete y[Za]),re})(p):(function(y){return Fr.call(y)})(p)}function jo(p,y){return p>y}function pp(p,y){return p!=null&&vn.call(p,y)}function hp(p,y){return p!=null&&y in C(p)}function Bc(p,y,O){for(var $=O?kc:Zi,Z=p[0].length,re=p.length,ve=re,xe=bn(re),Ue=1/0,_t=[];ve--;){var xt=p[ve];ve&&y&&(xt=Vr(xt,mo(y))),Ue=Gi(xt.length,Ue),xe[ve]=!O&&(y||Z>=120&&xt.length>=120)?new Wl(ve&&xt):f}xt=p[0];var Xt=-1,xn=xe[0];e:for(;++Xt<Z&&_t.length<Ue;){var An=xt[Xt],qn=y?y(An):An;if(An=O||An!==0?An:0,!(xn?Xa(xn,qn):$(_t,qn,O))){for(ve=re;--ve;){var Lt=xe[ve];if(!(Lt?Xa(Lt,qn):$(p[ve],qn,O)))continue e}xn&&xn.push(qn),_t.push(An)}}return _t}function zi(p,y,O){var $=(p=ws(p,y=Yr(y,p)))==null?p:p[il(xo(y))];return $==null?f:lo($,p,O)}function tf(p){return Xo(p)&&No(p)==W}function Fu(p,y,O,$,Z){return p===y||(p==null||y==null||!Xo(p)&&!Xo(y)?p!=p&&y!=y:(function(re,ve,xe,Ue,_t,xt){var Xt=wr(re),xn=wr(ve),An=Xt?H:Do(re),qn=xn?H:Do(ve),Lt=(An=An==W?ae:An)==ae,nn=(qn=qn==W?ae:qn)==ae,sr=An==qn;if(sr&&na(re)){if(!na(ve))return!1;Xt=!0,Lt=!1}if(sr&&!Lt)return xt||(xt=new Ea),Xt||ot(re)?zu(re,ve,xe,Ue,_t,xt):(function(Jn,dr,Mi,Ba,Jl,ki,As){switch(Mi){case Be:if(Jn.byteLength!=dr.byteLength||Jn.byteOffset!=dr.byteOffset)return!1;Jn=Jn.buffer,dr=dr.buffer;case tt:return!(Jn.byteLength!=dr.byteLength||!ki(new Bl(Jn),new Bl(dr)));case B:case F:case ue:return Fa(+Jn,+dr);case q:return Jn.name==dr.name&&Jn.message==dr.message;case je:case Me:return Jn==dr+"";case ee:var fu=ni;case Te:var Mf=1&Ba;if(fu||(fu=wa),Jn.size!=dr.size&&!Mf)return!1;var Ip=As.get(Jn);if(Ip)return Ip==dr;Ba|=2,As.set(Jn,dr);var Ms=zu(fu(Jn),fu(dr),Ba,Jl,ki,As);return As.delete(Jn),Ms;case Ne:if(Di)return Di.call(Jn)==Di.call(dr)}return!1})(re,ve,An,xe,Ue,_t,xt);if(!(1&xe)){var Pn=Lt&&vn.call(re,"__wrapped__"),qe=nn&&vn.call(ve,"__wrapped__");if(Pn||qe){var yr=Pn?re.value():re,Br=qe?ve.value():ve;return xt||(xt=new Ea),_t(yr,Br,xe,Ue,xt)}}return sr?(xt||(xt=new Ea),(function(Jn,dr,Mi,Ba,Jl,ki){var As=1&Mi,fu=Xc(Jn),Mf=fu.length,Ip=Xc(dr).length;if(Mf!=Ip&&!As)return!1;for(var Ms=Mf;Ms--;){var Ku=fu[Ms];if(!(As?Ku in dr:vn.call(dr,Ku)))return!1}var tm=ki.get(Jn),kf=ki.get(dr);if(tm&&kf)return tm==dr&&kf==Jn;var Lp=!0;ki.set(Jn,dr),ki.set(dr,Jn);for(var nm=As;++Ms<Mf;){var $p=Jn[Ku=fu[Ms]],fd=dr[Ku];if(Ba)var pd=As?Ba(fd,$p,Ku,dr,Jn,ki):Ba($p,fd,Ku,Jn,dr,ki);if(!(pd===f?$p===fd||Jl($p,fd,Mi,Ba,ki):pd)){Lp=!1;break}nm||(nm=Ku=="constructor")}if(Lp&&!nm){var pu=Jn.constructor,Fp=dr.constructor;pu==Fp||!("constructor"in Jn)||!("constructor"in dr)||typeof pu=="function"&&pu instanceof pu&&typeof Fp=="function"&&Fp instanceof Fp||(Lp=!1)}return ki.delete(Jn),ki.delete(dr),Lp})(re,ve,xe,Ue,_t,xt)):!1})(p,y,O,$,Fu,Z))}function Ia(p,y,O,$){var Z=O.length,re=Z,ve=!$;if(p==null)return!re;for(p=C(p);Z--;){var xe=O[Z];if(ve&&xe[2]?xe[1]!==p[xe[0]]:!(xe[0]in p))return!1}for(;++Z<re;){var Ue=(xe=O[Z])[0],_t=p[Ue],xt=xe[1];if(ve&&xe[2]){if(_t===f&&!(Ue in p))return!1}else{var Xt=new Ea;if($)var xn=$(_t,xt,Ue,p,y,Xt);if(!(xn===f?Fu(xt,_t,3,$,Xt):xn))return!1}}return!0}function ms(p){return!(!Lo(p)||(y=p,gr&&gr in y))&&(Aa(p)?ea:Yo).test(Es(p));var y}function Hl(p){return typeof p=="function"?p:p==null?tr:typeof p=="object"?wr(p)?mp(p[0],p[1]):vp(p):he(p)}function La(p){if(!Ct(p))return qd(p);var y=[];for(var O in C(p))vn.call(p,O)&&O!="constructor"&&y.push(O);return y}function wh(p){if(!Lo(p))return(function(Z){var re=[];if(Z!=null)for(var ve in C(Z))re.push(ve);return re})(p);var y=Ct(p),O=[];for(var $ in p)($!="constructor"||!y&&vn.call(p,$))&&O.push($);return O}function Ol(p,y){return p<y}function xa(p,y){var O=-1,$=ca(p)?bn(p.length):[];return Oo(p,(function(Z,re,ve){$[++O]=y(Z,re,ve)})),$}function vp(p){var y=qc(p);return y.length==1&&y[0][2]?Kc(y[0][0],y[0][1]):function(O){return O===p||Ia(O,p,y)}}function mp(p,y){return Sl(p)&&ru(y)?Kc(il(p),y):function(O){var $=qt(O,p);return $===f&&$===y?Tt(O,p):Fu(y,$,3)}}function nf(p,y,O,$,Z){p!==y&&Mr(y,(function(re,ve){if(Z||(Z=new Ea),Lo(re))(function(Ue,_t,xt,Xt,xn,An,qn){var Lt=_f(Ue,xt),nn=_f(_t,xt),sr=qn.get(nn);if(sr)return void Gl(Ue,xt,sr);var Pn=An?An(Lt,nn,xt+"",Ue,_t,qn):f,qe=Pn===f;if(qe){var yr=wr(nn),Br=!yr&&na(nn),Jn=!yr&&!Br&&ot(nn);Pn=nn,yr||Br||Jn?wr(Lt)?Pn=Lt:Co(Lt)?Pn=yi(Lt):Br?(qe=!1,Pn=Mh(nn,!0)):Jn?(qe=!1,Pn=kh(nn,!0)):Pn=[]:G(nn)||cu(nn)?(Pn=Lt,cu(Lt)?Pn=Dt(Lt):Lo(Lt)&&!Aa(Lt)||(Pn=ta(nn))):qe=!1}qe&&(qn.set(nn,Pn),xn(Pn,nn,Xt,An,qn),qn.delete(nn)),Gl(Ue,xt,Pn)})(p,y,ve,O,nf,$,Z);else{var xe=$?$(_f(p,ve),re,ve+"",p,y,Z):f;xe===f&&(xe=re),Gl(p,ve,xe)}}),Pt)}function Eh(p,y){var O=p.length;if(O)return Ii(y+=y<0?O:0,O)?p[y]:f}function Oh(p,y,O){y=y.length?Vr(y,(function(re){return wr(re)?function(ve){return El(ve,re.length===1?re[0]:re)}:re})):[tr];var $=-1;y=Vr(y,mo(rr()));var Z=xa(p,(function(re,ve,xe){var Ue=Vr(y,(function(_t){return _t(re)}));return{criteria:Ue,index:++$,value:re}}));return(function(re,ve){var xe=re.length;for(re.sort(ve);xe--;)re[xe]=re[xe].value;return re})(Z,(function(re,ve){return(function(xe,Ue,_t){for(var xt=-1,Xt=xe.criteria,xn=Ue.criteria,An=Xt.length,qn=_t.length;++xt<An;){var Lt=Bu(Xt[xt],xn[xt]);if(Lt)return xt>=qn?Lt:Lt*(_t[xt]=="desc"?-1:1)}return xe.index-Ue.index})(re,ve,O)}))}function xh(p,y,O){for(var $=-1,Z=y.length,re={};++$<Z;){var ve=y[$],xe=El(p,ve);O(xe,ve)&&qs(re,Yr(ve,p),xe)}return re}function rf(p,y,O,$){var Z=$?Ji:us,re=-1,ve=y.length,xe=p;for(p===y&&(y=yi(y)),O&&(xe=Vr(p,mo(O)));++re<ve;)for(var Ue=0,_t=y[re],xt=O?O(_t):_t;(Ue=Z(xe,xt,Ue,$))>-1;)xe!==p&&Vl.call(xe,Ue,1),Vl.call(p,Ue,1);return p}function yp(p,y){for(var O=p?y.length:0,$=O-1;O--;){var Z=y[O];if(O==$||Z!==re){var re=Z;Ii(Z)?Vl.call(p,Z,1):af(p,Z)}}return p}function gp(p,y){return p+Gs(ju()*(y-p+1))}function Vc(p,y){var O="";if(!p||y<1||y>R)return O;do y%2&&(O+=p),(y=Gs(y/2))&&(p+=p);while(y);return O}function kr(p,y){return Jc(Zc(p,y,tr),p+"")}function Yv(p){return Qd(Er(p))}function _p(p,y){var O=Er(p);return Ml(O,vs(y,0,O.length))}function qs(p,y,O,$){if(!Lo(p))return p;for(var Z=-1,re=(y=Yr(y,p)).length,ve=re-1,xe=p;xe!=null&&++Z<re;){var Ue=il(y[Z]),_t=O;if(Ue==="__proto__"||Ue==="constructor"||Ue==="prototype")return p;if(Z!=ve){var xt=xe[Ue];(_t=$?$(xt,Ue,xe):f)===f&&(_t=Lo(xt)?xt:Ii(y[Z+1])?[]:{})}Go(xe,Ue,_t),xe=xe[Ue]}return p}var Uc=Ic?function(p,y){return Ic.set(p,y),p}:tr,Kv=Ws?function(p,y){return Ws(p,"toString",{configurable:!0,enumerable:!1,value:Tr(y),writable:!0})}:tr;function Sh(p){return Ml(Er(p))}function Sa(p,y,O){var $=-1,Z=p.length;y<0&&(y=-y>Z?0:Z+y),(O=O>Z?Z:O)<0&&(O+=Z),Z=y>O?0:O-y>>>0,y>>>=0;for(var re=bn(Z);++$<Z;)re[$]=p[$+y];return re}function Zv(p,y){var O;return Oo(p,(function($,Z,re){return!(O=y($,Z,re))})),!!O}function Wc(p,y,O){var $=0,Z=p==null?$:p.length;if(typeof y=="number"&&y==y&&Z<=2147483647){for(;$<Z;){var re=$+Z>>>1,ve=p[re];ve!==null&&!gt(ve)&&(O?ve<=y:ve<y)?$=re+1:Z=re}return Z}return of(p,y,tr,O)}function of(p,y,O,$){var Z=0,re=p==null?0:p.length;if(re===0)return 0;for(var ve=(y=O(y))!=y,xe=y===null,Ue=gt(y),_t=y===f;Z<re;){var xt=Gs((Z+re)/2),Xt=O(p[xt]),xn=Xt!==f,An=Xt===null,qn=Xt==Xt,Lt=gt(Xt);if(ve)var nn=$||qn;else nn=_t?qn&&($||xn):xe?qn&&xn&&($||!An):Ue?qn&&xn&&!An&&($||!Lt):!An&&!Lt&&($?Xt<=y:Xt<y);nn?Z=xt+1:re=xt}return Gi(re,4294967294)}function bp(p,y){for(var O=-1,$=p.length,Z=0,re=[];++O<$;){var ve=p[O],xe=y?y(ve):ve;if(!O||!Fa(xe,Ue)){var Ue=xe;re[Z++]=ve===0?0:ve}}return re}function Ah(p){return typeof p=="number"?p:gt(p)?U:+p}function sa(p){if(typeof p=="string")return p;if(wr(p))return Vr(p,sa)+"";if(gt(p))return gh?gh.call(p):"";var y=p+"";return y=="0"&&1/p==-1/0?"-0":y}function ys(p,y,O){var $=-1,Z=Zi,re=p.length,ve=!0,xe=[],Ue=xe;if(O)ve=!1,Z=kc;else if(re>=200){var _t=y?null:Nh(p);if(_t)return wa(_t);ve=!1,Z=Xa,Ue=new Wl}else Ue=y?[]:xe;e:for(;++$<re;){var xt=p[$],Xt=y?y(xt):xt;if(xt=O||xt!==0?xt:0,ve&&Xt==Xt){for(var xn=Ue.length;xn--;)if(Ue[xn]===Xt)continue e;y&&Ue.push(Xt),xe.push(xt)}else Z(Ue,Xt,O)||(Ue!==xe&&Ue.push(Xt),xe.push(xt))}return xe}function af(p,y){return(p=ws(p,y=Yr(y,p)))==null||delete p[il(xo(y))]}function Ys(p,y,O,$){return qs(p,y,O(El(p,y)),$)}function lf(p,y,O,$){for(var Z=p.length,re=$?Z:-1;($?re--:++re<Z)&&y(p[re],re,p););return O?Sa(p,$?0:re,$?re+1:Z):Sa(p,$?re+1:0,$?Z:re)}function wp(p,y){var O=p;return O instanceof jr&&(O=O.value()),Pu(y,(function($,Z){return Z.func.apply(Z.thisArg,ui([$],Z.args))}),O)}function sf(p,y,O){var $=p.length;if($<2)return $?ys(p[0]):[];for(var Z=-1,re=bn($);++Z<$;)for(var ve=p[Z],xe=-1;++xe<$;)xe!=Z&&(re[Z]=el(re[Z]||ve,p[xe],y,O));return ys(oi(re,1),y,O)}function Gc(p,y,O){for(var $=-1,Z=p.length,re=y.length,ve={};++$<Z;){var xe=$<re?y[$]:f;O(ve,p[$],xe)}return ve}function uf(p){return Co(p)?p:[]}function cf(p){return typeof p=="function"?p:tr}function Yr(p,y){return wr(p)?p:Sl(p,y)?[p]:Tp(At(p))}var Jv=kr;function no(p,y,O){var $=p.length;return O=O===f?$:O,!y&&O>=$?p:Sa(p,y,O)}var df=hh||function(p){return Uo.clearTimeout(p)};function Mh(p,y){if(y)return p.slice();var O=p.length,$=ds?ds(O):new p.constructor(O);return p.copy($),$}function Ks(p){var y=new p.constructor(p.byteLength);return new Bl(y).set(new Bl(p)),y}function kh(p,y){var O=y?Ks(p.buffer):p.buffer;return new p.constructor(O,p.byteOffset,p.length)}function Bu(p,y){if(p!==y){var O=p!==f,$=p===null,Z=p==p,re=gt(p),ve=y!==f,xe=y===null,Ue=y==y,_t=gt(y);if(!xe&&!_t&&!re&&p>y||re&&ve&&Ue&&!xe&&!_t||$&&ve&&Ue||!O&&Ue||!Z)return 1;if(!$&&!re&&!_t&&p<y||_t&&O&&Z&&!$&&!re||xe&&O&&Z||!ve&&Z||!Ue)return-1}return 0}function Th(p,y,O,$){for(var Z=-1,re=p.length,ve=O.length,xe=-1,Ue=y.length,_t=Wo(re-ve,0),xt=bn(Ue+_t),Xt=!$;++xe<Ue;)xt[xe]=y[xe];for(;++Z<ve;)(Xt||Z<re)&&(xt[O[Z]]=p[Z]);for(;_t--;)xt[xe++]=p[Z++];return xt}function Zs(p,y,O,$){for(var Z=-1,re=p.length,ve=-1,xe=O.length,Ue=-1,_t=y.length,xt=Wo(re-xe,0),Xt=bn(xt+_t),xn=!$;++Z<xt;)Xt[Z]=p[Z];for(var An=Z;++Ue<_t;)Xt[An+Ue]=y[Ue];for(;++ve<xe;)(xn||Z<re)&&(Xt[An+O[ve]]=p[Z++]);return Xt}function yi(p,y){var O=-1,$=p.length;for(y||(y=bn($));++O<$;)y[O]=p[O];return y}function tl(p,y,O,$){var Z=!O;O||(O={});for(var re=-1,ve=y.length;++re<ve;){var xe=y[re],Ue=$?$(O[xe],p[xe],xe,O,p):f;Ue===f&&(Ue=p[xe]),Z?Qa(O,xe,Ue):Go(O,xe,Ue)}return O}function Xl(p,y){return function(O,$){var Z=wr(O)?ip:up,re=y?y():{};return Z(O,p,rr($,2),re)}}function Js(p){return kr((function(y,O){var $=-1,Z=O.length,re=Z>1?O[Z-1]:f,ve=Z>2?O[2]:f;for(re=p.length>3&&typeof re=="function"?(Z--,re):f,ve&&Ho(O[0],O[1],ve)&&(re=Z<3?f:re,Z=1),y=C(y);++$<Z;){var xe=O[$];xe&&p(y,xe,$,re)}return y}))}function Qs(p,y){return function(O,$){if(O==null)return O;if(!ca(O))return p(O,$);for(var Z=O.length,re=y?Z:-1,ve=C(O);(y?re--:++re<Z)&&$(ve[re],re,ve)!==!1;);return O}}function eu(p){return function(y,O,$){for(var Z=-1,re=C(y),ve=$(y),xe=ve.length;xe--;){var Ue=ve[p?xe:++Z];if(O(re[Ue],Ue,re)===!1)break}return y}}function ff(p){return function(y){var O=qa(y=At(y))?Qi(y):f,$=O?O[0]:y.charAt(0),Z=O?no(O,1).join(""):y.slice(1);return $[p]()+Z}}function ql(p){return function(y){return Pu(go(ir(y).replace(Fd,"")),p,"")}}function tu(p){return function(){var y=arguments;switch(y.length){case 0:return new p;case 1:return new p(y[0]);case 2:return new p(y[0],y[1]);case 3:return new p(y[0],y[1],y[2]);case 4:return new p(y[0],y[1],y[2],y[3]);case 5:return new p(y[0],y[1],y[2],y[3],y[4]);case 6:return new p(y[0],y[1],y[2],y[3],y[4],y[5]);case 7:return new p(y[0],y[1],y[2],y[3],y[4],y[5],y[6])}var O=Xs(p.prototype),$=p.apply(O,y);return Lo($)?$:O}}function pf(p){return function(y,O,$){var Z=C(y);if(!ca(y)){var re=rr(O,3);y=It(y),O=function(xe){return re(Z[xe],xe,Z)}}var ve=p(y,O,$);return ve>-1?Z[re?y[ve]:ve]:f}}function nl(p){return xl((function(y){var O=y.length,$=O,Z=Da.prototype.thru;for(p&&y.reverse();$--;){var re=y[$];if(typeof re!="function")throw new Ee(g);if(Z&&!ve&&gs(re)=="wrapper")var ve=new Da([],!0)}for($=ve?$:O;++$<O;){var xe=gs(re=y[$]),Ue=xe=="wrapper"?yf(re):f;ve=Ue&&Al(Ue[0])&&Ue[1]==424&&!Ue[4].length&&Ue[9]==1?ve[gs(Ue[0])].apply(ve,Ue[3]):re.length==1&&Al(re)?ve[xe]():ve.thru(re)}return function(){var _t=arguments,xt=_t[0];if(ve&&_t.length==1&&wr(xt))return ve.plant(xt).value();for(var Xt=0,xn=O?y[Xt].apply(this,_t):xt;++Xt<O;)xn=y[Xt].call(this,xn);return xn}}))}function zc(p,y,O,$,Z,re,ve,xe,Ue,_t){var xt=y&E,Xt=1&y,xn=2&y,An=24&y,qn=512&y,Lt=xn?f:tu(p);return function nn(){for(var sr=arguments.length,Pn=bn(sr),qe=sr;qe--;)Pn[qe]=arguments[qe];if(An)var yr=_s(nn),Br=ap(Pn,yr);if($&&(Pn=Th(Pn,$,Z,An)),re&&(Pn=Zs(Pn,re,ve,An)),sr-=Br,An&&sr<_t){var Jn=ia(Pn,yr);return Ep(p,y,zc,nn.placeholder,O,Pn,Jn,xe,Ue,_t-sr)}var dr=Xt?O:this,Mi=xn?dr[p]:p;return sr=Pn.length,xe?Pn=ou(Pn,xe):qn&&sr>1&&Pn.reverse(),xt&&Ue<sr&&(Pn.length=Ue),this&&this!==Uo&&this instanceof nn&&(Mi=Lt||tu(Mi)),Mi.apply(dr,Pn)}}function Hc(p,y){return function(O,$){return(function(Z,re,ve,xe){return Dn(Z,(function(Ue,_t,xt){re(xe,ve(Ue),_t,xt)})),xe})(O,p,y($),{})}}function Vu(p,y){return function(O,$){var Z;if(O===f&&$===f)return y;if(O!==f&&(Z=O),$!==f){if(Z===f)return $;typeof O=="string"||typeof $=="string"?(O=sa(O),$=sa($)):(O=Ah(O),$=Ah($)),Z=p(O,$)}return Z}}function Uu(p){return xl((function(y){return y=Vr(y,mo(rr())),kr((function(O){var $=this;return p(y,(function(Z){return lo(Z,$,O)}))}))}))}function Wu(p,y){var O=(y=y===f?" ":sa(y)).length;if(O<2)return O?Vc(y,p):y;var $=Vc(y,Rc(p/Wi(y)));return qa(y)?no(Qi($),0,p).join(""):$.slice(0,p)}function hf(p){return function(y,O,$){return $&&typeof $!="number"&&Ho(y,O,$)&&(O=$=f),y=jt(y),O===f?(O=y,y=0):O=jt(O),(function(Z,re,ve,xe){for(var Ue=-1,_t=Wo(Rc((re-Z)/(ve||1)),0),xt=bn(_t);_t--;)xt[xe?_t:++Ue]=Z,Z+=ve;return xt})(y,O,$=$===f?y<O?1:-1:jt($),p)}}function Gu(p){return function(y,O){return typeof y=="string"&&typeof O=="string"||(y=Gt(y),O=Gt(O)),p(y,O)}}function Ep(p,y,O,$,Z,re,ve,xe,Ue,_t){var xt=8&y;y|=xt?S:A,4&(y&=~(xt?A:S))||(y&=-4);var Xt=[p,y,Z,xt?re:f,xt?ve:f,xt?f:re,xt?f:ve,xe,Ue,_t],xn=O.apply(f,Xt);return Al(p)&&Mp(xn,Xt),xn.placeholder=$,bf(xn,p,y)}function vf(p){var y=N[p];return function(O,$){if(O=Gt(O),($=$==null?0:Gi(ht($),292))&&zs(O)){var Z=(At(O)+"e").split("e");return+((Z=(At(y(Z[0]+"e"+(+Z[1]+$)))+"e").split("e"))[0]+"e"+(+Z[1]-$))}return y(O)}}var Nh=Hs&&1/wa(new Hs([,-0]))[1]==I?function(p){return new Hs(p)}:ct;function Op(p){return function(y){var O=Do(y);return O==ee?ni(y):O==Te?Ru(y):(function($,Z){return Vr(Z,(function(re){return[re,$[re]]}))})(y,p(y))}}function rl(p,y,O,$,Z,re,ve,xe){var Ue=2&y;if(!Ue&&typeof p!="function")throw new Ee(g);var _t=$?$.length:0;if(_t||(y&=-97,$=Z=f),ve=ve===f?ve:Wo(ht(ve),0),xe=xe===f?xe:ht(xe),_t-=Z?Z.length:0,y&A){var xt=$,Xt=Z;$=Z=f}var xn=Ue?f:yf(p),An=[p,y,O,$,Z,xt,Xt,re,ve,xe];if(xn&&(function(Lt,nn){var sr=Lt[1],Pn=nn[1],qe=sr|Pn,yr=qe<131,Br=Pn==E&&sr==8||Pn==E&&sr==T&&Lt[7].length<=nn[8]||Pn==384&&nn[7].length<=nn[8]&&sr==8;if(!yr&&!Br)return Lt;1&Pn&&(Lt[2]=nn[2],qe|=1&sr?0:4);var Jn=nn[3];if(Jn){var dr=Lt[3];Lt[3]=dr?Th(dr,Jn,nn[4]):Jn,Lt[4]=dr?ia(Lt[3],b):nn[4]}(Jn=nn[5])&&(dr=Lt[5],Lt[5]=dr?Zs(dr,Jn,nn[6]):Jn,Lt[6]=dr?ia(Lt[5],b):nn[6]),(Jn=nn[7])&&(Lt[7]=Jn),Pn&E&&(Lt[8]=Lt[8]==null?nn[8]:Gi(Lt[8],nn[8])),Lt[9]==null&&(Lt[9]=nn[9]),Lt[0]=nn[0],Lt[1]=qe})(An,xn),p=An[0],y=An[1],O=An[2],$=An[3],Z=An[4],!(xe=An[9]=An[9]===f?Ue?0:p.length:Wo(An[9]-_t,0))&&24&y&&(y&=-25),y&&y!=1)qn=y==8||y==x?(function(Lt,nn,sr){var Pn=tu(Lt);return function qe(){for(var yr=arguments.length,Br=bn(yr),Jn=yr,dr=_s(qe);Jn--;)Br[Jn]=arguments[Jn];var Mi=yr<3&&Br[0]!==dr&&Br[yr-1]!==dr?[]:ia(Br,dr);return(yr-=Mi.length)<sr?Ep(Lt,nn,zc,qe.placeholder,f,Br,Mi,f,f,sr-yr):lo(this&&this!==Uo&&this instanceof qe?Pn:Lt,this,Br)}})(p,y,xe):y!=S&&y!=33||Z.length?zc.apply(f,An):(function(Lt,nn,sr,Pn){var qe=1&nn,yr=tu(Lt);return function Br(){for(var Jn=-1,dr=arguments.length,Mi=-1,Ba=Pn.length,Jl=bn(Ba+dr),ki=this&&this!==Uo&&this instanceof Br?yr:Lt;++Mi<Ba;)Jl[Mi]=Pn[Mi];for(;dr--;)Jl[Mi++]=arguments[++Jn];return lo(ki,qe?sr:this,Jl)}})(p,y,O,$);else var qn=(function(Lt,nn,sr){var Pn=1&nn,qe=tu(Lt);return function yr(){return(this&&this!==Uo&&this instanceof yr?qe:Lt).apply(Pn?sr:this,arguments)}})(p,y,O);return bf((xn?Uc:Mp)(qn,An),p,y)}function xp(p,y,O,$){return p===f||Fa(p,Yt[O])&&!vn.call($,O)?y:p}function Sp(p,y,O,$,Z,re){return Lo(p)&&Lo(y)&&(re.set(y,p),nf(p,y,f,Sp,re),re.delete(y)),p}function Ap(p){return G(p)?f:p}function zu(p,y,O,$,Z,re){var ve=1&O,xe=p.length,Ue=y.length;if(xe!=Ue&&!(ve&&Ue>xe))return!1;var _t=re.get(p),xt=re.get(y);if(_t&&xt)return _t==y&&xt==p;var Xt=-1,xn=!0,An=2&O?new Wl:f;for(re.set(p,y),re.set(y,p);++Xt<xe;){var qn=p[Xt],Lt=y[Xt];if($)var nn=ve?$(Lt,qn,Xt,y,p,re):$(qn,Lt,Xt,p,y,re);if(nn!==f){if(nn)continue;xn=!1;break}if(An){if(!Tc(y,(function(sr,Pn){if(!Xa(An,Pn)&&(qn===sr||Z(qn,sr,O,$,re)))return An.push(Pn)}))){xn=!1;break}}else if(qn!==Lt&&!Z(qn,Lt,O,$,re)){xn=!1;break}}return re.delete(p),re.delete(y),xn}function xl(p){return Jc(Zc(p,f,Qc),p+"")}function Xc(p){return ef(p,It,di)}function mf(p){return ef(p,Pt,nu)}var yf=Ic?function(p){return Ic.get(p)}:ct;function gs(p){for(var y=p.name+"",O=hs[y],$=vn.call(hs,y)?O.length:0;$--;){var Z=O[$],re=Z.func;if(re==null||re==p)return Z.name}return y}function _s(p){return(vn.call(le,"placeholder")?le:p).placeholder}function rr(){var p=le.iteratee||_o;return p=p===_o?Hl:p,arguments.length?p(arguments[0],arguments[1]):p}function Hu(p,y){var O,$,Z=p.__data__;return(($=typeof(O=y))=="string"||$=="number"||$=="symbol"||$=="boolean"?O!=="__proto__":O===null)?Z[typeof y=="string"?"string":"hash"]:Z.map}function qc(p){for(var y=It(p),O=y.length;O--;){var $=y[O],Z=p[$];y[O]=[$,Z,ru(Z)]}return y}function ol(p,y){var O=(function($,Z){return $==null?f:$[Z]})(p,y);return ms(O)?O:f}var di=Xd?function(p){return p==null?[]:(p=C(p),Bi(Xd(p),(function(y){return ri.call(p,y)})))}:Ge,nu=Xd?function(p){for(var y=[];p;)ui(y,di(p)),p=Ya(p);return y}:Ge,Do=No;function bs(p,y,O){for(var $=-1,Z=(y=Yr(y,p)).length,re=!1;++$<Z;){var ve=il(y[$]);if(!(re=p!=null&&O(p,ve)))break;p=p[ve]}return re||++$!=Z?re:!!(Z=p==null?0:p.length)&&dd(Z)&&Ii(ve,Z)&&(wr(p)||cu(p))}function ta(p){return typeof p.constructor!="function"||Ct(p)?{}:Xs(Ya(p))}function Yc(p){return wr(p)||cu(p)||!!(wl&&p&&p[wl])}function Ii(p,y){var O=typeof p;return!!(y=y??R)&&(O=="number"||O!="symbol"&&Nn.test(p))&&p>-1&&p%1==0&&p<y}function Ho(p,y,O){if(!Lo(O))return!1;var $=typeof y;return!!($=="number"?ca(O)&&Ii(y,O.length):$=="string"&&y in O)&&Fa(O[y],p)}function Sl(p,y){if(wr(p))return!1;var O=typeof p;return!(O!="number"&&O!="symbol"&&O!="boolean"&&p!=null&&!gt(p))||Gn.test(p)||!te.test(p)||y!=null&&p in C(y)}function Al(p){var y=gs(p),O=le[y];if(typeof O!="function"||!(y in jr.prototype))return!1;if(p===O)return!0;var $=yf(O);return!!$&&p===$[0]}(Du&&Do(new Du(new ArrayBuffer(1)))!=Be||Iu&&Do(new Iu)!=ee||Dc&&Do(Dc.resolve())!=we||Hs&&Do(new Hs)!=Te||ps&&Do(new ps)!=rt)&&(Do=function(p){var y=No(p),O=y==ae?p.constructor:f,$=O?Es(O):"";if($)switch($){case Hv:return Be;case Lc:return ee;case Xv:return we;case qv:return Te;case yh:return rt}return y});var gf=Sn?Aa:Je;function Ct(p){var y=p&&p.constructor;return p===(typeof y=="function"&&y.prototype||Yt)}function ru(p){return p==p&&!Lo(p)}function Kc(p,y){return function(O){return O!=null&&O[p]===y&&(y!==f||p in C(O))}}function Zc(p,y,O){return y=Wo(y===f?p.length-1:y,0),function(){for(var $=arguments,Z=-1,re=Wo($.length-y,0),ve=bn(re);++Z<re;)ve[Z]=$[y+Z];Z=-1;for(var xe=bn(y+1);++Z<y;)xe[Z]=$[Z];return xe[y]=O(ve),lo(p,this,xe)}}function ws(p,y){return y.length<2?p:El(p,Sa(y,0,-1))}function ou(p,y){for(var O=p.length,$=Gi(y.length,O),Z=yi(p);$--;){var re=y[$];p[$]=Ii(re,O)?Z[re]:f}return p}function _f(p,y){if((y!=="constructor"||typeof p[y]!="function")&&y!="__proto__")return p[y]}var Mp=kp(Uc),iu=lp||function(p,y){return Uo.setTimeout(p,y)},Jc=kp(Kv);function bf(p,y,O){var $=y+"";return Jc(p,(function(Z,re){var ve=re.length;if(!ve)return Z;var xe=ve-1;return re[xe]=(ve>1?"& ":"")+re[xe],re=re.join(ve>2?", ":" "),Z.replace(Se,`{
|
||
/* [wrapped with `+re+`] */
|
||
`)})($,(function(Z,re){return Fi(L,(function(ve){var xe="_."+ve[0];re&ve[1]&&!Zi(Z,xe)&&Z.push(xe)})),Z.sort()})((function(Z){var re=Z.match(Qe);return re?re[1].split($e):[]})($),O)))}function kp(p){var y=0,O=0;return function(){var $=Yd(),Z=16-($-O);if(O=$,Z>0){if(++y>=800)return arguments[0]}else y=0;return p.apply(f,arguments)}}function Ml(p,y){var O=-1,$=p.length,Z=$-1;for(y=y===f?$:y;++O<y;){var re=gp(O,Z),ve=p[re];p[re]=p[O],p[O]=ve}return p.length=y,p}var Tp=(function(p){var y=Zl(p,(function($){return O.size===500&&O.clear(),$})),O=y.cache;return y})((function(p){var y=[];return p.charCodeAt(0)===46&&y.push(""),p.replace(br,(function(O,$,Z,re){y.push(Z?re.replace(en,"$1"):$||O)})),y}));function il(p){if(typeof p=="string"||gt(p))return p;var y=p+"";return y=="0"&&1/p==-1/0?"-0":y}function Es(p){if(p!=null){try{return Or.call(p)}catch{}try{return p+""}catch{}}return""}function wf(p){if(p instanceof jr)return p.clone();var y=new Da(p.__wrapped__,p.__chain__);return y.__actions__=yi(p.__actions__),y.__index__=p.__index__,y.__values__=p.__values__,y}var Ph=kr((function(p,y){return Co(p)?el(p,oi(y,1,Co,!0)):[]})),Ch=kr((function(p,y){var O=xo(y);return Co(O)&&(O=f),Co(p)?el(p,oi(y,1,Co,!0),rr(O,2)):[]})),Rh=kr((function(p,y){var O=xo(y);return Co(O)&&(O=f),Co(p)?el(p,oi(y,1,Co,!0),f,O):[]}));function Np(p,y,O){var $=p==null?0:p.length;if(!$)return-1;var Z=O==null?0:ht(O);return Z<0&&(Z=Wo($+Z,0)),Vi(p,rr(y,3),Z)}function Ef(p,y,O){var $=p==null?0:p.length;if(!$)return-1;var Z=$-1;return O!==f&&(Z=ht(O),Z=O<0?Wo($+Z,0):Gi(Z,$-1)),Vi(p,rr(y,3),Z,!0)}function Qc(p){return p!=null&&p.length?oi(p,1):[]}function jh(p){return p&&p.length?p[0]:f}var al=kr((function(p){var y=Vr(p,uf);return y.length&&y[0]===p[0]?Bc(y):[]})),Os=kr((function(p){var y=xo(p),O=Vr(p,uf);return y===xo(O)?y=f:O.pop(),O.length&&O[0]===p[0]?Bc(O,rr(y,2)):[]})),Qv=kr((function(p){var y=xo(p),O=Vr(p,uf);return(y=typeof y=="function"?y:f)&&O.pop(),O.length&&O[0]===p[0]?Bc(O,f,y):[]}));function xo(p){var y=p==null?0:p.length;return y?p[y-1]:f}var ed=kr(au);function au(p,y){return p&&p.length&&y&&y.length?rf(p,y):p}var td=xl((function(p,y){var O=p==null?0:p.length,$=$c(p,y);return yp(p,Vr(y,(function(Z){return Ii(Z,O)?+Z:Z})).sort(Bu)),$}));function Xu(p){return p==null?p:zv.call(p)}var nd=kr((function(p){return ys(oi(p,1,Co,!0))})),rd=kr((function(p){var y=xo(p);return Co(y)&&(y=f),ys(oi(p,1,Co,!0),rr(y,2))})),od=kr((function(p){var y=xo(p);return y=typeof y=="function"?y:f,ys(oi(p,1,Co,!0),f,y)}));function lu(p){if(!p||!p.length)return[];var y=0;return p=Bi(p,(function(O){if(Co(O))return y=Wo(O.length,y),!0})),Fl(y,(function(O){return Vr(p,Ui(O))}))}function Yl(p,y){if(!p||!p.length)return[];var O=lu(p);return y==null?O:Vr(O,(function($){return lo(y,f,$)}))}var gi=kr((function(p,y){return Co(p)?el(p,y):[]})),Of=kr((function(p){return sf(Bi(p,Co))})),id=kr((function(p){var y=xo(p);return Co(y)&&(y=f),sf(Bi(p,Co),rr(y,2))})),su=kr((function(p){var y=xo(p);return y=typeof y=="function"?y:f,sf(Bi(p,Co),f,y)})),qu=kr(lu),Si=kr((function(p){var y=p.length,O=y>1?p[y-1]:f;return O=typeof O=="function"?(p.pop(),O):f,Yl(p,O)}));function Po(p){var y=le(p);return y.__chain__=!0,y}function ad(p,y){return y(p)}var Hi=xl((function(p){var y=p.length,O=y?p[0]:0,$=this.__wrapped__,Z=function(re){return $c(re,p)};return!(y>1||this.__actions__.length)&&$ instanceof jr&&Ii(O)?(($=$.slice(O,+O+(y?1:0))).__actions__.push({func:ad,args:[Z],thisArg:f}),new Da($,this.__chain__).thru((function(re){return y&&!re.length&&re.push(f),re}))):this.thru(Z)})),Wn=Xl((function(p,y,O){vn.call(p,O)?++p[O]:Qa(p,O,1)})),xf=pf(Np),ld=pf(Ef);function Sf(p,y){return(wr(p)?Fi:Oo)(p,rr(y,3))}function Pp(p,y){return(wr(p)?Gd:bh)(p,rr(y,3))}var Dh=Xl((function(p,y,O){vn.call(p,O)?p[O].push(y):Qa(p,O,[y])})),xs=kr((function(p,y,O){var $=-1,Z=typeof y=="function",re=ca(p)?bn(p.length):[];return Oo(p,(function(ve){re[++$]=Z?lo(y,ve,O):zi(ve,y,O)})),re})),Ih=Xl((function(p,y,O){Qa(p,O,y)}));function uu(p,y){return(wr(p)?Vr:xa)(p,rr(y,3))}var Lh=Xl((function(p,y,O){p[O?0:1].push(y)}),(function(){return[[],[]]})),Cp=kr((function(p,y){if(p==null)return[];var O=y.length;return O>1&&Ho(p,y[0],y[1])?y=[]:O>2&&Ho(y[0],y[1],y[2])&&(y=[y[0]]),Oh(p,oi(y,1),[])})),sd=vh||function(){return Uo.Date.now()};function $h(p,y,O){return y=O?f:y,y=p&&y==null?p.length:y,rl(p,E,f,f,f,f,y)}function $a(p,y){var O;if(typeof y!="function")throw new Ee(g);return p=ht(p),function(){return--p>0&&(O=y.apply(this,arguments)),p<=1&&(y=f),O}}var Kl=kr((function(p,y,O){var $=1;if(O.length){var Z=ia(O,_s(Kl));$|=S}return rl(p,$,y,O,Z)})),Ss=kr((function(p,y,O){var $=3;if(O.length){var Z=ia(O,_s(Ss));$|=S}return rl(y,$,p,O,Z)}));function zn(p,y,O){var $,Z,re,ve,xe,Ue,_t=0,xt=!1,Xt=!1,xn=!0;if(typeof p!="function")throw new Ee(g);function An(qe){var yr=$,Br=Z;return $=Z=f,_t=qe,ve=p.apply(Br,yr)}function qn(qe){return _t=qe,xe=iu(nn,y),xt?An(qe):ve}function Lt(qe){var yr=qe-Ue;return Ue===f||yr>=y||yr<0||Xt&&qe-_t>=re}function nn(){var qe=sd();if(Lt(qe))return sr(qe);xe=iu(nn,(function(yr){var Br=y-(yr-Ue);return Xt?Gi(Br,re-(yr-_t)):Br})(qe))}function sr(qe){return xe=f,xn&&$?An(qe):($=Z=f,ve)}function Pn(){var qe=sd(),yr=Lt(qe);if($=arguments,Z=this,Ue=qe,yr){if(xe===f)return qn(Ue);if(Xt)return df(xe),xe=iu(nn,y),An(Ue)}return xe===f&&(xe=iu(nn,y)),ve}return y=Gt(y)||0,Lo(O)&&(xt=!!O.leading,re=(Xt="maxWait"in O)?Wo(Gt(O.maxWait)||0,y):re,xn="trailing"in O?!!O.trailing:xn),Pn.cancel=function(){xe!==f&&df(xe),_t=0,$=Ue=Z=xe=f},Pn.flush=function(){return xe===f?ve:sr(sd())},Pn}var Rp=kr((function(p,y){return dp(p,1,y)})),Yu=kr((function(p,y,O){return dp(p,Gt(y)||0,O)}));function Zl(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new Ee(g);var O=function(){var $=arguments,Z=y?y.apply(this,$):$[0],re=O.cache;if(re.has(Z))return re.get(Z);var ve=p.apply(this,$);return O.cache=re.set(Z,ve)||re,ve};return O.cache=new(Zl.Cache||Ja),O}function ud(p){if(typeof p!="function")throw new Ee(g);return function(){var y=arguments;switch(y.length){case 0:return!p.call(this);case 1:return!p.call(this,y[0]);case 2:return!p.call(this,y[0],y[1]);case 3:return!p.call(this,y[0],y[1],y[2])}return!p.apply(this,y)}}Zl.Cache=Ja;var Xi=Jv((function(p,y){var O=(y=y.length==1&&wr(y[0])?Vr(y[0],mo(rr())):Vr(oi(y,1),mo(rr()))).length;return kr((function($){for(var Z=-1,re=Gi($.length,O);++Z<re;)$[Z]=y[Z].call(this,$[Z]);return lo(p,this,$)}))})),ll=kr((function(p,y){var O=ia(y,_s(ll));return rl(p,S,f,y,O)})),Io=kr((function(p,y){var O=ia(y,_s(Io));return rl(p,A,f,y,O)})),ua=xl((function(p,y){return rl(p,T,f,f,f,y)}));function Fa(p,y){return p===y||p!=p&&y!=y}var em=Gu(jo),cd=Gu((function(p,y){return p>=y})),cu=tf((function(){return arguments})())?tf:function(p){return Xo(p)&&vn.call(p,"callee")&&!ri.call(p,"callee")},wr=bn.isArray,Fh=Ac?mo(Ac):function(p){return Xo(p)&&No(p)==tt};function ca(p){return p!=null&&dd(p.length)&&!Aa(p)}function Co(p){return Xo(p)&&ca(p)}var na=mh||Je,jp=Wd?mo(Wd):function(p){return Xo(p)&&No(p)==F};function Ai(p){if(!Xo(p))return!1;var y=No(p);return y==q||y=="[object DOMException]"||typeof p.message=="string"&&typeof p.name=="string"&&!G(p)}function Aa(p){if(!Lo(p))return!1;var y=No(p);return y==K||y==X||y=="[object AsyncFunction]"||y=="[object Proxy]"}function du(p){return typeof p=="number"&&p==ht(p)}function dd(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=R}function Lo(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function Xo(p){return p!=null&&typeof p=="object"}var Af=Mc?mo(Mc):function(p){return Xo(p)&&Do(p)==ee};function Dp(p){return typeof p=="number"||Xo(p)&&No(p)==ue}function G(p){if(!Xo(p)||No(p)!=ae)return!1;var y=Ya(p);if(y===null)return!0;var O=vn.call(y,"constructor")&&y.constructor;return typeof O=="function"&&O instanceof O&&Or.call(O)==la}var se=$i?mo($i):function(p){return Xo(p)&&No(p)==je},Oe=si?mo(si):function(p){return Xo(p)&&Do(p)==Te};function ut(p){return typeof p=="string"||!wr(p)&&Xo(p)&&No(p)==Me}function gt(p){return typeof p=="symbol"||Xo(p)&&No(p)==Ne}var ot=ga?mo(ga):function(p){return Xo(p)&&dd(p.length)&&!!Kr[No(p)]},mt=Gu(Ol),Rt=Gu((function(p,y){return p<=y}));function Bt(p){if(!p)return[];if(ca(p))return ut(p)?Qi(p):yi(p);if(Ka&&p[Ka])return(function(O){for(var $,Z=[];!($=O.next()).done;)Z.push($.value);return Z})(p[Ka]());var y=Do(p);return(y==ee?ni:y==Te?wa:Er)(p)}function jt(p){return p?(p=Gt(p))===I||p===-1/0?17976931348623157e292*(p<0?-1:1):p==p?p:0:p===0?p:0}function ht(p){var y=jt(p),O=y%1;return y==y?O?y-O:y:0}function Kt(p){return p?vs(ht(p),0,D):0}function Gt(p){if(typeof p=="number")return p;if(gt(p))return U;if(Lo(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Lo(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=ja(p);var O=Ei.test(p);return O||ti.test(p)?ya(p.slice(2),O?2:8):li.test(p)?U:+p}function Dt(p){return tl(p,Pt(p))}function At(p){return p==null?"":sa(p)}var Ze=Js((function(p,y){if(Ct(y)||ca(y))tl(y,It(y),p);else for(var O in y)vn.call(y,O)&&Go(p,O,y[O])})),pt=Js((function(p,y){tl(y,Pt(y),p)})),$t=Js((function(p,y,O,$){tl(y,Pt(y),p,$)})),tn=Js((function(p,y,O,$){tl(y,It(y),p,$)})),kt=xl($c),ln=kr((function(p,y){p=C(p);var O=-1,$=y.length,Z=$>2?y[2]:f;for(Z&&Ho(y[0],y[1],Z)&&($=1);++O<$;)for(var re=y[O],ve=Pt(re),xe=-1,Ue=ve.length;++xe<Ue;){var _t=ve[xe],xt=p[_t];(xt===f||Fa(xt,Yt[_t])&&!vn.call(p,_t))&&(p[_t]=re[_t])}return p})),Nt=kr((function(p){return p.push(f,Sp),lo(Ln,f,p)}));function qt(p,y,O){var $=p==null?f:El(p,y);return $===f?O:$}function Tt(p,y){return p!=null&&bs(p,y,hp)}var Zt=Hc((function(p,y,O){y!=null&&typeof y.toString!="function"&&(y=Fr.call(y)),p[y]=O}),Tr(tr)),Cn=Hc((function(p,y,O){y!=null&&typeof y.toString!="function"&&(y=Fr.call(y)),vn.call(p,y)?p[y].push(O):p[y]=[O]}),rr),Hn=kr(zi);function It(p){return ca(p)?Jd(p):La(p)}function Pt(p){return ca(p)?Jd(p,!0):wh(p)}var Mt=Js((function(p,y,O){nf(p,y,O)})),Ln=Js((function(p,y,O,$){nf(p,y,O,$)})),or=xl((function(p,y){var O={};if(p==null)return O;var $=!1;y=Vr(y,(function(re){return re=Yr(re,p),$||($=re.length>1),re})),tl(p,mf(p),O),$&&(O=Oa(O,7,Ap));for(var Z=y.length;Z--;)af(O,y[Z]);return O})),mn=xl((function(p,y){return p==null?{}:(function(O,$){return xh(O,$,(function(Z,re){return Tt(O,re)}))})(p,y)}));function cr(p,y){if(p==null)return{};var O=Vr(mf(p),(function($){return[$]}));return y=rr(y),xh(p,O,(function($,Z){return y($,Z[0])}))}var Xn=Op(It),lr=Op(Pt);function Er(p){return p==null?[]:Vs(p,It(p))}var $o=ql((function(p,y,O){return y=y.toLowerCase(),p+(O?Ro(y):y)}));function Ro(p){return Jo(At(p).toLowerCase())}function ir(p){return(p=At(p))&&p.replace(Un,Pc).replace(gl,"")}var Zo=ql((function(p,y,O){return p+(O?"-":"")+y.toLowerCase()})),so=ql((function(p,y,O){return p+(O?" ":"")+y.toLowerCase()})),Fo=ff("toLowerCase"),qo=ql((function(p,y,O){return p+(O?"_":"")+y.toLowerCase()})),ii=ql((function(p,y,O){return p+(O?" ":"")+Jo(y)})),fi=ql((function(p,y,O){return p+(O?" ":"")+y.toUpperCase()})),Jo=ff("toUpperCase");function go(p,y,O){return p=At(p),(y=O?f:y)===f?(function($){return Sc.test($)})(p)?(function($){return $.match(ku)||[]})(p):(function($){return $.match(st)||[]})(p):p.match(y)||[]}var er=kr((function(p,y){try{return lo(p,f,y)}catch(O){return Ai(O)?O:new Rr(O)}})),pi=xl((function(p,y){return Fi(y,(function(O){O=il(O),Qa(p,O,Kl(p[O],p))})),p}));function Tr(p){return function(){return p}}var In=nl(),mr=nl(!0);function tr(p){return p}function _o(p){return Hl(typeof p=="function"?p:Oa(p,1))}var kl=kr((function(p,y){return function(O){return zi(O,p,y)}})),So=kr((function(p,y){return function(O){return zi(p,O,y)}}));function ye(p,y,O){var $=It(y),Z=Fc(y,$);O!=null||Lo(y)&&(Z.length||!$.length)||(O=y,y=p,p=this,Z=Fc(y,It(y)));var re=!(Lo(O)&&"chain"in O&&!O.chain),ve=Aa(p);return Fi(Z,(function(xe){var Ue=y[xe];p[xe]=Ue,ve&&(p.prototype[xe]=function(){var _t=this.__chain__;if(re||_t){var xt=p(this.__wrapped__),Xt=xt.__actions__=yi(this.__actions__);return Xt.push({func:Ue,args:arguments,thisArg:p}),xt.__chain__=_t,xt}return Ue.apply(p,ui([this.value()],arguments))})})),p}function ct(){}var it=Uu(Vr),dn=Uu(zd),hr=Uu(Tc);function he(p){return Sl(p)?Ui(il(p)):(function(y){return function(O){return El(O,y)}})(p)}var oe=hf(),Pe=hf(!0);function Ge(){return[]}function Je(){return!1}var De=Vu((function(p,y){return p+y}),0),Ce=vf("ceil"),Ve=Vu((function(p,y){return p/y}),1),pe=vf("floor"),Ae,fe=Vu((function(p,y){return p*y}),1),ze=vf("round"),Xe=Vu((function(p,y){return p-y}),0);return le.after=function(p,y){if(typeof y!="function")throw new Ee(g);return p=ht(p),function(){if(--p<1)return y.apply(this,arguments)}},le.ary=$h,le.assign=Ze,le.assignIn=pt,le.assignInWith=$t,le.assignWith=tn,le.at=kt,le.before=$a,le.bind=Kl,le.bindAll=pi,le.bindKey=Ss,le.castArray=function(){if(!arguments.length)return[];var p=arguments[0];return wr(p)?p:[p]},le.chain=Po,le.chunk=function(p,y,O){y=(O?Ho(p,y,O):y===f)?1:Wo(ht(y),0);var $=p==null?0:p.length;if(!$||y<1)return[];for(var Z=0,re=0,ve=bn(Rc($/y));Z<$;)ve[re++]=Sa(p,Z,Z+=y);return ve},le.compact=function(p){for(var y=-1,O=p==null?0:p.length,$=0,Z=[];++y<O;){var re=p[y];re&&(Z[$++]=re)}return Z},le.concat=function(){var p=arguments.length;if(!p)return[];for(var y=bn(p-1),O=arguments[0],$=p;$--;)y[$-1]=arguments[$];return ui(wr(O)?yi(O):[O],oi(y,1))},le.cond=function(p){var y=p==null?0:p.length,O=rr();return p=y?Vr(p,(function($){if(typeof $[1]!="function")throw new Ee(g);return[O($[0]),$[1]]})):[],kr((function($){for(var Z=-1;++Z<y;){var re=p[Z];if(lo(re[0],this,$))return lo(re[1],this,$)}}))},le.conforms=function(p){return(function(y){var O=It(y);return function($){return cp($,y,O)}})(Oa(p,1))},le.constant=Tr,le.countBy=Wn,le.create=function(p,y){var O=Xs(p);return y==null?O:zl(O,y)},le.curry=function p(y,O,$){var Z=rl(y,8,f,f,f,f,f,O=$?f:O);return Z.placeholder=p.placeholder,Z},le.curryRight=function p(y,O,$){var Z=rl(y,x,f,f,f,f,f,O=$?f:O);return Z.placeholder=p.placeholder,Z},le.debounce=zn,le.defaults=ln,le.defaultsDeep=Nt,le.defer=Rp,le.delay=Yu,le.difference=Ph,le.differenceBy=Ch,le.differenceWith=Rh,le.drop=function(p,y,O){var $=p==null?0:p.length;return $?Sa(p,(y=O||y===f?1:ht(y))<0?0:y,$):[]},le.dropRight=function(p,y,O){var $=p==null?0:p.length;return $?Sa(p,0,(y=$-(y=O||y===f?1:ht(y)))<0?0:y):[]},le.dropRightWhile=function(p,y){return p&&p.length?lf(p,rr(y,3),!0,!0):[]},le.dropWhile=function(p,y){return p&&p.length?lf(p,rr(y,3),!0):[]},le.fill=function(p,y,O,$){var Z=p==null?0:p.length;return Z?(O&&typeof O!="number"&&Ho(p,y,O)&&(O=0,$=Z),(function(re,ve,xe,Ue){var _t=re.length;for((xe=ht(xe))<0&&(xe=-xe>_t?0:_t+xe),(Ue=Ue===f||Ue>_t?_t:ht(Ue))<0&&(Ue+=_t),Ue=xe>Ue?0:Kt(Ue);xe<Ue;)re[xe++]=ve;return re})(p,y,O,$)):[]},le.filter=function(p,y){return(wr(p)?Bi:Zr)(p,rr(y,3))},le.flatMap=function(p,y){return oi(uu(p,y),1)},le.flatMapDeep=function(p,y){return oi(uu(p,y),I)},le.flatMapDepth=function(p,y,O){return O=O===f?1:ht(O),oi(uu(p,y),O)},le.flatten=Qc,le.flattenDeep=function(p){return p!=null&&p.length?oi(p,I):[]},le.flattenDepth=function(p,y){return p!=null&&p.length?oi(p,y=y===f?1:ht(y)):[]},le.flip=function(p){return rl(p,512)},le.flow=In,le.flowRight=mr,le.fromPairs=function(p){for(var y=-1,O=p==null?0:p.length,$={};++y<O;){var Z=p[y];$[Z[0]]=Z[1]}return $},le.functions=function(p){return p==null?[]:Fc(p,It(p))},le.functionsIn=function(p){return p==null?[]:Fc(p,Pt(p))},le.groupBy=Dh,le.initial=function(p){return p!=null&&p.length?Sa(p,0,-1):[]},le.intersection=al,le.intersectionBy=Os,le.intersectionWith=Qv,le.invert=Zt,le.invertBy=Cn,le.invokeMap=xs,le.iteratee=_o,le.keyBy=Ih,le.keys=It,le.keysIn=Pt,le.map=uu,le.mapKeys=function(p,y){var O={};return y=rr(y,3),Dn(p,(function($,Z,re){Qa(O,y($,Z,re),$)})),O},le.mapValues=function(p,y){var O={};return y=rr(y,3),Dn(p,(function($,Z,re){Qa(O,Z,y($,Z,re))})),O},le.matches=function(p){return vp(Oa(p,1))},le.matchesProperty=function(p,y){return mp(p,Oa(y,1))},le.memoize=Zl,le.merge=Mt,le.mergeWith=Ln,le.method=kl,le.methodOf=So,le.mixin=ye,le.negate=ud,le.nthArg=function(p){return p=ht(p),kr((function(y){return Eh(y,p)}))},le.omit=or,le.omitBy=function(p,y){return cr(p,ud(rr(y)))},le.once=function(p){return $a(2,p)},le.orderBy=function(p,y,O,$){return p==null?[]:(wr(y)||(y=y==null?[]:[y]),wr(O=$?f:O)||(O=O==null?[]:[O]),Oh(p,y,O))},le.over=it,le.overArgs=Xi,le.overEvery=dn,le.overSome=hr,le.partial=ll,le.partialRight=Io,le.partition=Lh,le.pick=mn,le.pickBy=cr,le.property=he,le.propertyOf=function(p){return function(y){return p==null?f:El(p,y)}},le.pull=ed,le.pullAll=au,le.pullAllBy=function(p,y,O){return p&&p.length&&y&&y.length?rf(p,y,rr(O,2)):p},le.pullAllWith=function(p,y,O){return p&&p.length&&y&&y.length?rf(p,y,f,O):p},le.pullAt=td,le.range=oe,le.rangeRight=Pe,le.rearg=ua,le.reject=function(p,y){return(wr(p)?Bi:Zr)(p,ud(rr(y,3)))},le.remove=function(p,y){var O=[];if(!p||!p.length)return O;var $=-1,Z=[],re=p.length;for(y=rr(y,3);++$<re;){var ve=p[$];y(ve,$,p)&&(O.push(ve),Z.push($))}return yp(p,Z),O},le.rest=function(p,y){if(typeof p!="function")throw new Ee(g);return kr(p,y=y===f?y:ht(y))},le.reverse=Xu,le.sampleSize=function(p,y,O){return y=(O?Ho(p,y,O):y===f)?1:ht(y),(wr(p)?sp:_p)(p,y)},le.set=function(p,y,O){return p==null?p:qs(p,y,O)},le.setWith=function(p,y,O,$){return $=typeof $=="function"?$:f,p==null?p:qs(p,y,O,$)},le.shuffle=function(p){return(wr(p)?_h:Sh)(p)},le.slice=function(p,y,O){var $=p==null?0:p.length;return $?(O&&typeof O!="number"&&Ho(p,y,O)?(y=0,O=$):(y=y==null?0:ht(y),O=O===f?$:ht(O)),Sa(p,y,O)):[]},le.sortBy=Cp,le.sortedUniq=function(p){return p&&p.length?bp(p):[]},le.sortedUniqBy=function(p,y){return p&&p.length?bp(p,rr(y,2)):[]},le.split=function(p,y,O){return O&&typeof O!="number"&&Ho(p,y,O)&&(y=O=f),(O=O===f?D:O>>>0)?(p=At(p))&&(typeof y=="string"||y!=null&&!se(y))&&!(y=sa(y))&&qa(p)?no(Qi(p),0,O):p.split(y,O):[]},le.spread=function(p,y){if(typeof p!="function")throw new Ee(g);return y=y==null?0:Wo(ht(y),0),kr((function(O){var $=O[y],Z=no(O,0,y);return $&&ui(Z,$),lo(p,this,Z)}))},le.tail=function(p){var y=p==null?0:p.length;return y?Sa(p,1,y):[]},le.take=function(p,y,O){return p&&p.length?Sa(p,0,(y=O||y===f?1:ht(y))<0?0:y):[]},le.takeRight=function(p,y,O){var $=p==null?0:p.length;return $?Sa(p,(y=$-(y=O||y===f?1:ht(y)))<0?0:y,$):[]},le.takeRightWhile=function(p,y){return p&&p.length?lf(p,rr(y,3),!1,!0):[]},le.takeWhile=function(p,y){return p&&p.length?lf(p,rr(y,3)):[]},le.tap=function(p,y){return y(p),p},le.throttle=function(p,y,O){var $=!0,Z=!0;if(typeof p!="function")throw new Ee(g);return Lo(O)&&($="leading"in O?!!O.leading:$,Z="trailing"in O?!!O.trailing:Z),zn(p,y,{leading:$,maxWait:y,trailing:Z})},le.thru=ad,le.toArray=Bt,le.toPairs=Xn,le.toPairsIn=lr,le.toPath=function(p){return wr(p)?Vr(p,il):gt(p)?[p]:yi(Tp(At(p)))},le.toPlainObject=Dt,le.transform=function(p,y,O){var $=wr(p),Z=$||na(p)||ot(p);if(y=rr(y,4),O==null){var re=p&&p.constructor;O=Z?$?new re:[]:Lo(p)&&Aa(re)?Xs(Ya(p)):{}}return(Z?Fi:Dn)(p,(function(ve,xe,Ue){return y(O,ve,xe,Ue)})),O},le.unary=function(p){return $h(p,1)},le.union=nd,le.unionBy=rd,le.unionWith=od,le.uniq=function(p){return p&&p.length?ys(p):[]},le.uniqBy=function(p,y){return p&&p.length?ys(p,rr(y,2)):[]},le.uniqWith=function(p,y){return y=typeof y=="function"?y:f,p&&p.length?ys(p,f,y):[]},le.unset=function(p,y){return p==null||af(p,y)},le.unzip=lu,le.unzipWith=Yl,le.update=function(p,y,O){return p==null?p:Ys(p,y,cf(O))},le.updateWith=function(p,y,O,$){return $=typeof $=="function"?$:f,p==null?p:Ys(p,y,cf(O),$)},le.values=Er,le.valuesIn=function(p){return p==null?[]:Vs(p,Pt(p))},le.without=gi,le.words=go,le.wrap=function(p,y){return ll(cf(y),p)},le.xor=Of,le.xorBy=id,le.xorWith=su,le.zip=qu,le.zipObject=function(p,y){return Gc(p||[],y||[],Go)},le.zipObjectDeep=function(p,y){return Gc(p||[],y||[],qs)},le.zipWith=Si,le.entries=Xn,le.entriesIn=lr,le.extend=pt,le.extendWith=$t,ye(le,le),le.add=De,le.attempt=er,le.camelCase=$o,le.capitalize=Ro,le.ceil=Ce,le.clamp=function(p,y,O){return O===f&&(O=y,y=f),O!==f&&(O=(O=Gt(O))==O?O:0),y!==f&&(y=(y=Gt(y))==y?y:0),vs(Gt(p),y,O)},le.clone=function(p){return Oa(p,4)},le.cloneDeep=function(p){return Oa(p,5)},le.cloneDeepWith=function(p,y){return Oa(p,5,y=typeof y=="function"?y:f)},le.cloneWith=function(p,y){return Oa(p,4,y=typeof y=="function"?y:f)},le.conformsTo=function(p,y){return y==null||cp(p,y,It(y))},le.deburr=ir,le.defaultTo=function(p,y){return p==null||p!=p?y:p},le.divide=Ve,le.endsWith=function(p,y,O){p=At(p),y=sa(y);var $=p.length,Z=O=O===f?$:vs(ht(O),0,$);return(O-=y.length)>=0&&p.slice(O,Z)==y},le.eq=Fa,le.escape=function(p){return(p=At(p))&&sn.test(p)?p.replace(Wt,Ko):p},le.escapeRegExp=function(p){return(p=At(p))&&zr.test(p)?p.replace(Dr,"\\$&"):p},le.every=function(p,y,O){var $=wr(p)?zd:fp;return O&&Ho(p,y,O)&&(y=f),$(p,rr(y,3))},le.find=xf,le.findIndex=Np,le.findKey=function(p,y){return Ha(p,rr(y,3),Dn)},le.findLast=ld,le.findLastIndex=Ef,le.findLastKey=function(p,y){return Ha(p,rr(y,3),fo)},le.floor=pe,le.forEach=Sf,le.forEachRight=Pp,le.forIn=function(p,y){return p==null?p:Mr(p,rr(y,3),Pt)},le.forInRight=function(p,y){return p==null?p:co(p,rr(y,3),Pt)},le.forOwn=function(p,y){return p&&Dn(p,rr(y,3))},le.forOwnRight=function(p,y){return p&&fo(p,rr(y,3))},le.get=qt,le.gt=em,le.gte=cd,le.has=function(p,y){return p!=null&&bs(p,y,pp)},le.hasIn=Tt,le.head=jh,le.identity=tr,le.includes=function(p,y,O,$){p=ca(p)?p:Er(p),O=O&&!$?ht(O):0;var Z=p.length;return O<0&&(O=Wo(Z+O,0)),ut(p)?O<=Z&&p.indexOf(y,O)>-1:!!Z&&us(p,y,O)>-1},le.indexOf=function(p,y,O){var $=p==null?0:p.length;if(!$)return-1;var Z=O==null?0:ht(O);return Z<0&&(Z=Wo($+Z,0)),us(p,y,Z)},le.inRange=function(p,y,O){return y=jt(y),O===f?(O=y,y=0):O=jt(O),(function($,Z,re){return $>=Gi(Z,re)&&$<Wo(Z,re)})(p=Gt(p),y,O)},le.invoke=Hn,le.isArguments=cu,le.isArray=wr,le.isArrayBuffer=Fh,le.isArrayLike=ca,le.isArrayLikeObject=Co,le.isBoolean=function(p){return p===!0||p===!1||Xo(p)&&No(p)==B},le.isBuffer=na,le.isDate=jp,le.isElement=function(p){return Xo(p)&&p.nodeType===1&&!G(p)},le.isEmpty=function(p){if(p==null)return!0;if(ca(p)&&(wr(p)||typeof p=="string"||typeof p.splice=="function"||na(p)||ot(p)||cu(p)))return!p.length;var y=Do(p);if(y==ee||y==Te)return!p.size;if(Ct(p))return!La(p).length;for(var O in p)if(vn.call(p,O))return!1;return!0},le.isEqual=function(p,y){return Fu(p,y)},le.isEqualWith=function(p,y,O){var $=(O=typeof O=="function"?O:f)?O(p,y):f;return $===f?Fu(p,y,f,O):!!$},le.isError=Ai,le.isFinite=function(p){return typeof p=="number"&&zs(p)},le.isFunction=Aa,le.isInteger=du,le.isLength=dd,le.isMap=Af,le.isMatch=function(p,y){return p===y||Ia(p,y,qc(y))},le.isMatchWith=function(p,y,O){return O=typeof O=="function"?O:f,Ia(p,y,qc(y),O)},le.isNaN=function(p){return Dp(p)&&p!=+p},le.isNative=function(p){if(gf(p))throw new Rr("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ms(p)},le.isNil=function(p){return p==null},le.isNull=function(p){return p===null},le.isNumber=Dp,le.isObject=Lo,le.isObjectLike=Xo,le.isPlainObject=G,le.isRegExp=se,le.isSafeInteger=function(p){return du(p)&&p>=-9007199254740991&&p<=R},le.isSet=Oe,le.isString=ut,le.isSymbol=gt,le.isTypedArray=ot,le.isUndefined=function(p){return p===f},le.isWeakMap=function(p){return Xo(p)&&Do(p)==rt},le.isWeakSet=function(p){return Xo(p)&&No(p)=="[object WeakSet]"},le.join=function(p,y){return p==null?"":jc.call(p,y)},le.kebabCase=Zo,le.last=xo,le.lastIndexOf=function(p,y,O){var $=p==null?0:p.length;if(!$)return-1;var Z=$;return O!==f&&(Z=(Z=ht(O))<0?Wo($+Z,0):Gi(Z,$-1)),y==y?(function(re,ve,xe){for(var Ue=xe+1;Ue--;)if(re[Ue]===ve)return Ue;return Ue})(p,y,Z):Vi(p,_a,Z,!0)},le.lowerCase=so,le.lowerFirst=Fo,le.lt=mt,le.lte=Rt,le.max=function(p){return p&&p.length?zo(p,tr,jo):f},le.maxBy=function(p,y){return p&&p.length?zo(p,rr(y,2),jo):f},le.mean=function(p){return Cr(p,tr)},le.meanBy=function(p,y){return Cr(p,rr(y,2))},le.min=function(p){return p&&p.length?zo(p,tr,Ol):f},le.minBy=function(p,y){return p&&p.length?zo(p,rr(y,2),Ol):f},le.stubArray=Ge,le.stubFalse=Je,le.stubObject=function(){return{}},le.stubString=function(){return""},le.stubTrue=function(){return!0},le.multiply=fe,le.nth=function(p,y){return p&&p.length?Eh(p,ht(y)):f},le.noConflict=function(){return Uo._===this&&(Uo._=To),this},le.noop=ct,le.now=sd,le.pad=function(p,y,O){p=At(p);var $=(y=ht(y))?Wi(p):0;if(!y||$>=y)return p;var Z=(y-$)/2;return Wu(Gs(Z),O)+p+Wu(Rc(Z),O)},le.padEnd=function(p,y,O){p=At(p);var $=(y=ht(y))?Wi(p):0;return y&&$<y?p+Wu(y-$,O):p},le.padStart=function(p,y,O){p=At(p);var $=(y=ht(y))?Wi(p):0;return y&&$<y?Wu(y-$,O)+p:p},le.parseInt=function(p,y,O){return O||y==null?y=0:y&&(y=+y),Kd(At(p).replace(jn,""),y||0)},le.random=function(p,y,O){if(O&&typeof O!="boolean"&&Ho(p,y,O)&&(y=O=f),O===f&&(typeof y=="boolean"?(O=y,y=f):typeof p=="boolean"&&(O=p,p=f)),p===f&&y===f?(p=0,y=1):(p=jt(p),y===f?(y=p,p=0):y=jt(y)),p>y){var $=p;p=y,y=$}if(O||p%1||y%1){var Z=ju();return Gi(p+Z*(y-p+ls("1e-"+((Z+"").length-1))),y)}return gp(p,y)},le.reduce=function(p,y,O){var $=wr(p)?Pu:mi,Z=arguments.length<3;return $(p,rr(y,4),O,Z,Oo)},le.reduceRight=function(p,y,O){var $=wr(p)?Hd:mi,Z=arguments.length<3;return $(p,rr(y,4),O,Z,bh)},le.repeat=function(p,y,O){return y=(O?Ho(p,y,O):y===f)?1:ht(y),Vc(At(p),y)},le.replace=function(){var p=arguments,y=At(p[0]);return p.length<3?y:y.replace(p[1],p[2])},le.result=function(p,y,O){var $=-1,Z=(y=Yr(y,p)).length;for(Z||(Z=1,p=f);++$<Z;){var re=p==null?f:p[il(y[$])];re===f&&($=Z,re=O),p=Aa(re)?re.call(p):re}return p},le.round=ze,le.runInContext=vt,le.sample=function(p){return(wr(p)?Qd:Yv)(p)},le.size=function(p){if(p==null)return 0;if(ca(p))return ut(p)?Wi(p):p.length;var y=Do(p);return y==ee||y==Te?p.size:La(p).length},le.snakeCase=qo,le.some=function(p,y,O){var $=wr(p)?Tc:Zv;return O&&Ho(p,y,O)&&(y=f),$(p,rr(y,3))},le.sortedIndex=function(p,y){return Wc(p,y)},le.sortedIndexBy=function(p,y,O){return of(p,y,rr(O,2))},le.sortedIndexOf=function(p,y){var O=p==null?0:p.length;if(O){var $=Wc(p,y);if($<O&&Fa(p[$],y))return $}return-1},le.sortedLastIndex=function(p,y){return Wc(p,y,!0)},le.sortedLastIndexBy=function(p,y,O){return of(p,y,rr(O,2),!0)},le.sortedLastIndexOf=function(p,y){if(p!=null&&p.length){var O=Wc(p,y,!0)-1;if(Fa(p[O],y))return O}return-1},le.startCase=ii,le.startsWith=function(p,y,O){return p=At(p),O=O==null?0:vs(ht(O),0,p.length),y=sa(y),p.slice(O,O+y.length)==y},le.subtract=Xe,le.sum=function(p){return p&&p.length?cs(p,tr):0},le.sumBy=function(p,y){return p&&p.length?cs(p,rr(y,2)):0},le.template=function(p,y,O){var $=le.templateSettings;O&&Ho(p,y,O)&&(y=f),p=At(p),y=$t({},y,$,xp);var Z,re,ve=$t({},y.imports,$.imports,xp),xe=It(ve),Ue=Vs(ve,xe),_t=0,xt=y.interpolate||Zn,Xt="__p += '",xn=z((y.escape||Zn).source+"|"+xt.source+"|"+(xt===Kn?Tn:Zn).source+"|"+(y.evaluate||Zn).source+"|$","g"),An="//# sourceURL="+(vn.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bd+"]")+`
|
||
`;p.replace(xn,(function(nn,sr,Pn,qe,yr,Br){return Pn||(Pn=qe),Xt+=p.slice(_t,Br).replace(ur,Us),sr&&(Z=!0,Xt+=`' +
|
||
__e(`+sr+`) +
|
||
'`),yr&&(re=!0,Xt+=`';
|
||
`+yr+`;
|
||
__p += '`),Pn&&(Xt+=`' +
|
||
((__t = (`+Pn+`)) == null ? '' : __t) +
|
||
'`),_t=Br+nn.length,nn})),Xt+=`';
|
||
`;var qn=vn.call(y,"variable")&&y.variable;if(qn){if(an.test(qn))throw new Rr("Invalid `variable` option passed into `_.template`")}else Xt=`with (obj) {
|
||
`+Xt+`
|
||
}
|
||
`;Xt=(re?Xt.replace(bt,""):Xt).replace(Ft,"$1").replace(Qt,"$1;"),Xt="function("+(qn||"obj")+`) {
|
||
`+(qn?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(re?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Xt+`return __p
|
||
}`;var Lt=er((function(){return yo(xe,An+"return "+Xt).apply(f,Ue)}));if(Lt.source=Xt,Ai(Lt))throw Lt;return Lt},le.times=function(p,y){if((p=ht(p))<1||p>R)return[];var O=D,$=Gi(p,D);y=rr(y),p-=D;for(var Z=Fl($,y);++O<p;)y(O);return Z},le.toFinite=jt,le.toInteger=ht,le.toLength=Kt,le.toLower=function(p){return At(p).toLowerCase()},le.toNumber=Gt,le.toSafeInteger=function(p){return p?vs(ht(p),-9007199254740991,R):p===0?p:0},le.toString=At,le.toUpper=function(p){return At(p).toUpperCase()},le.trim=function(p,y,O){if((p=At(p))&&(O||y===f))return ja(p);if(!p||!(y=sa(y)))return p;var $=Qi(p),Z=Qi(y);return no($,ba($,Z),Nc($,Z)+1).join("")},le.trimEnd=function(p,y,O){if((p=At(p))&&(O||y===f))return p.slice(0,ci(p)+1);if(!p||!(y=sa(y)))return p;var $=Qi(p);return no($,0,Nc($,Qi(y))+1).join("")},le.trimStart=function(p,y,O){if((p=At(p))&&(O||y===f))return p.replace(jn,"");if(!p||!(y=sa(y)))return p;var $=Qi(p);return no($,ba($,Qi(y))).join("")},le.truncate=function(p,y){var O=30,$="...";if(Lo(y)){var Z="separator"in y?y.separator:Z;O="length"in y?ht(y.length):O,$="omission"in y?sa(y.omission):$}var re=(p=At(p)).length;if(qa(p)){var ve=Qi(p);re=ve.length}if(O>=re)return p;var xe=O-Wi($);if(xe<1)return $;var Ue=ve?no(ve,0,xe).join(""):p.slice(0,xe);if(Z===f)return Ue+$;if(ve&&(xe+=Ue.length-xe),se(Z)){if(p.slice(xe).search(Z)){var _t,xt=Ue;for(Z.global||(Z=z(Z.source,At(Sr.exec(Z))+"g")),Z.lastIndex=0;_t=Z.exec(xt);)var Xt=_t.index;Ue=Ue.slice(0,Xt===f?xe:Xt)}}else if(p.indexOf(sa(Z),xe)!=xe){var xn=Ue.lastIndexOf(Z);xn>-1&&(Ue=Ue.slice(0,xn))}return Ue+$},le.unescape=function(p){return(p=At(p))&&nt.test(p)?p.replace(on,aa):p},le.uniqueId=function(p){var y=++qr;return At(p)+y},le.upperCase=fi,le.upperFirst=Jo,le.each=Sf,le.eachRight=Pp,le.first=jh,ye(le,(Ae={},Dn(le,(function(p,y){vn.call(le.prototype,y)||(Ae[y]=p)})),Ae),{chain:!1}),le.VERSION="4.17.21",Fi(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(p){le[p].placeholder=le})),Fi(["drop","take"],(function(p,y){jr.prototype[p]=function(O){O=O===f?1:Wo(ht(O),0);var $=this.__filtered__&&!y?new jr(this):this.clone();return $.__filtered__?$.__takeCount__=Gi(O,$.__takeCount__):$.__views__.push({size:Gi(O,D),type:p+($.__dir__<0?"Right":"")}),$},jr.prototype[p+"Right"]=function(O){return this.reverse()[p](O).reverse()}})),Fi(["filter","map","takeWhile"],(function(p,y){var O=y+1,$=O==1||O==3;jr.prototype[p]=function(Z){var re=this.clone();return re.__iteratees__.push({iteratee:rr(Z,3),type:O}),re.__filtered__=re.__filtered__||$,re}})),Fi(["head","last"],(function(p,y){var O="take"+(y?"Right":"");jr.prototype[p]=function(){return this[O](1).value()[0]}})),Fi(["initial","tail"],(function(p,y){var O="drop"+(y?"":"Right");jr.prototype[p]=function(){return this.__filtered__?new jr(this):this[O](1)}})),jr.prototype.compact=function(){return this.filter(tr)},jr.prototype.find=function(p){return this.filter(p).head()},jr.prototype.findLast=function(p){return this.reverse().find(p)},jr.prototype.invokeMap=kr((function(p,y){return typeof p=="function"?new jr(this):this.map((function(O){return zi(O,p,y)}))})),jr.prototype.reject=function(p){return this.filter(ud(rr(p)))},jr.prototype.slice=function(p,y){p=ht(p);var O=this;return O.__filtered__&&(p>0||y<0)?new jr(O):(p<0?O=O.takeRight(-p):p&&(O=O.drop(p)),y!==f&&(O=(y=ht(y))<0?O.dropRight(-y):O.take(y-p)),O)},jr.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},jr.prototype.toArray=function(){return this.take(D)},Dn(jr.prototype,(function(p,y){var O=/^(?:filter|find|map|reject)|While$/.test(y),$=/^(?:head|last)$/.test(y),Z=le[$?"take"+(y=="last"?"Right":""):y],re=$||/^find/.test(y);Z&&(le.prototype[y]=function(){var ve=this.__wrapped__,xe=$?[1]:arguments,Ue=ve instanceof jr,_t=xe[0],xt=Ue||wr(ve),Xt=function(sr){var Pn=Z.apply(le,ui([sr],xe));return $&&xn?Pn[0]:Pn};xt&&O&&typeof _t=="function"&&_t.length!=1&&(Ue=xt=!1);var xn=this.__chain__,An=!!this.__actions__.length,qn=re&&!xn,Lt=Ue&&!An;if(!re&&xt){ve=Lt?ve:new jr(this);var nn=p.apply(ve,xe);return nn.__actions__.push({func:ad,args:[Xt],thisArg:f}),new Da(nn,xn)}return qn&&Lt?p.apply(this,xe):(nn=this.thru(Xt),qn?$?nn.value()[0]:nn.value():nn)})})),Fi(["pop","push","shift","sort","splice","unshift"],(function(p){var y=Ke[p],O=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",$=/^(?:pop|shift)$/.test(p);le.prototype[p]=function(){var Z=arguments;if($&&!this.__chain__){var re=this.value();return y.apply(wr(re)?re:[],Z)}return this[O]((function(ve){return y.apply(wr(ve)?ve:[],Z)}))}})),Dn(jr.prototype,(function(p,y){var O=le[y];if(O){var $=O.name+"";vn.call(hs,$)||(hs[$]=[]),hs[$].push({name:y,func:O})}})),hs[zc(f,2).name]=[{name:"wrapper",func:f}],jr.prototype.clone=function(){var p=new jr(this.__wrapped__);return p.__actions__=yi(this.__actions__),p.__dir__=this.__dir__,p.__filtered__=this.__filtered__,p.__iteratees__=yi(this.__iteratees__),p.__takeCount__=this.__takeCount__,p.__views__=yi(this.__views__),p},jr.prototype.reverse=function(){if(this.__filtered__){var p=new jr(this);p.__dir__=-1,p.__filtered__=!0}else(p=this.clone()).__dir__*=-1;return p},jr.prototype.value=function(){var p=this.__wrapped__.value(),y=this.__dir__,O=wr(p),$=y<0,Z=O?p.length:0,re=(function(Br,Jn,dr){for(var Mi=-1,Ba=dr.length;++Mi<Ba;){var Jl=dr[Mi],ki=Jl.size;switch(Jl.type){case"drop":Br+=ki;break;case"dropRight":Jn-=ki;break;case"take":Jn=Gi(Jn,Br+ki);break;case"takeRight":Br=Wo(Br,Jn-ki)}}return{start:Br,end:Jn}})(0,Z,this.__views__),ve=re.start,xe=re.end,Ue=xe-ve,_t=$?xe:ve-1,xt=this.__iteratees__,Xt=xt.length,xn=0,An=Gi(Ue,this.__takeCount__);if(!O||!$&&Z==Ue&&An==Ue)return wp(p,this.__actions__);var qn=[];e:for(;Ue--&&xn<An;){for(var Lt=-1,nn=p[_t+=y];++Lt<Xt;){var sr=xt[Lt],Pn=sr.iteratee,qe=sr.type,yr=Pn(nn);if(qe==2)nn=yr;else if(!yr){if(qe==1)continue e;break e}}qn[xn++]=nn}return qn},le.prototype.at=Hi,le.prototype.chain=function(){return Po(this)},le.prototype.commit=function(){return new Da(this.value(),this.__chain__)},le.prototype.next=function(){this.__values__===f&&(this.__values__=Bt(this.value()));var p=this.__index__>=this.__values__.length;return{done:p,value:p?f:this.__values__[this.__index__++]}},le.prototype.plant=function(p){for(var y,O=this;O instanceof Ul;){var $=wf(O);$.__index__=0,$.__values__=f,y?Z.__wrapped__=$:y=$;var Z=$;O=O.__wrapped__}return Z.__wrapped__=p,y},le.prototype.reverse=function(){var p=this.__wrapped__;if(p instanceof jr){var y=p;return this.__actions__.length&&(y=new jr(this)),(y=y.reverse()).__actions__.push({func:ad,args:[Xu],thisArg:f}),new Da(y,this.__chain__)}return this.thru(Xu)},le.prototype.toJSON=le.prototype.valueOf=le.prototype.value=function(){return wp(this.__wrapped__,this.__actions__)},le.prototype.first=le.prototype.head,Ka&&(le.prototype[Ka]=function(){return this}),le})();Uo._=ji,(v=(function(){return ji}).call(a,r,a,c))===f||(c.exports=v)}).call(this)}).call(this,r(68),r(221)(n))},function(n,a,r){var s=r(7),c=r(34),v=r(33),f=r(87),g=r(62),_=r(174),b=r(28),x=s.TypeError,S=b("toPrimitive");n.exports=function(A,E){if(!v(A)||f(A))return A;var T,I=g(A,S);if(I){if(E===void 0&&(E="default"),T=c(I,A,E),!v(T)||f(T))return T;throw x("Can't convert object to primitive value")}return E===void 0&&(E="number"),_(A,E)}},function(n,a,r){var s=r(108);n.exports=s&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(n,a,r){var s=r(36),c=r(18),v=r(91);n.exports=!s&&!c((function(){return Object.defineProperty(v("div"),"a",{get:function(){return 7}}).a!=7}))},function(n,a,r){var s=r(35),c=r(135),v=r(50),f=r(38);n.exports=function(g,_){for(var b=c(_),x=f.f,S=v.f,A=0;A<b.length;A++){var E=b[A];s(g,E)||x(g,E,S(_,E))}}},function(n,a,r){var s=r(46),c=r(15),v=r(74),f=r(112),g=r(32),_=c([].concat);n.exports=s("Reflect","ownKeys")||function(b){var x=v.f(g(b)),S=f.f;return S?_(x,S(b)):x}},function(n,a,r){var s=r(15),c=r(35),v=r(41),f=r(137).indexOf,g=r(72),_=s([].push);n.exports=function(b,x){var S,A=v(b),E=0,T=[];for(S in A)!c(g,S)&&c(A,S)&&_(T,S);for(;x.length>E;)c(A,S=x[E++])&&(~f(T,S)||_(T,S));return T}},function(n,a,r){var s=r(41),c=r(75),v=r(45),f=function(g){return function(_,b,x){var S,A=s(_),E=v(A),T=c(x,E);if(g&&b!=b){for(;E>T;)if((S=A[T++])!=S)return!0}else for(;E>T;T++)if((g||T in A)&&A[T]===b)return g||T||0;return!g&&-1}};n.exports={includes:f(!0),indexOf:f(!1)}},function(n,a,r){var s=r(46);n.exports=s("document","documentElement")},function(n,a,r){var s=r(51),c=r(41),v=r(74).f,f=r(114),g=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(_){return g&&s(_)=="Window"?(function(b){try{return v(b)}catch{return f(g)}})(_):v(c(_))}},function(n,a,r){var s=r(28);a.f=s},function(n,a,r){var s=r(177),c=r(35),v=r(140),f=r(38).f;n.exports=function(g){var _=s.Symbol||(s.Symbol={});c(_,g)||f(_,g,{value:v.f(g)})}},function(n,a,r){var s,c,v,f=r(18),g=r(30),_=r(60),b=r(101),x=r(42),S=r(28),A=r(71),E=S("iterator"),T=!1;[].keys&&("next"in(v=[].keys())?(c=b(b(v)))!==Object.prototype&&(s=c):T=!0),s==null||f((function(){var I={};return s[E].call(I)!==I}))?s={}:A&&(s=_(s)),g(s[E])||x(s,E,(function(){return this})),n.exports={IteratorPrototype:s,BUGGY_SAFARI_ITERATORS:T}},function(n,a,r){var s=r(18);n.exports=!s((function(){function c(){}return c.prototype.constructor=null,Object.getPrototypeOf(new c)!==c.prototype}))},function(n,a,r){var s=r(16),c=r(15),v=r(72),f=r(33),g=r(35),_=r(38).f,b=r(74),x=r(139),S=r(183),A=r(90),E=r(185),T=!1,I=A("meta"),R=0,U=function(L){_(L,I,{value:{objectID:"O"+R++,weakData:{}}})},D=n.exports={enable:function(){D.enable=function(){},T=!0;var L=b.f,W=c([].splice),H={};H[I]=1,L(H).length&&(b.f=function(B){for(var F=L(B),q=0,K=F.length;q<K;q++)if(F[q]===I){W(F,q,1);break}return F},s({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:x.f}))},fastKey:function(L,W){if(!f(L))return typeof L=="symbol"?L:(typeof L=="string"?"S":"P")+L;if(!g(L,I)){if(!S(L))return"F";if(!W)return"E";U(L)}return L[I].objectID},getWeakData:function(L,W){if(!g(L,I)){if(!S(L))return!0;if(!W)return!1;U(L)}return L[I].weakData},onFreeze:function(L){return E&&T&&S(L)&&!g(L,I)&&U(L),L}};v[I]=!0},function(n,a,r){var s=r(28),c=r(80),v=s("iterator"),f=Array.prototype;n.exports=function(g){return g!==void 0&&(c.Array===g||f[v]===g)}},function(n,a,r){var s=r(7),c=r(34),v=r(56),f=r(32),g=r(88),_=r(118),b=s.TypeError;n.exports=function(x,S){var A=arguments.length<2?_(x):S;if(v(A))return f(c(A,x));throw b(g(x)+" is not iterable")}},function(n,a,r){var s=r(34),c=r(32),v=r(62);n.exports=function(f,g,_){var b,x;c(f);try{if(!(b=v(f,"return"))){if(g==="throw")throw _;return _}b=s(b,f)}catch(S){x=!0,b=S}if(g==="throw")throw _;if(x)throw b;return c(b),_}},function(n,a,r){var s=r(30),c=r(33),v=r(102);n.exports=function(f,g,_){var b,x;return v&&s(b=g.constructor)&&b!==_&&c(x=b.prototype)&&x!==_.prototype&&v(f,x),f}},function(n,a,r){var s=r(42);n.exports=function(c,v,f){for(var g in v)s(c,g,v[g],f);return c}},function(n,a,r){var s=r(46),c=r(38),v=r(28),f=r(36),g=v("species");n.exports=function(_){var b=s(_),x=c.f;f&&b&&!b[g]&&x(b,g,{configurable:!0,get:function(){return this}})}},function(n,a,r){var s=r(15),c=r(59),v=r(39),f=r(44),g=s("".charAt),_=s("".charCodeAt),b=s("".slice),x=function(S){return function(A,E){var T,I,R=v(f(A)),U=c(E),D=R.length;return U<0||U>=D?S?"":void 0:(T=_(R,U))<55296||T>56319||U+1===D||(I=_(R,U+1))<56320||I>57343?S?g(R,U):T:S?b(R,U,U+2):I-56320+(T-55296<<10)+65536}};n.exports={codeAt:x(!1),charAt:x(!0)}},function(n,a){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,a,r){var s=r(91)("span").classList,c=s&&s.constructor&&s.constructor.prototype;n.exports=c===Object.prototype?void 0:c},function(n,a,r){var s=r(32);n.exports=function(){var c=s(this),v="";return c.global&&(v+="g"),c.ignoreCase&&(v+="i"),c.multiline&&(v+="m"),c.dotAll&&(v+="s"),c.unicode&&(v+="u"),c.sticky&&(v+="y"),v}},function(n,a,r){var s=r(18),c=r(7).RegExp,v=s((function(){var _=c("a","y");return _.lastIndex=2,_.exec("abcd")!=null})),f=v||s((function(){return!c("a","y").sticky})),g=v||s((function(){var _=c("^r","gy");return _.lastIndex=2,_.exec("str")!=null}));n.exports={BROKEN_CARET:g,MISSED_STICKY:f,UNSUPPORTED_Y:v}},function(n,a,r){var s=r(16),c=r(79).find,v=r(100),f="find",g=!0;f in[]&&Array(1).find((function(){g=!1})),s({target:"Array",proto:!0,forced:g},{find:function(_){return c(this,_,arguments.length>1?arguments[1]:void 0)}}),v(f)},function(n,a,r){var s=r(16),c=r(137).includes,v=r(100);s({target:"Array",proto:!0},{includes:function(f){return c(this,f,arguments.length>1?arguments[1]:void 0)}}),v("includes")},function(n,a,r){var s=r(16),c=r(15),v=r(197),f=r(44),g=r(39),_=r(198),b=c("".indexOf);s({target:"String",proto:!0,forced:!_("includes")},{includes:function(x){return!!~b(g(f(this)),g(v(x)),arguments.length>1?arguments[1]:void 0)}})},function(n,a,r){var s=r(33),c=r(51),v=r(28)("match");n.exports=function(f){var g;return s(f)&&((g=f[v])!==void 0?!!g:c(f)=="RegExp")}},function(n,a,r){var s=r(15);n.exports=s(1 .valueOf)},function(n,a,r){var s=r(15),c=r(44),v=r(39),f=r(162),g=s("".replace),_="["+f+"]",b=RegExp("^"+_+_+"*"),x=RegExp(_+_+"*$"),S=function(A){return function(E){var T=v(c(E));return 1&A&&(T=g(T,b,"")),2&A&&(T=g(T,x,"")),T}};n.exports={start:S(1),end:S(2),trim:S(3)}},function(n,a){n.exports=`
|
||
\v\f\r \u2028\u2029\uFEFF`},function(n,a){var r,s,c=n.exports={};function v(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}function g(R){if(r===setTimeout)return setTimeout(R,0);if((r===v||!r)&&setTimeout)return r=setTimeout,setTimeout(R,0);try{return r(R,0)}catch{try{return r.call(null,R,0)}catch{return r.call(this,R,0)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:v}catch{r=v}try{s=typeof clearTimeout=="function"?clearTimeout:f}catch{s=f}})();var _,b=[],x=!1,S=-1;function A(){x&&_&&(x=!1,_.length?b=_.concat(b):S=-1,b.length&&E())}function E(){if(!x){var R=g(A);x=!0;for(var U=b.length;U;){for(_=b,b=[];++S<U;)_&&_[S].run();S=-1,U=b.length}_=null,x=!1,(function(D){if(s===clearTimeout)return clearTimeout(D);if((s===f||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(D);try{s(D)}catch{try{return s.call(null,D)}catch{return s.call(this,D)}}})(R)}}function T(R,U){this.fun=R,this.array=U}function I(){}c.nextTick=function(R){var U=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)U[D-1]=arguments[D];b.push(new T(R,U)),b.length!==1||x||g(E)},T.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=I,c.addListener=I,c.once=I,c.off=I,c.removeListener=I,c.removeAllListeners=I,c.emit=I,c.prependListener=I,c.prependOnceListener=I,c.listeners=function(R){return[]},c.binding=function(R){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(R){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(n,a,r){var s=r(32),c=r(165),v=r(28)("species");n.exports=function(f,g){var _,b=s(f).constructor;return b===void 0||(_=s(b)[v])==null?g:c(_)}},function(n,a,r){var s=r(7),c=r(99),v=r(88),f=s.TypeError;n.exports=function(g){if(c(g))return g;throw f(v(g)+" is not a constructor")}},function(n,a,r){var s=r(16),c=r(161).trim;s({target:"String",proto:!0,forced:r(200)("trim")},{trim:function(){return c(this)}})},function(n,a,r){var s=r(34),c=r(123),v=r(32),f=r(94),g=r(39),_=r(44),b=r(62),x=r(124),S=r(125);c("match",(function(A,E,T){return[function(I){var R=_(this),U=I==null?void 0:b(I,A);return U?s(U,I,R):new RegExp(I)[A](g(R))},function(I){var R=v(this),U=g(I),D=T(E,R,U);if(D.done)return D.value;if(!R.global)return S(R,U);var L=R.unicode;R.lastIndex=0;for(var W,H=[],B=0;(W=S(R,U))!==null;){var F=g(W[0]);H[B]=F,F===""&&(R.lastIndex=x(U,f(R.lastIndex),L)),B++}return B===0?null:H}]}))},function(n,a,r){var s,c,v,f,g=r(7),_=r(76),b=r(64),x=r(30),S=r(35),A=r(18),E=r(138),T=r(98),I=r(91),R=r(169),U=r(128),D=g.setImmediate,L=g.clearImmediate,W=g.process,H=g.Dispatch,B=g.Function,F=g.MessageChannel,q=g.String,K=0,X={},ee="onreadystatechange";try{s=g.location}catch{}var ue=function(Te){if(S(X,Te)){var Me=X[Te];delete X[Te],Me()}},ae=function(Te){return function(){ue(Te)}},we=function(Te){ue(Te.data)},je=function(Te){g.postMessage(q(Te),s.protocol+"//"+s.host)};D&&L||(D=function(Te){var Me=T(arguments,1);return X[++K]=function(){_(x(Te)?Te:B(Te),void 0,Me)},c(K),K},L=function(Te){delete X[Te]},U?c=function(Te){W.nextTick(ae(Te))}:H&&H.now?c=function(Te){H.now(ae(Te))}:F&&!R?(f=(v=new F).port2,v.port1.onmessage=we,c=b(f.postMessage,f)):g.addEventListener&&x(g.postMessage)&&!g.importScripts&&s&&s.protocol!=="file:"&&!A(je)?(c=je,g.addEventListener("message",we,!1)):c=ee in I("script")?function(Te){E.appendChild(I("script")).onreadystatechange=function(){E.removeChild(this),ue(Te)}}:function(Te){setTimeout(ae(Te),0)}),n.exports={set:D,clear:L}},function(n,a,r){var s=r(55);n.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(s)},function(n,a,r){var s=r(56),c=function(v){var f,g;this.promise=new v((function(_,b){if(f!==void 0||g!==void 0)throw TypeError("Bad Promise constructor");f=_,g=b})),this.resolve=s(f),this.reject=s(g)};n.exports.f=function(v){return new c(v)}},function(n,a,r){a.a=function(){return!1}},function(n,a,r){(function(s){r.d(a,"a",(function(){return W}));var c=r(1);function v(F){throw new Error("[mobx-utils] "+F)}function f(F,q){q===void 0&&(q="Illegal state"),F||v(q)}var g=function(F){return F&&F!==Object.prototype&&Object.getOwnPropertyNames(F).concat(g(Object.getPrototypeOf(F))||[])},_=function(F){return(function(q){var K=g(q);return K.filter((function(X,ee){return K.indexOf(X)===ee}))})(F).filter((function(q){return q!=="constructor"&&!~q.indexOf("__")}))},b="pending",x="fulfilled",S="rejected";function A(F){switch(this.state){case b:return F.pending&&F.pending(this.value);case S:return F.rejected&&F.rejected(this.value);case x:return F.fulfilled?F.fulfilled(this.value):this.value}}function E(F,q){if(f(arguments.length<=2,"fromPromise expects up to two arguments"),f(typeof F=="function"||typeof F=="object"&&F&&typeof F.then=="function","Please pass a promise or function to fromPromise"),F.isPromiseBasedObservable===!0)return F;typeof F=="function"&&(F=new Promise(F));var K=F;F.then(Object(c.k)("observableFromPromise-resolve",(function(ee){K.value=ee,K.state=x})),Object(c.k)("observableFromPromise-reject",(function(ee){K.value=ee,K.state=S}))),K.isPromiseBasedObservable=!0,K.case=A;var X=q&&q.state===x?q.value:void 0;return Object(c.q)(K,{value:X,state:b},{},{deep:!1}),K}(function(F){F.reject=Object(c.k)("fromPromise.reject",(function(q){var K=F(Promise.reject(q));return K.state=S,K.value=q,K})),F.resolve=Object(c.k)("fromPromise.resolve",(function(q){q===void 0&&(q=void 0);var K=F(Promise.resolve(q));return K.state=x,K.value=q,K}))})(E||(E={}));var T=function(F,q,K,X){var ee,ue=arguments.length,ae=ue<3?q:X===null?X=Object.getOwnPropertyDescriptor(q,K):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(F,q,K,X);else for(var we=F.length-1;we>=0;we--)(ee=F[we])&&(ae=(ue<3?ee(ae):ue>3?ee(q,K,ae):ee(q,K))||ae);return ue>3&&ae&&Object.defineProperty(q,K,ae),ae};(function(){function F(q,K){var X=this;Object(c.G)((function(){X.current=K,X.subscription=q.subscribe(X)}))}F.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},F.prototype.next=function(q){this.current=q},F.prototype.complete=function(){this.dispose()},F.prototype.error=function(q){this.current=q,this.dispose()},T([c.C.ref],F.prototype,"current",void 0),T([c.k.bound],F.prototype,"next",null),T([c.k.bound],F.prototype,"complete",null),T([c.k.bound],F.prototype,"error",null)})();var I=function(){return I=Object.assign||function(F){for(var q,K=1,X=arguments.length;K<X;K++)for(var ee in q=arguments[K])Object.prototype.hasOwnProperty.call(q,ee)&&(F[ee]=q[ee]);return F},I.apply(this,arguments)},R=function(F,q,K,X){var ee,ue=arguments.length,ae=ue<3?q:X===null?X=Object.getOwnPropertyDescriptor(q,K):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(F,q,K,X);else for(var we=F.length-1;we>=0;we--)(ee=F[we])&&(ae=(ue<3?ee(ae):ue>3?ee(q,K,ae):ee(q,K))||ae);return ue>3&&ae&&Object.defineProperty(q,K,ae),ae},U=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function F(q){var K=this;this.model=q,this.localValues=c.C.map({}),this.localComputedValues=c.C.map({}),this.isPropertyDirty=function(X){return K.localValues.has(X)},f(Object(c.A)(q),"createViewModel expects an observable object"),_(q).forEach((function(X){if(X!==c.a&&X!=="__mobxDidRunLazyInitializers"){if(f(U.indexOf(X)===-1,"The propertyname "+X+" is reserved and cannot be used with viewModels"),Object(c.w)(q,X)){var ee=Object(c.h)(q,X).derivation;K.localComputedValues.set(X,Object(c.m)(ee.bind(K)))}var ue=Object.getOwnPropertyDescriptor(q,X),ae=ue?{enumerable:ue.enumerable}:{};Object.defineProperty(K,X,I(I({},ae),{configurable:!0,get:function(){return Object(c.w)(q,X)?K.localComputedValues.get(X).get():K.isPropertyDirty(X)?K.localValues.get(X):K.model[X]},set:Object(c.k)((function(we){we!==K.model[X]?K.localValues.set(X,we):K.localValues.delete(X)}))}))}}))}Object.defineProperty(F.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),F.prototype.submit=function(){var q=this;Object(c.B)(this.localValues).forEach((function(K){var X=q.localValues.get(K),ee=q.model[K];Object(c.y)(ee)?ee.replace(X):Object(c.z)(ee)?(ee.clear(),ee.merge(X)):Object(c.v)(X)||(q.model[K]=X)})),this.localValues.clear()},F.prototype.reset=function(){this.localValues.clear()},F.prototype.resetProperty=function(q){this.localValues.delete(q)},R([c.m],F.prototype,"isDirty",null),R([c.m],F.prototype,"changedValues",null),R([c.k.bound],F.prototype,"submit",null),R([c.k.bound],F.prototype,"reset",null),R([c.k.bound],F.prototype,"resetProperty",null)})();function D(F){if(!F)return"ROOT";for(var q=[];F.parent;)q.push(F.path),F=F.parent;return q.reverse().join("/")}function L(F){return Object(c.A)(F)||Object(c.y)(F)||Object(c.z)(F)}function W(F,q){var K=new WeakMap;function X(ae){var we=K.get(ae.object);(function(je,Te){switch(je.type){case"add":ee(je.newValue,Te,je.name);break;case"update":ue(je.oldValue),ee(je.newValue,Te,je.name||""+je.index);break;case"remove":case"delete":ue(je.oldValue);break;case"splice":je.removed.map(ue),je.added.forEach((function(rt,tt){return ee(rt,Te,""+(je.index+tt))}));for(var Me=je.index+je.addedCount;Me<je.object.length;Me++)if(L(je.object[Me])){var Ne=K.get(je.object[Me]);Ne&&(Ne.path=""+Me)}}})(ae,we),q(ae,D(we),F)}function ee(ae,we,je){if(L(ae)){var Te=K.get(ae);if(Te){if(Te.parent!==we||Te.path!==je)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+D(we)+"/"+je+"', but it already exists at '"+D(Te.parent)+"/"+Te.path+"'")}else{var Me={parent:we,path:je,dispose:Object(c.D)(ae,X)};K.set(ae,Me),Object(c.p)(ae).forEach((function(Ne){var rt=Ne[0];return ee(Ne[1],Me,rt)}))}}}function ue(ae){if(L(ae)){var we=K.get(ae);if(!we)return;K.delete(ae),we.dispose(),Object(c.L)(ae).forEach(ue)}}return ee(F,void 0,""),function(){ue(F)}}var H,B=(H=function(F,q){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,X){K.__proto__=X}||function(K,X){for(var ee in X)X.hasOwnProperty(ee)&&(K[ee]=X[ee])},H(F,q)},function(F,q){function K(){this.constructor=F}H(F,q),F.prototype=q===null?Object.create(q):(K.prototype=q.prototype,new K)});(function(F){function q(K,X,ee){var ue=ee===void 0?{}:ee,ae=ue.name,we=ae===void 0?"ogm"+(1e3*Math.random()|0):ae,je=ue.keyToName,Te=je===void 0?function(rt){return""+rt}:je,Me=F.call(this)||this;Me._keyToName=Te,Me._groupBy=X,Me._ogmInfoKey=Symbol("ogmInfo"+we),Me._base=K;for(var Ne=0;Ne<K.length;Ne++)Me._addItem(K[Ne]);return Me._disposeBaseObserver=Object(c.D)(Me._base,(function(rt){if(rt.type==="splice")Object(c.J)((function(){for(var tt=0,Be=rt.removed;tt<Be.length;tt++){var lt=Be[tt];Me._removeItem(lt)}for(var St=0,He=rt.added;St<He.length;St++){var Jt=He[St];Me._addItem(Jt)}}));else{if(rt.type!=="update")throw new Error("illegal state");Object(c.J)((function(){Me._removeItem(rt.oldValue),Me._addItem(rt.newValue)}))}})),Me}B(q,F),q.prototype.clear=function(){throw new Error("not supported")},q.prototype.delete=function(K){throw new Error("not supported")},q.prototype.set=function(K,X){throw new Error("not supported")},q.prototype.dispose=function(){this._disposeBaseObserver();for(var K=0;K<this._base.length;K++){var X=this._base[K];X[this._ogmInfoKey].reaction(),delete X[this._ogmInfoKey]}},q.prototype._getGroupArr=function(K){var X=F.prototype.get.call(this,K);return X===void 0&&(X=Object(c.C)([],{name:"GroupArray["+this._keyToName(K)+"]",deep:!1}),F.prototype.set.call(this,K,X)),X},q.prototype._removeFromGroupArr=function(K,X){var ee=F.prototype.get.call(this,K);ee.length===1?F.prototype.delete.call(this,K):(X===ee.length-1||(ee[X]=ee[ee.length-1],ee[X][this._ogmInfoKey].groupArrIndex=X),ee.length--)},q.prototype._addItem=function(K){var X=this,ee=this._groupBy(K),ue=this._getGroupArr(ee),ae={groupByValue:ee,groupArrIndex:ue.length,reaction:Object(c.F)((function(){return X._groupBy(K)}),(function(we,je){var Te=K[X._ogmInfoKey];X._removeFromGroupArr(Te.groupByValue,Te.groupArrIndex);var Me=X._getGroupArr(we),Ne=Me.length;Me.push(K),Te.groupByValue=we,Te.groupArrIndex=Ne}))};Object.defineProperty(K,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:ae}),ue.push(K)},q.prototype._removeItem=function(K){var X=K[this._ogmInfoKey];this._removeFromGroupArr(X.groupByValue,X.groupArrIndex),X.reaction(),delete K[this._ogmInfoKey]}})(c.b),(function(){function F(q,K){this.base=q,this.args=K,this.closestIdx=0,this.isDisposed=!1;for(var X=this.closest=this.root=q,ee=0;ee<this.args.length-1&&(X=X.get(K[ee]));ee++)this.closest=X;this.closestIdx=ee}return F.prototype.exists=function(){this.assertNotDisposed();var q=this.args.length;return this.closestIdx>=q-1&&this.closest.has(this.args[q-1])},F.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])},F.prototype.set=function(q){this.assertNotDisposed();for(var K=this.args.length,X=this.closest,ee=this.closestIdx;ee<K-1;ee++){var ue=new Map;X.set(this.args[ee],ue),X=ue}this.closestIdx=K-1,this.closest=X,X.set(this.args[K-1],q)},F.prototype.delete=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var q=this.args.length;this.closest.delete(this.args[q-1]);for(var K=this.root,X=[K],ee=0;ee<q-1;ee++)K=K.get(this.args[ee]),X.push(K);for(ee=X.length-1;ee>0;ee--)X[ee].size===0&&X[ee-1].delete(this.args[ee-1]);this.isDisposed=!0},F.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},F})(),Promise.resolve(),typeof queueMicrotask<"u"||s!==void 0&&s.nextTick}).call(this,r(163))},function(n,a,r){var s;(function(c,v,f){if(c){for(var g,_={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"},b={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},x={"~":"`","!":"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"},A=1;A<20;++A)_[111+A]="f"+A;for(A=0;A<=9;++A)_[A+96]=A.toString();L.prototype.bind=function(W,H,B){var F=this;return W=W instanceof Array?W:[W],F._bindMultiple.call(F,W,H,B),F},L.prototype.unbind=function(W,H){return this.bind.call(this,W,(function(){}),H)},L.prototype.trigger=function(W,H){var B=this;return B._directMap[W+":"+H]&&B._directMap[W+":"+H]({},W),B},L.prototype.reset=function(){var W=this;return W._callbacks={},W._directMap={},W},L.prototype.stopCallback=function(W,H){if((" "+H.className+" ").indexOf(" mousetrap ")>-1||D(H,this.target))return!1;if("composedPath"in W&&typeof W.composedPath=="function"){var B=W.composedPath()[0];B!==W.target&&(H=B)}return H.tagName=="INPUT"||H.tagName=="SELECT"||H.tagName=="TEXTAREA"||H.isContentEditable},L.prototype.handleKey=function(){var W=this;return W._handleKey.apply(W,arguments)},L.addKeycodes=function(W){for(var H in W)W.hasOwnProperty(H)&&(_[H]=W[H]);g=null},L.init=function(){var W=L(v);for(var H in W)H.charAt(0)!=="_"&&(L[H]=(function(B){return function(){return W[B].apply(W,arguments)}})(H))},L.init(),c.Mousetrap=L,n.exports&&(n.exports=L),(s=(function(){return L}).call(a,r,a,n))===void 0||(n.exports=s)}function E(W,H,B){W.addEventListener?W.addEventListener(H,B,!1):W.attachEvent("on"+H,B)}function T(W){if(W.type=="keypress"){var H=String.fromCharCode(W.which);return W.shiftKey||(H=H.toLowerCase()),H}return _[W.which]?_[W.which]:b[W.which]?b[W.which]:String.fromCharCode(W.which).toLowerCase()}function I(W){return W=="shift"||W=="ctrl"||W=="alt"||W=="meta"}function R(W,H,B){return B||(B=(function(){if(!g)for(var F in g={},_)F>95&&F<112||_.hasOwnProperty(F)&&(g[_[F]]=F);return g})()[W]?"keydown":"keypress"),B=="keypress"&&H.length&&(B="keydown"),B}function U(W,H){var B,F,q,K=[];for(B=(function(X){return X==="+"?["+"]:(X=X.replace(/\+{2}/g,"+plus")).split("+")})(W),q=0;q<B.length;++q)F=B[q],S[F]&&(F=S[F]),H&&H!="keypress"&&x[F]&&(F=x[F],K.push("shift")),I(F)&&K.push(F);return{key:F,modifiers:K,action:H=R(F,K,H)}}function D(W,H){return W!==null&&W!==v&&(W===H||D(W.parentNode,H))}function L(W){var H=this;if(W=W||v,!(H instanceof L))return new L(W);H.target=W,H._callbacks={},H._directMap={};var B,F={},q=!1,K=!1,X=!1;function ee(Me){Me=Me||{};var Ne,rt=!1;for(Ne in F)Me[Ne]?rt=!0:F[Ne]=0;rt||(X=!1)}function ue(Me,Ne,rt,tt,Be,lt){var St,He,Jt,Fe,me=[],Le=rt.type;if(!H._callbacks[Me])return[];for(Le=="keyup"&&I(Me)&&(Ne=[Me]),St=0;St<H._callbacks[Me].length;++St)if(He=H._callbacks[Me][St],(tt||!He.seq||F[He.seq]==He.level)&&Le==He.action&&(Le=="keypress"&&!rt.metaKey&&!rt.ctrlKey||(Jt=Ne,Fe=He.modifiers,Jt.sort().join(",")===Fe.sort().join(",")))){var Ye=!tt&&He.combo==Be,Ot=tt&&He.seq==tt&&He.level==lt;(Ye||Ot)&&H._callbacks[Me].splice(St,1),me.push(He)}return me}function ae(Me,Ne,rt,tt){H.stopCallback(Ne,Ne.target||Ne.srcElement,rt,tt)||Me(Ne,rt)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(Ne),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(Ne))}function we(Me){typeof Me.which!="number"&&(Me.which=Me.keyCode);var Ne=T(Me);Ne&&(Me.type!="keyup"||q!==Ne?H.handleKey(Ne,(function(rt){var tt=[];return rt.shiftKey&&tt.push("shift"),rt.altKey&&tt.push("alt"),rt.ctrlKey&&tt.push("ctrl"),rt.metaKey&&tt.push("meta"),tt})(Me),Me):q=!1)}function je(Me,Ne,rt,tt){function Be(Jt){return function(){X=Jt,++F[Me],clearTimeout(B),B=setTimeout(ee,1e3)}}function lt(Jt){ae(rt,Jt,Me),tt!=="keyup"&&(q=T(Jt)),setTimeout(ee,10)}F[Me]=0;for(var St=0;St<Ne.length;++St){var He=St+1===Ne.length?lt:Be(tt||U(Ne[St+1]).action);Te(Ne[St],He,tt,Me,St)}}function Te(Me,Ne,rt,tt,Be){H._directMap[Me+":"+rt]=Ne;var lt,St=(Me=Me.replace(/\s+/g," ")).split(" ");St.length>1?je(Me,St,Ne,rt):(lt=U(Me,rt),H._callbacks[lt.key]=H._callbacks[lt.key]||[],ue(lt.key,lt.modifiers,{type:lt.action},tt,Me,Be),H._callbacks[lt.key][tt?"unshift":"push"]({callback:Ne,modifiers:lt.modifiers,action:lt.action,seq:tt,level:Be,combo:Me}))}H._handleKey=function(Me,Ne,rt){var tt,Be=ue(Me,Ne,rt),lt={},St=0,He=!1;for(tt=0;tt<Be.length;++tt)Be[tt].seq&&(St=Math.max(St,Be[tt].level));for(tt=0;tt<Be.length;++tt)if(Be[tt].seq){if(Be[tt].level!=St)continue;He=!0,lt[Be[tt].seq]=1,ae(Be[tt].callback,rt,Be[tt].combo,Be[tt].seq)}else He||ae(Be[tt].callback,rt,Be[tt].combo);var Jt=rt.type=="keypress"&&K;rt.type!=X||I(Me)||Jt||ee(lt),K=He&&rt.type=="keydown"},H._bindMultiple=function(Me,Ne,rt){for(var tt=0;tt<Me.length;++tt)Te(Me[tt],Ne,rt)},E(W,"keypress",we),E(W,"keydown",we),E(W,"keyup",we)}})(typeof window<"u"?window:null,typeof window<"u"?document:null)},function(n,a,r){var s=r(7),c=r(34),v=r(30),f=r(33),g=s.TypeError;n.exports=function(_,b){var x,S;if(b==="string"&&v(x=_.toString)&&!f(S=c(x,_))||v(x=_.valueOf)&&!f(S=c(x,_))||b!=="string"&&v(x=_.toString)&&!f(S=c(x,_)))return S;throw g("Can't convert object to primitive value")}},function(n,a,r){var s=r(7),c=r(30),v=r(92),f=s.WeakMap;n.exports=c(f)&&/native code/.test(v(f))},function(n,a,r){var s=r(36),c=r(38),v=r(32),f=r(41),g=r(77);n.exports=s?Object.defineProperties:function(_,b){v(_);for(var x,S=f(b),A=g(b),E=A.length,T=0;E>T;)c.f(_,x=A[T++],S[x]);return _}},function(n,a,r){var s=r(7);n.exports=s},function(n,a,r){var s=r(7),c=r(96),v=r(99),f=r(33),g=r(28)("species"),_=s.Array;n.exports=function(b){var x;return c(b)&&(x=b.constructor,(v(x)&&(x===_||c(x.prototype))||f(x)&&(x=x[g])===null)&&(x=void 0)),x===void 0?_:x}},function(n,a,r){var s=r(113),c=r(97);n.exports=s?{}.toString:function(){return"[object "+c(this)+"]"}},function(n,a,r){var s=r(142).IteratorPrototype,c=r(60),v=r(69),f=r(78),g=r(80),_=function(){return this};n.exports=function(b,x,S,A){var E=x+" Iterator";return b.prototype=c(s,{next:v(+!A,S)}),f(b,E,!1,!0),g[E]=_,b}},function(n,a,r){var s=r(7),c=r(30),v=s.String,f=s.TypeError;n.exports=function(g){if(typeof g=="object"||c(g))return g;throw f("Can't set "+v(g)+" as a prototype")}},function(n,a,r){var s=r(16),c=r(7),v=r(15),f=r(95),g=r(42),_=r(144),b=r(117),x=r(119),S=r(30),A=r(33),E=r(18),T=r(120),I=r(78),R=r(148);n.exports=function(U,D,L){var W=U.indexOf("Map")!==-1,H=U.indexOf("Weak")!==-1,B=W?"set":"add",F=c[U],q=F&&F.prototype,K=F,X={},ee=function(Me){var Ne=v(q[Me]);g(q,Me,Me=="add"?function(rt){return Ne(this,rt===0?0:rt),this}:Me=="delete"?function(rt){return!(H&&!A(rt))&&Ne(this,rt===0?0:rt)}:Me=="get"?function(rt){return H&&!A(rt)?void 0:Ne(this,rt===0?0:rt)}:Me=="has"?function(rt){return!(H&&!A(rt))&&Ne(this,rt===0?0:rt)}:function(rt,tt){return Ne(this,rt===0?0:rt,tt),this})};if(f(U,!S(F)||!(H||q.forEach&&!E((function(){new F().entries().next()})))))K=L.getConstructor(D,U,W,B),_.enable();else if(f(U,!0)){var ue=new K,ae=ue[B](H?{}:-0,1)!=ue,we=E((function(){ue.has(1)})),je=T((function(Me){new F(Me)})),Te=!H&&E((function(){for(var Me=new F,Ne=5;Ne--;)Me[B](Ne,Ne);return!Me.has(-0)}));je||((K=D((function(Me,Ne){x(Me,q);var rt=R(new F,Me,K);return Ne!=null&&b(Ne,rt[B],{that:rt,AS_ENTRIES:W}),rt}))).prototype=q,q.constructor=K),(we||Te)&&(ee("delete"),ee("has"),W&&ee("get")),(Te||ae)&&ee(B),H&&q.clear&&delete q.clear}return X[U]=K,s({global:!0,forced:K!=F},X),I(K,U),H||L.setStrong(K,U,W),K}},function(n,a,r){var s=r(18),c=r(33),v=r(51),f=r(184),g=Object.isExtensible,_=s((function(){}));n.exports=_||f?function(b){return!!c(b)&&(!f||v(b)!="ArrayBuffer")&&(!g||g(b))}:g},function(n,a,r){var s=r(18);n.exports=s((function(){if(typeof ArrayBuffer=="function"){var c=new ArrayBuffer(8);Object.isExtensible(c)&&Object.defineProperty(c,"a",{value:8})}}))},function(n,a,r){var s=r(18);n.exports=!s((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(n,a,r){var s=r(38).f,c=r(60),v=r(149),f=r(64),g=r(119),_=r(117),b=r(116),x=r(150),S=r(36),A=r(144).fastKey,E=r(58),T=E.set,I=E.getterFor;n.exports={getConstructor:function(R,U,D,L){var W=R((function(K,X){g(K,H),T(K,{type:U,index:c(null),first:void 0,last:void 0,size:0}),S||(K.size=0),X!=null&&_(X,K[L],{that:K,AS_ENTRIES:D})})),H=W.prototype,B=I(U),F=function(K,X,ee){var ue,ae,we=B(K),je=q(K,X);return je?je.value=ee:(we.last=je={index:ae=A(X,!0),key:X,value:ee,previous:ue=we.last,next:void 0,removed:!1},we.first||(we.first=je),ue&&(ue.next=je),S?we.size++:K.size++,ae!=="F"&&(we.index[ae]=je)),K},q=function(K,X){var ee,ue=B(K),ae=A(X);if(ae!=="F")return ue.index[ae];for(ee=ue.first;ee;ee=ee.next)if(ee.key==X)return ee};return v(H,{clear:function(){for(var K=B(this),X=K.index,ee=K.first;ee;)ee.removed=!0,ee.previous&&(ee.previous=ee.previous.next=void 0),delete X[ee.index],ee=ee.next;K.first=K.last=void 0,S?K.size=0:this.size=0},delete:function(K){var X=this,ee=B(X),ue=q(X,K);if(ue){var ae=ue.next,we=ue.previous;delete ee.index[ue.index],ue.removed=!0,we&&(we.next=ae),ae&&(ae.previous=we),ee.first==ue&&(ee.first=ae),ee.last==ue&&(ee.last=we),S?ee.size--:X.size--}return!!ue},forEach:function(K){for(var X,ee=B(this),ue=f(K,arguments.length>1?arguments[1]:void 0);X=X?X.next:ee.first;)for(ue(X.value,X.key,this);X&&X.removed;)X=X.previous},has:function(K){return!!q(this,K)}}),v(H,D?{get:function(K){var X=q(this,K);return X&&X.value},set:function(K,X){return F(this,K===0?0:K,X)}}:{add:function(K){return F(this,K=K===0?0:K,K)}}),S&&s(H,"size",{get:function(){return B(this).size}}),W},setStrong:function(R,U,D){var L=U+" Iterator",W=I(U),H=I(L);b(R,U,(function(B,F){T(this,{type:L,target:B,state:W(B),kind:F,last:void 0})}),(function(){for(var B=H(this),F=B.kind,q=B.last;q&&q.removed;)q=q.previous;return B.target&&(B.last=q=q?q.next:B.state.first)?F=="keys"?{value:q.key,done:!1}:F=="values"?{value:q.value,done:!1}:{value:[q.key,q.value],done:!1}:(B.target=void 0,{value:void 0,done:!0})}),D?"entries":"values",!D,!0),x(U)}}},function(n,a,r){var s=r(79).forEach,c=r(121)("forEach");n.exports=c?[].forEach:function(v){return s(this,v,arguments.length>1?arguments[1]:void 0)}},function(n,a,r){var s=r(7),c=r(64),v=r(34),f=r(40),g=r(189),_=r(145),b=r(99),x=r(45),S=r(63),A=r(146),E=r(118),T=s.Array;n.exports=function(I){var R=f(I),U=b(this),D=arguments.length,L=D>1?arguments[1]:void 0,W=L!==void 0;W&&(L=c(L,D>2?arguments[2]:void 0));var H,B,F,q,K,X,ee=E(R),ue=0;if(!ee||this==T&&_(ee))for(H=x(R),B=U?new this(H):T(H);H>ue;ue++)X=W?L(R[ue],ue):R[ue],S(B,ue,X);else for(K=(q=A(R,ee)).next,B=U?new this:[];!(F=v(K,q)).done;ue++)X=W?g(q,L,[F.value,ue],!0):F.value,S(B,ue,X);return B.length=ue,B}},function(n,a,r){var s=r(32),c=r(147);n.exports=function(v,f,g,_){try{return _?f(s(g)[0],g[1]):f(g)}catch(b){c(v,"throw",b)}}},function(n,a,r){var s=r(18),c=r(7).RegExp;n.exports=s((function(){var v=c(".","s");return!(v.dotAll&&v.exec(`
|
||
`)&&v.flags==="s")}))},function(n,a,r){var s=r(18),c=r(7).RegExp;n.exports=s((function(){var v=c("(?<a>b)","g");return v.exec("b").groups.a!=="b"||"b".replace(v,"$<a>c")!=="bc"}))},function(n,a,r){var s=r(16),c=r(15),v=r(56),f=r(40),g=r(45),_=r(39),b=r(18),x=r(193),S=r(121),A=r(194),E=r(195),T=r(70),I=r(196),R=[],U=c(R.sort),D=c(R.push),L=b((function(){R.sort(void 0)})),W=b((function(){R.sort(null)})),H=S("sort"),B=!b((function(){if(T)return T<70;if(!(A&&A>3)){if(E)return!0;if(I)return I<603;var F,q,K,X,ee="";for(F=65;F<76;F++){switch(q=String.fromCharCode(F),F){case 66:case 69:case 70:case 72:K=3;break;case 68:case 71:K=4;break;default:K=2}for(X=0;X<47;X++)R.push({k:q+X,v:K})}for(R.sort((function(ue,ae){return ae.v-ue.v})),X=0;X<R.length;X++)q=R[X].k.charAt(0),ee.charAt(ee.length-1)!==q&&(ee+=q);return ee!=="DGBEFHACIJK"}}));s({target:"Array",proto:!0,forced:L||!W||!H||!B},{sort:function(F){F!==void 0&&v(F);var q=f(this);if(B)return F===void 0?U(q):U(q,F);var K,X,ee=[],ue=g(q);for(X=0;X<ue;X++)X in q&&D(ee,q[X]);for(x(ee,(function(ae){return function(we,je){return je===void 0?-1:we===void 0?1:ae!==void 0?+ae(we,je)||0:_(we)>_(je)?1:-1}})(F)),K=ee.length,X=0;X<K;)q[X]=ee[X++];for(;X<ue;)delete q[X++];return q}})},function(n,a,r){var s=r(114),c=Math.floor,v=function(_,b){var x=_.length,S=c(x/2);return x<8?f(_,b):g(_,v(s(_,0,S),b),v(s(_,S),b),b)},f=function(_,b){for(var x,S,A=_.length,E=1;E<A;){for(S=E,x=_[E];S&&b(_[S-1],x)>0;)_[S]=_[--S];S!==E++&&(_[S]=x)}return _},g=function(_,b,x,S){for(var A=b.length,E=x.length,T=0,I=0;T<A||I<E;)_[T+I]=T<A&&I<E?S(b[T],x[I])<=0?b[T++]:x[I++]:T<A?b[T++]:x[I++];return _};n.exports=v},function(n,a,r){var s=r(55).match(/firefox\/(\d+)/i);n.exports=!!s&&+s[1]},function(n,a,r){var s=r(55);n.exports=/MSIE|Trident/.test(s)},function(n,a,r){var s=r(55).match(/AppleWebKit\/(\d+)\./);n.exports=!!s&&+s[1]},function(n,a,r){var s=r(7),c=r(159),v=s.TypeError;n.exports=function(f){if(c(f))throw v("The method doesn't accept regular expressions");return f}},function(n,a,r){var s=r(28)("match");n.exports=function(c){var v=/./;try{"/./"[c](v)}catch{try{return v[s]=!1,"/./"[c](v)}catch{}}return!1}},function(n,a,r){r(16)({target:"Number",stat:!0},{isNaN:function(s){return s!=s}})},function(n,a,r){var s=r(73).PROPER,c=r(18),v=r(162);n.exports=function(f){return c((function(){return!!v[f]()||"
"[f]()!=="
"||s&&v[f].name!==f}))}},function(n,a,r){var s=r(15),c=r(40),v=Math.floor,f=s("".charAt),g=s("".replace),_=s("".slice),b=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,x=/\$([$&'`]|\d{1,2})/g;n.exports=function(S,A,E,T,I,R){var U=E+S.length,D=T.length,L=x;return I!==void 0&&(I=c(I),L=b),g(R,L,(function(W,H){var B;switch(f(H,0)){case"$":return"$";case"&":return S;case"`":return _(A,0,E);case"'":return _(A,U);case"<":B=I[_(H,1,-1)];break;default:var F=+H;if(F===0)return W;if(F>D){var q=v(F/10);return q===0?W:q<=D?T[q-1]===void 0?f(H,1):T[q-1]+f(H,1):W}B=T[F-1]}return B===void 0?"":B}))}},function(n,a,r){var s=r(36),c=r(15),v=r(34),f=r(18),g=r(77),_=r(112),b=r(84),x=r(40),S=r(85),A=Object.assign,E=Object.defineProperty,T=c([].concat);n.exports=!A||f((function(){if(s&&A({b:1},A(E({},"a",{enumerable:!0,get:function(){E(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},R={},U=Symbol(),D="abcdefghijklmnopqrst";return I[U]=7,D.split("").forEach((function(L){R[L]=L})),A({},I)[U]!=7||g(A({},R)).join("")!=D}))?function(I,R){for(var U=x(I),D=arguments.length,L=1,W=_.f,H=b.f;D>L;)for(var B,F=S(arguments[L++]),q=W?T(g(F),W(F)):g(F),K=q.length,X=0;K>X;)B=q[X++],s&&!v(H,F,B)||(U[B]=F[B]);return U}:A},function(n,a,r){var s=r(7),c=r(15),v=r(56),f=r(33),g=r(35),_=r(98),b=s.Function,x=c([].concat),S=c([].join),A={},E=function(T,I,R){if(!g(A,I)){for(var U=[],D=0;D<I;D++)U[D]="a["+D+"]";A[I]=b("C,a","return new C("+S(U,",")+")")}return A[I](T,R)};n.exports=b.bind||function(T){var I=v(this),R=I.prototype,U=_(arguments,1),D=function(){var L=x(U,_(arguments));return this instanceof D?E(I,L.length,L):I.apply(T,L)};return f(R)&&(D.prototype=R),D}},function(n,a,r){var s=r(35);n.exports=function(c){return c!==void 0&&(s(c,"value")||s(c,"writable"))}},function(n,a,r){var s=r(15),c=r(44),v=r(39),f=/"/g,g=s("".replace);n.exports=function(_,b,x,S){var A=v(c(_)),E="<"+b;return x!==""&&(E+=" "+x+'="'+g(v(S),f,""")+'"'),E+">"+A+"</"+b+">"}},function(n,a,r){var s=r(18);n.exports=function(c){return s((function(){var v=""[c]('"');return v!==v.toLowerCase()||v.split('"').length>3}))}},function(n,a,r){r(16)({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(n,a,r){var s,c,v,f,g=r(16),_=r(71),b=r(7),x=r(46),S=r(34),A=r(209),E=r(42),T=r(149),I=r(102),R=r(78),U=r(150),D=r(56),L=r(30),W=r(33),H=r(119),B=r(92),F=r(117),q=r(120),K=r(164),X=r(168).set,ee=r(210),ue=r(213),ae=r(214),we=r(170),je=r(215),Te=r(58),Me=r(95),Ne=r(28),rt=r(216),tt=r(128),Be=r(70),lt=Ne("species"),St="Promise",He=Te.getterFor(St),Jt=Te.set,Fe=Te.getterFor(St),me=A&&A.prototype,Le=A,Ye=me,Ot=b.TypeError,bt=b.document,Ft=b.process,Qt=we.f,on=Qt,Wt=!!(bt&&bt.createEvent&&b.dispatchEvent),nt=L(b.PromiseRejectionEvent),sn="unhandledrejection",We=!1,yn=Me(St,(function(){var $e=B(Le),st=$e!==String(Le);if(!st&&Be===66||_&&!Ye.finally)return!0;if(Be>=51&&/native code/.test($e))return!1;var an=new Le((function(Tn){Tn(1)})),en=function(Tn){Tn((function(){}),(function(){}))};return(an.constructor={})[lt]=en,!(We=an.then((function(){}))instanceof en)||!st&&rt&&!nt})),Kn=yn||!q((function($e){Le.all($e).catch((function(){}))})),te=function($e){var st;return!(!W($e)||!L(st=$e.then))&&st},Gn=function($e,st){if(!$e.notified){$e.notified=!0;var an=$e.reactions;ee((function(){for(var en=$e.value,Tn=$e.state==1,Sr=0;an.length>Sr;){var li,Ei,Yo,ti=an[Sr++],Nn=Tn?ti.ok:ti.fail,Un=ti.resolve,Zn=ti.reject,ur=ti.domain;try{Nn?(Tn||($e.rejection===2&&jn($e),$e.rejection=1),Nn===!0?li=en:(ur&&ur.enter(),li=Nn(en),ur&&(ur.exit(),Yo=!0)),li===ti.promise?Zn(Ot("Promise-chain cycle")):(Ei=te(li))?S(Ei,li,Un,Zn):Un(li)):Zn(en)}catch(to){ur&&!Yo&&ur.exit(),Zn(to)}}$e.reactions=[],$e.notified=!1,st&&!$e.rejection&&Dr($e)}))}},br=function($e,st,an){var en,Tn;Wt?((en=bt.createEvent("Event")).promise=st,en.reason=an,en.initEvent($e,!1,!0),b.dispatchEvent(en)):en={promise:st,reason:an},!nt&&(Tn=b["on"+$e])?Tn(en):$e===sn&&ae("Unhandled promise rejection",an)},Dr=function($e){S(X,b,(function(){var st,an=$e.facade,en=$e.value;if(zr($e)&&(st=je((function(){tt?Ft.emit("unhandledRejection",en,an):br(sn,an,en)})),$e.rejection=tt||zr($e)?2:1,st.error))throw st.value}))},zr=function($e){return $e.rejection!==1&&!$e.parent},jn=function($e){S(X,b,(function(){var st=$e.facade;tt?Ft.emit("rejectionHandled",st):br("rejectionhandled",st,$e.value)}))},ko=function($e,st,an){return function(en){$e(st,en,an)}},Se=function($e,st,an){$e.done||($e.done=!0,an&&($e=an),$e.value=st,$e.state=2,Gn($e,!0))},Qe=function($e,st,an){if(!$e.done){$e.done=!0,an&&($e=an);try{if($e.facade===st)throw Ot("Promise can't be resolved itself");var en=te(st);en?ee((function(){var Tn={done:!1};try{S(en,st,ko(Qe,Tn,$e),ko(Se,Tn,$e))}catch(Sr){Se(Tn,Sr,$e)}})):($e.value=st,$e.state=1,Gn($e,!1))}catch(Tn){Se({done:!1},Tn,$e)}}};if(yn&&(Ye=(Le=function($e){H(this,Ye),D($e),S(s,this);var st=He(this);try{$e(ko(Qe,st),ko(Se,st))}catch(an){Se(st,an)}}).prototype,(s=function($e){Jt(this,{type:St,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=T(Ye,{then:function($e,st){var an=Fe(this),en=an.reactions,Tn=Qt(K(this,Le));return Tn.ok=!L($e)||$e,Tn.fail=L(st)&&st,Tn.domain=tt?Ft.domain:void 0,an.parent=!0,en[en.length]=Tn,an.state!=0&&Gn(an,!1),Tn.promise},catch:function($e){return this.then(void 0,$e)}}),c=function(){var $e=new s,st=He($e);this.promise=$e,this.resolve=ko(Qe,st),this.reject=ko(Se,st)},we.f=Qt=function($e){return $e===Le||$e===v?new c($e):on($e)},!_&&L(A)&&me!==Object.prototype)){f=me.then,We||(E(me,"then",(function($e,st){var an=this;return new Le((function(en,Tn){S(f,an,en,Tn)})).then($e,st)}),{unsafe:!0}),E(me,"catch",Ye.catch,{unsafe:!0}));try{delete me.constructor}catch{}I&&I(me,Ye)}g({global:!0,wrap:!0,forced:yn},{Promise:Le}),R(Le,St,!1,!0),U(St),v=x(St),g({target:St,stat:!0,forced:yn},{reject:function($e){var st=Qt(this);return S(st.reject,void 0,$e),st.promise}}),g({target:St,stat:!0,forced:_||yn},{resolve:function($e){return ue(_&&this===v?Le:this,$e)}}),g({target:St,stat:!0,forced:Kn},{all:function($e){var st=this,an=Qt(st),en=an.resolve,Tn=an.reject,Sr=je((function(){var li=D(st.resolve),Ei=[],Yo=0,ti=1;F($e,(function(Nn){var Un=Yo++,Zn=!1;ti++,S(li,st,Nn).then((function(ur){Zn||(Zn=!0,Ei[Un]=ur,--ti||en(Ei))}),Tn)})),--ti||en(Ei)}));return Sr.error&&Tn(Sr.value),an.promise},race:function($e){var st=this,an=Qt(st),en=an.reject,Tn=je((function(){var Sr=D(st.resolve);F($e,(function(li){S(Sr,st,li).then(an.resolve,en)}))}));return Tn.error&&en(Tn.value),an.promise}})},function(n,a,r){var s=r(7);n.exports=s.Promise},function(n,a,r){var s,c,v,f,g,_,b,x,S=r(7),A=r(64),E=r(50).f,T=r(168).set,I=r(169),R=r(211),U=r(212),D=r(128),L=S.MutationObserver||S.WebKitMutationObserver,W=S.document,H=S.process,B=S.Promise,F=E(S,"queueMicrotask"),q=F&&F.value;q||(s=function(){var K,X;for(D&&(K=H.domain)&&K.exit();c;){X=c.fn,c=c.next;try{X()}catch(ee){throw c?f():v=void 0,ee}}v=void 0,K&&K.enter()},I||D||U||!L||!W?!R&&B&&B.resolve?((b=B.resolve(void 0)).constructor=B,x=A(b.then,b),f=function(){x(s)}):D?f=function(){H.nextTick(s)}:(T=A(T,S),f=function(){T(s)}):(g=!0,_=W.createTextNode(""),new L(s).observe(_,{characterData:!0}),f=function(){_.data=g=!g})),n.exports=q||function(K){var X={fn:K,next:void 0};v&&(v.next=X),c||(c=X,f()),v=X}},function(n,a,r){var s=r(55),c=r(7);n.exports=/ipad|iphone|ipod/i.test(s)&&c.Pebble!==void 0},function(n,a,r){var s=r(55);n.exports=/web0s(?!.*chrome)/i.test(s)},function(n,a,r){var s=r(32),c=r(33),v=r(170);n.exports=function(f,g){if(s(f),c(g)&&g.constructor===f)return g;var _=v.f(f);return(0,_.resolve)(g),_.promise}},function(n,a,r){var s=r(7);n.exports=function(c,v){var f=s.console;f&&f.error&&(arguments.length==1?f.error(c):f.error(c,v))}},function(n,a){n.exports=function(r){try{return{error:!1,value:r()}}catch(s){return{error:!0,value:s}}}},function(n,a){n.exports=typeof window=="object"},function(n,a,r){var s=r(40),c=r(75),v=r(45);n.exports=function(f){for(var g=s(this),_=v(g),b=arguments.length,x=c(b>1?arguments[1]:void 0,_),S=b>2?arguments[2]:void 0,A=S===void 0?_:c(S,_);A>x;)g[x++]=f;return g}},function(n,a,r){var s=r(16),c=r(7),v=r(15),f=r(59),g=r(160),_=r(219),b=r(18),x=c.RangeError,S=c.String,A=Math.floor,E=v(_),T=v("".slice),I=v(1 .toFixed),R=function(W,H,B){return H===0?B:H%2==1?R(W,H-1,B*W):R(W*W,H/2,B)},U=function(W,H,B){for(var F=-1,q=B;++F<6;)q+=H*W[F],W[F]=q%1e7,q=A(q/1e7)},D=function(W,H){for(var B=6,F=0;--B>=0;)F+=W[B],W[B]=A(F/H),F=F%H*1e7},L=function(W){for(var H=6,B="";--H>=0;)if(B!==""||H===0||W[H]!==0){var F=S(W[H]);B=B===""?F:B+E("0",7-F.length)+F}return B};s({target:"Number",proto:!0,forced:b((function(){return I(8e-5,3)!=="0.000"||I(.9,0)!=="1"||I(1.255,2)!=="1.25"||I(0xde0b6b3a7640080,0)!=="1000000000000000128"}))||!b((function(){I({})}))},{toFixed:function(W){var H,B,F,q,K=g(this),X=f(W),ee=[0,0,0,0,0,0],ue="",ae="0";if(X<0||X>20)throw x("Incorrect fraction digits");if(K!=K)return"NaN";if(K<=-1e21||K>=1e21)return S(K);if(K<0&&(ue="-",K=-K),K>1e-21)if(B=(H=(function(we){for(var je=0,Te=we;Te>=4096;)je+=12,Te/=4096;for(;Te>=2;)je+=1,Te/=2;return je})(K*R(2,69,1))-69)<0?K*R(2,-H,1):K/R(2,H,1),B*=4503599627370496,(H=52-H)>0){for(U(ee,0,B),F=X;F>=7;)U(ee,1e7,0),F-=7;for(U(ee,R(10,F,1),0),F=H-1;F>=23;)D(ee,1<<23),F-=23;D(ee,1<<F),U(ee,1,1),D(ee,2),ae=L(ee)}else U(ee,0,B),U(ee,1<<-H,0),ae=L(ee)+E("0",X);return ae=X>0?ue+((q=ae.length)<=X?"0."+E("0",X-q)+ae:T(ae,0,q-X)+"."+T(ae,q-X)):ue+ae}})},function(n,a,r){var s=r(7),c=r(59),v=r(39),f=r(44),g=s.RangeError;n.exports=function(_){var b=v(f(this)),x="",S=c(_);if(S<0||S==1/0)throw g("Wrong number of repetitions");for(;S>0;(S>>>=1)&&(b+=b))1&S&&(x+=b);return x}},function(n,a,r){var s=r(36),c=r(15),v=r(77),f=r(41),g=c(r(84).f),_=c([].push),b=function(x){return function(S){for(var A,E=f(S),T=v(E),I=T.length,R=0,U=[];I>R;)A=T[R++],s&&!g(E,A)||_(U,x?[A,E[A]]:E[A]);return U}};n.exports={entries:b(!0),values:b(!1)}},function(n,a){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,a,r){r.r(a),r.d(a,"observer",(function(){return gu})),r.d(a,"LogicFlow",(function(){return y1})),r.d(a,"h",(function(){return We.g})),r.d(a,"LogicFlowUtil",(function(){return s})),r.d(a,"BaseNode",(function(){return gd})),r.d(a,"RectNode",(function(){return s0})),r.d(a,"CircleNode",(function(){return f0})),r.d(a,"PolygonNode",(function(){return y0})),r.d(a,"DiamondNode",(function(){return w0})),r.d(a,"EllipseNode",(function(){return A0})),r.d(a,"TextNode",(function(){return T0})),r.d(a,"HtmlNode",(function(){return R0})),r.d(a,"BaseEdge",(function(){return fm})),r.d(a,"LineEdge",(function(){return X0})),r.d(a,"PolylineEdge",(function(){return J0})),r.d(a,"BezierEdge",(function(){return n1})),r.d(a,"Arrow",(function(){return qj})),r.d(a,"BaseEdgeModel",(function(){return xf})),r.d(a,"BezierEdgeModel",(function(){return hb})),r.d(a,"LineEdgeModel",(function(){return Yu})),r.d(a,"PolylineEdgeModel",(function(){return Aa})),r.d(a,"BaseNodeModel",(function(){return yd})),r.d(a,"CircleNodeModel",(function(){return bb})),r.d(a,"DiamondNodeModel",(function(){return Sb})),r.d(a,"EllipseNodeModel",(function(){return Tb})),r.d(a,"PolygonNodeModel",(function(){return Db})),r.d(a,"RectNodeModel",(function(){return Fb})),r.d(a,"TextNodeModel",(function(){return Wb})),r.d(a,"HtmlNodeModel",(function(){return Hb})),r.d(a,"EditConfigModel",(function(){return ef})),r.d(a,"GraphModel",(function(){return r2})),r.d(a,"SnaplineModel",(function(){return BO})),r.d(a,"Keyboard",(function(){return Ax})),r.d(a,"get",(function(){return A2})),r.d(a,"defaults",(function(){return k2})),r.d(a,"ElementState",(function(){return Zr})),r.d(a,"ModelType",(function(){return Mr})),r.d(a,"ElementType",(function(){return co})),r.d(a,"EventType",(function(){return Dn})),r.d(a,"formateAnchorConnectValidateData",(function(){return Yl}));var s={};r.r(s),r.d(s,"createUuid",(function(){return ta})),r.d(s,"refreshGraphId",(function(){return Yc})),r.d(s,"StepDrag",(function(){return ye})),r.d(s,"setupEdgeModel",(function(){return Bt})),r.d(s,"isBboxOverLapping",(function(){return jt})),r.d(s,"filterRepeatPoints",(function(){return ht})),r.d(s,"getSimplePolyline",(function(){return Kt})),r.d(s,"getExpandedBBox",(function(){return Gt})),r.d(s,"pointDirection",(function(){return Dt})),r.d(s,"getExpandedBBoxPoint",(function(){return At})),r.d(s,"mergeBBox",(function(){return Ze})),r.d(s,"getBBoxOfPoints",(function(){return pt})),r.d(s,"getPointsFromBBox",(function(){return $t})),r.d(s,"isPointOutsideBBox",(function(){return tn})),r.d(s,"getBBoxXCrossPoints",(function(){return kt})),r.d(s,"getBBoxYCrossPoints",(function(){return ln})),r.d(s,"getBBoxCrossPointsByPoint",(function(){return Nt})),r.d(s,"estimateDistance",(function(){return qt})),r.d(s,"costByPoints",(function(){return Tt})),r.d(s,"heuristicCostEstimate",(function(){return Zt})),r.d(s,"rebuildPath",(function(){return Cn})),r.d(s,"removeClosePointFromOpenList",(function(){return Hn})),r.d(s,"isSegmentsIntersected",(function(){return It})),r.d(s,"isSegmentCrossingBBox",(function(){return Pt})),r.d(s,"getNextNeighborPoints",(function(){return Mt})),r.d(s,"pathFinder",(function(){return Ln})),r.d(s,"getBoxByOriginNode",(function(){return or})),r.d(s,"pointFilter",(function(){return mn})),r.d(s,"getPolylinePoints",(function(){return cr})),r.d(s,"getLongestEdge",(function(){return Xn})),r.d(s,"isSegmentsInNode",(function(){return lr})),r.d(s,"isSegmentsCrossNode",(function(){return Er})),r.d(s,"getCrossPointInRect",(function(){return $o})),r.d(s,"segmentDirection",(function(){return Ro})),r.d(s,"points2PointsList",(function(){return ir})),r.d(s,"getSimplePoints",(function(){return Zo})),r.d(s,"getBytesLength",(function(){return Fo})),r.d(s,"getTextWidth",(function(){return ii})),r.d(s,"getAppendAttributes",(function(){return fi})),r.d(s,"getBezierControlPoints",(function(){return Jo})),r.d(s,"getBezierPoints",(function(){return go})),r.d(s,"getEndTangent",(function(){return pi})),r.d(s,"getClosestPointOfPolyline",(function(){return Tr})),r.d(s,"pickEdgeConfig",(function(){return In})),r.d(s,"twoPointDistance",(function(){return mr})),r.d(s,"createEdgeGenerator",(function(){return tr})),r.d(s,"snapToGrid",(function(){return nl})),r.d(s,"getGridOffset",(function(){return zc})),r.d(s,"sampleCubic",(function(){return Lo})),r.d(s,"getThetaOfVector",(function(){return Af})),r.d(s,"degrees",(function(){return Dp})),r.d(s,"Vector",(function(){return Xe})),r.d(s,"Point",(function(){return p})),r.d(s,"Matrix",(function(){return Ms})),r.d(s,"RotateMatrix",(function(){return Ku})),r.d(s,"ScaleMatrix",(function(){return tm})),r.d(s,"TranslateMatrix",(function(){return kf}));var c=r(1),v=r(10);if(!v.j)throw new Error("mobx-react-lite requires React with Hooks support");if(!c.H)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var f=r(43),g=Object(f.b)("observerBatching");function _(i){i()}var b=!1;function x(){return b}function S(i){return Object(c.t)(i)}var A,E=1e4,T=new Set;function I(){A===void 0&&(A=setTimeout(R,1e4))}function R(){A=void 0;var i=Date.now();T.forEach((function(o){var l=o.current;l&&i>=l.cleanAt&&(l.reaction.dispose(),o.current=null,T.delete(o))})),T.size>0&&I()}var U=!1,D=[],L={};function W(i){return"observer"+i}function H(i,o,l){o===void 0&&(o="observed"),l===void 0&&(l=L),x();var u,h=(function(j){return function(){U?D.push(j):j()}})((l.useForceUpdate||f.d)()),d=v.d.useRef(null);if(!d.current){var m=new c.c(W(o),(function(){w.mounted?h():(m.dispose(),d.current=null)})),w=(function(j){return{cleanAt:Date.now()+E,reaction:j}})(m);d.current=w,u=d,T.add(u),I()}var M=d.current.reaction;return v.d.useDebugValue(M,S),v.d.useEffect((function(){var j;return j=d,T.delete(j),d.current?d.current.mounted=!0:(d.current={reaction:new c.c(W(o),(function(){h()})),cleanAt:1/0},h()),function(){d.current.reaction.dispose(),d.current=null}}),[]),(function(j){U=!0,D=[];try{var V=j();U=!1;var Q=D.length>0?D:void 0;return v.d.useLayoutEffect((function(){Q&&Q.forEach((function(ne){return ne()}))}),[Q]),V}finally{U=!1}})((function(){var j,V;if(M.track((function(){try{j=i()}catch(Q){V=Q}})),V)throw V;return j}))}var B=function(){return B=Object.assign||function(i){for(var o,l=1,u=arguments.length;l<u;l++)for(var h in o=arguments[l])Object.prototype.hasOwnProperty.call(o,h)&&(i[h]=o[h]);return i},B.apply(this,arguments)};function F(i,o){var l,u,h,d=B({forwardRef:!1},o),m=i.displayName||i.name,w=function(M,j){return H((function(){return i(M,j)}),m)};return w.displayName=m,l=d.forwardRef?Object(v.f)(Object(v.e)(w)):Object(v.f)(w),u=i,h=l,Object.keys(u).forEach((function(M){q[M]||Object.defineProperty(h,M,Object.getOwnPropertyDescriptor(u,M))})),l.displayName=m,l}var q={$$typeof:!0,render:!0,compare:!0,type:!0};function K(i){var o=i.children,l=i.render,u=o||l;return typeof u!="function"?null:H(u)}function X(i,o,l,u,h){var d=o==="children"?"render":"children",m=typeof i[o]=="function",w=typeof i[d]=="function";return m&&w?new Error("MobX Observer: Do not use children and render in the same time in`"+l):m||w?null:new Error("Invalid prop `"+h+"` of type `"+typeof i[o]+"` supplied to `"+l+"`, expected `function`.")}K.propTypes={children:X,render:X},K.displayName="Observer";var ee;(ee=v.g)||(ee=_),Object(c.n)({reactionScheduler:ee}),Object(f.a)()[g]=!0;var ue=0,ae={};function we(i){return ae[i]||(ae[i]=(function(o){if(typeof Symbol=="function")return Symbol(o);var l="__$mobx-react "+o+" ("+ue+")";return ue++,l})(i)),ae[i]}function je(i,o){if(Te(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length)return!1;for(var h=0;h<l.length;h++)if(!Object.hasOwnProperty.call(o,l[h])||!Te(i[l[h]],o[l[h]]))return!1;return!0}function Te(i,o){return i===o?i!==0||1/i==1/o:i!=i&&o!=o}function Me(i,o,l){Object.hasOwnProperty.call(i,o)?i[o]=l:Object.defineProperty(i,o,{enumerable:!1,configurable:!0,writable:!0,value:l})}var Ne=we("patchMixins"),rt=we("patchedDefinition");function tt(i,o){for(var l=this,u=arguments.length,h=new Array(u>2?u-2:0),d=2;d<u;d++)h[d-2]=arguments[d];o.locks++;try{var m;return i!=null&&(m=i.apply(this,h)),m}finally{o.locks--,o.locks===0&&o.methods.forEach((function(w){w.apply(l,h)}))}}function Be(i,o){return function(){for(var l=arguments.length,u=new Array(l),h=0;h<l;h++)u[h]=arguments[h];tt.call.apply(tt,[this,i,o].concat(u))}}function lt(i,o,l){var u=(function(w,M){var j=w[Ne]=w[Ne]||{},V=j[M]=j[M]||{};return V.locks=V.locks||0,V.methods=V.methods||[],V})(i,o);u.methods.indexOf(l)<0&&u.methods.push(l);var h=Object.getOwnPropertyDescriptor(i,o);if(!h||!h[rt]){var d=i[o],m=St(i,o,h?h.enumerable:void 0,u,d);Object.defineProperty(i,o,m)}}function St(i,o,l,u,h){var d,m=Be(h,u);return(d={})[rt]=!0,d.get=function(){return m},d.set=function(w){if(this===i)m=Be(w,u);else{var M=St(this,o,l,u,w);Object.defineProperty(this,o,M)}},d.configurable=!0,d.enumerable=l,d}var He=c.a||"$mobx",Jt=we("isMobXReactObserver"),Fe=we("isUnmounted"),me=we("skipRender"),Le=we("isForcingUpdate");function Ye(i){var o=i.prototype;if(i[Jt]?Ot(o):i[Jt]=!0,o.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(i.__proto__!==v.b)if(o.shouldComponentUpdate){if(o.shouldComponentUpdate!==Ft)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else o.shouldComponentUpdate=Ft;Qt(o,"props"),Qt(o,"state");var l=o.render;return o.render=function(){return bt.call(this,l)},lt(o,"componentWillUnmount",(function(){var u;(u=this.render[He])===null||u===void 0||u.dispose(),this[Fe]=!0,!this.render[He]&&Ot(this)})),i}function Ot(i){return i.displayName||i.name||i.constructor&&(i.constructor.displayName||i.constructor.name)||"<component>"}function bt(i){var o=this;Me(this,me,!1),Me(this,Le,!1);var l=Ot(this),u=i.bind(this),h=!1,d=new c.c(l+".render()",(function(){if(!h&&(h=!0,o[Fe]!==!0)){var w=!0;try{Me(o,Le,!0),o[me]||v.a.prototype.forceUpdate.call(o),w=!1}finally{Me(o,Le,!1),w&&d.dispose()}}}));function m(){h=!1;var w=void 0,M=void 0;if(d.track((function(){try{M=Object(c.d)(!1,u)}catch(j){w=j}})),w)throw w;return M}return d.reactComponent=this,m[He]=d,this.render=m,m.call(this)}function Ft(i,o){return this.state!==o||!je(this.props,i)}function Qt(i,o){var l=we("reactProp_"+o+"_valueHolder"),u=we("reactProp_"+o+"_atomHolder");function h(){return this[u]||Me(this,u,Object(c.o)("reactive "+o)),this[u]}Object.defineProperty(i,o,{configurable:!0,enumerable:!0,get:function(){var d=!1;return c.f&&c.e&&(d=Object(c.f)(!0)),h.call(this).reportObserved(),c.f&&c.e&&Object(c.e)(d),this[l]},set:function(d){this[Le]||je(this[l],d)?Me(this,l,d):(Me(this,l,d),Me(this,me,!0),h.call(this).reportChanged(),Me(this,me,!1))}})}var on=typeof Symbol=="function"&&Symbol.for,Wt=on?Symbol.for("react.forward_ref"):typeof v.e=="function"&&Object(v.e)((function(i){return null})).$$typeof,nt=on?Symbol.for("react.memo"):typeof v.f=="function"&&Object(v.f)((function(i){return null})).$$typeof;function sn(i){if(i.isMobxInjector,nt&&i.$$typeof===nt)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(Wt&&i.$$typeof===Wt){var o=i.render;if(typeof o!="function")throw new Error("render property of ForwardRef was not a function");return Object(v.e)((function(){var l=arguments;return Object(v.c)(K,null,(function(){return o.apply(void 0,l)}))}))}return typeof i!="function"||i.prototype&&i.prototype.render||i.isReactClass||Object.prototype.isPrototypeOf.call(v.a,i)?Ye(i):F(i)}if(!v.a)throw new Error("mobx-react requires React to be available");if(!c.C)throw new Error("mobx-react requires mobx to be available");var We=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 yn=function(i,o){for(var l=-1,u=i==null?0:i.length,h=Array(u);++l<u;)h[l]=o(i[l],l,i);return h},Kn=function(){this.__data__=[],this.size=0},te=function(i,o){return i===o||i!=i&&o!=o},Gn=function(i,o){for(var l=i.length;l--;)if(te(i[l][0],o))return l;return-1},br=Array.prototype.splice,Dr=function(i){var o=this.__data__,l=Gn(o,i);return!(l<0)&&(l==o.length-1?o.pop():br.call(o,l,1),--this.size,!0)},zr=function(i){var o=this.__data__,l=Gn(o,i);return l<0?void 0:o[l][1]},jn=function(i){return Gn(this.__data__,i)>-1},ko=function(i,o){var l=this.__data__,u=Gn(l,i);return u<0?(++this.size,l.push([i,o])):l[u][1]=o,this};function Se(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var u=i[o];this.set(u[0],u[1])}}Se.prototype.clear=Kn,Se.prototype.delete=Dr,Se.prototype.get=zr,Se.prototype.has=jn,Se.prototype.set=ko;var Qe=Se,$e=function(){this.__data__=new Qe,this.size=0},st=function(i){var o=this.__data__,l=o.delete(i);return this.size=o.size,l},an=function(i){return this.__data__.get(i)},en=function(i){return this.__data__.has(i)},Tn=r(31),Sr=Tn.a.Symbol,li=Object.prototype,Ei=li.hasOwnProperty,Yo=li.toString,ti=Sr?Sr.toStringTag:void 0,Nn=function(i){var o=Ei.call(i,ti),l=i[ti];try{i[ti]=void 0;var u=!0}catch{}var h=Yo.call(i);return u&&(o?i[ti]=l:delete i[ti]),h},Un=Object.prototype.toString,Zn=function(i){return Un.call(i)},ur=Sr?Sr.toStringTag:void 0,to=function(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":ur&&ur in Object(i)?Nn(i):Zn(i)},Lr=function(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")},ml,za=function(i){if(!Lr(i))return!1;var o=to(i);return o=="[object Function]"||o=="[object GeneratorFunction]"||o=="[object AsyncFunction]"||o=="[object Proxy]"},yl=Tn.a["__core-js_shared__"],as=(ml=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||""))?"Symbol(src)_1."+ml:"",np=function(i){return!!as&&as in i},gc=Function.prototype.toString,va=function(i){if(i!=null){try{return gc.call(i)}catch{}try{return i+""}catch{}}return""},Fs=/^\[object .+?Constructor\]$/,Rn=Function.prototype,Id=Object.prototype,Eo=Rn.toString,_c=Id.hasOwnProperty,Ki=RegExp("^"+Eo.call(_c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oa=function(i){return!(!Lr(i)||np(i))&&(za(i)?Ki:Fs).test(va(i))},Mu=function(i,o){return i==null?void 0:i[o]},Pa=function(i,o){var l=Mu(i,o);return oa(l)?l:void 0},ma=Pa(Tn.a,"Map"),Ca=Pa(Object,"create"),bc=function(){this.__data__=Ca?Ca(null):{},this.size=0},wc=function(i){var o=this.has(i)&&delete this.__data__[i];return this.size-=o?1:0,o},Ld=Object.prototype.hasOwnProperty,Bs=function(i){var o=this.__data__;if(Ca){var l=o[i];return l==="__lodash_hash_undefined__"?void 0:l}return Ld.call(o,i)?o[i]:void 0},$d=Object.prototype.hasOwnProperty,Ec=function(i){var o=this.__data__;return Ca?o[i]!==void 0:$d.call(o,i)},rp=function(i,o){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=Ca&&o===void 0?"__lodash_hash_undefined__":o,this};function Il(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var u=i[o];this.set(u[0],u[1])}}Il.prototype.clear=bc,Il.prototype.delete=wc,Il.prototype.get=Bs,Il.prototype.has=Ec,Il.prototype.set=rp;var Fd=Il,gl=function(){this.size=0,this.__data__={hash:new Fd,map:new(ma||Qe),string:new Fd}},Oc=function(i){var o=typeof i;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?i!=="__proto__":i===null},ku=function(i,o){var l=i.__data__;return Oc(o)?l[typeof o=="string"?"string":"hash"]:l.map},xc=function(i){var o=ku(this,i).delete(i);return this.size-=o?1:0,o},Sc=function(i){return ku(this,i).get(i)},op=function(i){return ku(this,i).has(i)},Bd=function(i,o){var l=ku(this,i),u=l.size;return l.set(i,o),this.size+=l.size==u?0:1,this};function Kr(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var u=i[o];this.set(u[0],u[1])}}Kr.prototype.clear=gl,Kr.prototype.delete=xc,Kr.prototype.get=Sc,Kr.prototype.has=op,Kr.prototype.set=Bd;var Xr=Kr,Vd=function(i,o){var l=this.__data__;if(l instanceof Qe){var u=l.__data__;if(!ma||u.length<199)return u.push([i,o]),this.size=++l.size,this;l=this.__data__=new Xr(u)}return l.set(i,o),this.size=l.size,this};function ls(i){var o=this.__data__=new Qe(i);this.size=o.size}ls.prototype.clear=$e,ls.prototype.delete=st,ls.prototype.get=an,ls.prototype.has=en,ls.prototype.set=Vd;var ya=ls,Tu=function(i){return this.__data__.set(i,"__lodash_hash_undefined__"),this},Ud=function(i){return this.__data__.has(i)};function Uo(i){var o=-1,l=i==null?0:i.length;for(this.__data__=new Xr;++o<l;)this.add(i[o])}Uo.prototype.add=Uo.prototype.push=Tu,Uo.prototype.has=Ud;var Ll=Uo,$l=function(i,o){for(var l=-1,u=i==null?0:i.length;++l<u;)if(o(i[l],l,i))return!0;return!1},Nu=function(i,o){return i.has(o)},ss=function(i,o,l,u,h,d){var m=1&l,w=i.length,M=o.length;if(w!=M&&!(m&&M>w))return!1;var j=d.get(i),V=d.get(o);if(j&&V)return j==o&&V==i;var Q=-1,ne=!0,_e=2&l?new Ll:void 0;for(d.set(i,o),d.set(o,i);++Q<w;){var ke=i[Q],Ie=o[Q];if(u)var ft=m?u(Ie,ke,Q,o,i,d):u(ke,Ie,Q,i,o,d);if(ft!==void 0){if(ft)continue;ne=!1;break}if(_e){if(!$l(o,(function(dt,Et){if(!Nu(_e,Et)&&(ke===dt||h(ke,dt,l,u,d)))return _e.push(Et)}))){ne=!1;break}}else if(ke!==Ie&&!h(ke,Ie,l,u,d)){ne=!1;break}}return d.delete(i),d.delete(o),ne},Oi=Tn.a.Uint8Array,Ac=function(i){var o=-1,l=Array(i.size);return i.forEach((function(u,h){l[++o]=[h,u]})),l},Wd=function(i){var o=-1,l=Array(i.size);return i.forEach((function(u){l[++o]=u})),l},Mc=Sr?Sr.prototype:void 0,$i=Mc?Mc.valueOf:void 0,si=function(i,o,l,u,h,d,m){switch(l){case"[object DataView]":if(i.byteLength!=o.byteLength||i.byteOffset!=o.byteOffset)return!1;i=i.buffer,o=o.buffer;case"[object ArrayBuffer]":return!(i.byteLength!=o.byteLength||!d(new Oi(i),new Oi(o)));case"[object Boolean]":case"[object Date]":case"[object Number]":return te(+i,+o);case"[object Error]":return i.name==o.name&&i.message==o.message;case"[object RegExp]":case"[object String]":return i==o+"";case"[object Map]":var w=Ac;case"[object Set]":var M=1&u;if(w||(w=Wd),i.size!=o.size&&!M)return!1;var j=m.get(i);if(j)return j==o;u|=2,m.set(i,o);var V=ss(w(i),w(o),u,h,d,m);return m.delete(i),V;case"[object Symbol]":if($i)return $i.call(i)==$i.call(o)}return!1},ga=function(i,o){for(var l=-1,u=o.length,h=i.length;++l<u;)i[h+l]=o[l];return i},lo=Array.isArray,ip=function(i,o,l){var u=o(i);return lo(i)?u:ga(u,l(i))},Fi=function(i,o){for(var l=-1,u=i==null?0:i.length,h=0,d=[];++l<u;){var m=i[l];o(m,l,i)&&(d[h++]=m)}return d},Gd=function(){return[]},zd=Object.prototype.propertyIsEnumerable,Bi=Object.getOwnPropertySymbols,Zi=Bi?function(i){return i==null?[]:(i=Object(i),Fi(Bi(i),(function(o){return zd.call(i,o)})))}:Gd,kc=function(i,o){for(var l=-1,u=Array(i);++l<i;)u[l]=o(l);return u},Vr=function(i){return i!=null&&typeof i=="object"},ui=function(i){return Vr(i)&&to(i)=="[object Arguments]"},Pu=Object.prototype,Hd=Pu.hasOwnProperty,Tc=Pu.propertyIsEnumerable,Cu=ui((function(){return arguments})())?ui:function(i){return Vr(i)&&Hd.call(i,"callee")&&!Tc.call(i,"callee")},Ha=Cu,Vi=r(48),us=/^(?:0|[1-9]\d*)$/,Ji=function(i,o){var l=typeof i;return!!(o=o??9007199254740991)&&(l=="number"||l!="symbol"&&us.test(i))&&i>-1&&i%1==0&&i<o},_a=function(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=9007199254740991},Cr={};Cr["[object Float32Array]"]=Cr["[object Float64Array]"]=Cr["[object Int8Array]"]=Cr["[object Int16Array]"]=Cr["[object Int32Array]"]=Cr["[object Uint8Array]"]=Cr["[object Uint8ClampedArray]"]=Cr["[object Uint16Array]"]=Cr["[object Uint32Array]"]=!0,Cr["[object Arguments]"]=Cr["[object Array]"]=Cr["[object ArrayBuffer]"]=Cr["[object Boolean]"]=Cr["[object DataView]"]=Cr["[object Date]"]=Cr["[object Error]"]=Cr["[object Function]"]=Cr["[object Map]"]=Cr["[object Number]"]=Cr["[object Object]"]=Cr["[object RegExp]"]=Cr["[object Set]"]=Cr["[object String]"]=Cr["[object WeakMap]"]=!1;var Ui=function(i){return Vr(i)&&_a(i.length)&&!!Cr[to(i)]},Ra=function(i){return function(o){return i(o)}},mi=r(49),cs=mi.a&&mi.a.isTypedArray,Fl=cs?Ra(cs):Ui,ja=Object.prototype.hasOwnProperty,mo=function(i,o){var l=lo(i),u=!l&&Ha(i),h=!l&&!u&&Object(Vi.a)(i),d=!l&&!u&&!h&&Fl(i),m=l||u||h||d,w=m?kc(i.length,String):[],M=w.length;for(var j in i)!o&&!ja.call(i,j)||m&&(j=="length"||h&&(j=="offset"||j=="parent")||d&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Ji(j,M))||w.push(j);return w},Vs=Object.prototype,Xa=function(i){var o=i&&i.constructor;return i===(typeof o=="function"&&o.prototype||Vs)},ba=function(i,o){return function(l){return i(o(l))}},Nc=ba(Object.keys,Object),ap=Object.prototype.hasOwnProperty,Pc=function(i){if(!Xa(i))return Nc(i);var o=[];for(var l in Object(i))ap.call(i,l)&&l!="constructor"&&o.push(l);return o},Ko=function(i){return i!=null&&_a(i.length)&&!za(i)},Us=function(i){return Ko(i)?mo(i):Pc(i)},qa=function(i){return ip(i,Us,Zi)},ni=Object.prototype.hasOwnProperty,Cc=function(i,o,l,u,h,d){var m=1&l,w=qa(i),M=w.length;if(M!=qa(o).length&&!m)return!1;for(var j=M;j--;){var V=w[j];if(!(m?V in o:ni.call(o,V)))return!1}var Q=d.get(i),ne=d.get(o);if(Q&&ne)return Q==o&&ne==i;var _e=!0;d.set(i,o),d.set(o,i);for(var ke=m;++j<M;){var Ie=i[V=w[j]],ft=o[V];if(u)var dt=m?u(ft,Ie,V,o,i,d):u(Ie,ft,V,i,o,d);if(!(dt===void 0?Ie===ft||h(Ie,ft,l,u,d):dt)){_e=!1;break}ke||(ke=V=="constructor")}if(_e&&!ke){var Et=i.constructor,zt=o.constructor;Et==zt||!("constructor"in i)||!("constructor"in o)||typeof Et=="function"&&Et instanceof Et&&typeof zt=="function"&&zt instanceof zt||(_e=!1)}return d.delete(i),d.delete(o),_e},ia=Pa(Tn.a,"DataView"),wa=Pa(Tn.a,"Promise"),Ru=Pa(Tn.a,"Set"),Wi=Pa(Tn.a,"WeakMap"),Qi="[object Map]",ci="[object Promise]",aa="[object Set]",ji="[object WeakMap]",vt="[object DataView]",Vt=va(ia),Ut=va(ma),bn=va(wa),pr=va(Ru),Rr=va(Wi),yo=to;(ia&&yo(new ia(new ArrayBuffer(1)))!=vt||ma&&yo(new ma)!=Qi||wa&&yo(wa.resolve())!=ci||Ru&&yo(new Ru)!=aa||Wi&&yo(new Wi)!=ji)&&(yo=function(i){var o=to(i),l=o=="[object Object]"?i.constructor:void 0,u=l?va(l):"";if(u)switch(u){case Vt:return vt;case Ut:return Qi;case bn:return ci;case pr:return aa;case Rr:return ji}return o});var N=yo,C="[object Arguments]",z="[object Array]",ie="[object Object]",Ee=Object.prototype.hasOwnProperty,Ke=function(i,o,l,u,h,d){var m=lo(i),w=lo(o),M=m?z:N(i),j=w?z:N(o),V=(M=M==C?ie:M)==ie,Q=(j=j==C?ie:j)==ie,ne=M==j;if(ne&&Object(Vi.a)(i)){if(!Object(Vi.a)(o))return!1;m=!0,V=!1}if(ne&&!V)return d||(d=new ya),m||Fl(i)?ss(i,o,l,u,h,d):si(i,o,M,l,u,h,d);if(!(1&l)){var _e=V&&Ee.call(i,"__wrapped__"),ke=Q&&Ee.call(o,"__wrapped__");if(_e||ke){var Ie=_e?i.value():i,ft=ke?o.value():o;return d||(d=new ya),h(Ie,ft,l,u,d)}}return!!ne&&(d||(d=new ya),Cc(i,o,l,u,h,d))},wt=function i(o,l,u,h,d){return o===l||(o==null||l==null||!Vr(o)&&!Vr(l)?o!=o&&l!=l:Ke(o,l,u,h,i,d))},Yt=function(i,o,l,u){var h=l.length,d=h;if(i==null)return!d;for(i=Object(i);h--;){var m=l[h];if(m[2]?m[1]!==i[m[0]]:!(m[0]in i))return!1}for(;++h<d;){var w=(m=l[h])[0],M=i[w],j=m[1];if(m[2]){if(M===void 0&&!(w in i))return!1}else{var V=new ya,Q;if(!(Q===void 0?wt(j,M,3,u,V):Q))return!1}}return!0},Sn=function(i){return i==i&&!Lr(i)},Or=function(i){for(var o=Us(i),l=o.length;l--;){var u=o[l],h=i[u];o[l]=[u,h,Sn(h)]}return o},vn=function(i,o){return function(l){return l!=null&&l[i]===o&&(o!==void 0||i in Object(l))}},qr=function(i){var o=Or(i);return o.length==1&&o[0][2]?vn(o[0][0],o[0][1]):function(l){return l===i||Yt(l,i,o)}},gr=function(i){return typeof i=="symbol"||Vr(i)&&to(i)=="[object Symbol]"},Fr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,la=/^\w*$/,To=function(i,o){if(lo(i))return!1;var l=typeof i;return!(l!="number"&&l!="symbol"&&l!="boolean"&&i!=null&&!gr(i))||la.test(i)||!Fr.test(i)||o!=null&&i in Object(o)};function ea(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var l=function(){var u=arguments,h=o?o.apply(this,u):u[0],d=l.cache;if(d.has(h))return d.get(h);var m=i.apply(this,u);return l.cache=d.set(h,m)||d,m};return l.cache=new(ea.Cache||Xr),l}ea.Cache=Xr;var _l=ea,bl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bl=/\\(\\)?/g,ds=(function(i){var o=_l(i,(function(u){return l.size===500&&l.clear(),u})),l=o.cache;return o})((function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(bl,(function(l,u,h,d){o.push(h?d.replace(Bl,"$1"):u||l)})),o})),Ya=Sr?Sr.prototype:void 0,fs=Ya?Ya.toString:void 0,ri=function i(o){if(typeof o=="string")return o;if(lo(o))return yn(o,i)+"";if(gr(o))return fs?fs.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l},Vl=function(i){return i==null?"":ri(i)},wl=function(i,o){return lo(i)?i:To(i,o)?[i]:ds(Vl(i))},Ka=function(i){if(typeof i=="string"||gr(i))return i;var o=i+"";return o=="0"&&1/i==-1/0?"-0":o},Za=function(i,o){for(var l=0,u=(o=wl(o,i)).length;i!=null&&l<u;)i=i[Ka(o[l++])];return l&&l==u?i:void 0},Ws=function(i,o,l){var u=i==null?void 0:Za(i,o);return u===void 0?l:u},hh=function(i,o){return i!=null&&o in Object(i)},vh=function(i,o,l){for(var u=-1,h=(o=wl(o,i)).length,d=!1;++u<h;){var m=Ka(o[u]);if(!(d=i!=null&&l(i,m)))break;i=i[m]}return d||++u!=h?d:!!(h=i==null?0:i.length)&&_a(h)&&Ji(m,h)&&(lo(i)||Ha(i))},lp=function(i,o){return i!=null&&vh(i,o,hh)},Rc=function(i,o){return To(i)&&Sn(o)?vn(Ka(i),o):function(l){var u=Ws(l,i);return u===void 0&&u===o?lp(l,i):wt(o,u,3)}},Gs=function(i){return i},Xd=function(i){return function(o){return o==null?void 0:o[i]}},mh=function(i){return function(o){return Za(o,i)}},zs=function(i){return To(i)?Xd(Ka(i)):mh(i)},jc=function(i){return typeof i=="function"?i:i==null?Gs:typeof i=="object"?lo(i)?Rc(i[0],i[1]):qr(i):zs(i)},qd=(function(i){return function(o,l,u){for(var h=-1,d=Object(o),m=u(o),w=m.length;w--;){var M=m[++h];if(l(d[M],M,d)===!1)break}return o}})(),Wo=(function(i,o){return function(l,u){if(l==null)return l;if(!Ko(l))return i(l,u);for(var h=l.length,d=-1,m=Object(l);++d<h&&u(m[d],d,m)!==!1;);return l}})((function(i,o){return i&&qd(i,o,Us)})),Gi=function(i,o){var l=-1,u=Ko(i)?Array(i.length):[];return Wo(i,(function(h,d,m){u[++l]=o(h,d,m)})),u},Yd=function(i,o){return(lo(i)?yn:Gi)(i,jc(o))};Object(c.n)({isolateGlobalState:!0});var Kd=(function(){try{var i=Pa(Object,"defineProperty");return i({},"",{}),i}catch{}})(),ju=function(i,o,l){o=="__proto__"&&Kd?Kd(i,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[o]=l},zv=Object.prototype.hasOwnProperty,Du=function(i,o,l){var u=i[o];zv.call(i,o)&&te(u,l)&&(l!==void 0||o in i)||ju(i,o,l)},Iu=function(i,o,l,u){var h=!l;l||(l={});for(var d=-1,m=o.length;++d<m;){var w=o[d],M=void 0;M===void 0&&(M=i[w]),h?ju(l,w,M):Du(l,w,M)}return l},Dc=function(i,o,l){switch(l.length){case 0:return i.call(o);case 1:return i.call(o,l[0]);case 2:return i.call(o,l[0],l[1]);case 3:return i.call(o,l[0],l[1],l[2])}return i.apply(o,l)},Hs=Math.max,ps=function(i,o,l){return o=Hs(o===void 0?i.length-1:o,0),function(){for(var u=arguments,h=-1,d=Hs(u.length-o,0),m=Array(d);++h<d;)m[h]=u[o+h];h=-1;for(var w=Array(o+1);++h<o;)w[h]=u[h];return w[o]=l(m),Dc(i,this,w)}},Lu=function(i){return function(){return i}},Ic=Kd?function(i,o){return Kd(i,"toString",{configurable:!0,enumerable:!1,value:Lu(o),writable:!0})}:Gs,hs=Date.now,Hv=function(i){var o=0,l=0;return function(){var u=hs(),h=16-(u-l);if(l=u,h>0){if(++o>=800)return arguments[0]}else o=0;return i.apply(void 0,arguments)}},Lc=Hv(Ic),Xv=function(i,o){return Lc(ps(i,o,Gs),i+"")},qv=function(i,o,l){if(!Lr(l))return!1;var u=typeof o;return!!(u=="number"?Ko(l)&&Ji(o,l.length):u=="string"&&o in l)&&te(l[o],i)},yh=function(i){return Xv((function(o,l){var u=-1,h=l.length,d=h>1?l[h-1]:void 0,m=h>2?l[2]:void 0;for(d=i.length>3&&typeof d=="function"?(h--,d):void 0,m&&qv(l[0],l[1],m)&&(d=h<3?void 0:d,h=1),o=Object(o);++u<h;){var w=l[u];w&&i(o,w,u,d)}return o}))},Zd=Object.prototype.hasOwnProperty,Di=yh((function(i,o){if(Xa(o)||Ko(o))Iu(o,Us(o),i);else for(var l in o)Zd.call(o,l)&&Du(i,l,o[l])})),gh=function(i,o,l,u){if(!Lr(i))return i;for(var h=-1,d=(o=wl(o,i)).length,m=d-1,w=i;w!=null&&++h<d;){var M=Ka(o[h]),j=l;if(M==="__proto__"||M==="constructor"||M==="prototype")return i;if(h!=m){var V=w[M];(j=void 0)==void 0&&(j=Lr(V)?V:Ji(o[h+1])?[]:{})}Du(w,M,j),w=w[M]}return i},le=function(i,o,l){for(var u=-1,h=o.length,d={};++u<h;){var m=o[u],w=Za(i,m);l(w,m)&&gh(d,wl(m,i),w)}return d},Xs=function(i,o){return le(i,o,(function(l,u){return lp(i,u)}))},Ul=Sr?Sr.isConcatSpreadable:void 0,Da=function(i){return lo(i)||Ha(i)||!!(Ul&&i&&i[Ul])},jr=function(o,l,u,h,d){var m=-1,w=o.length;for(u||(u=Da),d||(d=[]);++m<w;){var M=o[m];u(M)?ga(d,M):d[d.length]=M}return d},xi=function(i){return i!=null&&i.length?jr(i):[]},Ur,Ja,Wl,Ea,Jd,Qd,sp,_h,Gl,Go,$u,up,zl,Qa,$c,vs,Oa,cp,dp,el=(function(i){return Lc(ps(i,void 0,xi),i+"")})((function(i,o){return i==null?{}:Xs(i,o)}));function Oo(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function bh(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function fp(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function zo(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Zr,oi,Mr,co,Dn,fo,Fc={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},El=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotation","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],ef=(Ja=zo((Ur=(function(){function i(u){(function(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")})(this,i),Oo(this,"isSilentMode",Ja,this),Oo(this,"stopZoomGraph",Wl,this),Oo(this,"stopScrollGraph",Ea,this),Oo(this,"stopMoveGraph",Jd,this),Oo(this,"adjustEdge",Qd,this),Oo(this,"adjustEdgeMiddle",sp,this),Oo(this,"adjustEdgeStartAndEnd",_h,this),Oo(this,"adjustNodePosition",Gl,this),Oo(this,"hideAnchors",Go,this),Oo(this,"allowRotation",$u,this),Oo(this,"hoverOutline",up,this),Oo(this,"nodeSelectedOutline",zl,this),Oo(this,"edgeSelectedOutline",Qa,this),Oo(this,"nodeTextEdit",$c,this),Oo(this,"edgeTextEdit",vs,this),Oo(this,"nodeTextDraggable",Oa,this),Oo(this,"edgeTextDraggable",cp,this),Oo(this,"autoExpand",dp,this),fp(this,"multipleSelectKey",""),fp(this,"defaultConfig",{}),Di(this,this.getConfigDetail(u))}var o,l;return o=i,(l=[{key:"updateEditConfig",value:function(u){var h=this.getConfigDetail(u);Di(this,h)}},{key:"getConfigDetail",value:function(u){var h=u.isSilentMode,d=u.textEdit,m={};if(h===!1&&Di(m,this.defaultConfig),h===!0&&h!==this.isSilentMode){var w=el(Fc,El);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},Di(m,w)}d===!1&&Di(m,{nodeTextEdit:!1,edgeTextEdit:!1});var M=el(u,El);return Di(m,M)}},{key:"getConfig",value:function(){return el(this,El)}}])&&bh(o.prototype,l),i})()).prototype,"isSilentMode",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Wl=zo(Ur.prototype,"stopZoomGraph",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ea=zo(Ur.prototype,"stopScrollGraph",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Jd=zo(Ur.prototype,"stopMoveGraph",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Qd=zo(Ur.prototype,"adjustEdge",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),sp=zo(Ur.prototype,"adjustEdgeMiddle",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_h=zo(Ur.prototype,"adjustEdgeStartAndEnd",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Gl=zo(Ur.prototype,"adjustNodePosition",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Go=zo(Ur.prototype,"hideAnchors",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),$u=zo(Ur.prototype,"allowRotation",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),up=zo(Ur.prototype,"hoverOutline",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),zl=zo(Ur.prototype,"nodeSelectedOutline",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Qa=zo(Ur.prototype,"edgeSelectedOutline",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),$c=zo(Ur.prototype,"nodeTextEdit",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),vs=zo(Ur.prototype,"edgeTextEdit",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Oa=zo(Ur.prototype,"nodeTextDraggable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cp=zo(Ur.prototype,"edgeTextDraggable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),dp=zo(Ur.prototype,"autoExpand",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zo(Ur.prototype,"updateEditConfig",[c.k],Object.getOwnPropertyDescriptor(Ur.prototype,"updateEditConfig"),Ur.prototype),Ur);r(65),r(66),(function(i){i[i.DEFAULT=1]="DEFAULT",i[i.TEXT_EDIT=2]="TEXT_EDIT",i[i.SHOW_MENU=3]="SHOW_MENU",i[i.ALLOW_CONNECT=4]="ALLOW_CONNECT",i[i.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Zr||(Zr={})),(function(i){i.KEY="logic-flow",i.NODE_NAME="lf-node",i.EDGE_NAME="lf-edge"})(oi||(oi={})),(function(i){i.NODE="node",i.CIRCLE_NODE="circle-node",i.POLYGON_NODE="polygon-node",i.RECT_NODE="rect-node",i.TEXT_NODE="text-node",i.ELLIPSE_NODE="ellipse-node",i.DIAMOND_NODE="diamond-node",i.HTML_NODE="html-node",i.EDGE="edge",i.LINE_EDGE="line-edge",i.POLYLINE_EDGE="polyline-edge",i.BEZIER_EDGE="bezier-edge",i.GRAPH="graph"})(Mr||(Mr={})),(function(i){i.NODE="node",i.EDGE="edge",i.GRAPH="graph"})(co||(co={})),(function(i){i.ELEMENT_CLICK="element:click",i.NODE_CLICK="node:click",i.NODE_DBCLICK="node:dbclick",i.NODE_DELETE="node:delete",i.NODE_ADD="node:add",i.NODE_GROUP_COPY="node:group-copy-add",i.NODE_DND_ADD="node:dnd-add",i.NODE_DND_DRAG="node:dnd-drag",i.NODE_MOUSEDOWN="node:mousedown",i.NODE_DRAGSTART="node:dragstart",i.NODE_DRAG="node:drag",i.NODE_DROP="node:drop",i.NODE_MOUSEUP="node:mouseup",i.NODE_MOUSEMOVE="node:mousemove",i.NODE_MOUSEENTER="node:mouseenter",i.NODE_MOUSELEAVE="node:mouseleave",i.NODE_CONTEXTMENU="node:contextmenu",i.NODE_ROTATE="node:rotate",i.EDGE_DELETE="edge:delete",i.EDGE_ADD="edge:add",i.EDGE_CLICK="edge:click",i.EDGE_DBCLICK="edge:dbclick",i.EDGE_MOUSEENTER="edge:mouseenter",i.EDGE_MOUSELEAVE="edge:mouseleave",i.EDGE_CONTEXTMENU="edge:contextmenu",i.EDGE_ADJUST="edge:adjust",i.EDGE_EXCHANGE_NODE="edge:exchange-node",i.ANCHOR_DRAGSTART="anchor:dragstart",i.ANCHOR_DRAG="anchor:drag",i.ANCHOR_DROP="anchor:drop",i.ANCHOR_DRAGEND="anchor:dragend",i.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",i.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",i.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",i.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",i.ADJUST_POINT_DRAG="adjustPoint:drag",i.ADJUST_POINT_DROP="adjustPoint:drop",i.ADJUST_POINT_DRAGEND="adjustPoint:dragend",i.BLANK_MOUSEDOWN="blank:mousedown",i.BLANK_DRAGSTART="blank:dragstart",i.BLANK_DRAG="blank:drag",i.BLANK_DROP="blank:drop",i.BLANK_MOUSEMOVE="blank:mousemove",i.BLANK_MOUSEUP="blank:mouseup",i.BLANK_CLICK="blank:click",i.BLANK_CONTEXTMENU="blank:contextmenu",i.SELECTION_MOUSEDOWN="selection:mousedown",i.SELECTION_DRAGSTART="selection:dragstart",i.SELECTION_DRAG="selection:drag",i.SELECTION_DROP="selection:drop",i.SELECTION_MOUSEMOVE="selection:mousemove",i.SELECTION_MOUSEUP="selection:mouseup",i.SELECTION_CONTEXTMENU="selection:contextmenu",i.CONNECTION_NOT_ALLOWED="connection:not-allowed",i.HISTORY_CHANGE="history:change",i.TEXT_UPDATE="text:update",i.GRAPH_TRANSFORM="graph:transform",i.GRAPH_RENDERED="graph:rendered"})(Dn||(Dn={})),(function(i){i.HORIZONTAL="horizontal",i.VERTICAL="vertical"})(fo||(fo={}));var No,jo,pp,hp,Bc,zi,tf,Fu,Ia;function ms(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return Hl(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Hl(l,u)}})(i,o)||(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 Hl(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function La(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function wh(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Ol(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function xa(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}(function(i){i[i.DEFAULT=0]="DEFAULT",i[i.INCREASE=1]="INCREASE"})(No||(No={}));var vp={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]},mp=(jo=(function(){function i(u,h){(function(w,M){if(!(w instanceof M))throw new TypeError("Cannot call a class as a function")})(this,i),Ol(this,"MINI_SCALE_SIZE",.2),Ol(this,"MAX_SCALE_SIZE",16),La(this,"SCALE_X",pp,this),La(this,"SKEW_Y",hp,this),La(this,"SKEW_X",Bc,this),La(this,"SCALE_Y",zi,this),La(this,"TRANSLATE_X",tf,this),La(this,"TRANSLATE_Y",Fu,this),La(this,"ZOOM_SIZE",Ia,this),Ol(this,"eventCenter",void 0),Ol(this,"translateLimitMinX",void 0),Ol(this,"translateLimitMinY",void 0),Ol(this,"translateLimitMaxX",void 0),Ol(this,"translateLimitMaxY",void 0),this.eventCenter=u;var d=h.stopMoveGraph,m=d!==void 0&&d;this.updateTranslateLimits(m)}var o,l;return o=i,l=[{key:"setZoomMiniSize",value:function(u){this.MINI_SCALE_SIZE=u}},{key:"setZoomMaxSize",value:function(u){this.MAX_SCALE_SIZE=u}},{key:"HtmlPointToCanvasPoint",value:function(u){var h=ms(u,2),d=h[0],m=h[1];return[(d-this.TRANSLATE_X)/this.SCALE_X,(m-this.TRANSLATE_Y)/this.SCALE_Y]}},{key:"CanvasPointToHtmlPoint",value:function(u){var h=ms(u,2),d=h[0],m=h[1];return[d*this.SCALE_X+this.TRANSLATE_X,m*this.SCALE_Y+this.TRANSLATE_Y]}},{key:"moveCanvasPointByHtml",value:function(u,h,d){var m=ms(u,2),w=m[0],M=m[1];return[w+h/this.SCALE_X,M+d/this.SCALE_Y]}},{key:"fixDeltaXY",value:function(u,h){return[u/this.SCALE_X,h/this.SCALE_Y]}},{key:"getTransformStyle",value:function(){var u=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(u,")")}}},{key:"zoom",value:function(){var u=arguments.length>0&&arguments[0]!==void 0&&arguments[0],h=arguments.length>1?arguments[1]:void 0,d=this.SCALE_X,m=this.SCALE_Y;return u===!0?(d+=this.ZOOM_SIZE,m+=this.ZOOM_SIZE):u===!1?(d-=this.ZOOM_SIZE,m-=this.ZOOM_SIZE):typeof u=="number"&&(d=u,m=u),d<this.MINI_SCALE_SIZE||d>this.MAX_SCALE_SIZE||(h&&(this.TRANSLATE_X-=(d-this.SCALE_X)*h[0],this.TRANSLATE_Y-=(m-this.SCALE_Y)*h[1]),this.SCALE_X=d,this.SCALE_Y=m,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")}},{key:"emitGraphTransform",value:function(u){this.eventCenter.emit(Dn.GRAPH_TRANSFORM,{type:u,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(u,h){this.TRANSLATE_X+u<=this.translateLimitMaxX&&this.TRANSLATE_X+u>=this.translateLimitMinX&&(this.TRANSLATE_X+=u),this.TRANSLATE_Y+h<=this.translateLimitMaxY&&this.TRANSLATE_Y+h>=this.translateLimitMinY&&(this.TRANSLATE_Y+=h),this.emitGraphTransform("translate")}},{key:"focusOn",value:function(u,h,d,m){var w=ms(this.CanvasPointToHtmlPoint([u,h]),2),M=d/2-w[0],j=m/2-w[1];this.TRANSLATE_X+=M,this.TRANSLATE_Y+=j,this.emitGraphTransform("focusOn")}},{key:"updateTranslateLimits",value:function(u){var h=ms(Array.isArray(u)&&u.length===4?u:vp[u.toString()],4);this.translateLimitMinX=h[0],this.translateLimitMinY=h[1],this.translateLimitMaxX=h[2],this.translateLimitMaxY=h[3]}}],l&&wh(o.prototype,l),i})(),pp=xa(jo.prototype,"SCALE_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),hp=xa(jo.prototype,"SKEW_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Bc=xa(jo.prototype,"SKEW_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),zi=xa(jo.prototype,"SCALE_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),tf=xa(jo.prototype,"TRANSLATE_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Fu=xa(jo.prototype,"TRANSLATE_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ia=xa(jo.prototype,"ZOOM_SIZE",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),xa(jo.prototype,"zoom",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"zoom"),jo.prototype),xa(jo.prototype,"resetZoom",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"resetZoom"),jo.prototype),xa(jo.prototype,"translate",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"translate"),jo.prototype),xa(jo.prototype,"focusOn",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"focusOn"),jo.prototype),jo),nf=function(i,o){for(var l=-1,u=i==null?0:i.length;++l<u&&o(i[l],l,i)!==!1;);return i},Eh=function(i){var o=[];if(i!=null)for(var l in Object(i))o.push(l);return o},Oh=Object.prototype.hasOwnProperty,xh=function(i){if(!Lr(i))return Eh(i);var o=Xa(i),l=[];for(var u in i)(u!="constructor"||!o&&Oh.call(i,u))&&l.push(u);return l},rf=function(i){return Ko(i)?mo(i,!0):xh(i)},yp=r(107),gp=function(i,o){var l=-1,u=i.length;for(o||(o=Array(u));++l<u;)o[l]=i[l];return o},Vc=ba(Object.getPrototypeOf,Object),kr=Object.prototype.hasOwnProperty,Yv=function(i){var o=i.length,l=new i.constructor(o);return o&&typeof i[0]=="string"&&kr.call(i,"index")&&(l.index=i.index,l.input=i.input),l},_p=function(i){var o=new i.constructor(i.byteLength);return new Oi(o).set(new Oi(i)),o},qs=function(i,o){var l=_p(i.buffer);return new i.constructor(l,i.byteOffset,i.byteLength)},Uc=/\w*$/,Kv=function(i){var o=new i.constructor(i.source,Uc.exec(i));return o.lastIndex=i.lastIndex,o},Sh=Sr?Sr.prototype:void 0,Sa=Sh?Sh.valueOf:void 0,Zv=function(i){return Sa?Object(Sa.call(i)):{}},Wc=function(i,o){var l=o?_p(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.length)},of=function(i,o,l){var u=i.constructor;switch(o){case"[object ArrayBuffer]":return _p(i);case"[object Boolean]":case"[object Date]":return new u(+i);case"[object DataView]":return qs(i);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 Wc(i,l);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(i);case"[object RegExp]":return Kv(i);case"[object Symbol]":return Zv(i)}},bp=Object.create,Ah=(function(){function i(){}return function(o){if(!Lr(o))return{};if(bp)return bp(o);i.prototype=o;var l=new i;return i.prototype=void 0,l}})(),sa=function(i){return typeof i.constructor!="function"||Xa(i)?{}:Ah(Vc(i))},ys=function(i){return Vr(i)&&N(i)=="[object Map]"},af=mi.a&&mi.a.isMap,Ys=af?Ra(af):ys,lf=function(i){return Vr(i)&&N(i)=="[object Set]"},wp=mi.a&&mi.a.isSet,sf=wp?Ra(wp):lf,Gc="[object Arguments]",uf="[object Function]",cf="[object Object]",Yr={};Yr[Gc]=Yr["[object Array]"]=Yr["[object ArrayBuffer]"]=Yr["[object DataView]"]=Yr["[object Boolean]"]=Yr["[object Date]"]=Yr["[object Float32Array]"]=Yr["[object Float64Array]"]=Yr["[object Int8Array]"]=Yr["[object Int16Array]"]=Yr["[object Int32Array]"]=Yr["[object Map]"]=Yr["[object Number]"]=Yr["[object Object]"]=Yr["[object RegExp]"]=Yr["[object Set]"]=Yr["[object String]"]=Yr["[object Symbol]"]=Yr["[object Uint8Array]"]=Yr["[object Uint8ClampedArray]"]=Yr["[object Uint16Array]"]=Yr["[object Uint32Array]"]=!0,Yr["[object Error]"]=Yr[uf]=Yr["[object WeakMap]"]=!1;var Jv=function i(o,l,u,h,d,m){var w,M=1&l;if(w!==void 0)return w;if(!Lr(o))return o;var j=lo(o);if(j)w=Yv(o);else{var V=N(o),Q=V==uf||V=="[object GeneratorFunction]";if(Object(Vi.a)(o))return Object(yp.a)(o,M);if(V==cf||V==Gc||Q&&!d)w=Q?{}:sa(o);else{if(!Yr[V])return d?o:{};w=of(o,V,M)}}m||(m=new ya);var ne=m.get(o);if(ne)return ne;m.set(o,w),sf(o)?o.forEach((function(ke){w.add(i(ke,l,u,ke,o,m))})):Ys(o)&&o.forEach((function(ke,Ie){w.set(Ie,i(ke,l,u,Ie,o,m))}));var _e=j?void 0:qa(o);return nf(_e||o,(function(ke,Ie){_e&&(ke=o[Ie=ke]),Du(w,Ie,i(ke,l,u,Ie,o,m))})),w},no=function(i){return Jv(i,5)},df=function(i,o,l){(l!==void 0&&!te(i[o],l)||l===void 0&&!(o in i))&&ju(i,o,l)},Mh=function(i){return Vr(i)&&Ko(i)},Ks=Function.prototype,kh=Object.prototype,Bu=Ks.toString,Th=kh.hasOwnProperty,Zs=Bu.call(Object),yi=function(i){if(!Vr(i)||to(i)!="[object Object]")return!1;var o=Vc(i);if(o===null)return!0;var l=Th.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Bu.call(l)==Zs},tl=function(i,o){if((o!=="constructor"||typeof i[o]!="function")&&o!="__proto__")return i[o]},Xl=function(i){return Iu(i,rf(i))},Js=function(i,o,l,u,h,d,m){var w=tl(i,l),M=tl(o,l),j=m.get(M);if(j)df(i,l,j);else{var V=void 0,Q=V===void 0;if(Q){var ne=lo(M),_e=!ne&&Object(Vi.a)(M),ke=!ne&&!_e&&Fl(M);V=M,ne||_e||ke?lo(w)?V=w:Mh(w)?V=gp(w):_e?(Q=!1,V=Object(yp.a)(M,!0)):ke?(Q=!1,V=Wc(M,!0)):V=[]:yi(M)||Ha(M)?(V=w,Ha(w)?V=Xl(w):Lr(w)&&!za(w)||(V=sa(M))):Q=!1}Q&&(m.set(M,V),h(V,M,u,d,m),m.delete(M)),df(i,l,V)}},Qs=function i(o,l,u,h,d){o!==l&&qd(l,(function(m,w){if(d||(d=new ya),Lr(m))Js(o,l,w,u,i,h,d);else{var M=void 0;M===void 0&&(M=m),df(o,w,M)}}),rf)},eu=yh((function(i,o,l){Qs(i,o,l)})),ff={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}},ql=function(i){var o=no(ff);return i&&(o=eu(o,i)),o};r(82),r(166);function tu(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}var pf=(function(){function i(){var u,h,d;(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,i),d={},(h="_events")in(u=this)?Object.defineProperty(u,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[h]=d}var o,l;return o=i,(l=[{key:"on",value:function(u,h,d){var m=this;return u==null||u.split(",").forEach((function(w){w=w.trim(),m._events[w]||(m._events[w]=[]),m._events[w].push({callback:h,once:!!d})})),this}},{key:"once",value:function(u,h){var d=this;u==null||u.split(",").forEach((function(m){return m=m.trim(),d.on(m,h,!0)}))}},{key:"emit",value:function(u,h){var d=this;u==null||u.split(",").forEach((function(m){var w=d._events[m]||[],M=d._events["*"]||[],j=function(V){for(var Q=V.length,ne=0;ne<Q;ne++)if(V[ne]){var _e=V[ne],ke=_e.callback;_e.once&&(V.splice(ne,1),V.length===0&&delete d._events[m],Q--,ne--),ke.apply(d,[h])}};j(w),j(M)}))}},{key:"off",value:function(u,h){var d=this;return u||(this._events={}),u.split(",").forEach((function(m){if(h){for(var w=d._events[m]||[],M=w.length,j=0;j<M;j++)w[j].callback===h&&(w.splice(j,1),M--,j--);w.length===0&&delete d._events[m]}else delete d._events[m]})),this}},{key:"getEvents",value:function(){return this._events}}])&&tu(o.prototype,l),i})();function nl(i,o){return o*Math.round(i/o)||i}function zc(i,o){return i%o}function Hc(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return Vu(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Vu(l,u)}})(i,o)||(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 Vu(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}var Uu=function(i,o,l){var u=Hc(i,2),h=u[0],d=u[1],m=Hc(o,2),w=m[0],M=m[1],j=Hc(l,2),V=j[0],Q=j[1];return h>w&&h<V&&d>M&&d<Q},Wu=function(i,o){var l=!1;switch(o.multipleSelectKey){case"meta":l=i.metaKey;break;case"alt":l=i.altKey;break;case"shift":l=i.shiftKey;break;case"ctrl":l=i.ctrlKey;break;default:l=!1}return l};r(167),r(126),r(83),r(29),r(12),r(13),r(14),r(47);var hf=function(i){return function(o,l,u){var h=Object(o);if(!Ko(o)){var d=jc(l);o=Us(o),l=function(w){return d(h[w],w,h)}}var m=i(o,l,u);return m>-1?h[d?o[m]:m]:void 0}},Gu=function(i,o,l,u){for(var h=i.length,d=l+-1;++d<h;)if(o(i[d],d,i))return d;return-1},Ep=/\s/,vf=function(i){for(var o=i.length;o--&&Ep.test(i.charAt(o)););return o},Nh=/^\s+/,Op=function(i){return i&&i.slice(0,vf(i)+1).replace(Nh,"")},rl=/^[-+]0x[0-9a-f]+$/i,xp=/^0b[01]+$/i,Sp=/^0o[0-7]+$/i,Ap=parseInt,zu=function(i){if(typeof i=="number")return i;if(gr(i))return NaN;if(Lr(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=Lr(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=Op(i);var l=xp.test(i);return l||Sp.test(i)?Ap(i.slice(2),l?2:8):rl.test(i)?NaN:+i},xl=1/0,Xc=function(i){return i?(i=zu(i))===xl||i===-1/0?17976931348623157e292*(i<0?-1:1):i==i?i:0:i===0?i:0},mf=function(i){var o=Xc(i),l=o%1;return o==o?l?o-l:o:0},yf=Math.max,gs,_s=hf((function(i,o,l){var u=i==null?0:i.length;if(!u)return-1;var h=l==null?0:mf(l);return h<0&&(h=yf(u+h,0)),Gu(i,jc(o),h)})),rr=new Uint8Array(16);function Hu(){if(!gs&&!(gs=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 gs(rr)}for(var qc=/^(?:[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,ol=function(i){return typeof i=="string"&&qc.test(i)},di=[],nu=0;nu<256;++nu)di.push((nu+256).toString(16).substr(1));var Do=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(di[i[o+0]]+di[i[o+1]]+di[i[o+2]]+di[i[o+3]]+"-"+di[i[o+4]]+di[i[o+5]]+"-"+di[i[o+6]]+di[i[o+7]]+"-"+di[i[o+8]]+di[i[o+9]]+"-"+di[i[o+10]]+di[i[o+11]]+di[i[o+12]]+di[i[o+13]]+di[i[o+14]]+di[i[o+15]]).toLowerCase();if(!ol(l))throw TypeError("Stringified UUID is invalid");return l},bs=function(i,o,l){var u=(i=i||{}).random||(i.rng||Hu)();return u[6]=15&u[6]|64,u[8]=63&u[8]|128,Do(u)},ta=function(){return bs()},Yc=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",l=i.nodes.reduce((function(u,h){return u[h.id]=o+bs(),h.id=u[h.id],u}),{});return i.edges.forEach((function(u){u.id=o+bs(),u.sourceNodeId=l[u.sourceNodeId],u.targetNodeId=l[u.targetNodeId]})),i},Ii=(r(105),r(127),r(207),function(i,o,l){var u=i.x,h=i.y,d=o.x,m=o.y,w=l.x,M=l.y,j=(M-m)/(w-d),V=m-j*d;return u>=d&&u<=w&&h>=m&&h<=M&&Math.abs(h-j*u+V)<Number.EPSILON});function Ho(i){return Ho=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},Ho(i)}function Sl(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Al(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?Sl(Object(l),!0).forEach((function(u){gf(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Sl(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function gf(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var Ct,ru,Kc,Zc,ws,ou,_f,Mp,iu,Jc,bf,kp,Ml,Tp,il,Es,wf,Ph,Ch,Rh,Np,Ef=function(i){return i.anchors},Qc=function(i,o){for(var l,u=o.nodes,h=u.length-1;h>=0;h--){var d=u[h];if(Qv(i,d)){var m=d.getTargetAnchor(i);if(m){var w={node:d,anchorIndex:m.index,anchor:m.anchor};l&&!jh(d,l.node,o)||(l=w)}}}return l},jh=function(i,o,l){return i.zIndex>o.zIndex||l.nodesMap[i.id].index>l.nodesMap[o.id].index},al=function(i,o,l,u){return Math.hypot(i-l,o-u)},Os=function(i,o){var l=!1,u=xo(o);return i.x>=u.minX-0&&i.x<=u.maxX+0&&i.y>=u.minY-0&&i.y<=u.maxY+0&&(l=!0),l},Qv=function(i,o){var l=!1,u=xo(o);return i.x>=u.minX-5&&i.x<=u.maxX+5&&i.y>=u.minY-5&&i.y<=u.maxY+5&&(l=!0),l},xo=function(i){var o=i.x,l=i.y,u=i.width,h=i.height;return{minX:o-u/2,minY:l-h/2,maxX:o+u/2,maxY:l+h/2,x:o,y:l,width:u,height:h,centerX:o,centerY:l}},ed=function(i,o,l){var u,h=(function(m){var w=m,M=w.x,j=w.y,V=w.width,Q=w.height,ne=w.radius;return[{x:M-V/2+ne,y:j-Q/2+ne,r:ne},{x:M+V/2-ne,y:j-Q/2+ne,r:ne},{x:M-V/2+ne,y:j+Q/2-ne,r:ne},{x:M+V/2-ne,y:j+Q/2-ne,r:ne}]})(l),d=Number.MAX_SAFE_INTEGER;return h.forEach((function(m){var w=al(i.x,i.y,m.x,m.y);w<d&&(d=w,u=m)})),au(i,o,u)},au=function(i,o,l){var u,h=l,d=h.x,m=h.y,w=h.r;if(o===fo.HORIZONTAL){var M=d-Math.sqrt(w*w-(i.y-m)*(i.y-m)),j=d+Math.sqrt(w*w-(i.y-m)*(i.y-m));u={x:Math.abs(M-i.x)<Math.abs(j-i.x)?M:j,y:i.y}}else if(o===fo.VERTICAL){var V=m-Math.sqrt(w*w-(i.x-d)*(i.x-d)),Q=m+Math.sqrt(w*w-(i.x-d)*(i.x-d)),ne=Math.abs(V-i.y)<Math.abs(Q-i.y)?V:Q;u={x:i.x,y:ne}}return u},td=function(i,o){var l=o,u=!1,h=l.x-l.width/2+l.radius,d=l.x+l.width/2-l.radius,m=l.y-l.height/2+l.radius,w=l.y+l.height/2-l.radius,M=l.x,j=l.y,V=l.width,Q=l.height;return i.y===j+Q/2||i.y===j-Q/2?u=i.x>h&&i.x<d:i.x!==M+V/2&&i.x!==M-V/2||(u=i.y>m&&i.y<w),u},Xu=function(i,o,l){var u,h=l,d=h.x,m=h.y,w=h.rx,M=h.ry;if(o===fo.HORIZONTAL){var j=d-Math.sqrt(w*w-(i.y-m)*(i.y-m)*w*w/(M*M)),V=d+Math.sqrt(w*w-(i.y-m)*(i.y-m)*w*w/(M*M));u={x:Math.abs(j-i.x)<Math.abs(V-i.x)?j:V,y:i.y}}else if(o===fo.VERTICAL){var Q=m-Math.sqrt(M*M-(i.x-d)*(i.x-d)*M*M/(w*w)),ne=m+Math.sqrt(M*M-(i.x-d)*(i.x-d)*M*M/(w*w)),_e=Math.abs(Q-i.y)<Math.abs(ne-i.y)?Q:ne;u={x:i.x,y:_e}}return u},nd=function(i,o,l){for(var u,h=l.pointsPosition,d=Number.MAX_SAFE_INTEGER,m=[],w=0;w<h.length;w++)m.push({start:h[w],end:h[(w+1)%h.length]});return m.forEach((function(M){var j=M.start,V=M.end,Q=j,ne=V;j.x>V.x&&(Q=V,ne=j);var _e={x:i.x,y:i.y};if(Q.x===ne.x&&o===fo.HORIZONTAL&&(_e={x:Q.x,y:i.y}),Q.y===ne.y&&o===fo.VERTICAL&&(_e={x:i.x,y:Q.y}),Q.x!==ne.x&&Q.y!==ne.y){var ke=(ne.y-Q.y)/(ne.x-Q.x),Ie=(Q.x*ne.y-ne.x*Q.y)/(Q.x-ne.x);o===fo.HORIZONTAL?_e={x:(i.y-Ie)/ke,y:i.y}:o===fo.VERTICAL&&(_e={x:i.x,y:ke*i.x+Ie})}if(Ii(_e,j,V)){var ft=al(_e.x,_e.y,i.x,i.y);ft<d&&(d=ft,u=_e)}})),u},rd=function(i,o,l,u){var h=i.x,d=i.y;return o.x>i.x?h=i.x+l/2:o.x<i.x&&(h=i.x-l/2),o.y>i.y?d=i.y+u/2:o.y<i.y&&(d=i.y-u/2),{x:h,y:d}},od=function(i){var o=i.rows,l=i.style,u=i.rowsLength,h=i.className,d=document.createElement("div");d.style.fontSize=l.fontSize,d.style.width=l.width,d.className=h,d.style.lineHeight=l.lineHeight,d.style.padding=l.padding,l.fontFamily&&(d.style.fontFamily=l.fontFamily),u>1?o.forEach((function(w){var M=document.createElement("div");M.textContent=w,d.appendChild(M)})):d.textContent=o,document.body.appendChild(d);var m=d.clientHeight;return document.body.removeChild(d),m},lu=function(i){var o=i.rows,l=i.rowsLength,u=i.fontSize,h=0;return o&&o.forEach((function(d){var m=Fo(d);h=m>h?m:h})),{width:Math.ceil(h/2)*u+u/4,height:l*(u+2)+u/4}},Yl=function(i){return Ho(i)!=="object"?{isAllPass:!!i,msg:i?"":"不允许连接"}:i},gi=function(i){try{return JSON.parse(JSON.stringify(i))}catch{return i}},Of=1e3,id=999,su=function(){return++Of};function qu(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Si(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?qu(Object(l),!0).forEach((function(u){Hi(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):qu(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Po(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function ad(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Hi(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Wn(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var xf=(Ct=(function(){function i(u,h){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),Hi(this,"id",""),Po(this,"type",ru,this),Po(this,"sourceNodeId",Kc,this),Po(this,"targetNodeId",Zc,this),Po(this,"startPoint",ws,this),Po(this,"endPoint",ou,this),Po(this,"text",_f,this),Po(this,"properties",Mp,this),Po(this,"points",iu,this),Po(this,"pointsList",Jc,this),Po(this,"isSelected",bf,this),Po(this,"isHovered",kp,this),Po(this,"isHitable",Ml,this),Po(this,"draggable",Tp,this),Po(this,"visible",il,this),Hi(this,"virtual",!1),Po(this,"isAnimation",Es,this),Po(this,"isShowAdjustPoint",wf,this),Hi(this,"graphModel",void 0),Po(this,"zIndex",Ph,this),Hi(this,"BaseType",co.EDGE),Hi(this,"modelType",Mr.EDGE),Po(this,"state",Ch,this),Hi(this,"additionStateData",void 0),Hi(this,"sourceAnchorId",""),Hi(this,"targetAnchorId",""),Hi(this,"menu",void 0),Hi(this,"customTextPosition",!1),Po(this,"style",Rh,this),Po(this,"arrowConfig",Np,this),this.graphModel=h,this.initEdgeData(u),this.setAttributes()}var o,l;return o=i,l=[{key:"initEdgeData",value:function(u){if(u.properties||(u.properties={}),!u.id){var h=this.graphModel.idGenerator,d=h&&h(u.type),m=this.createId();u.id=m||d||ta()}this.arrowConfig.markerEnd="url(#marker-end-".concat(u.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(u.id,")");var w=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=w,Di(this,In(u)),this.graphModel.overlapMode===No.INCREASE&&(this.zIndex=u.zIndex||su()),this.setAnchors(),this.initPoints(),this.formatText(u)}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"getEdgeStyle",value:function(){return Si(Si({},this.graphModel.theme.baseEdge),this.style)}},{key:"getAdjustPointStyle",value:function(){return Si({},this.graphModel.theme.edgeAdjust)}},{key:"getTextStyle",value:function(){var u=this.graphModel.theme.edgeText;return no(u)}},{key:"getEdgeAnimationStyle",value:function(){var u=this.graphModel.theme.edgeAnimation;return no(u)}},{key:"getArrowStyle",value:function(){var u=this.getEdgeStyle(),h=this.getEdgeAnimationStyle(),d=this.graphModel.theme.arrow,m=this.isAnimation?h.stroke:u.stroke;return Si(Si({},u),{},{fill:m,stroke:m},d)}},{key:"getOutlineStyle",value:function(){var u=this.graphModel.theme.outline;return no(u)}},{key:"getTextPosition",value:function(){return{x:0,y:0}}},{key:"sourceNode",get:function(){var u,h;return(u=this.graphModel)===null||u===void 0||(h=u.nodesMap[this.sourceNodeId])===null||h===void 0?void 0:h.model}},{key:"targetNode",get:function(){var u,h;return(u=this.graphModel)===null||u===void 0||(h=u.nodesMap[this.targetNodeId])===null||h===void 0?void 0:h.model}},{key:"textPosition",get:function(){return this.getTextPosition()}},{key:"getBeginAnchor",value:function(u,h,d){var m,w,M=Ef(u);return d&&(m=_s(M,(function(j){return j.id===d})))||M.forEach((function(j){var V=mr(j,h);(w===void 0||V<w)&&(w=V,m=j)})),m}},{key:"getEndAnchor",value:function(u,h){var d,m,w=this,M=Ef(u);return h&&(d=_s(M,(function(j){return j.id===h})))||M.forEach((function(j){var V=mr(j,w.startPoint);(m===void 0||V<m)&&(m=V,d=j)})),d}},{key:"getProperties",value:function(){return Object(c.I)(this.properties)}},{key:"getData",value:function(){var u=this.text,h=u.x,d=u.y,m=u.value,w={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(c.I)(this.properties)};return m&&(w.text={x:h,y:d,value:m}),this.graphModel.overlapMode===No.INCREASE&&(w.zIndex=this.zIndex),w}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"setProperty",value:function(u,h){this.properties[u]=gi(h),this.setAttributes()}},{key:"deleteProperty",value:function(u){delete this.properties[u],this.setAttributes()}},{key:"setProperties",value:function(u){this.properties=Si(Si({},Object(c.I)(this.properties)),gi(u)),this.setAttributes()}},{key:"changeEdgeId",value:function(u){var h=this.arrowConfig,d=h.markerEnd,m=h.markerStart;m&&m==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(u,")")),d&&d==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(u,")")),this.id=u}},{key:"setStyle",value:function(u,h){this.style=Si(Si({},this.style),{},Hi({},u,gi(h)))}},{key:"setStyles",value:function(u){this.style=Si(Si({},this.style),gi(u))}},{key:"updateStyles",value:function(u){this.style=Si({},gi(u))}},{key:"formatText",value:function(u){var h=this.textPosition,d=h.x,m=h.y;u.text&&typeof u.text!="string"?Object.prototype.toString.call(u.text)==="[object Object]"&&(this.text={x:u.text.x||d,y:u.text.y||m,value:u.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:u.text||"",x:d,y:m,draggable:this.text.draggable,editable:this.text.editable}}},{key:"resetTextPosition",value:function(){var u=this.textPosition,h=u.x,d=u.y;this.text.x=h,this.text.y=d}},{key:"moveText",value:function(u,h){if(this.text){var d=this.text,m=d.x,w=d.y,M=d.value,j=d.draggable,V=d.editable;this.text={value:M,draggable:j,x:m+u,y:w+h,editable:V}}}},{key:"setText",value:function(u){u&&Di(this.text,u)}},{key:"updateText",value:function(u){this.text=Si(Si({},Object(c.I)(this.text)),{},{value:u})}},{key:"setAnchors",value:function(){if(!this.sourceAnchorId||!this.startPoint){var u=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!u)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:u.x,y:u.y}),this.sourceAnchorId||(this.sourceAnchorId=u.id)}if(!this.targetAnchorId||!this.endPoint){var h=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!h)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:h.x,y:h.y}),this.targetAnchorId||(this.targetAnchorId=h.id)}}},{key:"setSelected",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=u}},{key:"setHovered",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=u}},{key:"setHitable",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=u}},{key:"openEdgeAnimation",value:function(){this.isAnimation=!0}},{key:"closeEdgeAnimation",value:function(){this.isAnimation=!1}},{key:"setElementState",value:function(u,h){this.state=u,this.additionStateData=h}},{key:"updateStartPoint",value:function(u){this.startPoint=u}},{key:"moveStartPoint",value:function(u,h){this.startPoint.x+=u,this.startPoint.y+=h}},{key:"updateEndPoint",value:function(u){this.endPoint=u}},{key:"moveEndPoint",value:function(u,h){this.endPoint.x+=u,this.endPoint.y+=h}},{key:"setZIndex",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.zIndex=u}},{key:"initPoints",value:function(){}},{key:"updateAttributes",value:function(u){Di(this,u)}},{key:"getAdjustStart",value:function(){return this.startPoint}},{key:"getAdjustEnd",value:function(){return this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(u){var h=u.startPoint,d=u.endPoint;this.updateStartPoint({x:h.x,y:h.y}),this.updateEndPoint({x:d.x,y:d.y})}}],l&&ad(o.prototype,l),i})(),ru=Wn(Ct.prototype,"type",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Kc=Wn(Ct.prototype,"sourceNodeId",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Zc=Wn(Ct.prototype,"targetNodeId",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),ws=Wn(Ct.prototype,"startPoint",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),ou=Wn(Ct.prototype,"endPoint",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),_f=Wn(Ct.prototype,"text",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),Mp=Wn(Ct.prototype,"properties",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),iu=Wn(Ct.prototype,"points",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Jc=Wn(Ct.prototype,"pointsList",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),bf=Wn(Ct.prototype,"isSelected",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),kp=Wn(Ct.prototype,"isHovered",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ml=Wn(Ct.prototype,"isHitable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Tp=Wn(Ct.prototype,"draggable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),il=Wn(Ct.prototype,"visible",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Es=Wn(Ct.prototype,"isAnimation",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),wf=Wn(Ct.prototype,"isShowAdjustPoint",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ph=Wn(Ct.prototype,"zIndex",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ch=Wn(Ct.prototype,"state",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Rh=Wn(Ct.prototype,"style",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Np=Wn(Ct.prototype,"arrowConfig",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")}}}),Wn(Ct.prototype,"sourceNode",[c.m],Object.getOwnPropertyDescriptor(Ct.prototype,"sourceNode"),Ct.prototype),Wn(Ct.prototype,"targetNode",[c.m],Object.getOwnPropertyDescriptor(Ct.prototype,"targetNode"),Ct.prototype),Wn(Ct.prototype,"textPosition",[c.m],Object.getOwnPropertyDescriptor(Ct.prototype,"textPosition"),Ct.prototype),Wn(Ct.prototype,"setProperty",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setProperty"),Ct.prototype),Wn(Ct.prototype,"deleteProperty",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"deleteProperty"),Ct.prototype),Wn(Ct.prototype,"setProperties",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setProperties"),Ct.prototype),Wn(Ct.prototype,"changeEdgeId",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"changeEdgeId"),Ct.prototype),Wn(Ct.prototype,"setStyle",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setStyle"),Ct.prototype),Wn(Ct.prototype,"setStyles",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setStyles"),Ct.prototype),Wn(Ct.prototype,"updateStyles",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateStyles"),Ct.prototype),Wn(Ct.prototype,"formatText",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"formatText"),Ct.prototype),Wn(Ct.prototype,"resetTextPosition",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"resetTextPosition"),Ct.prototype),Wn(Ct.prototype,"moveText",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"moveText"),Ct.prototype),Wn(Ct.prototype,"setText",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setText"),Ct.prototype),Wn(Ct.prototype,"updateText",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateText"),Ct.prototype),Wn(Ct.prototype,"setAnchors",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setAnchors"),Ct.prototype),Wn(Ct.prototype,"setSelected",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setSelected"),Ct.prototype),Wn(Ct.prototype,"setHovered",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setHovered"),Ct.prototype),Wn(Ct.prototype,"setHitable",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setHitable"),Ct.prototype),Wn(Ct.prototype,"openEdgeAnimation",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"openEdgeAnimation"),Ct.prototype),Wn(Ct.prototype,"closeEdgeAnimation",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"closeEdgeAnimation"),Ct.prototype),Wn(Ct.prototype,"setElementState",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setElementState"),Ct.prototype),Wn(Ct.prototype,"updateStartPoint",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateStartPoint"),Ct.prototype),Wn(Ct.prototype,"moveStartPoint",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"moveStartPoint"),Ct.prototype),Wn(Ct.prototype,"updateEndPoint",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateEndPoint"),Ct.prototype),Wn(Ct.prototype,"moveEndPoint",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"moveEndPoint"),Ct.prototype),Wn(Ct.prototype,"setZIndex",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"setZIndex"),Ct.prototype),Wn(Ct.prototype,"initPoints",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"initPoints"),Ct.prototype),Wn(Ct.prototype,"updateAttributes",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateAttributes"),Ct.prototype),Wn(Ct.prototype,"getAdjustStart",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"getAdjustStart"),Ct.prototype),Wn(Ct.prototype,"getAdjustEnd",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"getAdjustEnd"),Ct.prototype),Wn(Ct.prototype,"updateAfterAdjustStartAndEnd",[c.k],Object.getOwnPropertyDescriptor(Ct.prototype,"updateAfterAdjustStartAndEnd"),Ct.prototype),Ct),ld=xf;function Sf(i){return Sf=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},Sf(i)}function Pp(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Dh(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?Pp(Object(l),!0).forEach((function(u){Ss(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Pp(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function xs(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Ih(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function uu(){return uu=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=Lh(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},uu.apply(this,arguments)}function Lh(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Kl(i))!==null;);return i}function Cp(i,o){return Cp=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Cp(i,o)}function sd(i){var o=(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 l,u=Kl(i);if(o){var h=Kl(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return $h(this,l)}}function $h(i,o){if(o&&(Sf(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $a(i)}function $a(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Kl(i){return Kl=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Kl(i)}function Ss(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var zn,Rp,Yu=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Cp(d,m)})(h,i);var o,l,u=sd(h);function h(){var d;xs(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return Ss($a(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.LINE_EDGE),d}return o=h,(l=[{key:"getEdgeStyle",value:function(){var d=this.graphModel.theme.line;return Dh(Dh({},uu(Kl(h.prototype),"getEdgeStyle",this).call(this)),no(d))}},{key:"getTextPosition",value:function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}])&&Ih(o.prototype,l),h})(ld);function Zl(i){return Zl=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},Zl(i)}function ud(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return Xi(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Xi(l,u)}})(i,o)||(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 Xi(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function ll(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Io(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?ll(Object(l),!0).forEach((function(u){jp(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):ll(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function ua(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function Fa(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function em(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function cd(){return cd=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=cu(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},cd.apply(this,arguments)}function cu(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=na(i))!==null;);return i}function wr(i,o){return wr=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},wr(i,o)}function Fh(i){var o=(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 l,u=na(i);if(o){var h=na(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return ca(this,l)}}function ca(i,o){if(o&&(Zl(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Co(i)}function Co(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function na(i){return na=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},na(i)}function jp(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Ai(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Aa=(zn=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&wr(d,m)})(h,i);var o,l,u=Fh(h);function h(){var d;Fa(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return jp(Co(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.POLYLINE_EDGE),jp(Co(d),"draggingPointList",void 0),ua(Co(d),"dbClickPosition",Rp,Co(d)),d}return o=h,(l=[{key:"initEdgeData",value:function(d){this.offset=30,cd(na(h.prototype),"initEdgeData",this).call(this,d)}},{key:"getEdgeStyle",value:function(){var d=this.graphModel.theme.polyline;return Io(Io({},cd(na(h.prototype),"getEdgeStyle",this).call(this)),no(d))}},{key:"getTextPosition",value:function(){var d,m=(d=this.text)===null||d===void 0?void 0:d.value;if(this.dbClickPosition&&!m){var w=this.dbClickPosition;return{x:w.x,y:w.y}}var M=ir(this.points),j=ud(Xn(M),2),V=j[0],Q=j[1];return{x:(V.x+Q.x)/2,y:(V.y+Q.y)/2}}},{key:"getAfterAnchor",value:function(d,m,w){var M,j;return w.forEach((function(V){var Q;d===fo.HORIZONTAL?Q=Math.abs(m.y-V.y):d===fo.VERTICAL&&(Q=Math.abs(m.x-V.x)),(!j||j>Q)&&(j=Q,M=V)})),M}},{key:"getCrossPoint",value:function(d,m,w){var M;return d===fo.HORIZONTAL?M={x:w.x,y:m.y}:d===fo.VERTICAL&&(M={x:m.x,y:w.y}),M}},{key:"removeCrossPoints",value:function(d,m,w){var M=w.map((function(dt){return dt}));if(d===1){var j=M[d],V=M[m],Q=M[d-1];if(lr(Q,j,this.sourceNode)){if(Er(j,V,this.sourceNode)){var ne=$o(j,V,this.sourceNode);ne&&(M[d]=ne,M.splice(d-1,1),d--,m--)}}else this.sourceNode.anchors.forEach((function(dt){(dt.x===Q.x&&dt.x===j.x||dt.y===Q.y&&dt.y===j.y)&&al(dt.x,dt.y,j.x,j.y)<al(Q.x,Q.y,j.x,j.y)&&(M[d-1]=dt)}))}if(m===w.length-2){var _e=M[d],ke=M[m],Ie=M[m+1];if(lr(ke,Ie,this.targetNode)){if(Er(_e,ke,this.targetNode)){var ft=$o(_e,ke,this.targetNode);ft&&(M[m]=ft,M.splice(m+1,1))}}else this.targetNode.anchors.forEach((function(dt){(dt.x===Ie.x&&dt.x===ke.x||dt.y===Ie.y&&dt.y===ke.y)&&al(dt.x,dt.y,ke.x,ke.y)<al(Ie.x,Ie.y,ke.x,ke.y)&&(M[m+1]=dt)}))}return M}},{key:"getDraggingPoints",value:function(d,m,w,M,j){var V=j.map((function(_e){return _e})),Q=this.getAfterAnchor(d,w,M),ne=this.getCrossPoint(d,w,Q);return m==="start"?(V.unshift(ne),V.unshift(Q)):(V.push(ne),V.push(Q)),V}},{key:"updateCrossPoints",value:function(d){var m=d.map((function(zt){return zt})),w=d[0],M=d[1],j=d[m.length-2],V=d[m.length-1],Q=this.sourceNode,ne=this.targetNode,_e=Q.modelType,ke=ne.modelType,Ie=Ro(w,M),ft=m[0];switch(_e){case Mr.RECT_NODE:Q.radius!==0&&(td(w,Q)||(ft=ed(w,Ie,Q)));break;case Mr.CIRCLE_NODE:ft=au(w,Ie,Q);break;case Mr.ELLIPSE_NODE:ft=Xu(w,Ie,Q);break;case Mr.DIAMOND_NODE:case Mr.POLYGON_NODE:ft=nd(w,Ie,Q)}ft&&(m[0]=ft);var dt=Ro(j,V),Et=m[m.length-1];switch(ke){case Mr.RECT_NODE:ne.radius!==0&&(td(V,ne)||(Et=ed(V,dt,ne)));break;case Mr.CIRCLE_NODE:Et=au(V,dt,ne);break;case Mr.ELLIPSE_NODE:Et=Xu(V,dt,ne);break;case Mr.DIAMOND_NODE:case Mr.POLYGON_NODE:Et=nd(V,dt,ne)}return Et&&(m[m.length-1]=Et),m}},{key:"getData",value:function(){var d=cd(na(h.prototype),"getData",this).call(this),m=this.pointsList.map((function(w){return{x:w.x,y:w.y}}));return Object.assign({},d,{pointsList:m})}},{key:"initPoints",value:function(){this.pointsList.length>0?this.points=this.pointsList.map((function(d){return"".concat(d.x,",").concat(d.y)})).join(" "):this.updatePoints()}},{key:"updatePoints",value:function(){var d=cr({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=d,this.points=d.map((function(m){return"".concat(m.x,",").concat(m.y)})).join(" ")}},{key:"updateStartPoint",value:function(d){this.startPoint=Object.assign({},d),this.updatePoints()}},{key:"moveStartPoint",value:function(d,m){this.startPoint.x+=d,this.startPoint.y+=m,this.updatePoints()}},{key:"updateEndPoint",value:function(d){this.endPoint=Object.assign({},d),this.updatePoints()}},{key:"moveEndPoint",value:function(d,m){this.endPoint.x+=d,this.endPoint.y+=m,this.updatePoints()}},{key:"updatePointsList",value:function(d,m){this.pointsList.forEach((function(j){j.x+=d,j.y+=m}));var w=this.pointsList[0];this.startPoint=Object.assign({},w);var M=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},M),this.initPoints()}},{key:"dragAppendStart",value:function(){this.draggingPointList=this.pointsList.map((function(d){return d}))}},{key:"dragAppendSimple",value:function(d,m){this.isDragging=!0;var w=d.start,M=d.end,j=d.startIndex,V=d.endIndex,Q=d.direction,ne=this.pointsList,_e=ne;return Q===fo.HORIZONTAL?(ne[j]={x:w.x,y:w.y+m.y},ne[V]={x:M.x,y:M.y+m.y},_e=this.pointsList.map((function(ke){return ke}))):Q===fo.VERTICAL&&(ne[j]={x:w.x+m.x,y:w.y},ne[V]={x:M.x+m.x,y:M.y},_e=this.pointsList.map((function(ke){return ke}))),this.updatePointsAfterDrag(_e),this.draggingPointList=_e,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ne[j]),end:Object.assign({},ne[V]),startIndex:j,endIndex:V,direction:Q}}},{key:"dragAppend",value:function(d,m){this.isDragging=!0;var w=d.start,M=d.end,j=d.startIndex,V=d.endIndex,Q=d.direction,ne=this.pointsList;if(Q===fo.HORIZONTAL){ne[j]={x:w.x,y:w.y+m.y},ne[V]={x:M.x,y:M.y+m.y};var _e=this.pointsList.map((function(gn){return gn}));if(j!==0&&V!==this.pointsList.length-1&&(_e=this.removeCrossPoints(j,V,_e)),j===0){var ke={x:w.x,y:w.y+m.y};if(!Os(ke,this.sourceNode)){var Ie=this.sourceNode.anchors;_e=this.getDraggingPoints(Q,"start",ke,Ie,_e)}}if(V===this.pointsList.length-1){var ft={x:M.x,y:M.y+m.y};if(!Os(ft,this.targetNode)){var dt=this.targetNode.anchors;_e=this.getDraggingPoints(Q,"end",ft,dt,_e)}}this.updatePointsAfterDrag(_e),this.draggingPointList=_e}else if(Q===fo.VERTICAL){ne[j]={x:w.x+m.x,y:w.y},ne[V]={x:M.x+m.x,y:M.y};var Et=this.pointsList.map((function(gn){return gn}));if(j!==0&&V!==this.pointsList.length-1&&(Et=this.removeCrossPoints(j,V,Et)),j===0){var zt={x:w.x+m.x,y:w.y};if(!Os(zt,this.sourceNode)){var En=this.sourceNode.anchors;Et=this.getDraggingPoints(Q,"start",zt,En,Et)}}if(V===this.pointsList.length-1){var wn={x:M.x+m.x,y:M.y};if(!Os(wn,this.targetNode)){var Yn=this.targetNode.anchors;Et=this.getDraggingPoints(Q,"end",wn,Yn,Et)}}this.updatePointsAfterDrag(Et),this.draggingPointList=Et}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ne[j]),end:Object.assign({},ne[V]),startIndex:j,endIndex:V,direction:Q}}},{key:"dragAppendEnd",value:function(){if(this.draggingPointList){var d=mn(ir(this.points));this.pointsList=d.map((function(M){return M})),this.draggingPointList=[];var m=d[0];this.startPoint=Object.assign({},m);var w=d[d.length-1];this.endPoint=Object.assign({},w)}this.isDragging=!1}},{key:"updatePointsAfterDrag",value:function(d){var m=this.updateCrossPoints(d);this.points=m.map((function(w){return"".concat(w.x,",").concat(w.y)})).join(" ")}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var d=this.pointsList;return d[d.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(d){var m=d.startPoint,w=d.endPoint,M=d.sourceNode,j=d.targetNode,V=cr({x:m.x,y:m.y},{x:w.x,y:w.y},M,j,this.offset||0);this.pointsList=V,this.initPoints()}}])&&em(o.prototype,l),h})(ld),Rp=Ai(zn.prototype,"dbClickPosition",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ai(zn.prototype,"initPoints",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"initPoints"),zn.prototype),Ai(zn.prototype,"updatePoints",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updatePoints"),zn.prototype),Ai(zn.prototype,"updateStartPoint",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updateStartPoint"),zn.prototype),Ai(zn.prototype,"moveStartPoint",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"moveStartPoint"),zn.prototype),Ai(zn.prototype,"updateEndPoint",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updateEndPoint"),zn.prototype),Ai(zn.prototype,"moveEndPoint",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"moveEndPoint"),zn.prototype),Ai(zn.prototype,"updatePointsList",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updatePointsList"),zn.prototype),Ai(zn.prototype,"dragAppendStart",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"dragAppendStart"),zn.prototype),Ai(zn.prototype,"dragAppendSimple",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"dragAppendSimple"),zn.prototype),Ai(zn.prototype,"dragAppend",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"dragAppend"),zn.prototype),Ai(zn.prototype,"dragAppendEnd",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"dragAppendEnd"),zn.prototype),Ai(zn.prototype,"updatePointsAfterDrag",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updatePointsAfterDrag"),zn.prototype),Ai(zn.prototype,"getAdjustStart",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"getAdjustStart"),zn.prototype),Ai(zn.prototype,"getAdjustEnd",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"getAdjustEnd"),zn.prototype),Ai(zn.prototype,"updateAfterAdjustStartAndEnd",[c.k],Object.getOwnPropertyDescriptor(zn.prototype,"updateAfterAdjustStartAndEnd"),zn.prototype),zn),du=function(i){var o=i.start,l=i.end,u=i.offset,h=i.verticalLength,d=i.type,m={leftX:0,leftY:0,rightX:0,rightY:0},w=Math.atan((l.y-o.y)/(l.x-o.x)),M=Math.atan(u/h),j=Math.sqrt(h*h+u*u);return d==="start"?l.x>=o.x?(m.leftX=o.x+j*Math.sin(w+M),m.leftY=o.y-j*Math.cos(w+M),m.rightX=o.x-j*Math.sin(w-M),m.rightY=o.y+j*Math.cos(w-M)):(m.leftX=o.x-j*Math.sin(w+M),m.leftY=o.y+j*Math.cos(w+M),m.rightX=o.x+j*Math.sin(w-M),m.rightY=o.y-j*Math.cos(w-M)):d==="end"&&(l.x>=o.x?(m.leftX=l.x+j*Math.sin(w-M),m.leftY=l.y-j*Math.cos(w-M),m.rightX=l.x-j*Math.sin(w+M),m.rightY=l.y+j*Math.cos(w+M)):(m.leftX=l.x-j*Math.sin(w-M),m.leftY=l.y+j*Math.cos(w-M),m.rightX=l.x+j*Math.sin(w+M),m.rightY=l.y-j*Math.cos(w+M))),m},dd={x:1,y:0,z:0};function Lo(i,o,l,u,h){for(var d=function(ke){if(ke<0||ke>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:i.x*Math.pow(1-ke,3)+3*o.x*ke*Math.pow(1-ke,2)+3*l.x*Math.pow(ke,2)*(1-ke)+u.x*Math.pow(ke,3),y:i.y*Math.pow(1-ke,3)+3*o.y*ke*Math.pow(1-ke,2)+3*l.y*Math.pow(ke,2)*(1-ke)+u.y*Math.pow(ke,3)}},m=0,w=2,M=u.x,j=u.y,V=u;m<h&&w<50;){var Q=V=d(1-w/100),ne=Q.x,_e=Q.y;m=al(M,j,ne,_e),w++}return V}function Xo(i){var o=Math.hypot(i.x,i.y);return{x:i.x/o,y:i.y/o,z:0}}function Af(i){return u=(function(d,m){return d.x*m.y-d.y*m.x})(o=dd,l=i),h=Math.acos((function(d,m){var w=[d.x,d.y,d.z];return[m.x,m.y,m.z].reduce((function(M,j,V){return M+j*w[V]}))})(Xo(o),Xo(l))),u>=0?h:-h;var o,l,u,h}function Dp(i){return i*(180/Math.PI)}function G(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function se(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?G(Object(l),!0).forEach((function(u){Oe(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):G(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Oe(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function ut(i){return(function(o){if(Array.isArray(o))return Rt(o)})(i)||(function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(i)||mt(i)||(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 gt(i){return gt=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},gt(i)}function ot(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||mt(i,o)||(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(i,o){if(i){if(typeof i=="string")return Rt(i,o);var l=Object.prototype.toString.call(i).slice(8,-1);return l==="Object"&&i.constructor&&(l=i.constructor.name),l==="Map"||l==="Set"?Array.from(i):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?Rt(i,o):void 0}}function Rt(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}var Bt=function(i,o){var l;switch(i.type){case"line":default:l=new Yu(i,o);break;case"polyline":l=new Aa(i,o)}return l},jt=function(i,o){return 2*Math.abs(i.centerX-o.centerX)<i.width+o.width&&2*Math.abs(i.centerY-o.centerY)<i.height+o.height},ht=function(i){var o=[],l={};return i.forEach((function(u){var h="".concat(u.x,"-").concat(u.y);u.id=h,l[h]=u})),Object.keys(l).forEach((function(u){o.push(l[u])})),o},Kt=function(i,o){var l=[i,{x:i.x,y:o.y},o];return ht(l)},Gt=function(i,o){return i.width===0&&i.height===0?i:{centerX:i.centerX,centerY:i.centerY,minX:i.minX-o,minY:i.minY-o,maxX:i.maxX+o,maxY:i.maxY+o,height:i.height+2*o,width:i.width+2*o}},Dt=function(i,o){var l=Math.abs(i.x-o.centerX),u=Math.abs(i.y-o.centerY);return l/o.width>u/o.height?fo.HORIZONTAL:fo.VERTICAL},At=function(i,o,l){return Dt(l,o)===fo.HORIZONTAL?{x:l.x>i.centerX?i.maxX:i.minX,y:l.y}:{x:l.x,y:l.y>i.centerY?i.maxY:i.minY}},Ze=function(i,o){var l=Math.min(i.minX,o.minX),u=Math.min(i.minY,o.minY),h=Math.max(i.maxX,o.maxX),d=Math.max(i.maxY,o.maxY);return{centerX:(l+h)/2,centerY:(u+d)/2,minX:l,minY:u,maxX:h,maxY:d,height:d-u,width:h-l}},pt=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1?arguments[1]:void 0,l=[],u=[];i.forEach((function(V){l.push(V.x),u.push(V.y)}));var h=Math.min.apply(Math,l),d=Math.max.apply(Math,l),m=Math.min.apply(Math,u),w=Math.max.apply(Math,u),M=d-h,j=w-m;return o&&(M+=o,j+=o),{centerX:(h+d)/2,centerY:(m+w)/2,maxX:d,maxY:w,minX:h,minY:m,x:(h+d)/2,y:(m+w)/2,height:j,width:M}},$t=function(i){var o=i.minX,l=i.minY,u=i.maxX,h=i.maxY;return[{x:o,y:l},{x:u,y:l},{x:u,y:h},{x:o,y:h}]},tn=function(i,o){var l=i.x,u=i.y;return l<o.minX||l>o.maxX||u<o.minY||u>o.maxY},kt=function(i,o){return o<i.minX||o>i.maxX?[]:[{x:o,y:i.minY},{x:o,y:i.maxY}]},ln=function(i,o){return o<i.minY||o>i.maxY?[]:[{x:i.minX,y:o},{x:i.maxX,y:o}]},Nt=function(i,o){return kt(i,o.x).concat(ln(i,o.y))},qt=function(i,o){return Math.abs(i.x-o.x)+Math.abs(i.y-o.y)},Tt=function(i,o){var l=0;return o.forEach((function(u){u&&(i.x===u.x&&(l+=-2),i.y===u.y&&(l+=-2))})),l},Zt=function(i,o,l,u,h){return qt(i,o)+qt(i,l)+Tt(i,[o,l,u,h])},Cn=function i(o,l,u,h,d){d||(d=0),o.unshift(l[h]),u[h]&&u[h]!==h&&d<=100&&i(o,l,u,u[h],d+1)},Hn=function(i,o){var l=i.indexOf(o);l>-1&&i.splice(l,1)},It=function(i,o,l,u){var h=o.x-i.x,d=o.y-i.y,m=u.x-l.x,w=u.y-l.y,M=(-d*(i.x-l.x)+h*(i.y-l.y))/(-m*d+h*w),j=(m*(i.y-l.y)-w*(i.x-l.x))/(-m*d+h*w);return M>=0&&M<=1&&j>=0&&j<=1},Pt=function(i,o,l){if(l.width===0&&l.height===0)return!1;var u=ot($t(l),4),h=u[0],d=u[1],m=u[2],w=u[3];return It(i,o,h,d)||It(i,o,h,w)||It(i,o,d,m)||It(i,o,m,w)},Mt=function(i,o,l,u){var h=[];return i.forEach((function(d){d!==o&&(d.x!==o.x&&d.y!==o.y||Pt(d,o,l)||Pt(d,o,u)||h.push(d))})),ht(h)},Ln=function(i,o,l,u,h,d,m){var w=[],M=[o],j={},V={},Q={};V[o.id]=0,Q[o.id]=Zt(o,l,o);var ne={};i.forEach((function(Ie){ne[Ie.id]=Ie}));for(var _e=function(){var Ie=void 0,ft=1/0;if(M.forEach((function(Et){Q[Et.id]<ft&&(ft=Q[Et.id],Ie=Et)})),Ie===l){var dt=[];return Cn(dt,ne,j,l.id),{v:dt}}Hn(M,Ie),w.push(Ie),Mt(i,Ie,u,h).forEach((function(Et){if(w.indexOf(Et)===-1){M.indexOf(Et)===-1&&M.push(Et);var zt=Q[Ie.id]+qt(Ie,Et);V[Et.id]&&zt>=V[Et.id]||(j[Et.id]=Ie.id,V[Et.id]=zt,Q[Et.id]=V[Et.id]+Zt(Et,l,o,d,m))}}))};M.length;){var ke=_e();if(gt(ke)==="object")return ke.v}return[o,l]},or=function(i){return xo(i)},mn=function(i){for(var o=1;o<i.length-1;){var l=i[o-1],u=i[o],h=i[o+1];l.x===u.x&&u.x===h.x||l.y===u.y&&u.y===h.y?i.splice(o,1):o++}return i},cr=function(i,o,l,u,h){var d=or(l),m=or(u),w=Gt(d,h),M=Gt(m,h),j=At(w,d,i),V=At(M,m,o);if(jt(w,M)){var Q=Zo(i,o,j,V);return[i,j].concat(ut(Q),[V,o])}var ne=pt([j,V]),_e=Ze(w,ne),ke=Ze(M,ne),Ie=[];Ie=(Ie=Ie.concat($t(_e))).concat($t(ke));var ft={x:(i.x+o.x)/2,y:(i.y+o.y)/2};[ne,_e,ke].forEach((function(Et){Ie=Ie.concat(Nt(Et,ft).filter((function(zt){return tn(zt,w)&&tn(zt,M)})))})),[{x:j.x,y:V.y},{x:V.x,y:j.y}].forEach((function(Et){tn(Et,w)&&tn(Et,M)&&Ie.push(Et)})),Ie.unshift(j),Ie.push(V),Ie=ht(Ie);var dt=Ln(Ie,j,V,d,m,i,o);return dt.unshift(i),dt.push(o),dt.length>2&&(dt=mn(dt)),ht(dt)},Xn=function(i){var o;if(i.length===1)o=[i[0],i[0]];else if(i.length>=2){for(var l=i[0],u=i[1],h=al(l.x,l.y,u.x,u.y),d=1;d<i.length-1;d++){var m=i[d],w=i[d+1],M=al(m.x,m.y,w.x,w.y);M>h&&(h=M,l=m,u=w)}o=[l,u]}return o},lr=function(i,o,l){var u=Os(i,l),h=Os(o,l);return u&&h},Er=function(i,o,l){var u=Os(i,l),h=Os(o,l);return!(u&&h)&&(u||h)},$o=function(i,o,l){for(var u,h,d=xo(l),m=$t(d),w=0;w<m.length;w++)It(i,o,m[w],m[(w+1)%m.length])&&(h=[m[w],m[(w+1)%m.length]]);return h&&(u=(function(M,j,V,Q){var ne=(j.y-M.y)*(Q.x-V.x)-(M.x-j.x)*(V.y-Q.y);if(ne===0)return!1;var _e=((j.x-M.x)*(Q.x-V.x)*(V.y-M.y)+(j.y-M.y)*(Q.x-V.x)*M.x-(Q.y-V.y)*(j.x-M.x)*V.x)/ne,ke=-((j.y-M.y)*(Q.y-V.y)*(V.x-M.x)+(j.x-M.x)*(Q.y-V.y)*M.y-(Q.x-V.x)*(j.y-M.y)*V.y)/ne;return(_e-M.x)*(_e-j.x)<=0&&(ke-M.y)*(ke-j.y)<=0&&(_e-V.x)*(_e-Q.x)<=0&&(ke-V.y)*(ke-Q.y)<=0&&{x:_e,y:ke}})(i,o,h[0],h[1])),u},Ro=function(i,o){var l;return i.x===o.x?l=fo.VERTICAL:i.y===o.y&&(l=fo.HORIZONTAL),l},ir=function(i){var o=i.split(" "),l=[];return o&&o.forEach((function(u){var h=ot(u.split(","),2),d=h[0],m=h[1];l.push({x:Number(d),y:Number(m)})})),l},Zo=function(i,o,l,u){var h=[];if(Ro(i,l)===Ro(o,u))i.y===l.y?(h.push({x:l.x,y:(l.y+u.y)/2}),h.push({x:u.x,y:(l.y+u.y)/2})):(h.push({x:(l.x+u.x)/2,y:l.y}),h.push({x:(l.x+u.x)/2,y:u.y}));else{var d={x:l.x,y:u.y},m=Ii(d,i,l),w=Ii(d,o,u);if(m||w)d={x:u.x,y:l.y};else{var M=so(d,i,l),j=so(d,o,u);M&&j&&(d={x:u.x,y:l.y})}h.push(d)}return h},so=function(i,o,l){return i.x===o.x&&i.x===l.x||i.y===o.y&&i.y===l.y},Fo=function(i){if(!i)return 0;for(var o=0,l=0;l<i.length;l++){var u=i.charCodeAt(l);i.match(/[A-Z]/)?o+=1.5:o+=u>=1&&u<=126||u>=65376&&u<=65439?1:2}return o},qo=null,ii=function(i,o){qo||(qo=document.createElement("canvas"));var l=qo.getContext("2d");return l.font=o,l.measureText(i).width},fi=function(i){var o,l=i.start,u=i.end;if(l.x===u.x&&l.y===u.y)o="";else{var h={start:l,end:u,offset:10,verticalLength:5},d=du(se(se({},h),{},{type:"start"})),m=du(se(se({},h),{},{type:"end"}));o="M".concat(d.leftX," ").concat(d.leftY,`
|
||
L`).concat(d.rightX," ").concat(d.rightY,`
|
||
L`).concat(m.rightX," ").concat(m.rightY,`
|
||
L`).concat(m.leftX," ").concat(m.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},Jo=function(i){var o=i.start,l=i.end,u=i.sourceNode,h=i.targetNode,d=i.offset,m=xo(u),w=xo(h),M=Gt(m,d),j=Gt(w,d);return{sNext:At(M,m,o),ePre:At(j,w,l)}},go=function(i){var o=i.replace(/M/g,"").replace(/C/g,",").split(",");return[er(o[0]),er(o[1]),er(o[2]),er(o[3])]},er=function(i){var o=ot(i.replace(/(^\s*)/g,"").split(" "),2);return{x:+o[0],y:+o[1]}},pi=function(i,o){var l=ot(i,4);return[Lo(l[0],l[1],l[2],l[3],o),i[3]]},Tr=function(i,o){for(var l,u=i.x,h=i.y,d=ir(o),m=Number.MAX_SAFE_INTEGER,w=[],M=0;M<d.length;M++)w.push({start:d[M],end:d[(M+1)%d.length]});if(w.forEach((function(ne){var _e=ne.start,ke=ne.end;if(_e.x===ke.x){var Ie={x:_e.x,y:h};if(Ii(Ie,_e,ke)){var ft=Math.abs(_e.x-u);ft<m&&(m=ft,l=Ie)}}else if(_e.y===ke.y){var dt={x:u,y:_e.y};if(Ii(dt,_e,ke)){var Et=Math.abs(_e.y-h);Et<m&&(m=Et,l=dt)}}})),!l){var j=w[0],V=j.start,Q=j.end;l={x:V.x+(Q.x-V.x)/2,y:V.y+(Q.y-V.y)/2}}return l},In=function(i){return el(i,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},mr=function(i,o){return Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2))};function tr(i,o){return typeof o!="function"?function(l,u,h){return Object.assign({type:i.edgeType},h)}:function(l,u,h){var d=o(l,u,h);return d?typeof d=="string"?Object.assign({},h,{type:d}):Object.assign({type:d},h):{type:i.edgeType}}}r(208);var _o=function(){};function kl(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function So(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var ye=(function(){function i(u){var h=this,d=u.onDragStart,m=d===void 0?_o:d,w=u.onDragging,M=w===void 0?_o:w,j=u.onDragEnd,V=j===void 0?_o:j,Q=u.eventType,ne=Q===void 0?"":Q,_e=u.eventCenter,ke=_e===void 0?null:_e,Ie=u.step,ft=Ie===void 0?1:Ie,dt=u.isStopPropagation,Et=dt===void 0||dt,zt=u.model,En=zt===void 0?null:zt,wn=u.data,Yn=wn===void 0?null:wn;(function(gn,Fn){if(!(gn instanceof Fn))throw new TypeError("Cannot call a class as a function")})(this,i),So(this,"onDragStart",void 0),So(this,"onDragging",void 0),So(this,"onDragEnd",void 0),So(this,"step",void 0),So(this,"isStopPropagation",void 0),So(this,"isDragging",!1),So(this,"isStartDragging",!1),So(this,"startX",0),So(this,"startY",0),So(this,"sumDeltaX",0),So(this,"sumDeltaY",0),So(this,"eventType",void 0),So(this,"eventCenter",void 0),So(this,"model",void 0),So(this,"data",void 0),So(this,"startTime",void 0),So(this,"handleMouseDown",(function(gn){var Fn,Mn,$r,Wr=(Fn=window)===null||Fn===void 0?void 0:Fn.document;if(gn.button===0){h.isStopPropagation&&gn.stopPropagation(),h.isStartDragging=!0,h.startX=gn.clientX,h.startY=gn.clientY,Wr.addEventListener("mousemove",h.handleMouseMove,!1),Wr.addEventListener("mouseup",h.handleMouseUp,!1);var vr=(Mn=h.model)===null||Mn===void 0?void 0:Mn.getData();($r=h.eventCenter)===null||$r===void 0||$r.emit(Dn["".concat(h.eventType,"_MOUSEDOWN")],{e:gn,data:h.data||vr}),h.startTime=new Date().getTime()}})),So(this,"handleMouseMove",(function(gn){if(h.isStopPropagation&&gn.stopPropagation(),h.isStartDragging&&(h.sumDeltaX+=gn.clientX-h.startX,h.sumDeltaY+=gn.clientY-h.startY,h.startX=gn.clientX,h.startY=gn.clientY,h.step<=1||Math.abs(h.sumDeltaX)>h.step||Math.abs(h.sumDeltaY)>h.step)){var Fn,Mn=h.sumDeltaX%h.step,$r=h.sumDeltaY%h.step,Wr=h.sumDeltaX-Mn,vr=h.sumDeltaY-$r;h.sumDeltaX=Mn,h.sumDeltaY=$r;var Jr,_i=(Fn=h.model)===null||Fn===void 0?void 0:Fn.getData();h.isDragging||((Jr=h.eventCenter)===null||Jr===void 0||Jr.emit(Dn["".concat(h.eventType,"_DRAGSTART")],{e:gn,data:h.data||_i}),h.onDragStart({event:gn})),h.isDragging=!0,Promise.resolve().then((function(){var bi,Ma;h.onDragging({deltaX:Wr,deltaY:vr,event:gn}),(bi=h.eventCenter)===null||bi===void 0||bi.emit(Dn["".concat(h.eventType,"_MOUSEMOVE")],{e:gn,data:h.data||_i}),(Ma=h.eventCenter)===null||Ma===void 0||Ma.emit(Dn["".concat(h.eventType,"_DRAG")],{e:gn,data:h.data||_i})}))}})),So(this,"handleMouseUp",(function(gn){var Fn=window.document;h.isStartDragging=!1,h.isStopPropagation&&gn.stopPropagation(),Promise.resolve().then((function(){var Mn,$r,Wr;Fn.removeEventListener("mousemove",h.handleMouseMove,!1),Fn.removeEventListener("mouseup",h.handleMouseUp,!1);var vr=(Mn=h.model)===null||Mn===void 0?void 0:Mn.getData();($r=h.eventCenter)===null||$r===void 0||$r.emit(Dn["".concat(h.eventType,"_MOUSEUP")],{e:gn,data:h.data||vr}),h.isDragging&&(h.isDragging=!1,h.onDragEnd({event:gn}),(Wr=h.eventCenter)===null||Wr===void 0||Wr.emit(Dn["".concat(h.eventType,"_DROP")],{e:gn,data:h.data||vr}))}))})),So(this,"cancelDrag",(function(){var gn,Fn=(gn=window)===null||gn===void 0?void 0:gn.document;Fn.removeEventListener("mousemove",h.handleMouseMove,!1),Fn.removeEventListener("mouseup",h.handleMouseUp,!1),h.onDragEnd({event:null}),h.isDragging=!1})),this.onDragStart=m,this.onDragging=M,this.onDragEnd=V,this.step=ft,this.isStopPropagation=Et,this.eventType=ne,this.eventCenter=ke,this.model=En,this.data=Yn}var o,l;return o=i,(l=[{key:"setStep",value:function(u){this.step=u}},{key:"setModel",value:function(u){this.model=u}}])&&kl(o.prototype,l),i})();function ct(i){return ct=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},ct(i)}function it(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function dn(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function hr(i,o,l){return o&&dn(i.prototype,o),i}function he(i,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(o&&o.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),o&&Ve(i,o)}function oe(i){var o=Ce();return function(){var l,u=pe(i);if(o){var h=pe(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Pe(this,l)}}function Pe(i,o){if(o&&(ct(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ge(i)}function Ge(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Je(i){var o=typeof Map=="function"?new Map:void 0;return Je=function(l){if(l===null||(u=l,Function.toString.call(u).indexOf("[native code]")===-1))return l;var u;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(l))return o.get(l);o.set(l,h)}function h(){return De(l,arguments,pe(this).constructor)}return h.prototype=Object.create(l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Ve(h,l)},Je(i)}function De(i,o,l){return De=Ce()?Reflect.construct:function(u,h,d){var m=[null];m.push.apply(m,h);var w=new(Function.bind.apply(u,m));return d&&Ve(w,d.prototype),w},De.apply(null,arguments)}function Ce(){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 Ve(i,o){return Ve=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Ve(i,o)}function pe(i){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},pe(i)}function Ae(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function fe(i,o){return i instanceof Xe&&o instanceof Xe}var ze=(function(i){he(l,i);var o=oe(l);function l(u,h,d){var m;return it(this,l),Ae(Ge(m=o.call(this,3)),"x",void 0),Ae(Ge(m),"y",void 0),Ae(Ge(m),"z",void 0),m[0]=u,m[1]=h,m[2]=d,m.x=u,m.y=h,m.z=d,Object.setPrototypeOf(Ge(m),l.prototype),m}return hr(l,[{key:"add",value:function(u){if(fe(this,u))return new Xe(this.x+u.x,this.y+u.y);var h=this.z+u.z;return new p((this.x+u.x)/h,(this.y+u.y)/h)}},{key:"subtract",value:function(u){if(fe(this,u))return new Xe(this.x-u.x,this.y-u.y);var h=this.z-u.z;return h===0?new Xe(this.x-u.x,this.y-u.y):new p((this.x-u.x)/h,(this.y-u.y)/h)}}]),l})(Je(Array)),Xe=(function(i){he(l,i);var o=oe(l);function l(u,h,d){var m;return it(this,l),m=o.call(this,u,h,d??0),Object.setPrototypeOf(Ge(m),l.prototype),m}return hr(l,[{key:"toString",value:function(){return"Vector"}},{key:"dot",value:function(u){var h=this;return u.reduce((function(d,m,w){return d+m*h[w]}))}},{key:"cross",value:function(u){return new l(this.y*u.z-this.z*u.y,this.z*u.x-this.x*u.z,this.x*u.y-this.y*u.x)}},{key:"getLength",value:function(){return Math.hypot(this.x,this.y)}},{key:"normalize",value:function(){var u=this.getLength();return new l(this.x/u,this.y/u)}},{key:"crossZ",value:function(u){return this.x*u.y-this.y*u.x}},{key:"angle",value:function(u){var h=this.crossZ(u),d=Math.acos(this.normalize().dot(u.normalize()));return h>=0?d:-d}}]),l})(ze),p=(function(i){he(l,i);var o=oe(l);function l(u,h){var d;return it(this,l),d=o.call(this,u,h,1),Object.setPrototypeOf(Ge(d),l.prototype),d}return hr(l,[{key:"toString",value:function(){return"Point"}}]),l})(ze);r(67),r(218);function y(i){return y=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},y(i)}function O(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||Z(i,o)||(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 $(i){return(function(o){if(Array.isArray(o))return re(o)})(i)||(function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(i)||Z(i)||(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 Z(i,o){if(i){if(typeof i=="string")return re(i,o);var l=Object.prototype.toString.call(i).slice(8,-1);return l==="Object"&&i.constructor&&(l=i.constructor.name),l==="Map"||l==="Set"?Array.from(i):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?re(i,o):void 0}}function re(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function ve(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function xe(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Ue(i,o,l){return o&&xe(i.prototype,o),i}function _t(i,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(o&&o.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),o&&nn(i,o)}function xt(i){var o=Lt();return function(){var l,u=sr(i);if(o){var h=sr(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Xt(this,l)}}function Xt(i,o){if(o&&(y(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xn(i)}function xn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function An(i){var o=typeof Map=="function"?new Map:void 0;return An=function(l){if(l===null||(u=l,Function.toString.call(u).indexOf("[native code]")===-1))return l;var u;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(l))return o.get(l);o.set(l,h)}function h(){return qn(l,arguments,sr(this).constructor)}return h.prototype=Object.create(l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),nn(h,l)},An(i)}function qn(i,o,l){return qn=Lt()?Reflect.construct:function(u,h,d){var m=[null];m.push.apply(m,h);var w=new(Function.bind.apply(u,m));return d&&nn(w,d.prototype),w},qn.apply(null,arguments)}function Lt(){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 nn(i,o){return nn=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},nn(i,o)}function sr(i){return sr=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},sr(i)}function Pn(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var qe,yr,Br,Jn,dr,Mi,Ba,Jl,ki,As,fu,Mf,Ip,Ms=(function(i){_t(l,i);var o=xt(l);function l(){var u;ve(this,l);for(var h=arguments.length,d=new Array(h),m=0;m<h;m++)d[m]=arguments[m];return Pn(xn(u=o.call(this,d.length)),"rows",void 0),Pn(xn(u),"columns",void 0),u.fill(new Array(3)),d.forEach((function(w,M){u[M]=w})),u.columns=d[0].length,u.rows=d.length,Object.setPrototypeOf(xn(u),l.prototype),u}return Ue(l,[{key:"getRow",value:function(u){return this[u]}},{key:"getColumn",value:function(u){return $(this.map((function(h){return h[u]})))}},{key:"transpose",value:function(){for(var u=[],h=0;h<this.columns;h++)u.push(this.getColumn(h));return qn(l,u)}},{key:"cross",value:function(u){var h=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===u.rows)for(var d=0;d<this.rows;d++)for(var m=this.getRow(d),w=function(j){var V=u.getColumn(j);h[d][j]=m.reduce((function(Q,ne,_e){return Q+ne*V[_e]}),0)},M=0;M<u.columns;M++)w(M);return qn(l,$(h))}},{key:"to2D",value:function(){return this.map((function(u){return[u[0],u[1]]}))}},{key:"toPoints",value:function(){return this.map((function(u){return new p(u[0],u[1])}))}},{key:"toString",value:function(){var u=O(this[0],2),h=u[0],d=u[1],m=O(this[1],2),w=m[0],M=m[1],j=O(this[2],2),V=j[0],Q=j[1];return"matrix(".concat(h," ").concat(d," ").concat(w," ").concat(M," ").concat(V," ").concat(Q,")")}},{key:"translate",value:function(u,h){return this.cross(new kf(u,h))}},{key:"rotate",value:function(u){return this.cross(new Ku(u))}},{key:"scale",value:function(u,h){return this.cross(new tm(u,h))}}]),l})(An(Array)),Ku=(function(i){_t(l,i);var o=xt(l);function l(u){var h;return ve(this,l),h=o.call(this,new Xe(+Math.cos(u).toFixed(2),+Math.sin(u).toFixed(2),0),new Xe(-Math.sin(u).toFixed(2),+Math.cos(u).toFixed(2),0),new Xe(0,0,1)),Object.setPrototypeOf(xn(h),l.prototype),h}return Ue(l,[{key:"inverse",value:function(){return this.transpose()}}]),l})(Ms),tm=(function(i){_t(l,i);var o=xt(l);function l(u,h){var d;return ve(this,l),Pn(xn(d=o.call(this,new Xe(u,0,0),new Xe(0,h,0),new Xe(0,0,1))),"sx",void 0),Pn(xn(d),"sy",void 0),d.sx=u,d.sy=h,Object.setPrototypeOf(xn(d),l.prototype),d}return Ue(l,[{key:"inverse",value:function(){return new l(1/this.sx,1/this.sy)}}]),l})(Ms),kf=(function(i){_t(l,i);var o=xt(l);function l(u,h){var d;return ve(this,l),Pn(xn(d=o.call(this,new Xe(1,0,0),new Xe(0,1,0),new Xe(u,h,1))),"tx",void 0),Pn(xn(d),"ty",void 0),d.tx=u,d.ty=h,Object.setPrototypeOf(xn(d),l.prototype),d}return Ue(l,[{key:"inverse",value:function(){return new l(-this.tx,-this.ty)}}]),l})(Ms),Lp={node:!1,edge:!1},nm={node:!0,edge:!0};function $p(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function fd(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?$p(Object(l),!0).forEach((function(u){hu(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):$p(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function pd(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||Fp(i,o)||(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 pu(i){return(function(o){if(Array.isArray(o))return B_(o)})(i)||(function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(i)||Fp(i)||(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 Fp(i,o){if(i){if(typeof i=="string")return B_(i,o);var l=Object.prototype.toString.call(i).slice(8,-1);return l==="Object"&&i.constructor&&(l=i.constructor.name),l==="Map"||l==="Set"?Array.from(i):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?B_(i,o):void 0}}function B_(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function iy(i){return iy=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},iy(i)}function ks(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function bC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function hu(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Qn(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var t2,n2=200,r2=(qe=(function(){function i(u){(function(_e,ke){if(!(_e instanceof ke))throw new TypeError("Cannot call a class as a function")})(this,i),hu(this,"rootEl",void 0),ks(this,"width",yr,this),ks(this,"height",Br,this),hu(this,"theme",void 0),hu(this,"eventCenter",void 0),hu(this,"modelMap",new Map),hu(this,"topElement",void 0),hu(this,"animation",void 0),hu(this,"idGenerator",void 0),hu(this,"edgeGenerator",void 0),hu(this,"nodeMoveRules",[]),hu(this,"customTrajectory",void 0),ks(this,"edgeType",Jn,this),ks(this,"nodes",dr,this),ks(this,"edges",Mi,this),ks(this,"overlapMode",Ba,this),ks(this,"background",Jl,this),ks(this,"transformModel",ki,this),ks(this,"editConfigModel",As,this),ks(this,"gridSize",fu,this),ks(this,"partial",Mf,this),ks(this,"fakerNode",Ip,this);var h,d=u.container,m=u.background,w=m===void 0?{}:m,M=u.grid,j=u.idGenerator,V=u.edgeGenerator,Q=u.animation,ne=u.customTrajectory;this.background=w,iy(M)==="object"&&(this.gridSize=M.size),this.rootEl=d,this.editConfigModel=new ef(u),this.eventCenter=new pf,this.transformModel=new mp(this.eventCenter,u),this.theme=ql(u.style),this.edgeType=u.edgeType||"polyline",this.width=u.width,this.height=u.height,this.animation=(h=Q)&&typeof h!="boolean"?eu(no(Lp),h):no(h===!0?nm:Lp),this.partial=u.partial,this.overlapMode=u.overlapMode||0,this.idGenerator=j,this.customTrajectory=ne,this.edgeGenerator=tr(this,V),this.width=u.width||this.rootEl.getBoundingClientRect().width,this.height=u.height||this.rootEl.getBoundingClientRect().height,this.flowId=ta()}var o,l;return o=i,l=[{key:"nodesMap",get:function(){return this.nodes.reduce((function(u,h,d){return u[h.id]={index:d,model:h},u}),{})}},{key:"edgesMap",get:function(){return this.edges.reduce((function(u,h,d){return u[h.id]={index:d,model:h},u}),{})}},{key:"modelsMap",get:function(){return[].concat(pu(this.nodes),pu(this.edges)).reduce((function(u,h){return u[h.id]=h,u}),{})}},{key:"sortElements",get:function(){var u=[];this.nodes.forEach((function(j){return u.push(j)})),this.edges.forEach((function(j){return u.push(j)})),u=u.sort((function(j,V){return j.zIndex-V.zIndex}));for(var h=[],d=[-200,-200],m=[this.width+n2,this.height+n2],w=0;w<u.length;w++){var M=u[w];M.visible&&(!this.partial||M.isSelected||this.isElementInArea(M,d,m,!1,!1))&&h.push(M)}return h}},{key:"textEditElement",get:function(){var u=this.nodes.find((function(d){return d.state===Zr.TEXT_EDIT})),h=this.edges.find((function(d){return d.state===Zr.TEXT_EDIT}));return u||h}},{key:"selectElements",get:function(){var u=new Map;return this.nodes.forEach((function(h){h.isSelected&&u.set(h.id,h)})),this.edges.forEach((function(h){h.isSelected&&u.set(h.id,h)})),u}},{key:"selectNodes",get:function(){var u=[];return this.nodes.forEach((function(h){h.isSelected&&u.push(h)})),u}},{key:"getAreaElement",value:function(u,h){var d=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],m=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],w=arguments.length>4&&arguments[4]!==void 0&&arguments[4],M=[],j=[];this.nodes.forEach((function(ne){return j.push(ne)})),this.edges.forEach((function(ne){return j.push(ne)}));for(var V=0;V<j.length;V++){var Q=j[V];w&&!Q.visible||!this.isElementInArea(Q,u,h,d,m)||M.push(Q)}return M}},{key:"getModel",value:function(u){return this.modelMap.get(u)}},{key:"getNodeModelById",value:function(u){var h;return this.fakerNode&&u===this.fakerNode.id?this.fakerNode:(h=this.nodesMap[u])===null||h===void 0?void 0:h.model}},{key:"getPointByClient",value:function(u){var h=u.x,d=u.y,m=this.rootEl.getBoundingClientRect(),w={x:h-m.left,y:d-m.top},M=pd(this.transformModel.HtmlPointToCanvasPoint([w.x,w.y]),2);return{domOverlayPosition:w,canvasOverlayPosition:{x:M[0],y:M[1]}}}},{key:"isElementInArea",value:function(u,h,d){var m=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],w=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(u.BaseType===co.NODE){for(var M=xo(u=u),j=M.minX,V=M.minY,Q=M.maxX,ne=M.maxY,_e=[{x:j,y:V},{x:Q,y:V},{x:Q,y:ne},{x:j,y:ne}],ke=w,Ie=0;Ie<_e.length;Ie++){var ft=_e[Ie],dt=ft.x,Et=ft.y,zt=this.transformModel.CanvasPointToHtmlPoint([dt,Et]),En=pd(zt,2);if(dt=En[0],Et=En[1],Uu([dt,Et],h,d)!==w){ke=!w;break}}return ke}if(u.BaseType===co.EDGE){var wn=u=u,Yn=wn.startPoint,gn=wn.endPoint,Fn=this.transformModel.CanvasPointToHtmlPoint([Yn.x,Yn.y]),Mn=this.transformModel.CanvasPointToHtmlPoint([gn.x,gn.y]),$r=Uu(Fn,h,d),Wr=Uu(Mn,h,d);return m?$r&&Wr:$r||Wr}return!1}},{key:"graphDataToModel",value:function(u){var h=this;if(this.width&&this.height||this.resize(),!u)return this.nodes=[],void(this.edges=[]);u.nodes?this.nodes=Yd(u.nodes,(function(d){return h.getModelAfterSnapToGrid(d)})):this.nodes=[],u.edges?this.edges=Yd(u.edges,(function(d){var m=h.getModel(d.type);if(!m)throw new Error("找不到".concat(d.type,"对应的边。"));return new m(d,h)})):this.edges=[]}},{key:"modelToGraphData",value:function(){var u=[];this.edges.forEach((function(d){var m=d.getData();m&&!d.virtual&&u.push(m)}));var h=[];return this.nodes.forEach((function(d){var m=d.getData();m&&!d.virtual&&h.push(m)})),{nodes:h,edges:u}}},{key:"modelToHistoryData",value:function(){for(var u=!1,h=[],d=0;d<this.nodes.length;d++){var m=this.nodes[d];if(m.isDragging){u=!0;break}h.push(m.getHistoryData())}if(u)return!1;for(var w=!1,M=[],j=0;j<this.edges.length;j++){var V=this.edges[j];if(V.isDragging){w=!0;break}M.push(V.getHistoryData())}return!w&&{nodes:h,edges:M}}},{key:"getEdgeModelById",value:function(u){var h;return(h=this.edgesMap[u])===null||h===void 0?void 0:h.model}},{key:"getElement",value:function(u){return this.modelsMap[u]}},{key:"getNodeEdges",value:function(u){for(var h=[],d=0;d<this.edges.length;d++){var m=this.edges[d],w=this.edges[d].sourceNodeId===u,M=this.edges[d].targetNodeId===u;(w||M)&&h.push(m)}return h}},{key:"getSelectElements",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],h=this.selectElements,d={nodes:[],edges:[]};return h.forEach((function(m){if(m.BaseType===co.NODE&&d.nodes.push(m.getData()),m.BaseType===co.EDGE){var w=m.getData(),M=h.get(w.sourceNodeId)&&h.get(w.targetNodeId);(u||M)&&d.edges.push(w)}})),d}},{key:"updateAttributes",value:function(u,h){this.getElement(u).updateAttributes(h)}},{key:"changeNodeId",value:function(u,h){return h||(h=ta()),this.nodesMap[h]?"":this.nodesMap[u]?(this.edges.forEach((function(d){d.sourceNodeId===u&&(d.sourceNodeId=h),d.targetNodeId===u&&(d.targetNodeId=h)})),this.nodesMap[u].model.id=h,this.nodesMap[h]=this.nodesMap[u],h):""}},{key:"changeEdgeId",value:function(u,h){return h||(h=ta()),this.edgesMap[h]?"":this.edgesMap[u]?(this.edges.forEach((function(d){d.id===u&&d.changeEdgeId(h)})),h):""}},{key:"setFakerNode",value:function(u){this.fakerNode=u}},{key:"removeFakerNode",value:function(){this.fakerNode=null}},{key:"setModel",value:function(u,h){return this.modelMap.set(u,h)}},{key:"toFront",value:function(u){var h,d,m,w=((h=this.nodesMap[u])===null||h===void 0?void 0:h.model)||((d=this.edgesMap[u])===null||d===void 0?void 0:d.model);w&&(this.overlapMode===No.DEFAULT&&((m=this.topElement)===null||m===void 0||m.setZIndex(),w.setZIndex(9999),this.topElement=w),this.overlapMode===No.INCREASE&&this.setElementZIndex(u,"top"))}},{key:"setElementZIndex",value:function(u,h){var d,m,w,M=((d=this.nodesMap[u])===null||d===void 0?void 0:d.model)||((m=this.edgesMap[u])===null||m===void 0?void 0:m.model);M&&(typeof h=="number"&&(w=h),h==="top"&&(w=su()),h==="bottom"&&(w=--id),M.setZIndex(w))}},{key:"deleteNode",value:function(u){var h=this.nodesMap[u].model.getData();this.deleteEdgeBySource(u),this.deleteEdgeByTarget(u),this.nodes.splice(this.nodesMap[u].index,1),this.eventCenter.emit(Dn.NODE_DELETE,{data:h})}},{key:"addNode",value:function(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dn.NODE_ADD,d=arguments.length>2?arguments[2]:void 0,m=gi(u);m.id&&this.nodesMap[u.id]&&delete m.id;var w=this.getModelAfterSnapToGrid(m);this.nodes.push(w);var M=w.getData(),j={data:M};return d&&(j.e=d),this.eventCenter.emit(h,j),w}},{key:"getModelAfterSnapToGrid",value:function(u){var h=this.getModel(u.type);if(!h)throw new Error("找不到".concat(u.type,"对应的节点,请确认是否已注册此类型节点。"));var d=u.x,m=u.y;return d&&m&&(u.x=nl(d,this.gridSize),u.y=nl(m,this.gridSize),iy(u.text)==="object"&&(u.text.x+=u.x-d,u.text.y+=u.y-m)),new h(u,this)}},{key:"cloneNode",value:function(u){var h=this.getNodeModelById(u),d=h.getData();d.x+=30,d.y+=30,delete d.id,d.text&&(d.text.x+=30,d.text.y+=30);var m=this.addNode(d);return m.setSelected(!0),h.setSelected(!1),m.getData()}},{key:"moveNode",value:function(u,h,d){var m=arguments.length>3&&arguments[3]!==void 0&&arguments[3],w=this.nodesMap[u];if(w){var M=w.model,j=M.getMoveDistance(h,d,m),V=pd(j,2);h=V[0],d=V[1],this.moveEdge(u,h,d)}}},{key:"moveNode2Coordinate",value:function(u,h,d){var m=arguments.length>3&&arguments[3]!==void 0&&arguments[3],w=this.nodesMap[u];if(w){var M=w.model,j=M.x,V=M.y,Q=h-j,ne=d-V;this.moveNode(u,Q,ne,m)}}},{key:"editText",value:function(u){this.setElementStateById(u,Zr.TEXT_EDIT)}},{key:"addEdge",value:function(u){var h=gi(u),d=h.type;d||(d=this.edgeType),h.id&&this.edgesMap[h.id]&&delete h.id;var m=this.getModel(d);if(!m)throw new Error("找不到".concat(d,"对应的边,请确认是否已注册此类型边。"));var w=new m(fd(fd({},h),{},{type:d}),this),M=w.getData();return this.edges.push(w),this.eventCenter.emit(Dn.EDGE_ADD,{data:M}),w}},{key:"moveEdge",value:function(u,h,d){for(var m=0;m<this.edges.length;m++){var w=this.edges[m],M=w.textPosition,j=M.x,V=M.y,Q=this.edges[m].sourceNodeId===u,ne=this.edges[m].targetNodeId===u;Q&&w.moveStartPoint(h,d),ne&&w.moveEndPoint(h,d),(Q||ne)&&this.handleEdgeTextMove(w,j,V)}}},{key:"handleEdgeTextMove",value:function(u,h,d){var m;if(u.customTextPosition===!0)u.resetTextPosition();else if(u.modelType===Mr.POLYLINE_EDGE&&(m=u.text)!==null&&m!==void 0&&m.value){var w=u.text,M=Tr(w,u.points);u.moveText(M.x-w.x,M.y-w.y)}else{var j=u.textPosition,V=j.x,Q=j.y;u.moveText(V-h,Q-d)}}},{key:"deleteEdgeBySourceAndTarget",value:function(u,h){for(var d=0;d<this.edges.length;d++)if(this.edges[d].sourceNodeId===u&&this.edges[d].targetNodeId===h){var m=this.edges[d].getData();this.edges.splice(d,1),d--,this.eventCenter.emit(Dn.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeById",value:function(u){if(this.edgesMap[u]){var h=this.edgesMap[u].index,d=this.edgesMap[u].model.getData();this.edges.splice(h,1),this.eventCenter.emit(Dn.EDGE_DELETE,{data:d})}}},{key:"deleteEdgeBySource",value:function(u){for(var h=0;h<this.edges.length;h++)if(this.edges[h].sourceNodeId===u){var d=this.edges[h].getData();this.edges.splice(h,1),h--,this.eventCenter.emit(Dn.EDGE_DELETE,{data:d})}}},{key:"deleteEdgeByTarget",value:function(u){for(var h=0;h<this.edges.length;h++)if(this.edges[h].targetNodeId===u){var d=this.edges[h].getData();this.edges.splice(h,1),h--,this.eventCenter.emit(Dn.EDGE_DELETE,{data:d})}}},{key:"setElementStateById",value:function(u,h,d){this.nodes.forEach((function(m){m.id===u?m.setElementState(h,d):m.setElementState(Zr.DEFAULT)})),this.edges.forEach((function(m){m.id===u?m.setElementState(h,d):m.setElementState(Zr.DEFAULT)}))}},{key:"updateText",value:function(u,h){this.nodes.forEach((function(d){d.id===u&&d.updateText(h)})),this.edges.forEach((function(d){d.id===u&&d.updateText(h)}))}},{key:"selectNodeById",value:function(u){var h,d=arguments.length>1&&arguments[1]!==void 0&&arguments[1];d||this.clearSelectElements();var m=(h=this.nodesMap[u])===null||h===void 0?void 0:h.model;m==null||m.setSelected(!0)}},{key:"selectEdgeById",value:function(u){var h,d=arguments.length>1&&arguments[1]!==void 0&&arguments[1];d||this.clearSelectElements();var m=(h=this.edgesMap[u])===null||h===void 0?void 0:h.model;m==null||m.setSelected(!0)}},{key:"selectElementById",value:function(u){var h=arguments.length>1&&arguments[1]!==void 0&&arguments[1];h||this.clearSelectElements();var d=this.getElement(u);d==null||d.setSelected(!0)}},{key:"clearSelectElements",value:function(){var u;this.selectElements.forEach((function(h){h==null||h.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===No.DEFAULT&&((u=this.topElement)===null||u===void 0||u.setZIndex())}},{key:"moveNodes",value:function(u,h,d){for(var m=this,w=arguments.length>3&&arguments[3]!==void 0&&arguments[3],M=u.reduce((function(wn,Yn){var gn=m.nodesMap[Yn].model.getMoveDistance(h,d,w);return wn[Yn]=gn,wn}),{}),j=0;j<this.edges.length;j++){var V=this.edges[j],Q=V.textPosition,ne=Q.x,_e=Q.y,ke=M[V.sourceNodeId],Ie=M[V.targetNodeId],ft=void 0,dt=void 0;if(ke&&Ie&&V.modelType===Mr.POLYLINE_EDGE){var Et=pd(ke,2);ft=Et[0],dt=Et[1],V.updatePointsList(ft,dt)}else{if(ke){var zt=pd(ke,2);ft=zt[0],dt=zt[1],V.moveStartPoint(ft,dt)}if(Ie){var En=pd(Ie,2);ft=En[0],dt=En[1],V.moveEndPoint(ft,dt)}}(ke||Ie)&&this.handleEdgeTextMove(V,ne,_e)}}},{key:"addNodeMoveRules",value:function(u){this.nodeMoveRules.includes(u)||this.nodeMoveRules.push(u)}},{key:"setDefaultEdgeType",value:function(u){this.edgeType=u}},{key:"changeNodeType",value:function(u,h){var d=this.getNodeModelById(u);if(d){var m=d.getData();m.type=h;var w=this.getModel(h);if(!w)throw new Error("找不到".concat(h,"对应的节点,请确认是否已注册此类型节点。"));var M=new w(m,this);this.nodes.splice(this.nodesMap[u].index,1,M),this.getNodeEdges(u).forEach((function(j){if(j.sourceNodeId===u){var V=rd(M,j.startPoint,M.width,M.height);j.updateStartPoint(V)}if(j.targetNodeId===u){var Q=rd(M,j.endPoint,M.width,M.height);j.updateEndPoint(Q)}}))}}},{key:"changeEdgeType",value:function(u,h){var d=this.getEdgeModelById(u);if(d&&d.type!==h){var m=d.getData();m.type=h;var w=this.getModel(h);if(!w)throw new Error("找不到".concat(h,"对应的节点,请确认是否已注册此类型节点。"));delete m.pointsList;var M=new w(m,this);this.edges.splice(this.edgesMap[u].index,1,M)}}},{key:"getNodeIncomingEdge",value:function(u){var h=[];return this.edges.forEach((function(d){d.targetNodeId===u&&h.push(d)})),h}},{key:"getNodeOutgoingEdge",value:function(u){var h=[];return this.edges.forEach((function(d){d.sourceNodeId===u&&h.push(d)})),h}},{key:"getAnchorIncomingEdge",value:function(u){var h=[];return this.edges.forEach((function(d){d.targetAnchorId===u&&h.push(d)})),h}},{key:"getAnchorOutcomingEdge",value:function(u){var h=[];return this.edges.forEach((function(d){d.sourceAnchorId===u&&h.push(d)})),h}},{key:"getNodeIncomingNode",value:function(u){var h=this,d=[];return this.edges.forEach((function(m){m.targetNodeId===u&&d.push(h.nodesMap[m.sourceNodeId].model)})),d}},{key:"getNodeOutgoingNode",value:function(u){var h=this,d=[];return this.edges.forEach((function(m){m.sourceNodeId===u&&d.push(h.nodesMap[m.targetNodeId].model)})),d}},{key:"setTheme",value:function(u){this.theme=ql(fd(fd({},this.theme),u))}},{key:"resize",value:function(u,h){this.width=u||this.rootEl.getBoundingClientRect().width,this.height=h||this.rootEl.getBoundingClientRect().height,!this.width||this.height}},{key:"clearData",value:function(){this.nodes=[],this.edges=[]}},{key:"getVirtualRectSize",value:function(){var u=this.nodes,h=[],d=[];u.forEach((function(Q){var ne=Q.x,_e=Q.y,ke=Q.width,Ie=Q.height,ft=Q.getNodeStyle().strokeWidth,dt=ft===void 0?0:ft,Et=ne+ke/2+dt,zt=ne-ke/2-dt,En=_e+Ie/2+dt,wn=_e-Ie/2-dt;h=h.concat([Et,zt].filter((function(Yn){return!Number.isNaN(Yn)}))),d=d.concat([En,wn].filter((function(Yn){return!Number.isNaN(Yn)})))}));var m=Math.min.apply(Math,pu(h)),w=Math.max.apply(Math,pu(h)),M=Math.min.apply(Math,pu(d)),j=w-m||0,V=Math.max.apply(Math,pu(d))-M||0;return{virtualRectWidth:j,virtualRectHeight:V,virtualRectCenterPositionX:m+j/2,virtualRectCenterPositionY:M+V/2}}},{key:"translateCenter",value:function(){var u=this.nodes,h=this.width,d=this.height,m=this.rootEl,w=this.transformModel;if(u.length){var M=h||m.clientWidth,j=d||m.clientHeight,V=this.getVirtualRectSize(),Q=V.virtualRectCenterPositionX,ne=V.virtualRectCenterPositionY;w.focusOn(Q,ne,M,j)}}},{key:"fitView",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,d=this.nodes,m=this.width,w=this.height,M=this.rootEl,j=this.transformModel;if(d.length){var V=m||M.clientWidth,Q=w||M.clientHeight,ne=this.getVirtualRectSize(),_e=ne.virtualRectWidth,ke=ne.virtualRectHeight,Ie=ne.virtualRectCenterPositionX,ft=ne.virtualRectCenterPositionY,dt=(_e+h)/V,Et=(ke+u)/Q,zt=0;zt=1/Math.max(dt,Et);var En=[V/2,Q/2];j.zoom(zt,En),j.focusOn(Ie,ft,V,Q)}}},{key:"openEdgeAnimation",value:function(u){this.getEdgeModelById(u).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(u){this.getEdgeModelById(u).closeEdgeAnimation()}}],l&&bC(o.prototype,l),i})(),yr=Qn(qe.prototype,"width",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Br=Qn(qe.prototype,"height",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jn=Qn(qe.prototype,"edgeType",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dr=Qn(qe.prototype,"nodes",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Mi=Qn(qe.prototype,"edges",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Ba=Qn(qe.prototype,"overlapMode",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return No.DEFAULT}}),Jl=Qn(qe.prototype,"background",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ki=Qn(qe.prototype,"transformModel",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),As=Qn(qe.prototype,"editConfigModel",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fu=Qn(qe.prototype,"gridSize",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Mf=Qn(qe.prototype,"partial",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ip=Qn(qe.prototype,"fakerNode",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qn(qe.prototype,"nodesMap",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"nodesMap"),qe.prototype),Qn(qe.prototype,"edgesMap",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"edgesMap"),qe.prototype),Qn(qe.prototype,"modelsMap",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"modelsMap"),qe.prototype),Qn(qe.prototype,"sortElements",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"sortElements"),qe.prototype),Qn(qe.prototype,"textEditElement",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"textEditElement"),qe.prototype),Qn(qe.prototype,"selectElements",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"selectElements"),qe.prototype),Qn(qe.prototype,"selectNodes",[c.m],Object.getOwnPropertyDescriptor(qe.prototype,"selectNodes"),qe.prototype),Qn(qe.prototype,"setFakerNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setFakerNode"),qe.prototype),Qn(qe.prototype,"removeFakerNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"removeFakerNode"),qe.prototype),Qn(qe.prototype,"setModel",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setModel"),qe.prototype),Qn(qe.prototype,"toFront",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"toFront"),qe.prototype),Qn(qe.prototype,"setElementZIndex",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setElementZIndex"),qe.prototype),Qn(qe.prototype,"deleteNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"deleteNode"),qe.prototype),Qn(qe.prototype,"addNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"addNode"),qe.prototype),Qn(qe.prototype,"cloneNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"cloneNode"),qe.prototype),Qn(qe.prototype,"moveNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"moveNode"),qe.prototype),Qn(qe.prototype,"moveNode2Coordinate",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"moveNode2Coordinate"),qe.prototype),Qn(qe.prototype,"editText",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"editText"),qe.prototype),Qn(qe.prototype,"addEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"addEdge"),qe.prototype),Qn(qe.prototype,"moveEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"moveEdge"),qe.prototype),Qn(qe.prototype,"deleteEdgeBySourceAndTarget",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"deleteEdgeBySourceAndTarget"),qe.prototype),Qn(qe.prototype,"deleteEdgeById",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"deleteEdgeById"),qe.prototype),Qn(qe.prototype,"deleteEdgeBySource",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"deleteEdgeBySource"),qe.prototype),Qn(qe.prototype,"deleteEdgeByTarget",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"deleteEdgeByTarget"),qe.prototype),Qn(qe.prototype,"setElementStateById",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setElementStateById"),qe.prototype),Qn(qe.prototype,"updateText",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"updateText"),qe.prototype),Qn(qe.prototype,"selectNodeById",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"selectNodeById"),qe.prototype),Qn(qe.prototype,"selectEdgeById",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"selectEdgeById"),qe.prototype),Qn(qe.prototype,"selectElementById",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"selectElementById"),qe.prototype),Qn(qe.prototype,"clearSelectElements",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"clearSelectElements"),qe.prototype),Qn(qe.prototype,"moveNodes",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"moveNodes"),qe.prototype),Qn(qe.prototype,"setDefaultEdgeType",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setDefaultEdgeType"),qe.prototype),Qn(qe.prototype,"changeNodeType",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"changeNodeType"),qe.prototype),Qn(qe.prototype,"changeEdgeType",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"changeEdgeType"),qe.prototype),Qn(qe.prototype,"getNodeIncomingEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getNodeIncomingEdge"),qe.prototype),Qn(qe.prototype,"getNodeOutgoingEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getNodeOutgoingEdge"),qe.prototype),Qn(qe.prototype,"getAnchorIncomingEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getAnchorIncomingEdge"),qe.prototype),Qn(qe.prototype,"getAnchorOutcomingEdge",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getAnchorOutcomingEdge"),qe.prototype),Qn(qe.prototype,"getNodeIncomingNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getNodeIncomingNode"),qe.prototype),Qn(qe.prototype,"getNodeOutgoingNode",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"getNodeOutgoingNode"),qe.prototype),Qn(qe.prototype,"setTheme",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"setTheme"),qe.prototype),Qn(qe.prototype,"resize",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"resize"),qe.prototype),Qn(qe.prototype,"clearData",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"clearData"),qe.prototype),Qn(qe.prototype,"translateCenter",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"translateCenter"),qe.prototype),Qn(qe.prototype,"fitView",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"fitView"),qe.prototype),Qn(qe.prototype,"openEdgeAnimation",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"openEdgeAnimation"),qe.prototype),Qn(qe.prototype,"closeEdgeAnimation",[c.k],Object.getOwnPropertyDescriptor(qe.prototype,"closeEdgeAnimation"),qe.prototype),qe),wC=r2;function V_(i){return V_=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},V_(i)}function U_(){return U_=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},U_.apply(this,arguments)}function EC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function W_(i,o){return W_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},W_(i,o)}function OC(i){var o=(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 l,u=ay(i);if(o){var h=ay(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return xC(this,l)}}function xC(i,o){if(o&&(V_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zu(i)}function Zu(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function ay(i){return ay=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},ay(i)}function hd(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var o2,SC=gu(t2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&W_(d,m)})(h,i);var o,l,u=OC(h);function h(d){var m;(function(V,Q){if(!(V instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,h),hd(Zu(m=u.call(this)),"stepDrag",void 0),hd(Zu(m),"stepScrollX",0),hd(Zu(m),"stepScrollY",0),hd(Zu(m),"onDragging",(function(V){var Q=V.deltaX,ne=V.deltaY;m.setState({isDragging:!0});var _e=m.props.graphModel,ke=_e.transformModel;_e.editConfigModel.stopMoveGraph!==!0&&ke.translate(Q,ne)})),hd(Zu(m),"onDragEnd",(function(){m.setState({isDragging:!1})})),hd(Zu(m),"zoomHandler",(function(V){var Q=m.props,ne=Q.graphModel,_e=ne.editConfigModel,ke=ne.transformModel,Ie=ne.gridSize,ft=Q.graphModel,dt=V.deltaX,Et=V.deltaY;if(_e.stopScrollGraph||V.ctrlKey===!0){if(!_e.stopZoomGraph){V.preventDefault();var zt=ft.getPointByClient({x:V.clientX,y:V.clientY}).canvasOverlayPosition,En=zt.x,wn=zt.y;ke.zoom(V.deltaY<0,[En,wn])}}else{if(V.preventDefault(),m.stepScrollX+=dt,m.stepScrollY+=Et,Math.abs(m.stepScrollX)>=Ie){var Yn=m.stepScrollX%Ie,gn=m.stepScrollX-Yn;ke.translate(-gn*ke.SCALE_X,0),m.stepScrollX=Yn}if(Math.abs(m.stepScrollY)>=Ie){var Fn=m.stepScrollY%Ie,Mn=m.stepScrollY-Fn;ke.translate(0,-Mn*ke.SCALE_Y),m.stepScrollY=Fn}}})),hd(Zu(m),"clickHandler",(function(V){if(V.target.getAttribute("name")==="canvas-overlay"){var Q=m.props.graphModel;Q.selectElements.size>0&&Q.clearSelectElements(),Q.eventCenter.emit(Dn.BLANK_CLICK,{e:V})}})),hd(Zu(m),"handleContextMenu",(function(V){if(V.target.getAttribute("name")==="canvas-overlay"){V.preventDefault();var Q=m.props.graphModel,ne=Q.getPointByClient({x:V.clientX,y:V.clientY});Q.eventCenter.emit(Dn.BLANK_CONTEXTMENU,{e:V,position:ne})}})),hd(Zu(m),"mouseDownHandler",(function(V){var Q=m.props.graphModel,ne=Q.eventCenter,_e=Q.editConfigModel,ke=Q.transformModel.SCALE_X,Ie=Q.gridSize,ft=V.target,dt=!_e.adjustEdge&&!_e.adjustNodePosition;(ft.getAttribute("name")==="canvas-overlay"||dt)&&(_e.stopMoveGraph!==!0?(m.stepDrag.setStep(Ie*ke),m.stepDrag.handleMouseDown(V)):ne.emit(Dn.BLANK_MOUSEDOWN,{e:V}),m.clickHandler(V))}));var w=d.graphModel,M=w.gridSize,j=w.eventCenter;return m.stepDrag=new ye({onDragging:m.onDragging,onDragEnd:m.onDragEnd,step:M,eventType:"BLANK",isStopPropagation:!1,eventCenter:j,model:null}),m.state={isDragging:!1},m}return o=h,(l=[{key:"render",value:function(){var d=this.props.graphModel.transformModel.getTransformStyle().transform,m=this.props,w=m.children,M=m.dnd,j=this.state.isDragging;return Object(We.g)("svg",U_({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:j?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},M.eventMap()),Object(We.g)("g",{transform:d},w))}}])&&EC(o.prototype,l),h})(We.a))||t2;function G_(i){return G_=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},G_(i)}function AC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function MC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function z_(i,o){return z_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},z_(i,o)}function kC(i){var o=(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 l,u=ly(i);if(o){var h=ly(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return TC(this,l)}}function TC(i,o){if(o&&(G_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function ly(i){return ly=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},ly(i)}var NC=gu(o2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&z_(d,m)})(h,i);var o,l,u=kC(h);function h(){return AC(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"componentDidMount",value:function(){this.triggerToolRender()}},{key:"componentDidUpdate",value:function(){this.triggerToolRender()}},{key:"getTools",value:function(){var d=this.props,m=d.tool,w=d.graphModel,M=m.getTools().map((function(j){return Object(We.g)(j,{graphModel:w,logicFlow:m.instance})}));return m.components=M,M}},{key:"triggerToolRender",value:function(){var d=this.props,m=d.tool,w=d.graphModel,M=document.querySelector("#ToolOverlay_".concat(w.flowId)),j=m.getInstance();j.components.forEach((function(V){return V(j,M)})),j.components=[]}},{key:"render",value:function(){var d=this.props.graphModel;return Object(We.g)("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(d.flowId)},this.getTools())}}])&&MC(o.prototype,l),h})(We.a))||o2;function H_(i){return H_=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},H_(i)}function PC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function CC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function X_(i,o){return X_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},X_(i,o)}function RC(i){var o=(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 l,u=sy(i);if(o){var h=sy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return jC(this,l)}}function jC(i,o){if(o&&(H_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function sy(i){return sy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},sy(i)}var i2,DC=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&X_(d,m)})(h,i);var o,l,u=RC(h);function h(){return PC(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"render",value:function(){var d=this.props.background;return Object(We.g)("div",{className:"lf-background"},Object(We.g)("div",{style:d,className:"lf-background-area"}))}}])&&CC(o.prototype,l),h})(We.a);function q_(i){return q_=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},q_(i)}function IC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function LC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Y_(i,o){return Y_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Y_(i,o)}function $C(i){var o=(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 l,u=uy(i);if(o){var h=uy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return FC(this,l)}}function FC(i,o){if(o&&(q_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a2(i)}function a2(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function uy(i){return uy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},uy(i)}function BC(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var l2=gu(i2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Y_(d,m)})(h,i);var o,l,u=$C(h);function h(){var d;IC(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return BC(a2(d=u.call.apply(u,[this].concat(w))),"id",ta()),d}return o=h,(l=[{key:"renderDot",value:function(){var d=this.props,m=d.config,w=m.color,M=m.thickness,j=M===void 0?2:M,V=d.size,Q=d.visible,ne=Math.min(Math.max(2,j),V/2),_e=1;return Q||(_e=0),Object(We.g)("rect",{width:ne,height:ne,rx:ne/2,ry:ne/2,fill:w,opacity:_e})}},{key:"renderMesh",value:function(){var d=this.props,m=d.config,w=m.color,M=m.thickness,j=M===void 0?1:M,V=d.size,Q=d.visible,ne=Math.min(Math.max(1,j),V/2),_e="M ".concat(V," 0 H0 M0 0 V0 ").concat(V),ke=1;return Q||(ke=0),Object(We.g)("path",{d:_e,stroke:w,strokeWidth:ne,opacity:ke})}},{key:"render",value:function(){var d=this.props,m=d.type,w=d.size,M=d.graphModel.transformModel,j=[M.SCALE_X,M.SKEW_Y,M.SKEW_X,M.SCALE_Y,M.TRANSLATE_X,M.TRANSLATE_Y].join(","),V="matrix(".concat(j,")");return Object(We.g)("div",{className:"lf-grid"},Object(We.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%"},Object(We.g)("defs",null,Object(We.g)("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:V,x:"0",y:"0",width:w,height:w},m==="dot"&&this.renderDot(),m==="mesh"&&this.renderMesh())),Object(We.g)("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})))}}])&&LC(o.prototype,l),h})(We.a))||i2;l2.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);function K_(i){return K_=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},K_(i)}function VC(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return s2(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return s2(l,u)}})(i,o)||(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 s2(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}var u2,Bh=function(i){var o={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(i).forEach((function(l){var u=VC(l,2),h=u[0],d=u[1];(h==="style"||K_(d)!=="object")&&(o[h]=d)})),Object(We.g)("line",o)};function Z_(i){return Z_=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},Z_(i)}function c2(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function cy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?c2(Object(l),!0).forEach((function(u){UC(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):c2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function UC(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function WC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function GC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function J_(i,o){return J_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},J_(i,o)}function zC(i){var o=(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 l,u=dy(i);if(o){var h=dy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return HC(this,l)}}function HC(i,o){if(o&&(Z_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function dy(i){return dy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},dy(i)}var d2,XC=gu(u2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&J_(d,m)})(h,i);var o,l,u=zC(h);function h(){return WC(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"render",value:function(){var d=this.props.snaplineModel,m=d.position,w=d.isShowHorizontal,M=d.isShowVertical,j=d.getStyle(),V=m.x,Q=V===void 0?0:V,ne=m.y,_e=ne===void 0?0:ne,ke=cy(cy({x1:-1e5,y1:_e,x2:1e5,y2:_e},j),{},{stroke:w?j.stroke:"none"}),Ie=cy(cy({x1:Q,y1:-1e5,x2:Q,y2:1e5},j),{},{stroke:M?j.stroke:"none"});return Object(We.g)("g",{className:"lf-snapline"},Object(We.g)(Bh,ke),Object(We.g)(Bh,Ie))}}])&&GC(o.prototype,l),h})(We.a))||u2;function Q_(i){return Q_=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},Q_(i)}function qC(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return f2(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return f2(l,u)}})(i,o)||(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 f2(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function Tf(i){var o=i.x,l=i.y,u=i.width,h=i.height,d=i.className,m=i.radius,w=o-u/2,M=l-h/2,j={};return Object.entries(i).forEach((function(V){var Q=qC(V,2),ne=Q[0],_e=Q[1];Q_(_e)!=="object"&&(j[ne]=_e)})),j.className=d?"lf-basic-shape ".concat(d):"lf-basic-shape",m&&(j.rx=m,j.ry=m),j.x=w,j.y=M,Object(We.g)("rect",j)}function eb(i){return eb=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},eb(i)}function Vh(){return Vh=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},Vh.apply(this,arguments)}function p2(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function h2(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?p2(Object(l),!0).forEach((function(u){YC(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):p2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function YC(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function KC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function ZC(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function tb(i,o){return tb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},tb(i,o)}function JC(i){var o=(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 l,u=fy(i);if(o){var h=fy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return QC(this,l)}}function QC(i,o){if(o&&(eb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function fy(i){return fy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},fy(i)}Tf.defaultProps={className:"",radius:""};var v2,eR=gu(d2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&tb(d,m)})(h,i);var o,l,u=JC(h);function h(){return KC(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getNodesOutline",value:function(){var d=this.props.graphModel,m=d.nodes,w=d.editConfigModel,M=w.hoverOutline,j=w.nodeSelectedOutline,V=[];return m.forEach((function(Q){if(Q.isHovered||Q.isSelected){var ne=Q.isHovered,_e=Q.isSelected,ke=Q.x,Ie=Q.y,ft=Q.width,dt=Q.height;if(j&&_e||M&&ne){var Et=Q.getOutlineStyle(),zt={};if(Object.keys(Et).forEach((function(wn){wn!=="hover"&&(zt[wn]=Et[wn])})),ne){var En=Et.hover;zt=h2(h2({},zt),En)}V.push(Object(We.g)(Tf,Vh({transform:Q.transform,className:"lf-outline-node",x:ke,y:Ie,width:ft+10,height:dt+10},zt)))}}})),V}},{key:"getEdgeOutline",value:function(){for(var d=this.props.graphModel,m=d.edges,w=d.editConfigModel,M=w.edgeSelectedOutline,j=w.hoverOutline,V=[],Q=0;Q<m.length;Q++){var ne=m[Q];(M&&ne.isSelected||j&&ne.isHovered)&&(ne.modelType===Mr.LINE_EDGE?V.push(this.getLineOutline(ne)):ne.modelType===Mr.POLYLINE_EDGE?V.push(this.getPolylineOutline(ne)):ne.modelType===Mr.BEZIER_EDGE&&V.push(this.getBezierOutline(ne)))}return V}},{key:"getLineOutline",value:function(d){var m=d.startPoint,w=d.endPoint,M=(m.x+w.x)/2,j=(m.y+w.y)/2,V=Math.abs(m.x-w.x)+10,Q=Math.abs(m.y-w.y)+10,ne=d.getOutlineStyle();return Object(We.g)(Tf,Vh({className:"lf-outline-edge",x:M,y:j,width:V,height:Q},ne))}},{key:"getPolylineOutline",value:function(d){var m=d.points,w=ir(m),M=pt(w,8),j=M.x,V=M.y,Q=M.width,ne=M.height,_e=d.getOutlineStyle();return Object(We.g)(Tf,Vh({className:"lf-outline",x:j,y:V,width:Q,height:ne},_e))}},{key:"getBezierOutline",value:function(d){var m=d.path,w=go(m),M=pt(w,8),j=M.x,V=M.y,Q=M.width,ne=M.height,_e=d.getOutlineStyle();return Object(We.g)(Tf,Vh({className:"lf-outline",x:j,y:V,width:Q,height:ne},_e))}},{key:"render",value:function(){return Object(We.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&ZC(o.prototype,l),h})(We.a))||d2;function nb(i){return nb=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},nb(i)}function tR(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return m2(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return m2(l,u)}})(i,o)||(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 m2(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function Uh(i){var o=i.x,l=o===void 0?0:o,u=i.y,h=u===void 0?0:u,d=i.r,m=d===void 0?4:d,w=i.className,M={cx:l,cy:h,r:m,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(i).forEach((function(j){var V=tR(j,2),Q=V[0],ne=V[1];nb(ne)!=="object"&&(M[Q]=ne)})),M.className=w?"lf-basic-shape ".concat(w):"lf-basic-shape",Object(We.g)("circle",M)}function rb(i){return rb=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},rb(i)}function nR(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return y2(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return y2(l,u)}})(i,o)||(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 y2(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function rm(){return rm=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},rm.apply(this,arguments)}function g2(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function rR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function _2(i,o,l){return o&&rR(i.prototype,o),i}function b2(i,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(o&&o.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),o&&ob(i,o)}function ob(i,o){return ob=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},ob(i,o)}function w2(i){var o=(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 l,u=hy(i);if(o){var h=hy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return oR(this,l)}}function oR(i,o){if(o&&(rb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return py(i)}function py(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function hy(i){return hy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},hy(i)}function ib(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var E2,O2=(function(i){b2(l,i);var o=w2(l);function l(){var u;return g2(this,l),ib(py(u=o.call(this)),"dragHandler",void 0),ib(py(u),"onDragging",(function(h){var d=h.event,m=u.props,w=m.graphModel,M=m.bezierModel,j=m.type,V=w.getPointByClient({x:d.clientX,y:d.clientY}).canvasOverlayPosition,Q=V.x,ne=V.y;M.updateAdjustAnchor({x:Q,y:ne},j),w.eventCenter.emit(Dn.EDGE_ADJUST,{data:M.getData()})})),ib(py(u),"onDragEnd",(function(){u.props.bezierModel.isDragging=!1})),u.dragHandler=new ye({onDragging:u.onDragging,onDragEnd:u.onDragEnd}),u}return _2(l,[{key:"render",value:function(){var u=this,h=this.props.position,d=h.x,m=h.y,w=this.props.bezierModel.getEdgeStyle().adjustAnchor;return Object(We.g)(Uh,rm({className:"lf-bezier-adjust-anchor",x:d,y:m},w,{onMouseDown:function(M){u.dragHandler.handleMouseDown(M)}}))}}]),l})(We.a),iR=gu(v2=(function(i){b2(l,i);var o=w2(l);function l(){return g2(this,l),o.apply(this,arguments)}return _2(l,[{key:"getBezierAdjust",value:function(u,h){var d=u.path,m=u.id,w=nR(go(d),4),M=w[0],j=w[1],V=w[2],Q=w[3],ne=u.getEdgeStyle().adjustLine,_e=[];return _e.push(Object(We.g)(Bh,rm({x1:M.x,y1:M.y,x2:j.x,y2:j.y},ne))),_e.push(Object(We.g)(O2,{position:j,bezierModel:u,graphModel:h,key:"".concat(m,"_ePre"),type:"sNext"})),_e.push(Object(We.g)(Bh,rm({x1:Q.x,y1:Q.y,x2:V.x,y2:V.y},ne))),_e.push(Object(We.g)(O2,{position:V,bezierModel:u,graphModel:h,key:"".concat(m,"_sNext"),type:"ePre"})),_e}},{key:"selectedBezierEdge",value:function(){for(var u=this.props.graphModel,h=u.edges,d=[],m=0;m<h.length;m++){var w=h[m];w.isSelected&&w.modelType===Mr.BEZIER_EDGE&&w.draggable&&d.push(this.getBezierAdjust(w,u))}return d}},{key:"render",value:function(){return Object(We.g)("g",{className:"lf-bezier-adjust"},this.selectedBezierEdge())}}]),l})(We.a))||v2;function ab(i){return ab=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},ab(i)}function aR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function lR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function lb(i,o){return lb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},lb(i,o)}function sR(i){var o=(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 l,u=vy(i);if(o){var h=vy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return uR(this,l)}}function uR(i,o){if(o&&(ab(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function vy(i){return vy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},vy(i)}var x2,cR=gu(E2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&lb(d,m)})(h,i);var o,l,u=sR(h);function h(){return aR(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"render",value:function(){var d=this.props.graphModel.transformModel.getTransformStyle().transform,m=this.props.children;return Object(We.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay"},Object(We.g)("g",{transform:d},m))}}])&&lR(o.prototype,l),h})(We.a))||E2;function sb(i){return sb=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},sb(i)}function ub(){return ub=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},ub.apply(this,arguments)}function dR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function fR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function cb(i,o){return cb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},cb(i,o)}function pR(i){var o=(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 l,u=my(i);if(o){var h=my(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return hR(this,l)}}function hR(i,o){if(o&&(sb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function my(i){return my=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},my(i)}var vR=gu(x2=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&cb(d,m)})(h,i);var o,l,u=pR(h);function h(){return dR(this,h),u.apply(this,arguments)}return o=h,l=[{key:"getComponent",value:function(d,m){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"canvas-overlay",M=this.props.getView,j=M(d.type);return Object(We.g)(j,{key:d.id,model:d,graphModel:m,overlay:w})}},{key:"render",value:function(){var d=this,m=this.props,w=m.graphModel,M=m.tool,j=m.options,V=m.dnd,Q=m.snaplineModel,ne={};j.width&&(ne.width="".concat(w.width,"px")),j.height&&(ne.height="".concat(w.height,"px"));var _e=j.grid,ke=w.fakerNode,Ie=w.editConfigModel.adjustEdge;return Object(We.g)("div",{className:"lf-graph","flow-id":w.flowId,style:ne},Object(We.g)(SC,{graphModel:w,dnd:V},Object(We.g)("g",{className:"lf-base"},Yd(w.sortElements,(function(ft){return d.getComponent(ft,w)}))),ke?this.getComponent(ke,w):""),Object(We.g)(cR,{graphModel:w},Object(We.g)(eR,{graphModel:w}),Ie?Object(We.g)(iR,{graphModel:w}):"",j.snapline!==!1?Object(We.g)(XC,{snaplineModel:Q}):""),Object(We.g)(NC,{graphModel:w,tool:M}),j.background&&Object(We.g)(DC,{background:j.background}),j.grid&&Object(We.g)(l2,ub({},_e,{graphModel:w})))}}],l&&fR(o.prototype,l),h})(We.a))||x2,mR=vR;function S2(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function yy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?S2(Object(l),!0).forEach((function(u){vd(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):S2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function yR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function vd(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var gR=(function(){function i(u){var h=this;(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,i),vd(this,"nodeConfig",void 0),vd(this,"lf",void 0),vd(this,"fakerNode",void 0),vd(this,"stopDrag",(function(){h.nodeConfig=null,window.document.removeEventListener("mouseup",h.stopDrag)})),vd(this,"dragEnter",(function(m){h.nodeConfig&&!h.fakerNode&&(h.fakerNode=h.lf.createFakerNode(yy(yy({},h.nodeConfig),h.clientToLocalPoint({x:m.clientX,y:m.clientY}))))})),vd(this,"onDragOver",(function(m){if(m.preventDefault(),h.fakerNode){var w=h.clientToLocalPoint({x:m.clientX,y:m.clientY}),M=w.x,j=w.y;h.fakerNode.moveTo(M,j);var V=h.fakerNode.getData();h.lf.setNodeSnapLine(V),h.lf.graphModel.eventCenter.emit(Dn.NODE_DND_DRAG,{data:V})}return!1})),vd(this,"onDragLeave",(function(){h.fakerNode&&(h.lf.removeNodeSnapLine(),h.lf.graphModel.removeFakerNode(),h.fakerNode=null)})),vd(this,"onDrop",(function(m){h.lf.graphModel&&m&&h.nodeConfig&&(h.lf.addNode(yy(yy({},h.nodeConfig),h.clientToLocalPoint({x:m.clientX,y:m.clientY})),Dn.NODE_DND_ADD,m),m.preventDefault(),m.stopPropagation(),h.nodeConfig=null,h.lf.removeNodeSnapLine(),h.lf.graphModel.removeFakerNode(),h.fakerNode=null)}));var d=u.lf;this.lf=d}var o,l;return o=i,(l=[{key:"clientToLocalPoint",value:function(u){var h=u.x,d=u.y,m=Ws(this.lf.options,["grid","size"]),w=this.lf.graphModel.getPointByClient({x:h,y:d}).canvasOverlayPosition,M=w.x,j=w.y;return{x:nl(M,m),y:nl(j,m)}}},{key:"startDrag",value:function(u){var h=this.lf.graphModel.editConfigModel;h!=null&&h.isSilentMode||(this.nodeConfig=u,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}}}])&&yR(o.prototype,l),i})();function A2(i){var o=i.container,l=i.grid,u=i.width,h=i.height;if(!o)throw new Error("请检查 container 参数是否有效");if(typeof u=="string"||typeof h=="string")throw new Error("width或height不支持传入字符串,请传数字");return l&&(i.grid=eu({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},l)),eu({},k2,i)}var uo,M2,k2={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function db(i){return db=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},db(i)}function fb(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return T2(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return T2(l,u)}})(i,o)||(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 T2(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function N2(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function gy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?N2(Object(l),!0).forEach((function(u){P2(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):N2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function _R(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function bR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function wR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function om(){return om=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=ER(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},om.apply(this,arguments)}function ER(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Nf(i))!==null;);return i}function pb(i,o){return pb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},pb(i,o)}function OR(i){var o=(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 l,u=Nf(i);if(o){var h=Nf(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return xR(this,l)}}function xR(i,o){if(o&&(db(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _y(i)}function _y(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Nf(i){return Nf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Nf(i)}function P2(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function vu(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var hb=(uo=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&pb(d,m)})(h,i);var o,l,u=OR(h);function h(){var d;bR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return P2(_y(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.BEZIER_EDGE),_R(_y(d),"path",M2,_y(d)),d}return o=h,(l=[{key:"initEdgeData",value:function(d){this.offset=100,om(Nf(h.prototype),"initEdgeData",this).call(this,d)}},{key:"getEdgeStyle",value:function(){var d=this.graphModel.theme.bezier;return gy(gy({},om(Nf(h.prototype),"getEdgeStyle",this).call(this)),no(d))}},{key:"getTextPosition",value:function(){if(this.pointsList&&this.pointsList.length>0){var d=0,m=0;return this.pointsList.forEach((function(w){var M=w.x,j=w.y;d+=M,m+=j})),{x:d/this.pointsList.length,y:m/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 d=om(Nf(h.prototype),"getData",this).call(this),m=this.pointsList.map((function(w){return{x:w.x,y:w.y}}));return gy(gy({},d),{},{pointsList:m})}},{key:"getControls",value:function(){var d=this.startPoint,m=this.endPoint;return Jo({start:d,end:m,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})}},{key:"getPath",value:function(d){var m=fb(d,4),w=m[0],M=m[1],j=m[2],V=m[3];return"M ".concat(w.x," ").concat(w.y,`
|
||
C `).concat(M.x," ").concat(M.y,`,
|
||
`).concat(j.x," ").concat(j.y,`,
|
||
`).concat(V.x," ").concat(V.y)}},{key:"initPoints",value:function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()}},{key:"updatePoints",value:function(){var d=this.getControls(),m=d.sNext,w=d.ePre;this.updatePath(m,w)}},{key:"updatePath",value:function(d,m){d=no(d),m=no(m);var w={x:this.startPoint.x,y:this.startPoint.y},M={x:this.endPoint.x,y:this.endPoint.y};if(!d||!m){var j=this.getControls();d=j.sNext,m=j.ePre}this.pointsList=[w,d,m,M],this.path=this.getPath(this.pointsList)}},{key:"updateStartPoint",value:function(d){this.startPoint=Object.assign({},d),this.updatePoints()}},{key:"updateEndPoint",value:function(d){this.endPoint=Object.assign({},d),this.updatePoints()}},{key:"moveStartPoint",value:function(d,m){this.startPoint.x+=d,this.startPoint.y+=m;var w=fb(this.pointsList,3),M=w[1],j=w[2];M.x+=d,M.y+=m,this.updatePath(M,j)}},{key:"moveEndPoint",value:function(d,m){this.endPoint.x+=d,this.endPoint.y+=m;var w=fb(this.pointsList,3),M=w[1],j=w[2];j.x+=d,j.y+=m,this.updatePath(M,j)}},{key:"updateAdjustAnchor",value:function(d,m){m==="sNext"?this.pointsList[1]=d:m==="ePre"&&(this.pointsList[2]=d),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 d=this.pointsList;return d[d.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(d){var m=d.startPoint,w=d.endPoint,M=d.sourceNode,j=d.targetNode,V=Jo({start:m,end:w,sourceNode:M,targetNode:j,offset:this.offset}),Q=V.sNext,ne=V.ePre;this.pointsList=[m,Q,ne,w],this.initPoints()}}])&&wR(o.prototype,l),h})(ld),M2=vu(uo.prototype,"path",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),vu(uo.prototype,"initPoints",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"initPoints"),uo.prototype),vu(uo.prototype,"updatePoints",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updatePoints"),uo.prototype),vu(uo.prototype,"updateStartPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateStartPoint"),uo.prototype),vu(uo.prototype,"updateEndPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateEndPoint"),uo.prototype),vu(uo.prototype,"moveStartPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"moveStartPoint"),uo.prototype),vu(uo.prototype,"moveEndPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"moveEndPoint"),uo.prototype),vu(uo.prototype,"updateAdjustAnchor",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateAdjustAnchor"),uo.prototype),vu(uo.prototype,"getAdjustStart",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"getAdjustStart"),uo.prototype),vu(uo.prototype,"getAdjustEnd",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"getAdjustEnd"),uo.prototype),vu(uo.prototype,"updateAfterAdjustStartAndEnd",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateAfterAdjustStartAndEnd"),uo.prototype),uo),un,C2,R2,j2,D2,I2,L2,$2,F2,B2,V2,U2,W2,G2,z2,H2,X2,q2,Y2,K2,Z2,J2,Q2,SR=function(i){return i==null};function AR(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||eO(i,o)||(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 vb(i){return vb=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},vb(i)}function eO(i,o){if(i){if(typeof i=="string")return tO(i,o);var l=Object.prototype.toString.call(i).slice(8,-1);return l==="Object"&&i.constructor&&(l=i.constructor.name),l==="Map"||l==="Set"?Array.from(i):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?tO(i,o):void 0}}function tO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function nO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function sl(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?nO(Object(l),!0).forEach((function(u){Tl(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):nO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Ti(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function MR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Tl(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Nr(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var md,rO,yd=(un=(function(){function i(u,h){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),Tl(this,"id",""),Ti(this,"type",C2,this),Ti(this,"x",R2,this),Ti(this,"y",j2,this),Ti(this,"text",D2,this),Ti(this,"properties",I2,this),Ti(this,"_width",L2,this),Ti(this,"_height",$2,this),Ti(this,"anchorsOffset",F2,this),Ti(this,"isSelected",B2,this),Ti(this,"isHovered",V2,this),Ti(this,"isShowAnchor",U2,this),Ti(this,"isDragging",W2,this),Ti(this,"isHitable",G2,this),Ti(this,"draggable",z2,this),Ti(this,"visible",H2,this),Ti(this,"enableRotate",X2,this),Tl(this,"virtual",!1),Tl(this,"graphModel",void 0),Ti(this,"zIndex",q2,this),Ti(this,"state",Y2,this),Ti(this,"autoToFront",K2,this),Ti(this,"style",Z2,this),Ti(this,"transform",J2,this),Ti(this,"_rotate",Q2,this),Tl(this,"BaseType",co.NODE),Tl(this,"modelType",Mr.NODE),Tl(this,"additionStateData",void 0),Tl(this,"targetRules",[]),Tl(this,"sourceRules",[]),Tl(this,"moveRules",[]),Tl(this,"hasSetTargetRules",!1),Tl(this,"hasSetSourceRules",!1),this.graphModel=h,this.initNodeData(u),this.setAttributes()}var o,l;return o=i,l=[{key:"width",get:function(){return this._width},set:function(u){this._width=u}},{key:"height",get:function(){return this._height},set:function(u){this._height=u}},{key:"rotate",get:function(){return this._rotate},set:function(u){this._rotate=u;var h=this.x,d=h===void 0?0:h,m=this.y,w=m===void 0?0:m;this.transform=new kf(-d,-w).rotate(u).translate(d,w).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(u){if(u.properties||(u.properties={}),!u.id){var h=this.graphModel.idGenerator,d=h&&h(u.type),m=this.createId();u.id=m||d||ta()}this.formatText(u),Di(this,(function(w){return el(w,["id","type","x","y","text","properties","virtual","rotate"])})(u)),this.graphModel.overlapMode===No.INCREASE&&(this.zIndex=u.zIndex||su())}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"formatText",value:function(u){u.text||(u.text={value:"",x:u.x,y:u.y,draggable:!1,editable:!0}),u.text&&typeof u.text=="string"?u.text={value:u.text,x:u.x,y:u.y,draggable:!1,editable:!0}:u.text&&u.text.editable===void 0&&(u.text.editable=!0)}},{key:"getData",value:function(){var u=this.text,h=u.x,d=u.y,m=u.value,w=this.properties;Object(c.x)(w)&&(w=Object(c.I)(w));var M={id:this.id,type:this.type,x:this.x,y:this.y,properties:w};return this.rotate&&(M.rotate=this.rotate),this.graphModel.overlapMode===No.INCREASE&&(M.zIndex=this.zIndex),m&&(M.text={x:h,y:d,value:m}),M}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"getProperties",value:function(){return Object(c.I)(this.properties)}},{key:"getOuterGAttributes",value:function(){return{className:""}}},{key:"getNodeStyle",value:function(){return sl(sl({},this.graphModel.theme.baseNode),this.style)}},{key:"getTextStyle",value:function(){var u=this.graphModel.theme.nodeText;return no(u)}},{key:"getRotateControlStyle",value:function(){var u=this.graphModel.theme.rotateControl;return no(u)}},{key:"getAnchorStyle",value:function(u){var h=this.graphModel.theme.anchor;return no(h)}},{key:"getAnchorLineStyle",value:function(u){var h=this.graphModel.theme.anchorLine;return no(h)}},{key:"getOutlineStyle",value:function(){var u=this.graphModel.theme.outline;return no(u)}},{key:"isAllowConnectedAsSource",value:function(u,h,d,m){var w=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var M,j=!0,V=0;V<w.length;V++){var Q=w[V];if(!Q.validate.call(this,this,u,h,d,m)){j=!1,M=Q.message;break}}return{isAllPass:j,msg:M}}},{key:"getConnectedSourceRules",value:function(){return this.sourceRules}},{key:"isAllowConnectedAsTarget",value:function(u,h,d,m){var w=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var M,j=!0,V=0;V<w.length;V++){var Q=w[V];if(!Q.validate.call(this,u,this,h,d,m)){j=!1,M=Q.message;break}}return{isAllPass:j,msg:M}}},{key:"isAllowMoveNode",value:function(u,h){var d,m=!0,w=!0,M=(function(Q,ne){var _e=typeof Symbol<"u"&&Q[Symbol.iterator]||Q["@@iterator"];if(!_e){if(Array.isArray(Q)||(_e=eO(Q))||ne){_e&&(Q=_e);var ke=0,Ie=function(){};return{s:Ie,n:function(){return ke>=Q.length?{done:!0}:{done:!1,value:Q[ke++]}},e:function(zt){throw zt},f:Ie}}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 ft,dt=!0,Et=!1;return{s:function(){_e=_e.call(Q)},n:function(){var zt=_e.next();return dt=zt.done,zt},e:function(zt){Et=!0,ft=zt},f:function(){try{dt||_e.return==null||_e.return()}finally{if(Et)throw ft}}}})(this.moveRules.concat(this.graphModel.nodeMoveRules));try{for(M.s();!(d=M.n()).done;){var j=(0,d.value)(this,u,h);if(!j)return!1;if(vb(j)==="object"){var V=j;if(V.x===!1&&V.y===!1)return!1;m=m&&V.x,w=w&&V.y}}}catch(Q){M.e(Q)}finally{M.f()}return{x:m,y:w}}},{key:"getConnectedTargetRules",value:function(){return this.targetRules}},{key:"getAnchorsByOffset",value:function(){var u=this.anchorsOffset,h=this.id,d=this.x,m=this.y;return u&&u.length>0?u.map((function(w,M){return w.length?(w=w,{id:"".concat(h,"_").concat(M),x:d+w[0],y:m+w[1]}):sl(sl({},w=w),{},{x:d+w.x,y:m+w.y,id:w.id||"".concat(h,"_").concat(M)})})):this.getDefaultAnchor()}},{key:"getDefaultAnchor",value:function(){return[]}},{key:"getTargetAnchor",value:function(u){return(function(h,d){for(var m,w=Ef(d),M=Number.MAX_SAFE_INTEGER,j=0;j<w.length;j++){var V=al(h.x,h.y,w[j].x,w[j].y);V<M&&(M=V,m={index:j,anchor:Al(Al({},w[j]),{},{x:w[j].x,y:w[j].y,id:w[j].id})})}return m})(u,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 u=this.getAnchorsByOffset(),h=this.x,d=this.y,m=this.rotate;return u.forEach((function(w){var M=w.x,j=w.y,V=AR(new Ms([M,j,1]).translate(-h,-d).rotate(m).translate(h,d)[0],2),Q=V[0],ne=V[1];w.x=Q,w.y=ne})),u}},{key:"getAnchorInfo",value:function(u){if(!SR(u))for(var h=0;h<this.anchors.length;h++){var d=this.anchors[h];if(d.id===u)return d}}},{key:"addNodeMoveRules",value:function(u){this.moveRules.includes(u)||this.moveRules.push(u)}},{key:"move",value:function(u,h){var d=arguments.length>2&&arguments[2]!==void 0&&arguments[2],m=!1,w=!1;if(d)m=!0,w=!0;else{var M=this.isAllowMoveNode(u,h);typeof M=="boolean"?(m=M,w=M):(m=M.x,w=M.y)}if(m){var j=this.x+u;this.x=j,this.text&&this.moveText(u,0)}if(w){var V=this.y+h;this.y=V,this.text&&this.moveText(0,h)}return m||w}},{key:"getMoveDistance",value:function(u,h){var d=arguments.length>2&&arguments[2]!==void 0&&arguments[2],m=!1,w=!1,M=0,j=0;if(d)m=!0,w=!0;else{var V=this.isAllowMoveNode(u,h);typeof V=="boolean"?(m=V,w=V):(m=V.x,w=V.y)}if(m&&u){var Q=this.x+u;this.x=Q,this.text&&this.moveText(u,0),M=u}if(w&&h){var ne=this.y+h;this.y=ne,this.text&&this.moveText(0,h),j=h}return[M,j]}},{key:"moveTo",value:function(u,h){var d=arguments.length>2&&arguments[2]!==void 0&&arguments[2],m=u-this.x,w=h-this.y;return!(!d&&!this.isAllowMoveNode(m,w)||(this.text&&this.text&&this.moveText(m,w),this.x=u,this.y=h,0))}},{key:"moveText",value:function(u,h){var d=this.text,m=d.x,w=d.y,M=d.value,j=d.draggable,V=d.editable;this.text={value:M,editable:V,draggable:j,x:m+u,y:w+h}}},{key:"updateText",value:function(u){this.text=sl(sl({},Object(c.I)(this.text)),{},{value:u})}},{key:"setSelected",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=u}},{key:"setHovered",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=u,this.setIsShowAnchor(u)}},{key:"setIsShowAnchor",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isShowAnchor=u}},{key:"setEnableRotate",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.enableRotate=u}},{key:"setHitable",value:function(){var u=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=u}},{key:"setElementState",value:function(u,h){this.state=u,this.additionStateData=h}},{key:"setProperty",value:function(u,h){this.properties=sl(sl({},Object(c.I)(this.properties)),{},Tl({},u,gi(h))),this.setAttributes()}},{key:"setProperties",value:function(u){this.properties=sl(sl({},Object(c.I)(this.properties)),gi(u)),this.setAttributes()}},{key:"deleteProperty",value:function(u){delete this.properties[u],this.setAttributes()}},{key:"setStyle",value:function(u,h){this.style=sl(sl({},this.style),{},Tl({},u,gi(h)))}},{key:"setStyles",value:function(u){this.style=sl(sl({},this.style),gi(u))}},{key:"updateStyles",value:function(u){this.style=sl({},gi(u))}},{key:"setZIndex",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.zIndex=u}},{key:"updateAttributes",value:function(u){Di(this,u)}}],l&&MR(o.prototype,l),i})(),C2=Nr(un.prototype,"type",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),R2=Nr(un.prototype,"x",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),j2=Nr(un.prototype,"y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),D2=Nr(un.prototype,"text",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),I2=Nr(un.prototype,"properties",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),L2=Nr(un.prototype,"_width",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),$2=Nr(un.prototype,"_height",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),F2=Nr(un.prototype,"anchorsOffset",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),B2=Nr(un.prototype,"isSelected",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),V2=Nr(un.prototype,"isHovered",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),U2=Nr(un.prototype,"isShowAnchor",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),W2=Nr(un.prototype,"isDragging",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),G2=Nr(un.prototype,"isHitable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),z2=Nr(un.prototype,"draggable",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),H2=Nr(un.prototype,"visible",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),X2=Nr(un.prototype,"enableRotate",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),q2=Nr(un.prototype,"zIndex",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Y2=Nr(un.prototype,"state",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),K2=Nr(un.prototype,"autoToFront",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Z2=Nr(un.prototype,"style",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),J2=Nr(un.prototype,"transform",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Q2=Nr(un.prototype,"_rotate",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Nr(un.prototype,"incoming",[c.m],Object.getOwnPropertyDescriptor(un.prototype,"incoming"),un.prototype),Nr(un.prototype,"outgoing",[c.m],Object.getOwnPropertyDescriptor(un.prototype,"outgoing"),un.prototype),Nr(un.prototype,"addNodeMoveRules",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"addNodeMoveRules"),un.prototype),Nr(un.prototype,"move",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"move"),un.prototype),Nr(un.prototype,"getMoveDistance",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"getMoveDistance"),un.prototype),Nr(un.prototype,"moveTo",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"moveTo"),un.prototype),Nr(un.prototype,"moveText",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"moveText"),un.prototype),Nr(un.prototype,"updateText",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"updateText"),un.prototype),Nr(un.prototype,"setSelected",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setSelected"),un.prototype),Nr(un.prototype,"setHovered",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setHovered"),un.prototype),Nr(un.prototype,"setIsShowAnchor",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setIsShowAnchor"),un.prototype),Nr(un.prototype,"setEnableRotate",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setEnableRotate"),un.prototype),Nr(un.prototype,"setHitable",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setHitable"),un.prototype),Nr(un.prototype,"setElementState",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setElementState"),un.prototype),Nr(un.prototype,"setProperty",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setProperty"),un.prototype),Nr(un.prototype,"setProperties",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setProperties"),un.prototype),Nr(un.prototype,"deleteProperty",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"deleteProperty"),un.prototype),Nr(un.prototype,"setStyle",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setStyle"),un.prototype),Nr(un.prototype,"setStyles",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setStyles"),un.prototype),Nr(un.prototype,"updateStyles",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"updateStyles"),un.prototype),Nr(un.prototype,"setZIndex",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"setZIndex"),un.prototype),Nr(un.prototype,"updateAttributes",[c.k],Object.getOwnPropertyDescriptor(un.prototype,"updateAttributes"),un.prototype),un);function mb(i){return mb=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},mb(i)}function oO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function iO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?oO(Object(l),!0).forEach((function(u){aO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):oO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function kR(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function TR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function NR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function yb(){return yb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=PR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},yb.apply(this,arguments)}function PR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Wh(i))!==null;);return i}function gb(i,o){return gb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},gb(i,o)}function CR(i){var o=(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 l,u=Wh(i);if(o){var h=Wh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return RR(this,l)}}function RR(i,o){if(o&&(mb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return by(i)}function by(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Wh(i){return Wh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Wh(i)}function aO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function _b(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Va,lO,sO,bb=(md=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&gb(d,m)})(h,i);var o,l,u=CR(h);function h(){var d;TR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return aO(by(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.CIRCLE_NODE),kR(by(d),"r",rO,by(d)),d}return o=h,(l=[{key:"width",get:function(){return 2*this.r}},{key:"height",get:function(){return 2*this.r}},{key:"getNodeStyle",value:function(){var d=yb(Wh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.circle;return iO(iO({},d),no(m))}},{key:"getDefaultAnchor",value:function(){var d=this.x,m=this.y,w=this.r;return[{x:d,y:m-w,id:"".concat(this.id,"_0")},{x:d+w,y:m,id:"".concat(this.id,"_1")},{x:d,y:m+w,id:"".concat(this.id,"_2")},{x:d-w,y:m,id:"".concat(this.id,"_3")}]}}])&&NR(o.prototype,l),h})(yd),rO=_b(md.prototype,"r",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),_b(md.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(md.prototype,"width"),md.prototype),_b(md.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(md.prototype,"height"),md.prototype),md);r(129);function wb(i){return wb=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},wb(i)}function Eb(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return uO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return uO(l,u)}})(i,o)||(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 uO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function cO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function dO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?cO(Object(l),!0).forEach((function(u){pO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):cO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function fO(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function jR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function DR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Ob(){return Ob=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=IR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Ob.apply(this,arguments)}function IR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=zh(i))!==null;);return i}function xb(i,o){return xb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},xb(i,o)}function LR(i){var o=(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 l,u=zh(i);if(o){var h=zh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return $R(this,l)}}function $R(i,o){if(o&&(wb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gh(i)}function Gh(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function zh(i){return zh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},zh(i)}function pO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Hh(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Ju,hO,vO,Sb=(Va=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&xb(d,m)})(h,i);var o,l,u=LR(h);function h(){var d;jR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return pO(Gh(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.DIAMOND_NODE),fO(Gh(d),"rx",lO,Gh(d)),fO(Gh(d),"ry",sO,Gh(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=Ob(zh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.diamond;return dO(dO({},d),no(m))}},{key:"points",get:function(){var d=this.x,m=this.y,w=this.rx,M=this.ry;return[[d,m-M],[d+w,m],[d,m+M],[d-w,m]]}},{key:"pointsPosition",get:function(){return this.points.map((function(d){return{x:d[0],y:d[1]}}))}},{key:"width",get:function(){var d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(w){var M=Eb(w,1)[0];M<d&&(d=M),M>m&&(m=M)})),m-d}},{key:"height",get:function(){var d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(w){var M=Eb(w,2)[1];M<d&&(d=M),M>m&&(m=M)})),m-d}},{key:"getDefaultAnchor",value:function(){var d=this;return this.points.map((function(m,w){var M=Eb(m,2);return{x:M[0],y:M[1],id:"".concat(d.id,"_").concat(w)}}))}}])&&DR(o.prototype,l),h})(yd),lO=Hh(Va.prototype,"rx",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),sO=Hh(Va.prototype,"ry",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Hh(Va.prototype,"points",[c.m],Object.getOwnPropertyDescriptor(Va.prototype,"points"),Va.prototype),Hh(Va.prototype,"pointsPosition",[c.m],Object.getOwnPropertyDescriptor(Va.prototype,"pointsPosition"),Va.prototype),Hh(Va.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Va.prototype,"width"),Va.prototype),Hh(Va.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Va.prototype,"height"),Va.prototype),Va);function Ab(i){return Ab=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},Ab(i)}function mO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function yO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?mO(Object(l),!0).forEach((function(u){_O(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):mO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function gO(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function FR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function BR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Mb(){return Mb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=VR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Mb.apply(this,arguments)}function VR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=qh(i))!==null;);return i}function kb(i,o){return kb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},kb(i,o)}function UR(i){var o=(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 l,u=qh(i);if(o){var h=qh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return WR(this,l)}}function WR(i,o){if(o&&(Ab(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xh(i)}function Xh(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function qh(i){return qh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},qh(i)}function _O(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function wy(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Ts,bO,Tb=(Ju=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&kb(d,m)})(h,i);var o,l,u=UR(h);function h(){var d;FR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return _O(Xh(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.ELLIPSE_NODE),gO(Xh(d),"rx",hO,Xh(d)),gO(Xh(d),"ry",vO,Xh(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=Mb(qh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.ellipse;return yO(yO({},d),no(m))}},{key:"width",get:function(){return 2*this.rx}},{key:"height",get:function(){return 2*this.ry}},{key:"getDefaultAnchor",value:function(){var d=this.x,m=this.y,w=this.rx,M=this.ry;return[{x:d,y:m-M,id:"".concat(this.id,"_0")},{x:d+w,y:m,id:"".concat(this.id,"_1")},{x:d,y:m+M,id:"".concat(this.id,"_2")},{x:d-w,y:m,id:"".concat(this.id,"_3")}]}}])&&BR(o.prototype,l),h})(yd),hO=wy(Ju.prototype,"rx",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),vO=wy(Ju.prototype,"ry",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),wy(Ju.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Ju.prototype,"width"),Ju.prototype),wy(Ju.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Ju.prototype,"height"),Ju.prototype),Ju);function Nb(i){return Nb=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},Nb(i)}function Pb(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return wO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return wO(l,u)}})(i,o)||(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 wO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function EO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function OO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?EO(Object(l),!0).forEach((function(u){xO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):EO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function GR(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function zR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function HR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Cb(){return Cb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=XR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Cb.apply(this,arguments)}function XR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Yh(i))!==null;);return i}function Rb(i,o){return Rb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Rb(i,o)}function qR(i){var o=(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 l,u=Yh(i);if(o){var h=Yh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return YR(this,l)}}function YR(i,o){if(o&&(Nb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ey(i)}function Ey(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Yh(i){return Yh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Yh(i)}function xO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Oy(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var jb,SO,Db=(Ts=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Rb(d,m)})(h,i);var o,l,u=qR(h);function h(){var d;zR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return xO(Ey(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.POLYGON_NODE),GR(Ey(d),"points",bO,Ey(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=Cb(Yh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.polygon;return OO(OO({},d),no(m))}},{key:"pointsPosition",get:function(){var d=this.x,m=this.y,w=this.width,M=this.height;return this.points.map((function(j){return{x:j[0]+d-w/2,y:j[1]+m-M/2}}))}},{key:"width",get:function(){var d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(w){var M=Pb(w,1)[0];M<d&&(d=M),M>m&&(m=M)})),m-d}},{key:"height",get:function(){var d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(w){var M=Pb(w,2)[1];M<d&&(d=M),M>m&&(m=M)})),m-d}},{key:"getDefaultAnchor",value:function(){var d=this,m=this.x,w=this.y,M=this.width,j=this.height;return this.points.map((function(V,Q){var ne=Pb(V,2),_e=ne[0],ke=ne[1];return{x:m+_e-M/2,y:w+ke-j/2,id:"".concat(d.id,"_").concat(Q)}}))}}])&&HR(o.prototype,l),h})(yd),bO=Oy(Ts.prototype,"points",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),Oy(Ts.prototype,"pointsPosition",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"pointsPosition"),Ts.prototype),Oy(Ts.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"width"),Ts.prototype),Oy(Ts.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"height"),Ts.prototype),Ts);function Ib(i){return Ib=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},Ib(i)}function AO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function MO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?AO(Object(l),!0).forEach((function(u){kO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):AO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function KR(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function ZR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function JR(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Lb(){return Lb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=QR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Lb.apply(this,arguments)}function QR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Kh(i))!==null;);return i}function $b(i,o){return $b=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},$b(i,o)}function e3(i){var o=(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 l,u=Kh(i);if(o){var h=Kh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return t3(this,l)}}function t3(i,o){if(o&&(Ib(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xy(i)}function xy(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Kh(i){return Kh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Kh(i)}function kO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var Pf,Fb=(jb=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&$b(d,m)})(h,i);var o,l,u=e3(h);function h(){var d;ZR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return kO(xy(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.RECT_NODE),KR(xy(d),"radius",SO,xy(d)),d}return o=h,(l=[{key:"getDefaultAnchor",value:function(){var d=this.x,m=this.y,w=this.width,M=this.height;return[{x:d,y:m-M/2,id:"".concat(this.id,"_0")},{x:d+w/2,y:m,id:"".concat(this.id,"_1")},{x:d,y:m+M/2,id:"".concat(this.id,"_2")},{x:d-w/2,y:m,id:"".concat(this.id,"_3")}]}},{key:"getNodeStyle",value:function(){var d=Lb(Kh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.rect;return MO(MO({},d),no(m))}}])&&JR(o.prototype,l),h})(yd),SO=(function(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d})(jb.prototype,"radius",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),jb);function Bb(i){return Bb=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},Bb(i)}function TO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function NO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?TO(Object(l),!0).forEach((function(u){CO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):TO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function n3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function r3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Vb(){return Vb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=o3(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Vb.apply(this,arguments)}function o3(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Zh(i))!==null;);return i}function Ub(i,o){return Ub=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Ub(i,o)}function i3(i){var o=(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 l,u=Zh(i);if(o){var h=Zh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return a3(this,l)}}function a3(i,o){if(o&&(Bb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PO(i)}function PO(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Zh(i){return Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Zh(i)}function CO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function RO(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var Wb=(Pf=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Ub(d,m)})(h,i);var o,l,u=i3(h);function h(){var d;n3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return CO(PO(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.TEXT_NODE),d}return o=h,(l=[{key:"getTextStyle",value:function(){var d=Vb(Zh(h.prototype),"getTextStyle",this).call(this),m=this.graphModel.theme.text;return NO(NO({},d),no(m))}},{key:"width",get:function(){var d=String(this.text.value).split(/[\r\n]/g),m=this.getTextStyle().fontSize;return lu({rows:d,fontSize:m,rowsLength:d.length}).width}},{key:"height",get:function(){var d=String(this.text.value).split(/[\r\n]/g),m=this.getTextStyle().fontSize;return lu({rows:d,fontSize:m,rowsLength:d.length}).height}}])&&r3(o.prototype,l),h})(yd),RO(Pf.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Pf.prototype,"width"),Pf.prototype),RO(Pf.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Pf.prototype,"height"),Pf.prototype),Pf);function Gb(i){return Gb=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},Gb(i)}function l3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function s3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function zb(i,o){return zb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},zb(i,o)}function u3(i){var o=(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 l,u=Sy(i);if(o){var h=Sy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return c3(this,l)}}function c3(i,o){if(o&&(Gb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jO(i)}function jO(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Sy(i){return Sy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Sy(i)}function d3(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var mu,DO,IO,LO,Hb=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&zb(d,m)})(h,i);var o,l,u=u3(h);function h(){var d;l3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return d3(jO(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.HTML_NODE),d}return o=h,(l=[{key:"getDefaultAnchor",value:function(){var d=this.x,m=this.y,w=this.width,M=this.height;return[{x:d,y:m-M/2,id:"".concat(this.id,"_0")},{x:d+w/2,y:m,id:"".concat(this.id,"_1")},{x:d,y:m+M/2,id:"".concat(this.id,"_2")},{x:d-w/2,y:m,id:"".concat(this.id,"_3")}]}}])&&s3(o.prototype,l),h})(yd);function $O(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Xb(i,o,l,u){l&&Object.defineProperty(i,o,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(u):void 0})}function f3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function FO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function im(i,o,l,u,h){var d={};return Object.keys(u).forEach((function(m){d[m]=u[m]})),d.enumerable=!!d.enumerable,d.configurable=!!d.configurable,("value"in d||d.initializer)&&(d.writable=!0),d=l.slice().reverse().reduce((function(m,w){return w(i,o,m)||m}),d),h&&d.initializer!==void 0&&(d.value=d.initializer?d.initializer.call(h):void 0,d.initializer=void 0),d.initializer===void 0&&(Object.defineProperty(i,o,d),d=null),d}var BO=(mu=(function(){function i(u){(function(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")})(this,i),FO(this,"graphModel",void 0),Xb(this,"isShowHorizontal",DO,this),Xb(this,"isShowVertical",IO,this),Xb(this,"position",LO,this),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=u}var o,l;return o=i,l=[{key:"getStyle",value:function(){return(function(u){for(var h=1;h<arguments.length;h++){var d=arguments[h]!=null?arguments[h]:{};h%2?$O(Object(d),!0).forEach((function(m){FO(u,m,d[m])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):$O(Object(d)).forEach((function(m){Object.defineProperty(u,m,Object.getOwnPropertyDescriptor(d,m))}))}return u})({},this.graphModel.theme.snapline)}},{key:"getCenterSnapLine",value:function(u,h){for(var d=u.x,m=u.y,w=!1,M=!1,j=0;j<h.length;j++){var V=h[j];if(V.id!==u.id&&(d===V.x&&(w=!0),m===V.y&&(M=!0),w&&M))break}return{isShowVertical:w,isShowHorizontal:M,position:{x:d,y:m}}}},{key:"getHorizontalSnapline",value:function(u,h){var d,m,w=!1,M=u.id;if(M){var j=this.graphModel.fakerNode;if(j&&j.id===M)m=xo(j);else{var V=this.graphModel.getNodeModelById(M);m=xo(V)}}for(var Q=0;Q<h.length;Q++){var ne=h[Q];if(ne.id!==u.id){var _e=xo(ne);if(_e.minY===m.minY||_e.maxY===m.minY){w=!0,d=m.minY;break}if(_e.minY===m.maxY||_e.maxY===m.maxY){w=!0,d=m.maxY;break}}}return Di({isShowHorizontal:w,position:{y:d}})}},{key:"getVerticalSnapline",value:function(u,h){var d,m,w=!1,M=u.id;if(M){var j=this.graphModel.fakerNode;if(j&&j.id===M)m=xo(j);else{var V=this.graphModel.getNodeModelById(M);m=xo(V)}}for(var Q=0;Q<h.length;Q++){var ne=h[Q];if(ne.id!==u.id){var _e=xo(ne);if(_e.minX===m.minX||_e.maxX===m.minX){w=!0,d=m.minX;break}if(_e.minX===m.maxX||_e.maxX===m.maxX){w=!0,d=m.maxX;break}}}return Di({isShowVertical:w,position:{x:d}})}},{key:"getSnapLinePosition",value:function(u,h){var d=this.getCenterSnapLine(u,h),m=d.isShowHorizontal,w=d.isShowVertical;if(!m){var M=this.getHorizontalSnapline(u,h);M.isShowHorizontal&&(d.isShowHorizontal=M.isShowHorizontal,d.position.y=M.position.y)}if(!w){var j=this.getVerticalSnapline(u,h);j.isShowVertical&&(d.isShowVertical=j.isShowVertical,d.position.x=j.position.x)}return d}},{key:"setSnaplineInfo",value:function(u){var h=u.isShowHorizontal,d=u.isShowVertical,m=u.position;this.position=m,this.isShowHorizontal=h,this.isShowVertical=d}},{key:"clearSnapline",value:function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1}},{key:"setNodeSnapLine",value:function(u){var h=this.graphModel.nodes,d=this.getSnapLinePosition(u,h);this.setSnaplineInfo(d)}}],l&&f3(o.prototype,l),i})(),DO=im(mu.prototype,"isShowHorizontal",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),IO=im(mu.prototype,"isShowVertical",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),LO=im(mu.prototype,"position",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),im(mu.prototype,"clearSnapline",[c.k],Object.getOwnPropertyDescriptor(mu.prototype,"clearSnapline"),mu.prototype),im(mu.prototype,"setNodeSnapLine",[c.k],Object.getOwnPropertyDescriptor(mu.prototype,"setNodeSnapLine"),mu.prototype),mu),am=new Map,VO=function(i){var o=ta(),l=window.requestAnimationFrame((function u(){if(i(),am.get(o)){var h=window.requestAnimationFrame(u);am.set(o,h)}}));return am.set(o,l),o},Ay=function(i){var o=am.get(i);o&&(window.cancelAnimationFrame(o),am.delete(i))};function qb(i){return qb=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},qb(i)}function lm(){return lm=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},lm.apply(this,arguments)}function UO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function sm(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?UO(Object(l),!0).forEach((function(u){ec(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):UO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function p3(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return WO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return WO(l,u)}})(i,o)||(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 WO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function h3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Yb(i,o){return Yb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Yb(i,o)}function v3(i){var o=(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 l,u=My(i);if(o){var h=My(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return m3(this,l)}}function m3(i,o){if(o&&(qb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qu(i)}function Qu(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function My(i){return My=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},My(i)}function ec(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var y3=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Yb(d,m)})(h,i);var o,l,u=v3(h);function h(){var d;return(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,h),ec(Qu(d=u.call(this)),"preTargetNode",void 0),ec(Qu(d),"sourceRuleResults",void 0),ec(Qu(d),"targetRuleResults",void 0),ec(Qu(d),"dragHandler",void 0),ec(Qu(d),"t",void 0),ec(Qu(d),"onDragStart",(function(m){var w=m.event,M=d.props,j=M.anchorData,V=M.nodeModel,Q=M.graphModel;Q.overlapMode,Q.selectNodeById(V.id),V.autoToFront&&Q.toFront(V.id),Q.eventCenter.emit(Dn.ANCHOR_DRAGSTART,{data:j,e:w,nodeModel:V}),d.setState({startX:j.x,startY:j.y,endX:j.x,endY:j.y})})),ec(Qu(d),"onDragging",(function(m){var w=m.event,M=d.props,j=M.graphModel,V=M.nodeModel,Q=M.anchorData,ne=j.transformModel,_e=j.eventCenter,ke=j.width,Ie=j.height,ft=j.editConfigModel,dt=ft.autoExpand,Et=ft.stopMoveGraph,zt=w.clientX,En=w.clientY,wn=j.getPointByClient({x:zt,y:En}),Yn=wn.domOverlayPosition,gn=Yn.x,Fn=Yn.y,Mn=wn.canvasOverlayPosition,$r=Mn.x,Wr=Mn.y;d.t&&Ay(d.t);var vr=[];gn<10?vr=[10,0]:gn+10>ke?vr=[-10,0]:Fn<10?vr=[0,10]:Fn+10>Ie&&(vr=[0,-10]),d.setState({endX:$r,endY:Wr,dragging:!0}),d.moveAnchorEnd($r,Wr),vr.length>0&&!Et&&dt&&(d.t=VO((function(){var Jr=p3(vr,2),_i=Jr[0],bi=Jr[1];ne.translate(_i,bi);var Ma=d.state,ts=Ma.endX,ns=Ma.endY;d.setState({endX:ts-_i,endY:ns-bi}),d.moveAnchorEnd(ts-_i,ns-bi)}))),_e.emit(Dn.ANCHOR_DRAG,{data:Q,e:w,nodeModel:V})})),ec(Qu(d),"onDragEnd",(function(m){var w=m.event;d.t&&Ay(d.t);var M=d.checkEnd(w);d.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),d.sourceRuleResults.clear(),d.targetRuleResults.clear();var j=d.props,V=j.graphModel,Q=j.nodeModel,ne=j.anchorData;V.eventCenter.emit(Dn.ANCHOR_DRAGEND,{data:ne,e:w,nodeModel:Q,edgeModel:M})})),ec(Qu(d),"checkEnd",(function(m){var w=d.props,M=w.graphModel,j=w.nodeModel,V=w.anchorData,Q=V.x,ne=V.y,_e=V.id,ke=(M.edgeType,d.state),Ie=ke.endX,ft=ke.endY,dt=ke.dragging,Et=Qc({x:Ie,y:ft},M);if(d.preTargetNode&&d.preTargetNode.state!==Zr.DEFAULT&&d.preTargetNode.setElementState(Zr.DEFAULT),dt&&Et&&Et.node){var zt=Et.node,En=Et.anchor.id,wn="".concat(j.id,"_").concat(zt.id,"_").concat(En,"_").concat(_e),Yn=d.sourceRuleResults.get(wn)||{},gn=Yn.isAllPass,Fn=Yn.msg,Mn=d.targetRuleResults.get(wn)||{},$r=Mn.isAllPass,Wr=Mn.msg;if(gn&&$r){zt.setElementState(Zr.DEFAULT);var vr=M.edgeGenerator(j.getData(),M.getNodeModelById(Et.node.id).getData()),Jr=M.addEdge(sm(sm({},vr),{},{sourceNodeId:j.id,sourceAnchorId:_e,startPoint:{x:Q,y:ne},targetNodeId:Et.node.id,targetAnchorId:Et.anchor.id,endPoint:{x:Et.anchor.x,y:Et.anchor.y}})),_i=d.props.anchorData;return M.eventCenter.emit(Dn.ANCHOR_DROP,{data:_i,e:m,nodeModel:j,edgeModel:Jr}),Jr}var bi=zt.getData();return M.eventCenter.emit(Dn.CONNECTION_NOT_ALLOWED,{data:bi,msg:Wr||Fn||"不允许添加连线"}),null}})),d.sourceRuleResults=new Map,d.targetRuleResults=new Map,d.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},d.dragHandler=new ye({onDragStart:d.onDragStart,onDragging:d.onDragging,onDragEnd:d.onDragEnd}),d}return o=h,(l=[{key:"getAnchorShape",value:function(){var d=this.props,m=d.anchorData,w=d.style,M=d.node.getAnchorShape(m);if(M)return M;var j=m.x,V=m.y,Q=sm(sm({},w),w.hover);return Object(We.g)("g",null,Object(We.g)(Uh,lm({className:"lf-node-anchor-hover"},Q,{x:j,y:V})),Object(We.g)(Uh,lm({className:"lf-node-anchor"},w,{x:j,y:V})))}},{key:"customTrajectory",get:function(){return this.props.graphModel.customTrajectory}},{key:"relateEdges",get:function(){var d=this.props,m=d.graphModel,w=m.getAnchorIncomingEdge,M=m.getAnchorOutcomingEdge,j=d.anchorData.id;return{incomingEdgeList:w(j),outcomingEdgeList:M(j)}}},{key:"moveAnchorEnd",value:function(d,m){var w=this.props,M=w.graphModel,j=w.nodeModel,V=w.anchorData,Q=Qc({x:d,y:m},M);if(Q){var ne=Q.node,_e=Q.anchor.id;if(this.preTargetNode&&this.preTargetNode!==Q.node&&this.preTargetNode.setElementState(Zr.DEFAULT),V.id===_e)return;this.preTargetNode=ne;var ke="".concat(j.id,"_").concat(ne.id,"_").concat(_e,"_").concat(V.id);if(!this.targetRuleResults.has(ke)){var Ie=Q.anchor,ft=j.isAllowConnectedAsSource(ne,V,Ie),dt=ne.isAllowConnectedAsTarget(j,V,Ie);this.sourceRuleResults.set(ke,Yl(ft)),this.targetRuleResults.set(ke,Yl(dt))}var Et=this.sourceRuleResults.get(ke).isAllPass,zt=this.targetRuleResults.get(ke).isAllPass;Et&&zt?ne.setElementState(Zr.ALLOW_CONNECT):ne.setElementState(Zr.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Zr.DEFAULT&&this.preTargetNode.setElementState(Zr.DEFAULT)}},{key:"isShowLine",value:function(){var d=this.state,m=d.startX,w=d.startY,M=d.endX,j=d.endY;return al(m,w,M,j)>10}},{key:"render",value:function(){var d=this,m=this.state,w=m.startX,M=m.startY,j=m.endX,V=m.endY,Q=this.props,ne=Q.anchorData.edgeAddable,_e=Q.edgeStyle;return Object(We.g)("g",{className:"lf-anchor"},Object(We.g)("g",{onMouseDown:function(ke){ne!==!1&&d.dragHandler.handleMouseDown(ke)}},this.getAnchorShape()),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(sm({sourcePoint:{x:w,y:M},targetPoint:{x:j,y:V}},_e)):Object(We.g)(Bh,lm({x1:w,y1:M,x2:j,y2:V},_e,{"pointer-events":"none"}))))}}])&&h3(o.prototype,l),h})(We.a);function GO(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function g3(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?GO(Object(l),!0).forEach((function(u){_3(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):GO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function _3(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Kb(i){return Kb=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},Kb(i)}function b3(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return zO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return zO(l,u)}})(i,o)||(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 zO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function HO(i){var o=i.x,l=o===void 0?0:o,u=i.y,h=u===void 0?0:u,d=i.value,m=i.fontSize,w=i.fill,M=w===void 0?"currentColor":w,j=i.overflowMode,V=j===void 0?"default":j,Q=i.textWidth,ne=Q===void 0?"":Q,_e=i.model,ke={textAnchor:"middle","dominant-baseline":"middle",x:l,y:h,fill:M};if(Object.entries(i).forEach((function(En){var wn=b3(En,2),Yn=wn[0],gn=wn[1];Kb(gn)!=="object"&&(ke[Yn]=gn)})),d){var Ie=String(d).split(/[\r\n]/g),ft=Ie.length;if(V!=="default"){var dt=_e.BaseType,Et=_e.modelType;if(dt===co.NODE&&Et!==Mr.TEXT_NODE||dt===co.EDGE&&ne)return(function(En){var wn=En.value,Yn=En.fontSize,gn=En.model,Fn=En.fontFamily,Mn=Fn===void 0?"":Fn,$r=En.lineHeight,Wr=En.wrapPadding,vr=Wr===void 0?"0, 0":Wr,Jr=En.overflowMode,_i=En.x,bi=En.y,Ma=gn.width,ts=gn.textHeight,ns=En.textWidth||Ma,rc=String(wn).split(/[\r\n]/g),Gp=rc.length,Jy=od({rows:rc,style:{fontSize:"".concat(Yn,"px"),width:"".concat(ns,"px"),fontFamily:Mn,lineHeight:$r,padding:vr},rowsLength:Gp,className:"lf-get-text-height"}),zp=gn.height>Jy?gn.height:Jy;ts&&(zp=ts);var jf=Jr==="ellipsis";return jf&&(zp=Yn+2),Object(We.g)("g",null,Object(We.g)("foreignObject",{width:ns,height:zp,x:_i-ns/2,y:bi-zp/2},Object(We.g)("div",{className:"lf-node-text-auto-wrap",style:{minHeight:zp,width:ns,padding:vr}},Object(We.g)("div",{className:jf?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:jf?rc.join(""):"",style:g3({},En)},rc.map((function(Df){return Object(We.g)("div",{className:"lf-node-text--auto-wrap-inner"},Df)}))))))})(i)}if(ft>1){var zt=Ie.map((function(En,wn){var Yn=(wn-(ft-1)/2)*(m+2);return Object(We.g)("tspan",{className:"lf-text-tspan",x:l,y:h+Yn},En)}));return Object(We.g)("text",ke,zt)}return Object(We.g)("text",ke,d)}}function Zb(i){return Zb=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},Zb(i)}function Jb(){return Jb=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},Jb.apply(this,arguments)}function w3(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return XO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return XO(l,u)}})(i,o)||(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 XO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function E3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Qb(i,o){return Qb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Qb(i,o)}function O3(i){var o=(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 l,u=ky(i);if(o){var h=ky(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return x3(this,l)}}function x3(i,o){if(o&&(Zb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cf(i)}function Cf(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function ky(i){return ky=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},ky(i)}function Bp(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var qO=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Qb(d,m)})(h,i);var o,l,u=O3(h);function h(d){var m;(function(M,j){if(!(M instanceof j))throw new TypeError("Cannot call a class as a function")})(this,h),Bp(Cf(m=u.call(this)),"dragHandler",void 0),Bp(Cf(m),"sumDeltaX",0),Bp(Cf(m),"sumDeltaY",0),Bp(Cf(m),"stepDrag",void 0),Bp(Cf(m),"onDragging",(function(M){var j=M.deltaX,V=M.deltaY,Q=m.props,ne=Q.model,_e=w3(Q.graphModel.transformModel.fixDeltaXY(j,V),2),ke=_e[0],Ie=_e[1];ne.moveText(ke,Ie)})),Bp(Cf(m),"dblClickHandler",(function(){m.props.editable&&m.props.model.setElementState(Zr.TEXT_EDIT)})),Bp(Cf(m),"mouseDownHandle",(function(M){var j=m.props,V=j.draggable,Q=j.model,ne=j.graphModel.editConfigModel.nodeTextDraggable;(V||ne)&&(m.stepDrag.model=Q,m.stepDrag.handleMouseDown(M))})),d.model;var w=d.draggable;return m.stepDrag=new ye({onDragging:m.onDragging,step:1,isStopPropagation:w}),m}return o=h,(l=[{key:"getShape",value:function(){var d=this.props,m=d.model,w=d.graphModel,M=m.text,j=w.editConfigModel,V=M.value,Q=M.x,ne=M.y,_e=M.editable,ke=M.draggable,Ie={x:Q,y:ne,className:"",value:V};_e?Ie.className="lf-element-text":ke||j.nodeTextDraggable?Ie.className="lf-text-draggable":Ie.className="lf-text-disabled";var ft=m.getTextStyle();return Object(We.g)(HO,Jb({},Ie,ft,{model:m}))}},{key:"render",value:function(){if(this.props.model.text)return Object(We.g)("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler},this.getShape())}}])&&E3(o.prototype,l),h})(We.a),S3=Ws(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,YO=r(130);function e0(i){return e0=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},e0(i)}function t0(){return t0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},t0.apply(this,arguments)}function A3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function n0(i,o){return n0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},n0(i,o)}function M3(i){var o=(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 l,u=Ty(i);if(o){var h=Ty(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return k3(this,l)}}function k3(i,o){if(o&&(e0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jh(i)}function Jh(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ty(i){return Ty=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ty(i)}function um(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var T3=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&n0(d,m)})(h,i);var o,l,u=M3(h);function h(d){var m;return(function(w,M){if(!(w instanceof M))throw new TypeError("Cannot call a class as a function")})(this,h),um(Jh(m=u.call(this,d)),"style",{}),um(Jh(m),"defaultAngle",void 0),um(Jh(m),"normal",void 0),um(Jh(m),"stepperDrag",void 0),um(Jh(m),"onDragging",(function(w){var M,j=w.event,V=m.props,Q=V.graphModel,ne=V.nodeModel,_e=V.eventCenter,ke=Q.selectNodes,Ie=ne.x,ft=ne.y,dt=j.clientX,Et=j.clientY,zt=Q.getPointByClient({x:dt,y:Et}).canvasOverlayPosition,En=zt.x,wn=zt.y,Yn=new Xe(En-Ie,wn-ft),gn=((M=m.normal)===null||M===void 0?void 0:M.angle(Yn))-m.defaultAngle,Fn=new kf(-Ie,-ft).rotate(gn).translate(Ie,ft).toString();ne.transform=Fn,ne.rotate=gn;var Mn=Object(YO.map)(ke,(function(Wr){return Wr.id}));Mn.indexOf(ne.id)===-1&&(Mn=[ne.id]);var $r=Object(YO.reduce)(Mn,(function(Wr,vr){var Jr=Q.getNodeModelById(vr);return Wr[vr]=Jr==null?void 0:Jr.getMoveDistance(0,0,!1),Wr}),{});Mn.forEach((function(Wr){Q.getNodeEdges(Wr).forEach((function(vr){if($r[vr.sourceNodeId]){var Jr=Q.getNodeModelById(vr.sourceNodeId).anchors.find((function(bi){return bi.id===vr.sourceAnchorId}));vr.updateStartPoint(Jr)}if($r[vr.targetNodeId]){var _i=Q.getNodeModelById(vr.targetNodeId).anchors.find((function(bi){return bi.id===vr.targetAnchorId}));vr.updateEndPoint(_i)}}))})),_e.emit(Dn.NODE_ROTATE,{e:j,nodeModel:ne})})),m.style=d.style,m.stepperDrag=new ye({onDragging:m.onDragging}),m}return o=h,(l=[{key:"render",value:function(){var d=this,m=this.props.nodeModel,w=m.x,M=m.y,j=w+m.width/2+20,V=M-m.height/2-20;return this.normal=new Xe(1,0),this.defaultAngle=this.normal.angle(new Xe(j-w,V-M)),m.defaultAngle=this.defaultAngle,Object(We.g)("g",{className:"lf-rotate-control"},Object(We.g)("g",{onMouseDown:function(Q){d.stepperDrag.handleMouseDown(Q)}},Object(We.g)(Uh,t0({},this.style,{cx:j,cy:V}))))}}])&&A3(o.prototype,l),h})(We.a);function r0(i){return r0=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},r0(i)}var N3=["className"];function Ny(){return Ny=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},Ny.apply(this,arguments)}function P3(i,o){if(i==null)return{};var l,u,h=(function(m,w){if(m==null)return{};var M,j,V={},Q=Object.keys(m);for(j=0;j<Q.length;j++)M=Q[j],w.indexOf(M)>=0||(V[M]=m[M]);return V})(i,o);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(i);for(u=0;u<d.length;u++)l=d[u],o.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(i,l)&&(h[l]=i[l])}return h}function Py(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return KO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return KO(l,u)}})(i,o)||(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 KO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function ZO(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function o0(i,o){return o0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},o0(i,o)}function C3(i){var o=(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 l,u=Cy(i);if(o){var h=Cy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return R3(this,l)}}function R3(i,o){if(o&&(r0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ra(i)}function ra(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Cy(i){return Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Cy(i)}function da(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var gd=(function(i){(function(m,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(w&&w.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),w&&o0(m,w)})(d,i);var o,l,u,h=C3(d);function d(m){var w;(function(ne,_e){if(!(ne instanceof _e))throw new TypeError("Cannot call a class as a function")})(this,d),da(ra(w=h.call(this)),"t",void 0),da(ra(w),"moveOffset",void 0),da(ra(w),"stepDrag",void 0),da(ra(w),"contextMenuTime",void 0),da(ra(w),"mouseUpDrag",void 0),da(ra(w),"startTime",void 0),da(ra(w),"clickTimer",void 0),da(ra(w),"modelDisposer",void 0),da(ra(w),"onDragStart",(function(ne){var _e=ne.event,ke=_e.clientX,Ie=_e.clientY,ft=w.props,dt=ft.model,Et=ft.graphModel.getPointByClient({x:ke,y:Ie}).canvasOverlayPosition,zt=Et.x,En=Et.y;w.moveOffset={x:dt.x-zt,y:dt.y-En}})),da(ra(w),"onDragging",(function(ne){var _e=ne.event,ke=w.props,Ie=ke.model,ft=ke.graphModel,dt=ft.editConfigModel,Et=dt.stopMoveGraph,zt=dt.autoExpand,En=ft.transformModel,wn=ft.selectNodes,Yn=ft.width,gn=ft.height,Fn=ft.gridSize;Ie.isDragging=!0;var Mn=_e.clientX,$r=_e.clientY,Wr=ft.getPointByClient({x:Mn,y:$r}).canvasOverlayPosition,vr=Wr.x,Jr=Wr.y,_i=Py(En.CanvasPointToHtmlPoint([vr,Jr]),2),bi=_i[0],Ma=_i[1];if(vr+=w.moveOffset.x,Jr+=w.moveOffset.y,vr=nl(vr,Fn),Jr=nl(Jr,Fn),Yn&&gn){if(!zt||Et||!(bi<0||Ma<0||bi>Yn||Ma>gn)){var ts=Py(En.CanvasPointToHtmlPoint([vr-Ie.width/2,Jr-Ie.height/2]),2),ns=ts[0],rc=ts[1],Gp=Py(En.CanvasPointToHtmlPoint([vr+Ie.width/2,Jr+Ie.height/2]),2),Jy=Gp[0],zp=Gp[1],jf=Math.max(Fn,20),Df=[];ns<0?Df=[jf,0]:Jy>ft.width?Df=[-jf,0]:rc<0?Df=[0,jf]:zp>ft.height&&(Df=[0,-jf]),w.t&&Ay(w.t);var m8=new kf(-vr,-Jr).rotate(Ie.rotate).translate(vr,Jr).toString();Ie.transform=m8;var Qy=wn.map((function(eg){return eg.id}));Qy.indexOf(Ie.id)===-1&&(Qy=[Ie.id]),Df.length>0&&!Et&&zt?w.t=VO((function(){var eg=Py(Df,2),Px=eg[0],Cx=eg[1];En.translate(Px,Cx);var y8=-Px/En.SCALE_X,g8=-Cx/En.SCALE_X;ft.moveNodes(Qy,y8,g8)})):ft.moveNodes(Qy,vr-Ie.x,Jr-Ie.y)}}else ft.moveNode2Coordinate(Ie.id,vr,Jr)})),da(ra(w),"onDragEnd",(function(){w.t&&Ay(w.t),w.props.model.isDragging=!1})),da(ra(w),"handleMouseUp",(function(){var ne=w.props.model;w.mouseUpDrag=ne.isDragging})),da(ra(w),"handleClick",(function(ne){var _e=w.mouseUpDrag===!1;if(w.startTime){var ke=w.props,Ie=ke.model,ft=ke.graphModel;if(_e){var dt={data:Ie.getData(),e:ne,position:ft.getPointByClient({x:ne.clientX,y:ne.clientY}),isSelected:!1,isMultiple:!1},Et=ne.button===2,zt=ne.detail===2;if(!Et){var En=ft.editConfigModel,wn=Wu(ne,En);dt.isMultiple=wn,Ie.isSelected&&!zt&&wn?(dt.isSelected=!1,Ie.setSelected(!1)):(ft.selectNodeById(Ie.id,wn),dt.isSelected=!0,w.toFront()),zt?(En.nodeTextEdit&&Ie.text.editable&&(Ie.setSelected(!1),ft.setElementStateById(Ie.id,Zr.TEXT_EDIT)),ft.eventCenter.emit(Dn.NODE_DBCLICK,dt)):(ft.eventCenter.emit(Dn.ELEMENT_CLICK,dt),ft.eventCenter.emit(Dn.NODE_CLICK,dt))}}}})),da(ra(w),"handleContextMenu",(function(ne){ne.preventDefault();var _e=w.props,ke=_e.model,Ie=_e.graphModel,ft=ke.getData(),dt=Ie.getPointByClient({x:ne.clientX,y:ne.clientY});Ie.setElementStateById(ke.id,Zr.SHOW_MENU,dt.domOverlayPosition),ke.isSelected||Ie.selectNodeById(ke.id),Ie.eventCenter.emit(Dn.NODE_CONTEXTMENU,{data:ft,e:ne,position:dt}),w.toFront()})),da(ra(w),"handleMouseDown",(function(ne){var _e=w.props,ke=_e.model,Ie=_e.graphModel;w.startTime=new Date().getTime(),Ie.editConfigModel.adjustNodePosition&&ke.draggable&&w.stepDrag&&w.stepDrag.handleMouseDown(ne)})),da(ra(w),"setHoverON",(function(ne){var _e=w.props,ke=_e.model,Ie=_e.graphModel;if(!ke.isHovered){var ft=ke.getData();ke.setHovered(!0),Ie.eventCenter.emit(Dn.NODE_MOUSEENTER,{data:ft,e:ne})}})),da(ra(w),"setHoverOFF",(function(ne){var _e=w.props,ke=_e.model,Ie=_e.graphModel,ft=ke.getData();ke.isHovered&&(ke.setHovered(!1),Ie.eventCenter.emit(Dn.NODE_MOUSELEAVE,{data:ft,e:ne}))})),da(ra(w),"onMouseOut",(function(ne){S3&&w.setHoverOFF(ne)}));var M=m.graphModel,j=M.gridSize,V=M.eventCenter,Q=m.model;return w.stepDrag=new ye({onDragStart:w.onDragStart,onDragging:w.onDragging,onDragEnd:w.onDragEnd,step:j,eventType:"NODE",isStopPropagation:!1,eventCenter:V,model:Q}),w.modelDisposer=Object(c.F)((function(){return w.props}),(function(ne){ne&&ne.model&&w.stepDrag.setModel(ne.model)})),w}return o=d,u=[{key:"getModel",value:function(m){return m}}],(l=[{key:"componentWillUnmount",value:function(){this.modelDisposer&&this.modelDisposer()}},{key:"getAnchorShape",value:function(m){return null}},{key:"getAnchors",value:function(){var m=this,w=this.props,M=w.model,j=w.graphModel,V=M.isSelected,Q=M.isHitable,ne=M.isDragging,_e=M.isShowAnchor;return Q&&(V||_e)&&!ne?Yd(M.anchors,(function(ke,Ie){var ft=M.getAnchorLineStyle(ke),dt=M.getAnchorStyle(ke);return Object(We.g)(y3,{anchorData:ke,node:m,style:dt,edgeStyle:ft,anchorIndex:Ie,nodeModel:M,graphModel:j,setHoverOFF:m.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var m=this.props,w=m.model,M=m.graphModel,j=w.isSelected,V=w.isHitable,Q=w.enableRotate,ne=w.isHovered,_e=w.getRotateControlStyle().style;if(V&&(j||ne)&&Q)return Object(We.g)(T3,{graphModel:M,nodeModel:w,eventCenter:M.eventCenter,style:_e})}},{key:"getText",value:function(){var m=this.props,w=m.model,M=m.graphModel;if(w.state===Zr.TEXT_EDIT)return"";if(w.text){var j=M.editConfigModel,V=!1;return(w.text.draggable||j.nodeTextDraggable)&&(V=!0),Object(We.g)(qO,{editable:j.nodeTextEdit&&w.text.editable,model:w,graphModel:M,draggable:V})}}},{key:"getStateClassName",value:function(){var m=this.props.model,w=m.state,M=m.isDragging,j=m.isSelected,V="lf-node";switch(w){case Zr.ALLOW_CONNECT:V+=" lf-node-allow";break;case Zr.NOT_ALLOW_CONNECT:V+=" lf-node-not-allow";break;default:V+=" lf-node-default"}return M&&(V+=" lf-isDragging"),j&&(V+=" lf-node-selected"),V}},{key:"toFront",value:function(){var m=this.props,w=m.model,M=m.graphModel;w.autoToFront&&M.toFront(w.id)}},{key:"render",value:function(){var m,w=this.props,M=w.model,j=w.graphModel,V=j.editConfigModel,Q=V.hideAnchors,ne=V.adjustNodePosition,_e=V.allowRotation,ke=j.gridSize,Ie=j.transformModel.SCALE_X,ft=M.isHitable,dt=M.draggable,Et=M.transform,zt=M.getOuterGAttributes(),En=zt.className,wn=En===void 0?"":En,Yn=P3(zt,N3),gn=Object(We.g)("g",{className:"lf-node-content"},Object(We.g)("g",{transform:Et},this.getShape(),this.getText(),_e&&this.getRotateControl()),!Q&&this.getAnchors());return ft?(ne&&dt&&this.stepDrag.setStep(ke*Ie),m=Object(We.g)("g",Ny({className:"".concat(this.getStateClassName()," ").concat(wn),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},Yn),gn)):m=Object(We.g)("g",Ny({className:"".concat(this.getStateClassName()," ").concat(wn)},Yn),gn),m}}])&&ZO(o.prototype,l),u&&ZO(o,u),d})(We.a);function i0(i){return i0=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},i0(i)}function a0(){return a0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},a0.apply(this,arguments)}function j3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function D3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function l0(i,o){return l0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},l0(i,o)}function I3(i){var o=(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 l,u=Ry(i);if(o){var h=Ry(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return L3(this,l)}}function L3(i,o){if(o&&(i0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Ry(i){return Ry=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ry(i)}var s0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&l0(d,m)})(h,i);var o,l,u=I3(h);function h(){return j3(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getShape",value:function(){var d=this.props.model,m=d.getNodeStyle();return Object(We.g)(Tf,a0({},m,{x:d.x,y:d.y,width:d.width,height:d.height,radius:d.radius}))}}])&&D3(o.prototype,l),h})(gd);function u0(i){return u0=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},u0(i)}function c0(){return c0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},c0.apply(this,arguments)}function $3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function F3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function d0(i,o){return d0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},d0(i,o)}function B3(i){var o=(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 l,u=jy(i);if(o){var h=jy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return V3(this,l)}}function V3(i,o){if(o&&(u0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function jy(i){return jy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},jy(i)}var f0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&d0(d,m)})(h,i);var o,l,u=B3(h);function h(){return $3(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getShape",value:function(){var d=this.props.model,m=d.x,w=d.y,M=d.r,j=d.getNodeStyle();return Object(We.g)(Uh,c0({},j,{x:m,y:w,r:M}))}}])&&F3(o.prototype,l),h})(gd);function p0(i){return p0=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},p0(i)}function U3(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return JO(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return JO(l,u)}})(i,o)||(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 JO(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function QO(i){var o=i.points,l=i.className,u={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(i).forEach((function(h){var d=U3(h,2),m=d[0],w=d[1];p0(w)!=="object"&&(u[m]=w)})),u.className=l?"lf-basic-shape ".concat(l):"lf-basic-shape",u.points=o.map((function(h){return h.join(",")})).join(" "),Object(We.g)("polygon",u)}function h0(i){return h0=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},h0(i)}function v0(){return v0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},v0.apply(this,arguments)}function W3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function G3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function m0(i,o){return m0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},m0(i,o)}function z3(i){var o=(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 l,u=Dy(i);if(o){var h=Dy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return H3(this,l)}}function H3(i,o){if(o&&(h0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Dy(i){return Dy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Dy(i)}var y0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&m0(d,m)})(h,i);var o,l,u=z3(h);function h(){return W3(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getShape",value:function(){var d=this.props.model,m=d.x,w=d.y,M=d.width,j=d.height,V=d.points,Q=d.getNodeStyle(),ne={transform:"matrix(1 0 0 1 ".concat(m-M/2," ").concat(w-j/2,")")};return Object(We.g)("g",ne,Object(We.g)(QO,v0({},Q,{points:V,x:m,y:w})))}}])&&G3(o.prototype,l),h})(gd);function g0(i){return g0=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},g0(i)}function _0(){return _0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},_0.apply(this,arguments)}function X3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function q3(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function b0(i,o){return b0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},b0(i,o)}function Y3(i){var o=(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 l,u=Iy(i);if(o){var h=Iy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return K3(this,l)}}function K3(i,o){if(o&&(g0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Iy(i){return Iy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Iy(i)}var w0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&b0(d,m)})(h,i);var o,l,u=Y3(h);function h(){return X3(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getShape",value:function(){var d=this.props.model,m=d.getNodeStyle();return Object(We.g)("g",null,Object(We.g)(QO,_0({},m,{points:d.points,x:d.x,y:d.y})))}}])&&q3(o.prototype,l),h})(gd);function E0(i){return E0=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},E0(i)}function Z3(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return ex(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ex(l,u)}})(i,o)||(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 ex(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function J3(i){var o=i.x,l=o===void 0?0:o,u=i.y,h=u===void 0?0:u,d=i.rx,m=d===void 0?4:d,w=i.ry,M=w===void 0?4:w,j=i.className,V={cx:l,cy:h,rx:m,ry:M,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(i).forEach((function(Q){var ne=Z3(Q,2),_e=ne[0],ke=ne[1];E0(ke)!=="object"&&(V[_e]=ke)})),V.className=j?"lf-basic-shape ".concat(j):"lf-basic-shape",Object(We.g)("ellipse",V)}function O0(i){return O0=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},O0(i)}function x0(){return x0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},x0.apply(this,arguments)}function Q3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function ej(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function S0(i,o){return S0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},S0(i,o)}function tj(i){var o=(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 l,u=Ly(i);if(o){var h=Ly(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return nj(this,l)}}function nj(i,o){if(o&&(O0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Ly(i){return Ly=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ly(i)}var A0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&S0(d,m)})(h,i);var o,l,u=tj(h);function h(){return Q3(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getShape",value:function(){var d=this.props.model,m=d.getNodeStyle();return Object(We.g)(J3,x0({},m,{x:d.x,y:d.y,rx:d.rx,ry:d.ry}))}}])&&ej(o.prototype,l),h})(gd);function M0(i){return M0=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},M0(i)}function tx(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function nx(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?tx(Object(l),!0).forEach((function(u){rj(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):tx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function rj(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function oj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function ij(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function k0(i,o){return k0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},k0(i,o)}function aj(i){var o=(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 l,u=$y(i);if(o){var h=$y(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return lj(this,l)}}function lj(i,o){if(o&&(M0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function $y(i){return $y=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},$y(i)}var T0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&k0(d,m)})(h,i);var o,l,u=aj(h);function h(){return oj(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getBackground",value:function(){var d=this.props.model,m=d.getTextStyle(),w=d.width,M=d.height,j=d.x,V=d.y,Q=nx(nx({},m.background),{},{x:j,y:V-1,width:w,height:M});return Object(We.g)(Tf,Q)}},{key:"getShape",value:function(){return Object(We.g)("g",null,this.getBackground())}}])&&ij(o.prototype,l),h})(gd);function N0(i){return N0=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},N0(i)}function P0(){return P0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},P0.apply(this,arguments)}function sj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function uj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function C0(i,o){return C0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},C0(i,o)}function cj(i){var o=(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 l,u=Fy(i);if(o){var h=Fy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return dj(this,l)}}function dj(i,o){if(o&&(N0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cm(i)}function cm(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Fy(i){return Fy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Fy(i)}function By(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var R0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&C0(d,m)})(h,i);var o,l,u=cj(h);function h(){var d;sj(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return By(cm(d=u.call.apply(u,[this].concat(w))),"ref",void 0),By(cm(d),"currentProperties",void 0),By(cm(d),"preProperties",void 0),By(cm(d),"setRef",(function(j){d.ref=j})),d}return o=h,(l=[{key:"rootEl",get:function(){return this.ref}},{key:"setHtml",value:function(d){d.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 d=this.props.model,m=d.x,w=d.y,M=d.height,j=d.width,V=d.getNodeStyle();return this.currentProperties=JSON.stringify(d.properties),Object(We.g)("foreignObject",P0({},V,{x:m-j/2,y:w-M/2,width:j,height:M,ref:this.setRef}))}}])&&uj(o.prototype,l),h})(gd);function j0(i){return j0=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},j0(i)}function D0(){return D0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},D0.apply(this,arguments)}function rx(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Vp(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?rx(Object(l),!0).forEach((function(u){$0(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):rx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function fj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function I0(i,o){return I0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},I0(i,o)}function pj(i){var o=(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 l,u=Vy(i);if(o){var h=Vy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return hj(this,l)}}function hj(i,o){if(o&&(j0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L0(i)}function L0(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Vy(i){return Vy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Vy(i)}function $0(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var vj=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&I0(d,m)})(h,i);var o,l,u=pj(h);function h(d){var m;return(function(w,M){if(!(w instanceof M))throw new TypeError("Cannot call a class as a function")})(this,h),$0(L0(m=u.call(this,d)),"setHoverON",(function(){m.setState({isHovered:!0})})),$0(L0(m),"setHoverOFF",(function(){m.setState({isHovered:!1})})),m.state={isHovered:!1},m}return o=h,(l=[{key:"getBackground",value:function(){var d=this.props.model,m=d.getTextStyle(),w=d.text,M=d.width,j=m.background||{};if(this.state.isHovered&&m.hover&&m.hover.background&&(j=Vp(Vp({},j),m.hover.background)),w&&w.value&&j.fill!=="transparent"){var V,Q=m.fontSize,ne=m.overflowMode,_e=m.lineHeight,ke=m.wrapPadding,Ie=m.textWidth,ft=w.value,dt=w.x,Et=w.y,zt=String(ft).split(/[\r\n]/g),En=zt.length;if(ne==="autoWrap"&&Ie){var wn=od({rows:zt,style:{fontSize:"".concat(Q,"px"),width:"".concat(Ie,"px"),lineHeight:_e,padding:ke},rowsLength:En,className:"lf-get-text-height"});V=Vp(Vp({},j),{},{x:dt-1,y:Et-1,width:Ie,height:wn})}else{zt&&zt.forEach((function($r){Fo($r)}));var Yn=lu({rows:zt,fontSize:Q,rowsLength:En}),gn=Yn.width,Fn=Yn.height;if(ne==="ellipsis"&&(gn=Ie||M,Fn=Q+2),typeof j.wrapPadding=="string"){var Mn=j.wrapPadding.split(",").filter((function($r){return $r.trim()})).map((function($r){return parseFloat($r.trim())}));Mn.length>0&&Mn.length<=4&&(Mn.length===1?Mn=[Mn[0],Mn[0],Mn[0],Mn[0]]:Mn.length===2?Mn=[Mn[0],Mn[1],Mn[0],Mn[1]]:Mn.length===3&&(Mn=[Mn[0],Mn[1],Mn[2],Mn[1]]),gn+=Mn[1]+Mn[3],Fn+=Mn[0]+Mn[2],dt+=(Mn[1]-Mn[3])/2,Et+=(Mn[2]-Mn[0])/2)}V=Vp(Vp({},j),{},{x:dt-1,y:Et-1,width:gn,height:Fn})}return Object(We.g)(Tf,V)}}},{key:"getShape",value:function(){var d=this.props.model,m=d.text,w=m.value,M=m.x,j=m.y;if(w){var V=Vp({x:M,y:j,className:"lf-element-text",value:w},d.getTextStyle());return Object(We.g)("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getBackground(),Object(We.g)(HO,D0({},V,{model:d})))}}}])&&fj(o.prototype,l),h})(qO);function F0(i){return F0=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},F0(i)}var tc,mj=["text","sourceAnchorId","targetAnchorId"];function ox(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function _d(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?ox(Object(l),!0).forEach((function(u){es(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):ox(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function yj(i,o){if(i==null)return{};var l,u,h=(function(m,w){if(m==null)return{};var M,j,V={},Q=Object.keys(m);for(j=0;j<Q.length;j++)M=Q[j],w.indexOf(M)>=0||(V[M]=m[M]);return V})(i,o);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(i);for(u=0;u<d.length;u++)l=d[u],o.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(i,l)&&(h[l]=i[l])}return h}function gj(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return ix(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ix(l,u)}})(i,o)||(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 ix(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function _j(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function B0(i,o){return B0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},B0(i,o)}function bj(i){var o=(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 l,u=Uy(i);if(o){var h=Uy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return wj(this,l)}}function wj(i,o){if(o&&(F0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ql(i)}function Ql(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Uy(i){return Uy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Uy(i)}function es(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}(function(i){i.SOURCE="SOURCE",i.TARGET="TARGET"})(tc||(tc={}));var ax=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&B0(d,m)})(h,i);var o,l,u=bj(h);function h(d){var m;(function(V,Q){if(!(V instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,h),es(Ql(m=u.call(this)),"stepDragData",void 0),es(Ql(m),"stepDrag",void 0),es(Ql(m),"oldEdge",void 0),es(Ql(m),"preTargetNode",void 0),es(Ql(m),"targetRuleResults",void 0),es(Ql(m),"sourceRuleResults",void 0),es(Ql(m),"handleMouseDown",(function(V){m.stepDrag&&m.stepDrag.handleMouseDown(V)})),es(Ql(m),"onDragStart",(function(){var V=m.props,Q=V.x,ne=V.y,_e=V.edgeModel,ke=_e.startPoint,Ie=_e.endPoint,ft=_e.pointsList;m.oldEdge={startPoint:ke,endPoint:Ie,pointsList:ft},m.setState({endX:Q,endY:ne,dragging:!0})})),es(Ql(m),"onDragging",(function(V){var Q=V.deltaX,ne=V.deltaY,_e=m.state,ke=_e.endX,Ie=_e.endY,ft=m.props,dt=ft.graphModel,Et=ft.type,zt=dt.transformModel,En=dt.editConfigModel,wn=gj(zt.moveCanvasPointByHtml([ke,Ie],Q,ne),2),Yn=wn[0],gn=wn[1];m.setState({endX:Yn,endY:gn,dragging:!0});var Fn=m.props.edgeModel,Mn=Qc({x:ke,y:Ie},dt);if(Mn&&Mn.node&&m.isAllowAdjust(Mn).pass){var $r,Wr=Fn.startPoint,vr=Fn.endPoint,Jr=Fn.sourceNode,_i=Fn.targetNode;Et===tc.SOURCE?$r={startPoint:{x:Mn.anchor.x,y:Mn.anchor.y},endPoint:{x:vr.x,y:vr.y},sourceNode:Mn.node,targetNode:_i}:Et===tc.TARGET&&($r={startPoint:{x:Wr.x,y:Wr.y},endPoint:{x:Mn.anchor.x,y:Mn.anchor.y},sourceNode:Jr,targetNode:Mn.node}),Fn.updateAfterAdjustStartAndEnd($r)}else Et===tc.SOURCE?Fn.updateStartPoint({x:Yn,y:gn}):Et===tc.TARGET&&Fn.updateEndPoint({x:Yn,y:gn});Fn.text.value&&En.adjustEdge&&Fn.setText(Object.assign({},Fn.text,Fn.textPosition))})),es(Ql(m),"onDragEnd",(function(V){var Q=V.event;try{var ne;m.setState({dragging:!1});var _e=m.props,ke=_e.graphModel,Ie=_e.edgeModel,ft=_e.type,dt=m.state,Et=dt.endX,zt=dt.endY,En=dt.dragging,wn=Qc({x:Et,y:zt},ke);if(!En)return;var Yn,gn=!1;if(wn&&wn.node){var Fn=m.isAllowAdjust(wn),Mn=Fn.pass,$r=Fn.msg,Wr=Fn.newTargetNode;if(Mn){var vr=Ie.getData(),Jr=vr.text,_i=vr.sourceAnchorId,bi=_i===void 0?"":_i,Ma=vr.targetAnchorId;Yn=_d(_d({sourceAnchorId:bi,targetAnchorId:Ma===void 0?"":Ma},yj(vr,mj)),{},{text:(Jr==null?void 0:Jr.value)||""}),ft===tc.SOURCE?(Yn=_d(_d({},ke.edgeGenerator(ke.getNodeModelById(wn.node.id).getData(),ke.getNodeModelById(Ie.targetNodeId).getData(),Yn)),{},{sourceNodeId:wn.node.id,sourceAnchorId:wn.anchor.id,startPoint:{x:wn.anchor.x,y:wn.anchor.y},targetNodeId:Ie.targetNodeId,endPoint:_d({},Ie.endPoint)}),Ie.sourceNodeId===wn.node.id&&Ie.sourceAnchorId===wn.anchor.id&&(gn=!0)):ft===tc.TARGET&&(Yn=_d(_d({},ke.edgeGenerator(ke.getNodeModelById(Ie.sourceNodeId).getData(),ke.getNodeModelById(wn.node.id).getData(),Yn)),{},{sourceNodeId:Ie.sourceNodeId,startPoint:_d({},Ie.startPoint),targetNodeId:wn.node.id,targetAnchorId:wn.anchor.id,endPoint:{x:wn.anchor.x,y:wn.anchor.y}}),Ie.targetNodeId===wn.node.id&&Ie.targetAnchorId===wn.anchor.id&&(gn=!0))}else{gn=!0;var ts=Wr.getData();ke.eventCenter.emit(Dn.CONNECTION_NOT_ALLOWED,{data:ts,msg:$r})}}else gn=!0;if(gn)m.recoveryEdge();else{var ns=Ie.getData();ke.deleteEdgeById(Ie.id);var rc=ke.addEdge(_d({},Yn));ke.eventCenter.emit(Dn.EDGE_EXCHANGE_NODE,{data:{newEdge:rc.getData(),oldEdge:ns}})}(ne=m.preTargetNode)===null||ne===void 0||ne.setElementState(Zr.DEFAULT)}finally{m.props.graphModel.eventCenter.emit(Dn.ADJUST_POINT_DRAGEND,{e:Q,data:m.stepDragData})}})),es(Ql(m),"recoveryEdge",(function(){var V=m.props.edgeModel,Q=m.oldEdge,ne=Q.startPoint,_e=Q.endPoint,ke=Q.pointsList;V.updateStartPoint(ne),V.updateEndPoint(_e),V.modelType!==Mr.LINE_EDGE&&(V.pointsList=ke,V.initPoints())})),es(Ql(m),"getAdjustPointStyle",(function(){var V=m.props,Q=V.graphModel.theme;return V.edgeModel,Q.edgeAdjust})),m.state={dragging:!1,endX:0,endY:0},m.targetRuleResults=new Map,m.sourceRuleResults=new Map;var w=d.type,M=d.edgeModel,j=d.graphModel.eventCenter;return m.stepDragData={type:w,edgeData:M.getData()},m.stepDrag=new ye({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:j,data:m.stepDragData}),m}return o=h,(l=[{key:"isAllowAdjust",value:function(d){var m=this.props,w=m.edgeModel,M=w.id,j=w.sourceNode,V=w.targetNode,Q=w.sourceAnchorId,ne=w.targetAnchorId,_e=m.type,ke=null,Ie=null,ft=null,dt=null;if(_e===tc.SOURCE?(ke=d.node,Ie=V,ft=d.anchor,dt=V.getAnchorInfo(ne)):(ke=j,Ie=d.node,dt=d.anchor,ft=j.getAnchorInfo(Q)),this.preTargetNode&&this.preTargetNode!==d.node&&this.preTargetNode.setElementState(Zr.DEFAULT),this.preTargetNode=d.node,dt.id===ft.id)return{pass:!1,msg:"",newTargetNode:Ie};var Et="".concat(ke.id,"_").concat(Ie.id,"_").concat(ft.id,"_").concat(dt.id);if(!this.targetRuleResults.has(Et)){var zt=ke.isAllowConnectedAsSource(Ie,ft,dt,M),En=Ie.isAllowConnectedAsTarget(ke,ft,dt,M);this.sourceRuleResults.set(Et,Yl(zt)),this.targetRuleResults.set(Et,Yl(En))}var wn=this.sourceRuleResults.get(Et),Yn=wn.isAllPass,gn=wn.msg,Fn=this.targetRuleResults.get(Et),Mn=Fn.isAllPass,$r=Fn.msg,Wr=Yn&&Mn?Zr.ALLOW_CONNECT:Zr.NOT_ALLOW_CONNECT;return _e===tc.SOURCE?ke.setElementState(Wr):Ie.setElementState(Wr),{pass:Yn&&Mn,msg:$r||gn,newTargetNode:Ie}}},{key:"render",value:function(){var d=this.props,m=d.x,w=d.y,M=d.getAdjustPointShape,j=d.edgeModel,V=this.state.dragging;return Object(We.g)("g",{pointerEvents:V?"none":"",onMouseDown:this.handleMouseDown},V?"":M(m,w,j))}}])&&_j(o.prototype,l),h})(We.a);function V0(i){return V0=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},V0(i)}function dm(){return dm=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},dm.apply(this,arguments)}function Ej(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return lx(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return lx(l,u)}})(i,o)||(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 lx(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function Oj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function xj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function U0(i,o){return U0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},U0(i,o)}function Sj(i){var o=(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 l,u=Wy(i);if(o){var h=Wy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Aj(this,l)}}function Aj(i,o){if(o&&(V0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yu(i)}function yu(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Wy(i){return Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Wy(i)}function nc(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var fm=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&U0(d,m)})(h,i);var o,l,u=Sj(h);function h(){var d;Oj(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return nc(yu(d=u.call.apply(u,[this].concat(w))),"startTime",void 0),nc(yu(d),"contextMenuTime",void 0),nc(yu(d),"clickTimer",void 0),nc(yu(d),"textRef",Object(We.f)()),nc(yu(d),"handleHover",(function(j,V){var Q=d.props,ne=Q.model,_e=Q.graphModel.eventCenter;ne.setHovered(j);var ke=j?Dn.EDGE_MOUSEENTER:Dn.EDGE_MOUSELEAVE,Ie=ne.getData();_e.emit(ke,{data:Ie,e:V})})),nc(yu(d),"setHoverON",(function(j){d.props.model.isHovered||(d.textRef&&d.textRef.current&&d.textRef.current.setHoverON(),d.handleHover(!0,j))})),nc(yu(d),"setHoverOFF",(function(j){d.props.model.isHovered&&(d.textRef&&d.textRef.current&&d.textRef.current.setHoverOFF(),d.handleHover(!1,j))})),nc(yu(d),"handleContextMenu",(function(j){j.preventDefault(),d.contextMenuTime=new Date().getTime(),d.clickTimer&&clearTimeout(d.clickTimer);var V=d.props,Q=V.model,ne=V.graphModel,_e=ne.getPointByClient({x:j.clientX,y:j.clientY});ne.setElementStateById(Q.id,Zr.SHOW_MENU,_e.domOverlayPosition),d.toFront(),Q.isSelected||ne.selectEdgeById(Q.id);var ke=Q==null?void 0:Q.getData();ne.eventCenter.emit(Dn.EDGE_CONTEXTMENU,{data:ke,e:j,position:_e})})),nc(yu(d),"handleMouseDown",(function(j){j.stopPropagation(),d.startTime=new Date().getTime()})),nc(yu(d),"handleMouseUp",(function(j){if(d.startTime&&!(new Date().getTime()-d.startTime>200||j.button===2)){var V=j.detail===2,Q=d.props,ne=Q.model,_e=Q.graphModel,ke=ne==null?void 0:ne.getData(),Ie=_e.getPointByClient({x:j.clientX,y:j.clientY});if(V){var ft=_e.editConfigModel,dt=_e.textEditElement;if(dt&&dt.id===ne.id&&_e.setElementStateById(ne.id,Zr.DEFAULT),ft.edgeTextEdit&&ne.text.editable&&_e.setElementStateById(ne.id,Zr.TEXT_EDIT),ne.modelType===Mr.POLYLINE_EDGE){var Et=ne,zt=_e.getPointByClient({x:j.x,y:j.y}).canvasOverlayPosition,En=zt.x,wn=zt.y,Yn=Tr({x:En,y:wn},Et.points);Et.dbClickPosition=Yn}_e.eventCenter.emit(Dn.EDGE_DBCLICK,{data:ke,e:j,position:Ie})}else _e.eventCenter.emit(Dn.ELEMENT_CLICK,{data:ke,e:j,position:Ie}),_e.eventCenter.emit(Dn.EDGE_CLICK,{data:ke,e:j,position:Ie});var gn=_e.editConfigModel;_e.selectEdgeById(ne.id,Wu(j,gn)),d.toFront()}})),d}return o=h,(l=[{key:"getShape",value:function(){return Object(We.g)("g",null,this.getEdge())}},{key:"getTextStyle",value:function(){}},{key:"getText",value:function(){var d=this.props,m=d.model,w=d.graphModel;if(m.state===Zr.TEXT_EDIT)return null;var M=!1,j=w.editConfigModel;return(m.text.draggable||j.edgeTextDraggable)&&(M=!0),Object(We.g)(vj,{ref:this.textRef,editable:j.edgeTextEdit&&m.text.editable,model:m,graphModel:w,draggable:M})}},{key:"getArrowInfo",value:function(){var d=this.props.model,m=d.startPoint,w=d.endPoint,M=d.isSelected;return{start:m,end:w,hover:this.state.hover,isSelected:M}}},{key:"getLastTwoPoints",value:function(){var d=this.props.model;return[d.startPoint,d.endPoint]}},{key:"getArrowStyle",value:function(){return null}},{key:"getArrow",value:function(){var d=this.props.model,m=d.id,w=d.getArrowStyle(),M=w.refY,j=M===void 0?0:M,V=w.refX,Q=V===void 0?2:V,ne=Ej(this.getLastTwoPoints(),2),_e=ne[0],ke=ne[1],Ie="auto";return _e!==null&&ke!==null&&(Ie=Dp(Af({x:ke.x-_e.x,y:ke.y-_e.y,z:0}))),Object(We.g)("g",null,Object(We.g)("defs",null,Object(We.g)("marker",{id:"marker-start-".concat(m),refX:-Q,refY:j,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse"},this.getStartArrow()),Object(We.g)("marker",{id:"marker-end-".concat(m),refX:Q,refY:j,overflow:"visible",orient:Ie,markerUnits:"userSpaceOnUse"},this.getEndArrow())))}},{key:"getStartArrow",value:function(){var d=this.props.model.getArrowStyle();return d.stroke,d.strokeWidth,d.offset,d.verticalLength,Object(We.g)("path",null)}},{key:"getEndArrow",value:function(){var d=this.props.model.getArrowStyle(),m=d.stroke,w=d.strokeWidth,M=d.offset,j=d.verticalLength;return Object(We.g)("path",{stroke:m,fill:m,strokeWidth:w,transform:"rotate(180)",d:"M 0 0 L ".concat(M," -").concat(j," L ").concat(M," ").concat(j," Z")})}},{key:"getAdjustPointShape",value:function(d,m,w){var M=w.getAdjustPointStyle();return Object(We.g)(Uh,dm({className:"lf-edge-adjust-point"},M,{x:d,y:m}))}},{key:"getAdjustPoints",value:function(){var d=this.props,m=d.model,w=d.graphModel,M=m.getAdjustStart(),j=m.getAdjustEnd();return Object(We.g)("g",null,Object(We.g)(ax,dm({type:"SOURCE"},M,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:m,graphModel:w})),Object(We.g)(ax,dm({type:"TARGET"},j,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:m,graphModel:w})))}},{key:"getAnimation",value:function(){}},{key:"getAppendWidth",value:function(){return Object(We.g)("g",null)}},{key:"getAppend",value:function(){return Object(We.g)("g",{className:"lf-edge-append"},this.getAppendWidth())}},{key:"getEdge",value:function(){return null}},{key:"toFront",value:function(){var d=this.props,m=d.graphModel,w=d.model;m.toFront(w.id)}},{key:"render",value:function(){var d=this.props,m=d.model,w=m.isSelected,M=m.isHitable,j=m.isShowAdjustPoint;return d.graphModel.animation,Object(We.g)("g",null,Object(We.g)("g",{className:["lf-edge",!M&&"pointer-none",w&&"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()),j&&w?this.getAdjustPoints():"")}}])&&xj(o.prototype,l),h})(We.a);function W0(i){return W0=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},W0(i)}function Mj(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return sx(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return sx(l,u)}})(i,o)||(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 sx(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}var pm=function(i){var o={d:""};return Object.entries(i).forEach((function(l){var u=Mj(l,2),h=u[0],d=u[1],m=W0(d);h!=="style"&&m==="object"||(o[h]=d)})),Object(We.g)("path",o)};function G0(i){return G0=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},G0(i)}function z0(){return z0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},z0.apply(this,arguments)}function kj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Tj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function H0(i,o){return H0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},H0(i,o)}function Nj(i){var o=(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 l,u=Gy(i);if(o){var h=Gy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Pj(this,l)}}function Pj(i,o){if(o&&(G0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Gy(i){return Gy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Gy(i)}var X0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&H0(d,m)})(h,i);var o,l,u=Nj(h);function h(){return kj(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getEdge",value:function(){var d=this.props.model,m=d.startPoint,w=d.endPoint,M=d.isAnimation,j=d.arrowConfig,V=d.getEdgeStyle(),Q=d.getEdgeAnimationStyle(),ne=Q.strokeDasharray,_e=Q.stroke,ke=Q.strokeDashoffset,Ie=Q.animationName,ft=Q.animationDuration,dt=Q.animationIterationCount,Et=Q.animationTimingFunction,zt=Q.animationDirection;return Object(We.g)(Bh,z0({},V,{x1:m.x,y1:m.y,x2:w.x,y2:w.y},j,M?{strokeDasharray:ne,stroke:_e,style:{strokeDashoffset:ke,animationName:Ie,animationDuration:ft,animationIterationCount:dt,animationTimingFunction:Et,animationDirection:zt}}:{}))}},{key:"getAppendWidth",value:function(){var d=this.props.model,m=d.startPoint,w=d.endPoint,M=fi({start:m,end:w}),j=M.d,V=M.strokeWidth,Q=M.fill,ne=M.strokeDasharray,_e=M.stroke;return Object(We.g)(pm,{d:j,fill:Q,strokeWidth:V,stroke:_e,strokeDasharray:ne})}}])&&Tj(o.prototype,l),h})(fm);function q0(i){return q0=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},q0(i)}function Cj(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return ux(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ux(l,u)}})(i,o)||(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 ux(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}var Rj=function(i){var o={points:"",fill:"none"};return Object.entries(i).forEach((function(l){var u=Cj(l,2),h=u[0],d=u[1];(h==="style"||q0(d)!=="object")&&(o[h]=d)})),Object(We.g)("polyline",o)};function Y0(i){return Y0=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},Y0(i)}function cx(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function zy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?cx(Object(l),!0).forEach((function(u){wd(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):cx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function K0(){return K0=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},K0.apply(this,arguments)}function jj(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return dx(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return dx(l,u)}})(i,o)||(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 dx(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function Dj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Z0(i,o){return Z0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Z0(i,o)}function Ij(i){var o=(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 l,u=Hy(i);if(o){var h=Hy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Lj(this,l)}}function Lj(i,o){if(o&&(Y0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bd(i)}function bd(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Hy(i){return Hy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Hy(i)}function wd(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var J0=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&Z0(d,m)})(h,i);var o,l,u=Ij(h);function h(){var d;return(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,h),wd(bd(d=u.call(this)),"drag",void 0),wd(bd(d),"isDragging",void 0),wd(bd(d),"isShowAdjustPointTemp",void 0),wd(bd(d),"appendInfo",void 0),wd(bd(d),"onDragStart",(function(){var m=d.props.model;m.dragAppendStart(),d.isShowAdjustPointTemp=m.isShowAdjustPoint,m.isShowAdjustPoint=!1})),wd(bd(d),"onDragging",(function(m){var w=m.deltaX,M=m.deltaY,j=d.props,V=j.model,Q=j.graphModel;d.isDragging=!0;var ne=Q.transformModel,_e=Q.editConfigModel,ke=jj(ne.fixDeltaXY(w,M),2),Ie=ke[0],ft=ke[1],dt=V,Et=_e.adjustEdgeMiddle;d.appendInfo=Et?dt.dragAppendSimple(d.appendInfo,{x:Ie,y:ft}):dt.dragAppend(d.appendInfo,{x:Ie,y:ft})})),wd(bd(d),"onDragEnd",(function(){var m=d.props,w=m.model,M=m.graphModel.eventCenter,j=w;j.dragAppendEnd(),d.isDragging=!1,j.isShowAdjustPoint=d.isShowAdjustPointTemp,d.appendInfo=void 0,M.emit(Dn.EDGE_ADJUST,{data:j.getData()})})),wd(bd(d),"beforeDragStart",(function(m,w){w.dragAble&&d.drag.handleMouseDown(m),d.appendInfo=w})),d.drag=new ye({onDragStart:d.onDragStart,onDragging:d.onDragging,onDragEnd:d.onDragEnd,isStopPropagation:!1}),d}return o=h,(l=[{key:"getEdge",value:function(){var d=this.props.model,m=d.points,w=d.isAnimation,M=d.arrowConfig,j=d.getEdgeStyle(),V=d.getEdgeAnimationStyle(),Q=V.strokeDasharray,ne=V.stroke,_e=V.strokeDashoffset,ke=V.animationName,Ie=V.animationDuration,ft=V.animationIterationCount,dt=V.animationTimingFunction,Et=V.animationDirection;return Object(We.g)(Rj,K0({points:m},j,M,w?{strokeDasharray:Q,stroke:ne,style:{strokeDashoffset:_e,animationName:ke,animationDuration:Ie,animationIterationCount:ft,animationTimingFunction:dt,animationDirection:Et}}:{}))}},{key:"getArrowInfo",value:function(){var d=this.props.model,m=d.points,w=d.isSelected,M={start:null,end:null,hover:this.state.hover,isSelected:w},j=ir(m);return j.length>=2&&(M.start=j[j.length-2],M.end=j[j.length-1]),M}},{key:"getLastTwoPoints",value:function(){var d=this.props.model.points,m=ir(d);return m.length>=2?[m[m.length-2],m[m.length-1]]:[null,null]}},{key:"getAppendAttributes",value:function(d){var m,w=d.start,M=d.end;if(w.x===M.x&&w.y===M.y)m="";else{var j={start:w,end:M,offset:10,verticalLength:5},V=du(zy(zy({},j),{},{type:"start"})),Q=du(zy(zy({},j),{},{type:"end"}));m="M".concat(V.leftX," ").concat(V.leftY,`
|
||
L`).concat(V.rightX," ").concat(V.rightY,`
|
||
L`).concat(Q.rightX," ").concat(Q.rightY,`
|
||
L`).concat(Q.leftX," ").concat(Q.leftY," z")}return{d:m,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}},{key:"getAppendShape",value:function(d){var m=this.getAppendAttributes(d),w=m.d,M=m.strokeWidth,j=m.fill,V=m.strokeDasharray,Q=m.stroke;return Object(We.g)(pm,{d:w,fill:j,strokeWidth:M,stroke:Q,strokeDasharray:V})}},{key:"getAppendWidth",value:function(){for(var d=this,m=this.props,w=m.model,M=m.graphModel,j=w.pointsList,V=w.draggable,Q=[],ne=j.length,_e=function(Ie){var ft="lf-polyline-append",dt={start:{x:j[Ie].x,y:j[Ie].y},end:{x:j[Ie+1].x,y:j[Ie+1].y},startIndex:Ie,endIndex:Ie+1,direction:"",dragAble:!0},Et=Object(We.g)("g",{className:ft},d.getAppendShape(dt)),zt=M.editConfigModel,En=zt.adjustEdge,wn=zt.adjustEdgeMiddle;if(En&&V){var Yn=dt.startIndex,gn=dt.endIndex,Fn=wn&&(Yn===0||gn===ne-1);dt.dragAble=!Fn,dt.start.x===dt.end.x?(dt.dragAble&&(ft+="-ew-resize"),dt.direction=fo.VERTICAL):dt.start.y===dt.end.y&&(dt.dragAble&&(ft+="-ns-resize"),dt.direction=fo.HORIZONTAL),Et=Object(We.g)("g",{className:d.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(Mn){return d.beforeDragStart(Mn,dt)}},Object(We.g)("g",{className:ft},d.getAppendShape(dt)))}Q.push(Et)},ke=0;ke<ne-1;ke++)_e(ke);return Object(We.g)("g",null,Q)}}])&&Dj(o.prototype,l),h})(fm);function Q0(i){return Q0=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},Q0(i)}function $j(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return fx(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return fx(l,u)}})(i,o)||(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 fx(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function e1(){return e1=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(i[u]=l[u])}return i},e1.apply(this,arguments)}function Fj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Bj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function t1(i,o){return t1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},t1(i,o)}function Vj(i){var o=(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 l,u=Xy(i);if(o){var h=Xy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Uj(this,l)}}function Uj(i,o){if(o&&(Q0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function Xy(i){return Xy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Xy(i)}var n1=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&t1(d,m)})(h,i);var o,l,u=Vj(h);function h(){return Fj(this,h),u.apply(this,arguments)}return o=h,(l=[{key:"getEdge",value:function(){var d=this.props.model,m=d.getEdgeStyle(),w=d.path,M=d.isAnimation,j=d.arrowConfig,V=d.getEdgeAnimationStyle(),Q=V.strokeDasharray,ne=V.stroke,_e=V.strokeDashoffset,ke=V.animationName,Ie=V.animationDuration,ft=V.animationIterationCount,dt=V.animationTimingFunction,Et=V.animationDirection;return Object(We.g)(pm,e1({d:w},m,j,M?{strokeDasharray:Q,stroke:ne,style:{strokeDashoffset:_e,animationName:ke,animationDuration:Ie,animationIterationCount:ft,animationTimingFunction:dt,animationDirection:Et}}:{}))}},{key:"getAppendWidth",value:function(){var d=this.props.model.path;return Object(We.g)(pm,{d,strokeWidth:10,stroke:"transparent",fill:"none"})}},{key:"getArrowInfo",value:function(){var d=this.props.model,m=this.state.hover,w=d.isSelected,M=d.getArrowStyle().offset,j=d.pointsList.map((function(Q){return{x:Q.x,y:Q.y}})),V=$j(pi(j,M),2);return{start:V[0],end:V[1],hover:m,isSelected:w}}},{key:"getLastTwoPoints",value:function(){var d=this.props.model,m=d.getArrowStyle().offset,w=d.pointsList.map((function(M){return{x:M.x,y:M.y}}));return pi(w,m)}}])&&Bj(o.prototype,l),h})(fm);function r1(i){return r1=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},r1(i)}function px(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Wj(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Gj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function zj(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function o1(i,o){return o1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},o1(i,o)}function Hj(i){var o=(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 l,u=qy(i);if(o){var h=qy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Xj(this,l)}}function Xj(i,o){if(o&&(r1(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(i)}function qy(i){return qy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},qy(i)}var qj=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&o1(d,m)})(h,i);var o,l,u=Hj(h);function h(){return Gj(this,h),u.apply(this,arguments)}return o=h,l=[{key:"getArrowAttributes",value:function(){var d=this.props,m=d.arrowInfo,w=d.style,M=m.start,j=m.end,V={start:M,end:j,offset:w.offset,verticalLength:w.verticalLength,type:"end"},Q=du(V),ne=Q.leftX,_e=Q.leftY,ke=Q.rightX,Ie=Q.rightY;return(function(ft){for(var dt=1;dt<arguments.length;dt++){var Et=arguments[dt]!=null?arguments[dt]:{};dt%2?px(Object(Et),!0).forEach((function(zt){Wj(ft,zt,Et[zt])})):Object.getOwnPropertyDescriptors?Object.defineProperties(ft,Object.getOwnPropertyDescriptors(Et)):px(Object(Et)).forEach((function(zt){Object.defineProperty(ft,zt,Object.getOwnPropertyDescriptor(Et,zt))}))}return ft})({d:"M".concat(ne," ").concat(_e," L").concat(j.x," ").concat(j.y," L").concat(ke," ").concat(Ie," z")},w)}},{key:"getShape",value:function(){var d=this.getArrowAttributes(),m=d.d,w=d.strokeWidth,M=d.stroke,j=d.fill;return Object(We.g)(pm,{d:m,fill:j,strokeWidth:w,stroke:M})}},{key:"render",value:function(){return Object(We.g)("g",{className:"lf-arrow"},this.getShape())}}],l&&zj(o.prototype,l),h})(We.a),hx=function(i,o){return wt(i,o)},Yj=function(i){var o=i==null?0:i.length;return o?i[o-1]:void 0},i1=function(){return Tn.a.Date.now()},Kj=Math.max,Zj=Math.min,Jj=function(i,o,l){var u,h,d,m,w,M,j=0,V=!1,Q=!1,ne=!0;if(typeof i!="function")throw new TypeError("Expected a function");function _e(zt){var En=u,wn=h;return u=h=void 0,j=zt,m=i.apply(wn,En)}function ke(zt){return j=zt,w=setTimeout(ft,o),V?_e(zt):m}function Ie(zt){var En=zt-M;return M===void 0||En>=o||En<0||Q&&zt-j>=d}function ft(){var zt=i1();if(Ie(zt))return dt(zt);w=setTimeout(ft,(function(En){var wn=o-(En-M);return Q?Zj(wn,d-(En-j)):wn})(zt))}function dt(zt){return w=void 0,ne&&u?_e(zt):(u=h=void 0,m)}function Et(){var zt=i1(),En=Ie(zt);if(u=arguments,h=this,M=zt,En){if(w===void 0)return ke(M);if(Q)return clearTimeout(w),w=setTimeout(ft,o),_e(M)}return w===void 0&&(w=setTimeout(ft,o)),m}return o=zu(o)||0,Lr(l)&&(V=!!l.leading,d=(Q="maxWait"in l)?Kj(zu(l.maxWait)||0,o):d,ne="trailing"in l?!!l.trailing:ne),Et.cancel=function(){w!==void 0&&clearTimeout(w),j=0,u=M=h=w=void 0},Et.flush=function(){return w===void 0?m:dt(i1())},Et},Qj=r(172);function e8(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Rf(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var vx,mx,yx,t8=(function(){function i(u){(function(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")})(this,i),Rf(this,"undos",[]),Rf(this,"redos",[]),Rf(this,"callbacks",[]),Rf(this,"stopWatch",null),Rf(this,"curData",null),Rf(this,"maxSize",50),Rf(this,"waitTime",100),Rf(this,"eventCenter",void 0),this.eventCenter=u}var o,l;return o=i,(l=[{key:"add",value:function(u){hx(Yj(this.undos),u)||(this.undos.push(u),hx(this.curData,u)||(this.redos=[]),this.eventCenter.emit(Dn.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 u=this.undos.pop();this.redos.push(u);var h=this.undos.pop();return this.curData=no(h),h}}},{key:"redoAble",value:function(){return this.redos.length>0}},{key:"redo",value:function(){if(this.redoAble()){var u=this.redos.pop();return this.curData=no(u),u}}},{key:"watch",value:function(u){var h=this;this.stopWatch&&this.stopWatch(),this.undos.push(u.modelToGraphData()),this.stopWatch=Object(Qj.a)(u,Jj((function(){var d=u.modelToHistoryData();d&&h.add(d)}),this.waitTime))}}])&&e8(o.prototype,l),i})();function a1(i){return a1=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},a1(i)}function n8(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||(function(l,u){if(l){if(typeof l=="string")return gx(l,u);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return gx(l,u)}})(i,o)||(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 gx(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function _x(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function Up(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?_x(Object(l),!0).forEach((function(u){Wp(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):_x(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function bx(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function l1(i,o){return l1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},l1(i,o)}function r8(i){var o=(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 l,u=Yy(i);if(o){var h=Yy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return o8(this,l)}}function o8(i,o){if(o&&(a1(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qh(i)}function Qh(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Yy(i){return Yy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Yy(i)}function Wp(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var wx,Ex,Ox,s1=gu((yx=mx=(function(i){(function(m,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(w&&w.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),w&&l1(m,w)})(d,i);var o,l,u,h=r8(d);function d(){var m;return(function(w,M){if(!(w instanceof M))throw new TypeError("Cannot call a class as a function")})(this,d),Wp(Qh(m=h.call(this)),"ref",Object(We.f)()),Wp(Qh(m),"__prevText",{type:"",text:"",id:""}),Wp(Qh(m),"keyupHandler",(function(w){var M=m.props.graphModel.textEditElement;w.key==="Enter"&&w.altKey&&M.setElementState(0)})),Wp(Qh(m),"inputHandler",(function(w){var M=w.target.innerText,j=m.props.graphModel.textEditElement;m.__prevText={type:j.type,text:M.replace(/(\r\n)+$|(\n)+$/,""),id:j.id}})),Wp(Qh(m),"keydownHandler",(function(w){w.stopPropagation()})),m.state={style:{left:0,top:0}},m}return o=d,u=[{key:"getDerivedStateFromProps",value:function(m){var w,M=m.graphModel,j=M.transformModel,V=M.theme,Q=V.inputText,ne=M.textEditElement;if(ne){var _e;if((_e=ne.text)===null||_e===void 0||!_e.value)if(ne.BaseType===co.EDGE){var ke=(ne=ne).text,Ie=ne.textPosition,ft=Ie.x,dt=Ie.y;ke.x=ft,ke.y=dt,ne.setText(ke)}else ne=ne;var Et={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(ne.BaseType===co.EDGE){var zt=V.edgeText,En=zt.overflowMode,wn=zt.lineHeight,Yn=zt.wrapPadding,gn=zt.textWidth;gn&&En==="autoWrap"&&(w=Up(Up({},Et),{},{width:gn,minWidth:gn,lineHeight:wn,padding:Yn}))}else if(ne.BaseType===co.NODE){var Fn=V.nodeText,Mn=Fn.overflowMode,$r=Fn.lineHeight,Wr=Fn.wrapPadding,vr=Fn.textWidth,Jr=ne,_i=Jr.width,bi=Jr.modelType,Ma=Jr.textWidth||vr||_i;(bi!==Mr.TEXT_NODE&&Mn==="autoWrap"||bi===Mr.TEXT_NODE&&vr)&&(w=Up(Up({},Et),{},{width:Ma,minWidth:Ma,lineHeight:$r,padding:Wr}))}var ts=ne.text,ns=ts.x,rc=ts.y,Gp=n8(j.CanvasPointToHtmlPoint([ns,rc]),2);return{style:Up(Up({left:Gp[0],top:Gp[1]},w),Q)}}}}],(l=[{key:"componentDidUpdate",value:function(){var m=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var w=this.__prevText,M=w.text,j=w.id;m.updateText(j,M),m.eventCenter.emit(Dn.TEXT_UPDATE,Up({},this.__prevText)),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}}},{key:"placeCaretAtEnd",value:function(m){if(window.getSelection!==void 0&&document.createRange!==void 0){var w=document.createRange();w.selectNodeContents(m),w.collapse(!1);var M=window.getSelection();M.removeAllRanges(),M.addRange(w)}}},{key:"render",value:function(){var m,w=this.props.graphModel.textEditElement,M=this.state.style;return w?Object(We.g)("div",{contentEditable:!0,className:"lf-text-input",style:M,ref:this.ref,key:w.id,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler},(m=w.text)===null||m===void 0?void 0:m.value):null}}])&&bx(o.prototype,l),u&&bx(o,u),d})(We.a),Wp(mx,"toolName","textEdit"),vx=yx))||vx,i8=function(i){return i.modelType===Mr.LINE_EDGE?(function(o){var l=o.startPoint,u=o.endPoint,h=(l.x+u.x)/2,d=(l.y+u.y)/2,m=Math.abs(l.x-u.x)+10,w=Math.abs(l.y-u.y)+10;return{x:h-m/2,y:d-w/2,x1:h+m/2,y1:d+w/2}})(i):i.modelType===Mr.POLYLINE_EDGE?(function(o){var l=o.points,u=ir(l),h=pt(u,8),d=h.x,m=h.y,w=h.width,M=h.height;return{x:d-w/2,y:m-M/2,x1:d+w/2,y1:m+M/2}})(i):i.modelType===Mr.BEZIER_EDGE?(function(o){var l=o.path,u=go(l),h=pt(u,8),d=h.x,m=h.y,w=h.width,M=h.height;return{x:d-w/2,y:m-M/2,x1:d+w/2,y1:m+M/2}})(i):void 0};function u1(i){return u1=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},u1(i)}function xx(i,o){return(function(l){if(Array.isArray(l))return l})(i)||(function(l,u){var h=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(h!=null){var d,m,w=[],M=!0,j=!1;try{for(h=h.call(l);!(M=(d=h.next()).done)&&(w.push(d.value),!u||w.length!==u);M=!0);}catch(V){j=!0,m=V}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||Sx(i,o)||(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 a8(i){return(function(o){if(Array.isArray(o))return c1(o)})(i)||(function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(i)||Sx(i)||(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 Sx(i,o){if(i){if(typeof i=="string")return c1(i,o);var l=Object.prototype.toString.call(i).slice(8,-1);return l==="Object"&&i.constructor&&(l=i.constructor.name),l==="Map"||l==="Set"?Array.from(i):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?c1(i,o):void 0}}function c1(i,o){(o==null||o>i.length)&&(o=i.length);for(var l=0,u=new Array(o);l<o;l++)u[l]=i[l];return u}function l8(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function d1(i,o){return d1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},d1(i,o)}function s8(i){var o=(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 l,u=Ky(i);if(o){var h=Ky(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return u8(this,l)}}function u8(i,o){if(o&&(u1(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ev(i)}function ev(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ky(i){return Ky=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ky(i)}function tv(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var f1=gu((Ox=Ex=(function(i){(function(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),m&&d1(d,m)})(h,i);var o,l,u=s8(h);function h(d){var m;(function(V,Q){if(!(V instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,h),tv(ev(m=u.call(this)),"stepDrag",void 0),tv(ev(m),"handleMouseDown",(function(V){m.stepDrag.handleMouseDown(V)})),tv(ev(m),"handleWheelEvent",(function(V){var Q,ne;V.preventDefault();var _e=V.deltaX,ke=V.deltaY,Ie=V.clientX,ft=V.clientY,dt=V.ctrlKey,Et=new WheelEvent("wheel",{deltaX:_e,deltaY:ke,clientX:Ie,clientY:ft,ctrlKey:dt});(Q=m.props.logicFlow.container)===null||Q===void 0||(ne=Q.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||ne===void 0||ne.dispatchEvent(Et)})),tv(ev(m),"onDragging",(function(V){var Q=V.deltaX,ne=V.deltaY,_e=m.props.graphModel,ke=_e.getSelectElements(!0);_e.moveNodes(ke.nodes.map((function(Ie){return Ie.id})),Q,ne)})),tv(ev(m),"handleContextMenu",(function(V){V.preventDefault();var Q=m.props,ne=Q.graphModel,_e=Q.graphModel,ke=_e.eventCenter,Ie=_e.selectElements,ft=ne.getPointByClient({x:V.clientX,y:V.clientY}),dt={nodes:[],edges:[]};a8(Ie.values()).forEach((function(Et){Et.BaseType===co.NODE&&dt.nodes.push(Et.getData()),Et.BaseType===co.EDGE&&dt.edges.push(Et.getData())})),ke.emit(Dn.SELECTION_CONTEXTMENU,{data:dt,e:V,position:ft})}));var w=d.graphModel,M=w.gridSize,j=w.eventCenter;return m.stepDrag=new ye({onDragging:m.onDragging,step:M,eventType:"SELECTION",eventCenter:j}),m}return o=h,(l=[{key:"render",value:function(){var d=this.props.graphModel,m=d.selectElements,w=d.transformModel;if(!(m.size<=1)){var M=Number.MAX_SAFE_INTEGER,j=Number.MAX_SAFE_INTEGER,V=Number.MIN_SAFE_INTEGER,Q=Number.MIN_SAFE_INTEGER;m.forEach((function(Ie){var ft={x:0,y:0,x1:0,y1:0};Ie.BaseType===co.NODE&&(ft=(function(dt){var Et=dt.x,zt=dt.y,En=dt.width,wn=dt.height;return{x:Et-En/2,y:zt-wn/2,x1:Et+En/2,y1:zt+wn/2}})(Ie)),Ie.BaseType===co.EDGE&&(ft=i8(Ie)),M=Math.min(M,ft.x),j=Math.min(j,ft.y),V=Math.max(V,ft.x1),Q=Math.max(Q,ft.y1)}));var ne=xx(w.CanvasPointToHtmlPoint([M,j]),2);M=ne[0],j=ne[1];var _e=xx(w.CanvasPointToHtmlPoint([V,Q]),2);V=_e[0],Q=_e[1];var ke={left:"".concat(M-10,"px"),top:"".concat(j-10,"px"),width:"".concat(V-M+20,"px"),height:"".concat(Q-j+20,"px")};return Object(We.g)("div",{className:"lf-multiple-select",style:ke,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}}}])&&l8(o.prototype,l),h})(We.a),tv(Ex,"toolName","multipleSelect"),wx=Ox))||wx;function c8(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function Zy(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var d8=(function(){function i(u){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),Zy(this,"tools",void 0),Zy(this,"components",void 0),Zy(this,"toolMap",new Map),Zy(this,"instance",void 0),this.instance=u,this.isDisabledTool(s1.toolName)||this.registerTool(s1.toolName,s1),this.isDisabledTool(f1.toolName)||this.registerTool(f1.toolName,f1);var h=u.graphModel;h.eventCenter.on("".concat(Dn.GRAPH_TRANSFORM,",").concat(Dn.NODE_CLICK,",").concat(Dn.BLANK_CLICK," "),(function(){var d=h.textEditElement,m=h.editConfigModel,w=m.edgeTextEdit,M=m.nodeTextEdit;(w||M)&&d&&h.textEditElement.setElementState(Zr.DEFAULT)}))}var o,l;return o=i,(l=[{key:"isDisabledTool",value:function(u){return this.instance.options.disabledTools.indexOf(u)!==-1}},{key:"registerTool",value:function(u,h){this.toolMap.set(u,h)}},{key:"getTools",value:function(){return Array.from(this.toolMap.values())}},{key:"getInstance",value:function(){return this.instance}}])&&c8(o.prototype,l),i})(),f8=r(173),p8=r.n(f8);function h8(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function p1(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var Ax=(function(){function i(u){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),p1(this,"mousetrap",void 0),p1(this,"options",void 0),p1(this,"target",void 0),u.keyboard||(u.keyboard={enabled:!1}),this.options=u;var h=u.lf;this.target=h.container,this.mousetrap=new p8.a(this.target),u.keyboard.enabled&&!h.options.isSilentMode&&this.enable(!0)}var o,l;return o=i,(l=[{key:"initShortcuts",value:function(){var u=this,h=this.options.keyboard.shortcuts;if(h)if(lo(h))h.forEach((function(M){var j=M.keys,V=M.callback,Q=M.action;return u.on(j,V,Q)}));else{var d=h.keys,m=h.callback,w=h.action;this.on(d,m,w)}}},{key:"on",value:function(u,h,d){this.mousetrap.bind(this.getKeys(u),h,d)}},{key:"disabled",get:function(){return this.options.keyboard.enabled!==!0}},{key:"off",value:function(u,h){this.mousetrap.unbind(this.getKeys(u),h)}},{key:"enable",value:function(u){(this.disabled||u)&&(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(u){var h=this;return(Array.isArray(u)?u:[u]).map((function(d){return h.formatKey(d)}))}},{key:"formatKey",value:function(u){return u.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")}}])&&h8(o.prototype,l),i})(),v8=Ax,Ed=null;function Mx(i,o){return i.x+=o,i.y+=o,i.text&&(i.text.x+=o,i.text.y+=o),i}function kx(i,o){return i.startPoint&&(i.startPoint.x+=o,i.startPoint.y+=o),i.endPoint&&(i.endPoint.x+=o,i.endPoint.y+=o),i.pointsList&&i.pointsList.length>0&&i.pointsList.forEach((function(l){l.x+=o,l.y+=o})),i.text&&(i.text.x+=o,i.text.y+=o),i}var nv=40,h1=40;function v1(i){return v1=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},v1(i)}function Tx(i,o){var l=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter((function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable}))),l.push.apply(l,u)}return l}function hm(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?Tx(Object(l),!0).forEach((function(u){hi(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Tx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Nx(i,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function hi(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var m1=Symbol("plugin register by Logicflow.use"),y1=(function(){function i(h){var d,m,w=this;(function(M,j){if(!(M instanceof j))throw new TypeError("Cannot call a class as a function")})(this,i),hi(this,"container",void 0),hi(this,"width",void 0),hi(this,"height",void 0),hi(this,"graphModel",void 0),hi(this,"history",void 0),hi(this,"viewMap",new Map),hi(this,"tool",void 0),hi(this,"keyboard",void 0),hi(this,"dnd",void 0),hi(this,"options",void 0),hi(this,"snaplineModel",void 0),hi(this,"components",[]),hi(this,"plugins",void 0),hi(this,"extension",{}),hi(this,"adapterIn",void 0),hi(this,"adapterOut",void 0),hi(this,"getView",(function(M){return w.viewMap.get(M)})),h=A2(h),this.options=h,this.container=this.initContainer(h.container),this.plugins=h.plugins,this.graphModel=new wC(hm({},h)),this.tool=new d8(this),this.history=new t8(this.graphModel.eventCenter),this.dnd=new gR({lf:this}),this.keyboard=new v8({lf:this,keyboard:h.keyboard}),h.snapline!==!1&&(this.snaplineModel=new BO(this.graphModel),d=this.graphModel.eventCenter,m=this.snaplineModel,d.on("node:mousemove",(function(M){var j=M.data;m.setNodeSnapLine(j)})),d.on("node:mouseup",(function(){m.clearSnapline()}))),(function(M,j){var V=M.keyboard,Q=V.options.keyboard;V.on(["cmd + c","ctrl + c"],(function(){if(h1=nv,!Q.enabled||j.textEditElement)return!0;var ne=M.options.guards,_e=j.getSelectElements(!1);return ne&&ne.beforeClone&&!ne.beforeClone(_e)||_e.nodes.length===0&&_e.edges.length===0?(Ed=null,!0):((Ed=_e).nodes.forEach((function(ke){return Mx(ke,nv)})),Ed.edges.forEach((function(ke){return kx(ke,nv)})),!1)})),V.on(["cmd + v","ctrl + v"],(function(){if(!Q.enabled||j.textEditElement)return!0;if(Ed&&(Ed.nodes||Ed.edges)){M.clearSelectElements();var ne=M.addElements(Ed,h1);if(!ne)return!0;ne.nodes.forEach((function(_e){return M.selectElementById(_e.id,!0)})),ne.edges.forEach((function(_e){return M.selectElementById(_e.id,!0)})),Ed.nodes.forEach((function(_e){return Mx(_e,nv)})),Ed.edges.forEach((function(_e){return kx(_e,nv)})),h1+=nv}return!1})),V.on(["cmd + z","ctrl + z"],(function(){return!Q.enabled||!!j.textEditElement||(M.undo(),!1)})),V.on(["cmd + y","ctrl + y"],(function(){return!Q.enabled||!!j.textEditElement||(M.redo(),!1)})),V.on(["backspace"],(function(){if(!Q.enabled||j.textEditElement)return!0;var ne=j.getSelectElements(!0);return M.clearSelectElements(),ne.edges.forEach((function(_e){return M.deleteEdge(_e.id)})),ne.nodes.forEach((function(_e){return M.deleteNode(_e.id)})),!1}))})(this,this.graphModel),this.keyboard.initShortcuts(),this.defaultRegister(),this.installPlugins(h.disabledPlugins)}var o,l,u;return o=i,l=[{key:"register",value:function(h,d){var m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(typeof h=="string"){var w={BaseEdge:fm,BaseEdgeModel:xf,BaseNode:gd,BaseNodeModel:yd,RectNode:s0,RectNodeModel:Fb,CircleNode:f0,CircleNodeModel:bb,PolygonNode:y0,PolygonNodeModel:Db,TextNode:T0,TextNodeModel:Wb,LineEdge:X0,LineEdgeModel:Yu,DiamondNode:w0,DiamondNodeModel:Sb,PolylineEdge:J0,PolylineEdgeModel:Aa,BezierEdge:n1,BezierEdgeModel:hb,EllipseNode:A0,EllipseNodeModel:Tb,HtmlNode:R0,HtmlNodeModel:Hb,h:We.g,type:h};this.viewMap.forEach((function(ne){var _e=ne.extendKey;_e&&(w[_e]=ne)})),this.graphModel.modelMap.forEach((function(ne){var _e=ne.extendKey;_e&&(w[_e]=ne)}));var M=d(w),j=M.view,V=M.model,Q=j;m&&!Q.isObervered&&(Q.isObervered=!0,Q=sn(Q)),this.setView(h,Q),this.graphModel.setModel(h,V)}else this.registerElement(h)}},{key:"registerElement",value:function(h){var d=h.view;h.isObserverView===!1||d.isObervered||(d.isObervered=!0,d=sn(d)),this.setView(h.type,d),this.graphModel.setModel(h.type,h.model)}},{key:"batchRegister",value:function(){var h=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach((function(m){h.registerElement(m)}))}},{key:"defaultRegister",value:function(){this.registerElement({view:s0,model:Fb,type:"rect"}),this.registerElement({type:"circle",view:f0,model:bb}),this.registerElement({type:"polygon",view:y0,model:Db}),this.registerElement({type:"line",view:X0,model:Yu}),this.registerElement({type:"polyline",view:J0,model:Aa}),this.registerElement({type:"bezier",view:n1,model:hb}),this.registerElement({type:"text",view:T0,model:Wb}),this.registerElement({type:"ellipse",view:A0,model:Tb}),this.registerElement({type:"diamond",view:w0,model:Sb}),this.registerElement({type:"html",view:R0,model:Hb})}},{key:"selectElementById",value:function(h){var d=arguments.length>1&&arguments[1]!==void 0&&arguments[1],m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.graphModel.selectElementById(h,d),!d&&m&&this.graphModel.toFront(h)}},{key:"focusOn",value:function(h){var d=this.graphModel.transformModel,m=h.coordinate,w=h.id;if(!m){var M=this.getNodeModelById(w);M&&(m=M.getData());var j=this.getEdgeModelById(w);j&&(m=j.textPosition)}var V=m,Q=V.x,ne=V.y;d.focusOn(Q,ne,this.graphModel.width,this.graphModel.height)}},{key:"setTheme",value:function(h){this.graphModel.setTheme(h)}},{key:"resize",value:function(h,d){this.graphModel.resize(h,d),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height}},{key:"setDefaultEdgeType",value:function(h){this.graphModel.setDefaultEdgeType(h)}},{key:"updateText",value:function(h,d){this.graphModel.updateText(h,d)}},{key:"deleteElement",value:function(h){var d,m,w,M=this.getModelById(h);return!!M&&(m=(w=(hi(d={},co.NODE,this.deleteNode),hi(d,co.EDGE,this.deleteEdge),d)[M.BaseType])===null||w===void 0?void 0:w.call(this,h))!==null&&m!==void 0&&m}},{key:"getModelById",value:function(h){return this.graphModel.getElement(h)}},{key:"getDataById",value:function(h){var d;return(d=this.graphModel.getElement(h))===null||d===void 0?void 0:d.getData()}},{key:"changeNodeType",value:function(h,d){this.graphModel.changeNodeType(h,d)}},{key:"changeEdgeType",value:function(h,d){this.graphModel.changeEdgeType(h,d)}},{key:"getNodeEdges",value:function(h){return this.graphModel.getNodeEdges(h)}},{key:"addNode",value:function(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dn.NODE_ADD,m=arguments.length>2?arguments[2]:void 0;return this.graphModel.addNode(h,d,m)}},{key:"deleteNode",value:function(h){var d=this.graphModel.getNodeModelById(h);if(!d)return!1;var m=d.getData(),w=this.options.guards,M=!w||!w.beforeDelete||w.beforeDelete(m);return M&&this.graphModel.deleteNode(h),M}},{key:"cloneNode",value:function(h){var d=this.graphModel.getNodeModelById(h).getData(),m=this.options.guards;if(!m||!m.beforeClone||m.beforeClone(d))return this.graphModel.cloneNode(h)}},{key:"changeNodeId",value:function(h,d){return this.graphModel.changeNodeId(h,d)}},{key:"getNodeModelById",value:function(h){return this.graphModel.getNodeModelById(h)}},{key:"getNodeDataById",value:function(h){var d;return(d=this.graphModel.getNodeModelById(h))===null||d===void 0?void 0:d.getData()}},{key:"addEdge",value:function(h){return this.graphModel.addEdge(h)}},{key:"deleteEdge",value:function(h){var d=this.options.guards,m=this.graphModel.edgesMap[h];if(!m)return!1;var w=m.model.getData(),M=!d||!d.beforeDelete||d.beforeDelete(w);return M&&this.graphModel.deleteEdgeById(h),M}},{key:"deleteEdgeByNodeId",value:function(h){var d=h.sourceNodeId,m=h.targetNodeId;d&&m?this.graphModel.deleteEdgeBySourceAndTarget(d,m):d?this.graphModel.deleteEdgeBySource(d):m&&this.graphModel.deleteEdgeByTarget(m)}},{key:"changeEdgeId",value:function(h,d){return this.graphModel.changeEdgeId(h,d)}},{key:"getEdgeModelById",value:function(h){var d;return(d=this.graphModel.edgesMap[h])===null||d===void 0?void 0:d.model}},{key:"getEdgeModels",value:function(h){var d=this.graphModel.edges,m=h.sourceNodeId,w=h.targetNodeId;if(m&&w){var M=[];return d.forEach((function(Q){Q.sourceNodeId===m&&Q.targetNodeId===w&&M.push(Q)})),M}if(m){var j=[];return d.forEach((function(Q){Q.sourceNodeId===m&&j.push(Q)})),j}if(w){var V=[];return d.forEach((function(Q){Q.targetNodeId===w&&V.push(Q)})),V}return[]}},{key:"getEdgeDataById",value:function(h){var d;return(d=this.getEdgeModelById(h))===null||d===void 0?void 0:d.getData()}},{key:"getNodeIncomingEdge",value:function(h){return this.graphModel.getNodeIncomingEdge(h)}},{key:"getNodeOutgoingEdge",value:function(h){return this.graphModel.getNodeOutgoingEdge(h)}},{key:"getNodeIncomingNode",value:function(h){return this.graphModel.getNodeIncomingNode(h)}},{key:"getNodeOutgoingNode",value:function(h){return this.graphModel.getNodeOutgoingNode(h)}},{key:"editText",value:function(h){this.graphModel.editText(h)}},{key:"setProperties",value:function(h,d){var m;(m=this.graphModel.getElement(h))===null||m===void 0||m.setProperties(gi(d))}},{key:"deleteProperty",value:function(h,d){var m;(m=this.graphModel.getElement(h))===null||m===void 0||m.deleteProperty(d)}},{key:"getProperties",value:function(h){var d;return(d=this.graphModel.getElement(h))===null||d===void 0?void 0:d.getProperties()}},{key:"toFront",value:function(h){this.graphModel.toFront(h)}},{key:"setElementZIndex",value:function(h,d){return this.graphModel.setElementZIndex(h,d)}},{key:"addElements",value:function(h){for(var d=this,m=h.nodes,w=h.edges,M={},j={nodes:[],edges:[]},V=0;V<m.length;V++){var Q=m[V],ne=Q.id,_e=this.addNode(Q);if(!_e)return;ne&&(M[ne]=_e.id),j.nodes.push(_e)}return w.forEach((function(ke){var Ie=ke.sourceNodeId,ft=ke.targetNodeId;M[Ie]&&(Ie=M[Ie]),M[ft]&&(ft=M[ft]);var dt=d.graphModel.addEdge(hm(hm({},ke),{},{sourceNodeId:Ie,targetNodeId:ft}));j.edges.push(dt)})),j}},{key:"getAreaElement",value:function(h,d){var m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],w=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],M=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return this.graphModel.getAreaElement(h,d,m,w,M).map((function(j){return j.getData()}))}},{key:"getSelectElements",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this.graphModel.getSelectElements(h)}},{key:"clearSelectElements",value:function(){this.graphModel.clearSelectElements()}},{key:"getGraphData",value:function(){var h=this.graphModel.modelToGraphData();if(this.adapterOut){for(var d=arguments.length,m=new Array(d),w=0;w<d;w++)m[w]=arguments[w];return this.adapterOut.apply(this,[h].concat(m))}return h}},{key:"getGraphRawData",value:function(){return this.graphModel.modelToGraphData()}},{key:"clearData",value:function(){this.graphModel.clearData()}},{key:"updateEditConfig",value:function(h){var d=this.graphModel,m=d.editConfigModel,w=d.transformModel;m.updateEditConfig(h),(h==null?void 0:h.stopMoveGraph)!==void 0&&w.updateTranslateLimits(h.stopMoveGraph),h!=null&&h.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0)}},{key:"getEditConfig",value:function(){return this.graphModel.editConfigModel.getConfig()}},{key:"getPointByClient",value:function(h,d){return this.graphModel.getPointByClient({x:h,y:d})}},{key:"undo",value:function(){if(this.history.undoAble()){var h=gi(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(h)}}},{key:"redo",value:function(){if(this.history.redoAble()){var h=gi(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(h)}}},{key:"zoom",value:function(h,d){return this.graphModel.transformModel.zoom(h,d)}},{key:"resetZoom",value:function(){this.graphModel.transformModel.resetZoom()}},{key:"setZoomMiniSize",value:function(h){this.graphModel.transformModel.setZoomMiniSize(h)}},{key:"setZoomMaxSize",value:function(h){this.graphModel.transformModel.setZoomMaxSize(h)}},{key:"getTransform",value:function(){var h=this.graphModel.transformModel;return{SCALE_X:h.SCALE_X,SCALE_Y:h.SCALE_Y,TRANSLATE_X:h.TRANSLATE_X,TRANSLATE_Y:h.TRANSLATE_Y}}},{key:"translate",value:function(h,d){this.graphModel.transformModel.translate(h,d)}},{key:"resetTranslate",value:function(){var h=this.graphModel.transformModel,d=h.TRANSLATE_X,m=h.TRANSLATE_Y;this.translate(-d,-m)}},{key:"translateCenter",value:function(){this.graphModel.translateCenter()}},{key:"fitView",value:function(h,d){d===void 0&&(d=h),this.graphModel.fitView(h,d)}},{key:"openEdgeAnimation",value:function(h){this.graphModel.openEdgeAnimation(h)}},{key:"closeEdgeAnimation",value:function(h){this.graphModel.closeEdgeAnimation(h)}},{key:"on",value:function(h,d){this.graphModel.eventCenter.on(h,d)}},{key:"off",value:function(h,d){this.graphModel.eventCenter.off(h,d)}},{key:"once",value:function(h,d){this.graphModel.eventCenter.once(h,d)}},{key:"emit",value:function(h,d){this.graphModel.eventCenter.emit(h,d)}},{key:"initContainer",value:function(h){var d=document.createElement("div");return d.style.position="relative",d.style.width="100%",d.style.height="100%",h.innerHTML="",h.appendChild(d),d}},{key:"installPlugins",value:function(){var h,d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],w=(h=this.plugins)!==null&&h!==void 0?h:i.extensions;w.forEach((function(M){var j=null,V=null;M[m1]?(j=M.extension,V=M.props):j=M;var Q=j.pluginName||j.name;m.indexOf(Q)===-1&&d.installPlugin(j,V)}))}},{key:"installPlugin",value:function(h,d){if(v1(h)==="object"){var m=h.install,w=h.render;return m&&m.call(h,this,i),w&&this.components.push(w.bind(h)),void(this.extension[h.pluginName]=h)}var M=h,j=new M({lf:this,LogicFlow:i,options:this.options.pluginsOptions,props:d});j.render&&this.components.push(j.render.bind(j)),this.extension[M.pluginName]=j}},{key:"updateAttributes",value:function(h,d){this.graphModel.updateAttributes(h,d)}},{key:"createFakerNode",value:function(h){var d=this.graphModel.modelMap.get(h.type);if(d){var m=new d(hm(hm({},h),{},{virtual:!0}),this.graphModel);return this.graphModel.setFakerNode(m),m}}},{key:"removeFakerNode",value:function(){this.graphModel.removeFakerNode()}},{key:"setNodeSnapLine",value:function(h){this.snaplineModel&&this.snaplineModel.setNodeSnapLine(h)}},{key:"removeNodeSnapLine",value:function(){this.snaplineModel&&this.snaplineModel.clearSnapline()}},{key:"setView",value:function(h,d){this.viewMap.set(h,d)}},{key:"renderRawData",value:function(h){this.graphModel.graphDataToModel(gi(h)),this.options.history!==!1&&this.history.watch(this.graphModel),Object(We.j)(Object(We.g)(mR,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(Dn.GRAPH_RENDERED,this.graphModel.modelToGraphData())}},{key:"render",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.adapterIn&&(h=this.adapterIn(h)),this.renderRawData(h)}}],u=[{key:"use",value:function(h,d){var m,w,M=h.pluginName;M||(M=h.name);var j=(m=this.extensions.get(M))===null||m===void 0?void 0:m.extension;j&&j.destroy&&j.destroy(),this.extensions.set(M,(hi(w={},m1,m1),hi(w,"extension",h),hi(w,"props",d),w))}}],l&&Nx(o.prototype,l),u&&Nx(o,u),i})();function gu(i){return sn(i)}hi(y1,"extensions",new Map),a.default=y1}])}))})(og,og.exports)),og.exports}var hn=gV();const NT=bD(hn);var _V=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,function(n){var a=Math.random()*16|0,r=n==="x"?a:a&3|8;return r.toString(16)});return t},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),bV=(globalThis==null?void 0:globalThis._ids)||new _V;function Vv(){return bV.next()}var PT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})();(function(e){PT(t,e);function t(n,a){var r=this;return n.id||(n.id="Event_"+Vv()),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=e.call(this,n,a)||this,r}return t.prototype.setAttributes=function(){this.r=18},t.prototype.getConnectedTargetRules=function(){var n=e.prototype.getConnectedTargetRules.call(this),a={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(a),n},t.extendKey="StartEventModel",t})(hn.CircleNodeModel);(function(e){PT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="StartEventNode",t})(hn.CircleNode);var CT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Cg=function(){return Cg=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Cg.apply(this,arguments)};(function(e){CT(t,e);function t(n,a){var r=this;return n.id||(n.id="Event_"+Vv()),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=e.call(this,n,a)||this,r}return t.prototype.setAttributes=function(){this.r=18},t.prototype.getConnectedSourceRules=function(){var n=e.prototype.getConnectedSourceRules.call(this),a={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(a),n},t.extendKey="EndEventModel",t})(hn.CircleNodeModel);(function(e){CT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},t.prototype.getShape=function(){var n=this.props.model,a=n.getNodeStyle(),r=n.x,s=n.y,c=n.r,v=e.prototype.getShape.call(this);return hn.h("g",{},v,hn.h("circle",Cg(Cg({},a),{cx:r,cy:s,r:c-5})))},t.extendKey="EndEventView",t})(hn.CircleNode);var RT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Sm=function(){return Sm=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Sm.apply(this,arguments)};(function(e){RT(t,e);function t(n,a){var r=this;return n.id||(n.id="Gateway_"+Vv()),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=e.call(this,n,a)||this,r.points=[[25,0],[50,25],[25,50],[0,25]],r}return t.extendKey="ExclusiveGatewayModel",t})(hn.PolygonNodeModel);(function(e){RT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.points,f=n.getNodeStyle();return hn.h("g",{transform:"matrix(1 0 0 1 "+(a-s/2)+" "+(r-c/2)+")"},hn.h("polygon",Sm(Sm({},f),{x:a,y:r,points:v})),hn.h("path",Sm({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)))},t.extendKey="ExclusiveGatewayNode",t})(hn.PolygonNode);var jT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Rg=function(){return Rg=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Rg.apply(this,arguments)};(function(e){jT(t,e);function t(n,a){var r=this;return n.id||(n.id="Activity_"+Vv()),r=e.call(this,n,a)||this,r}return t.extendKey="UserTaskModel",t})(hn.RectNodeModel);(function(e){jT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.getNodeStyle();return hn.h("svg",{x:a-s/2+5,y:r-c/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},hn.h("path",{fill:v.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"}))},t.prototype.getShape=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.radius,f=n.getNodeStyle();return hn.h("g",{},[hn.h("rect",Rg(Rg({},f),{x:a-s/2,y:r-c/2,rx:v,ry:v,width:s,height:c})),this.getLabelShape()])},t.extendKey="UserTaskNode",t})(hn.RectNode);var DT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),_w=function(){return _w=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_w.apply(this,arguments)};(function(e){DT(t,e);function t(n,a){var r=this;return n.id||(n.id="Activity_"+Vv()),r=e.call(this,n,a)||this,r}return t.extendKey="ServiceTaskModel",t})(hn.RectNodeModel);(function(e){DT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.getNodeStyle();return hn.h("svg",{x:a-s/2+5,y:r-c/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},hn.h("path",{fill:v.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"}))},t.prototype.getShape=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.radius,f=n.getNodeStyle();return hn.h("g",{},[hn.h("rect",_w({x:a-s/2,y:r-c/2,rx:v,ry:v,width:s,height:c},f)),this.getLabelShape()])},t.extendKey="ServiceTaskNode",t})(hn.RectNode);var IT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})();(function(e){IT(t,e);function t(n,a){var r=this;return n.id||(n.id="Flow_"+Vv()),r=e.call(this,n,a)||this,r}return t.extendKey="SequenceFlowModel",t})(hn.PolylineEdgeModel);(function(e){IT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="SequenceFlowEdge",t})(hn.PolylineEdge);var hS={width:40,height:40},vS={width:40,height:40},mS={width:40,height:40},yS={width:100,height:80},gS={width:100,height:80},wV=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,function(n){var a=Math.random()*16|0,r=n==="x"?a:a&3|8;return r.toString(16)});return t},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),EV=(globalThis==null?void 0:globalThis._ids)||new wV;function _S(){return EV.next()}function LT(e){return Object.prototype.toString.call(e)}function OV(e){return" ".repeat(e)}function jg(e){var t=e;return LT(e)==="[object Object]"?(t={},Object.keys(e).forEach(function(n){var a=n;n.charAt(0)==="-"&&(a=n.substring(1)),t[a]=jg(e[n])})):Array.isArray(e)&&(t=[],e.forEach(function(n,a){t[a]=jg(n)})),t}function xV(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(jg(e)).replace(/"/g,"'")}return t}var rv=`
|
||
`;function vg(e,t,n){var a=OV(n),r="";if(t==="#text")return rv+a+e;if(t==="#cdata-section")return rv+a+"<![CDATA["+e+"]]>";if(t==="#comment")return rv+a+"<!--"+e+"-->";if((""+t).charAt(0)==="-")return" "+t.substring(1)+'="'+xV(e)+'"';if(Array.isArray(e))e.forEach(function(f){r+=vg(f,t,n+1)});else if(LT(e)==="[object Object]"){var s=Object.keys(e),c="",v="";r+=(n===0?"":rv+a)+"<"+t,s.forEach(function(f){f.charAt(0)==="-"?c+=vg(e[f],f,n+1):v+=vg(e[f],f,n+1)}),r+=c+(v!==""?">"+v+(rv+a)+"</"+t+">":" />")}else r+=rv+a+("<"+t+">"+e.toString()+"</"+t+">");return r}function SV(e){var t="";for(var n in e)t+=vg(e[n],n,0);return t}var hl=function(){};hl.ObjTree=function(){return this};hl.ObjTree.VERSION="0.23";hl.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;hl.ObjTree.prototype.attr_prefix="-";hl.ObjTree.prototype.parseXML=function(e){var t;if(window.DOMParser){var n=new DOMParser,a=n.parseFromString(e,"application/xml");if(!a)return;t=a.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(e),t=n.documentElement);if(t)return this.parseDOM(t)};hl.ObjTree.prototype.parseHTTP=function(e,t,n){var a={};for(var r in t)a[r]=t[r];if(a.method||(typeof a.postBody>"u"&&typeof a.postbody>"u"&&typeof a.parameters>"u"?a.method="get":a.method="post"),n){a.asynchronous=!0;var s=this,c=n,v=a.onComplete;a.onComplete=function(_){var b;_&&_.responseXML&&_.responseXML.documentElement&&(b=s.parseDOM(_.responseXML.documentElement)),c(b,_),v&&v(_)}}else a.asynchronous=!1;var f;if(typeof HTTP<"u"&&HTTP.Request){a.uri=e;var g=new HTTP.Request(a);g&&(f=g.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var g=new Ajax.Request(e,a);g&&(f=g.transport)}if(n)return f;if(f&&f.responseXML&&f.responseXML.documentElement)return this.parseDOM(f.responseXML.documentElement)};hl.ObjTree.prototype.parseDOM=function(e){if(e){if(this.__force_array={},this.force_array)for(var t=0;t<this.force_array.length;t++)this.__force_array[this.force_array[t]]=1;var n=this.parseElement(e);if(this.__force_array[e.nodeName]&&(n=[n]),e.nodeType!=11){var a={};a[e.nodeName]=n,n=a}return n}};hl.ObjTree.prototype.parseElement=function(e){if(e.nodeType!=7){if(e.nodeType==3||e.nodeType==4||e.nodeType==8){var t=e.nodeValue.match(/[^\x00-\x20]/);return t==null?void 0:e.nodeValue}var n=null,a={};if(e.attributes&&e.attributes.length){n={};for(var r=0;r<e.attributes.length;r++){var s=e.attributes[r].nodeName;if(typeof s=="string"){var c=e.attributes[r].nodeValue;try{c=JSON.parse(e.attributes[r].nodeValue.replace(/'/g,'"'))}catch{c=e.attributes[r].nodeValue}c&&(s=this.attr_prefix+s,typeof a[s]>"u"&&(a[s]=0),a[s]++,this.addNode(n,s,a[s],c))}}}if(e.childNodes&&e.childNodes.length){var v=!0;n&&(v=!1);for(var r=0;r<e.childNodes.length&&v;r++){var f=e.childNodes[r].nodeType;f==3||f==4||f==8||(v=!1)}if(v){n||(n="");for(var r=0;r<e.childNodes.length;r++)n+=e.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<e.childNodes.length;r++){var s=e.childNodes[r].nodeName;if(typeof s=="string"){var c=this.parseElement(e.childNodes[r]);c&&(typeof a[s]>"u"&&(a[s]=0),a[s]++,this.addNode(n,s,a[s],c))}}}}else n===null&&(n={});return n}};hl.ObjTree.prototype.addNode=function(e,t,n,a){this.__force_array[t]?(n==1&&(e[t]=[]),e[t][e[t].length]=a):n==1?e[t]=a:n==2?e[t]=[e[t],a]:e[t][e[t].length]=a};hl.ObjTree.prototype.writeXML=function(e){var t=this.hash_to_xml(null,e);return this.xmlDecl+t};hl.ObjTree.prototype.hash_to_xml=function(e,t){var n=[],a=[];for(var r in t)if(t.hasOwnProperty(r)){var s=t[r];r.charAt(0)!=this.attr_prefix?typeof s>"u"||s==null?n[n.length]="<"+r+" />":typeof s=="object"&&s.constructor==Array?n[n.length]=this.array_to_xml(r,s):typeof s=="object"?n[n.length]=this.hash_to_xml(r,s):n[n.length]=this.scalar_to_xml(r,s):a[a.length]=" "+r.substring(1)+'="'+this.xml_escape(s)+'"'}var c=a.join(""),v=n.join("");return typeof e>"u"||e==null||(n.length>0?v.match(/\n/)?v="<"+e+c+`>
|
||
`+v+"</"+e+`>
|
||
`:v="<"+e+c+">"+v+"</"+e+`>
|
||
`:v="<"+e+c+` />
|
||
`),v};hl.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],a=0;a<t.length;a++){var r=t[a];typeof r>"u"||r==null?n[n.length]="<"+e+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(e,r):typeof r=="object"?n[n.length]=this.hash_to_xml(e,r):n[n.length]=this.scalar_to_xml(e,r)}return n.join("")};hl.ObjTree.prototype.scalar_to_xml=function(e,t){return e=="#text"?this.xml_escape(t):"<"+e+">"+this.xml_escape(t)+"</"+e+`>
|
||
`};hl.ObjTree.prototype.xml_escape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var AV=function(e){return new hl.ObjTree().parseXML(e)},MV=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),bw=function(){return bw=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},bw.apply(this,arguments)},w_=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),r,s=[],c;try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(v){c={error:v}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return s},uc;(function(e){e.START="bpmn:startEvent",e.END="bpmn:endEvent",e.GATEWAY="bpmn:exclusiveGateway",e.USER="bpmn:userTask",e.SYSTEM="bpmn:serviceTask",e.FLOW="bpmn:sequenceFlow"})(uc||(uc={}));var $T=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],bS=["properties","startPoint","endPoint","pointsList"];function wS(e){var t=e?bS.concat(e):bS;return function(n){function a(r){var s={};return typeof r=="string"?r:Array.isArray(r)?r.map(function(c){return a(c)}):(Object.entries(r).forEach(function(c){var v=w_(c,2),f=v[0],g=v[1];typeof g!="object"?f.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(f)?s[f]=g:s["-"+f]=g:t.includes(f)?s["-"+f]=a(g):s[f]=a(g)}),s)}return a(n)}}function Dg(e){var t={};return Object.entries(e).forEach(function(n){var a=w_(n,2),r=a[0],s=a[1];r.indexOf("-")===0?t[r.substring(1)]=jg(s):typeof s=="string"?t[r]=s:Object.prototype.toString.call(s)==="[object Object]"?t[r]=Dg(s):Array.isArray(s)?t[r]=s.map(function(c){return Dg(c)}):t[r]=s}),t}function kV(e,t,n){var a=new Map;t.nodes.forEach(function(s){var c,v={"-id":s.id};if(!((c=s.text)===null||c===void 0)&&c.value&&(v["-name"]=s.text.value),s.properties){var f=wS(n)(s.properties);Object.assign(v,f)}a.set(s.id,v),e[s.type]?Array.isArray(e[s.type])?e[s.type].push(v):e[s.type]=[e[s.type],v]:e[s.type]=v});var r=t.edges.map(function(s){var c,v,f=a.get(s.targetNodeId);f["bpmn:incoming"]?Array.isArray(f["bpmn:incoming"])?f["bpmn:incoming"].push(s.id):f["bpmn:incoming"]=[f["bpmn:incoming"],s.id]:f["bpmn:incoming"]=s.id;var g={"-id":s.id,"-sourceRef":s.sourceNodeId,"-targetRef":s.targetNodeId};if(!((c=s.text)===null||c===void 0)&&c.value&&(g["-name"]=(v=s.text)===null||v===void 0?void 0:v.value),s.properties){var _=wS(n)(s.properties);Object.assign(g,_)}return g});t.edges.forEach(function(s){var c=a.get(s.sourceNodeId);c["bpmn:outgoing"]?Array.isArray(c["bpmn:outgoing"])?c["bpmn:outgoing"].push(s.id):c["bpmn:outgoing"]=[c["bpmn:outgoing"],s.id]:c["bpmn:outgoing"]=s.id}),e[uc.FLOW]=r}function TV(e,t){e["bpmndi:BPMNEdge"]=t.edges.map(function(n){var a,r=n.id,s=n.pointsList.map(function(v){var f=v.x,g=v.y;return{"-x":f,"-y":g}}),c={"-id":r+"_di","-bpmnElement":r,"di:waypoint":s};return!((a=n.text)===null||a===void 0)&&a.value&&(c["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}}),c}),e["bpmndi:BPMNShape"]=t.nodes.map(function(n){var a,r=n.id,s=100,c=80,v=n.x,f=n.y,g=Qf.shapeConfigMap.get(n.type);g&&(s=g.width,c=g.height),v-=s/2,f-=c/2;var _={"-id":r+"_di","-bpmnElement":r,"dc:Bounds":{"-x":v,"-y":f,"-width":s,"-height":c}};return!((a=n.text)===null||a===void 0)&&a.value&&(_["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}}),_})}function NV(e){var t=[],n=[],a=e["bpmn:definitions"];if(a){var r=a["bpmn:process"];Object.keys(r).forEach(function(s){if(s.indexOf("bpmn:")===0){var c=r[s];if(s===uc.FLOW){var v=a["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=CV(c,v)}else{var f=a["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];t=t.concat(PV(c,f,s))}}})}return{nodes:t,edges:n}}function PV(e,t,n){var a=[];if(Array.isArray(e))e.forEach(function(c){var v;Array.isArray(t)?v=t.find(function(g){return g["-bpmnElement"]===c["-id"]}):v=t;var f=ES(v,n,c);a.push(f)});else{var r=void 0;Array.isArray(t)?r=t.find(function(c){return c["-bpmnElement"]===e["-id"]}):r=t;var s=ES(r,n,e);a.push(s)}return a}function ES(e,t,n){var a=Number(e["dc:Bounds"]["-x"]),r=Number(e["dc:Bounds"]["-y"]),s=n["-name"],c=Qf.shapeConfigMap.get(t);c&&(a+=c.width/2,r+=c.height/2);var v;Object.entries(n).forEach(function(b){var x=w_(b,2),S=x[0],A=x[1];$T.indexOf(S)===-1&&(v||(v={}),v[S]=A)}),v&&(v=Dg(v));var f;if(s&&(f={x:a,y:r,value:s},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var g=e["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(g["-x"])+Number(g["-width"])/2,f.y=Number(g["-y"])+Number(g["-height"])/2}var _={id:e["-bpmnElement"],type:t,x:a,y:r,properties:v};return f&&(_.text=f),_}function CV(e,t){var n=[];if(Array.isArray(e))e.forEach(function(r){var s;Array.isArray(t)?s=t.find(function(c){return c["-bpmnElement"]===r["-id"]}):s=t,n.push(OS(s,r))});else{var a=void 0;Array.isArray(t)?a=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):a=t,n.push(OS(a,e))}return n}function OS(e,t){var n,a=t["-name"];if(a){var r=e["bpmndi:BPMNLabel"]["dc:Bounds"],s=0;a.split(`
|
||
`).forEach(function(f){s<f.length&&(s=f.length)}),n={value:a,x:Number(r["-x"])+s*10/2,y:Number(r["-y"])+7}}var c;Object.entries(t).forEach(function(f){var g=w_(f,2),_=g[0],b=g[1];$T.indexOf(_)===-1&&(c||(c={}),c[_]=b)}),c&&(c=Dg(c));var v={id:t["-id"],type:uc.FLOW,pointsList:e["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),sourceNodeId:t["-sourceRef"],targetNodeId:t["-targetRef"],properties:c};return n&&(v.text=n),v}var Qf=(function(){function e(t){var n=this,a=t.lf;this.adapterOut=function(r,s){var c=bw({},n.processAttributes);kV(c,r,s);var v={"-id":"BPMNPlane_1","-bpmnElement":c["-id"]};TV(v,r);var f=n.definitionAttributes;f["bpmn:process"]=c,f["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":v};var g={"bpmn:definitions":f};return g},this.adapterIn=function(r){if(r)return NV(r)},a.adapterIn=function(r){return n.adapterIn(r)},a.adapterOut=function(r,s){return n.adapterOut(r,s)},this.processAttributes={"-isExecutable":"true","-id":"Process_"+_S()},this.definitionAttributes={"-id":"Definitions_"+_S(),"-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 e.prototype.setCustomShape=function(t,n){e.shapeConfigMap.set(t,n)},e.pluginName="bpmn-adapter",e.shapeConfigMap=new Map,e})();Qf.shapeConfigMap.set(uc.START,{width:hS.width,height:hS.height});Qf.shapeConfigMap.set(uc.END,{width:vS.width,height:vS.height});Qf.shapeConfigMap.set(uc.GATEWAY,{width:mS.width,height:mS.height});Qf.shapeConfigMap.set(uc.SYSTEM,{width:yS.width,height:yS.height});Qf.shapeConfigMap.set(uc.USER,{width:gS.width,height:gS.height});(function(e){MV(t,e);function t(n){var a=e.call(this,n)||this;a.adapterXmlIn=function(s){var c=AV(s);return a.adapterIn(c)},a.adapterXmlOut=function(s,c){var v=a.adapterOut(s,c);return SV(v)};var r=n.lf;return r.adapterIn=a.adapterXmlIn,r.adapterOut=a.adapterXmlOut,a}return t.pluginName="bpmnXmlAdapter",t})(Qf);var RV=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,function(n){var a=Math.random()*16|0,r=n==="x"?a:a&3|8;return r.toString(16)});return t},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),jV=(globalThis==null?void 0:globalThis._ids)||new RV;function DV(){return jV.next()}hn.h("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"}),hn.h("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;"});hn.h("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);"});hn.h("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 SE,Pi,FT,Jp,xS,BT,VT,UT,AE,ww,Ew,WT={},Ig=[],IV=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E_=Array.isArray;function Ad(e,t){for(var n in t)e[n]=t[n];return e}function ME(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Am(e,t,n){var a,r,s,c={};for(s in t)s=="key"?a=t[s]:s=="ref"?r=t[s]:c[s]=t[s];if(arguments.length>2&&(c.children=arguments.length>3?SE.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)c[s]===void 0&&(c[s]=e.defaultProps[s]);return mg(e,c,a,r,null)}function mg(e,t,n,a,r){var s={type:e,props:t,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++FT,__i:-1,__u:0};return r==null&&Pi.vnode!=null&&Pi.vnode(s),s}function kE(e){return e.children}function gv(e,t){this.props=e,this.context=t}function Tv(e,t){if(t==null)return e.__?Tv(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Tv(e):null}function LV(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,a=[],r=[],s=Ad({},t);s.__v=t.__v+1,Pi.vnode&&Pi.vnode(s),XT(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,a,n??Tv(t),!!(32&t.__u),r),s.__v=t.__v,s.__.__k[s.__i]=s,BV(a,s,r),t.__e=t.__=null,s.__e!=n&>(s)}}function GT(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),GT(e)}function SS(e){(!e.__d&&(e.__d=!0)&&Jp.push(e)&&!Lg.__r++||xS!=Pi.debounceRendering)&&((xS=Pi.debounceRendering)||BT)(Lg)}function Lg(){for(var e,t=1;Jp.length;)Jp.length>t&&Jp.sort(VT),e=Jp.shift(),t=Jp.length,LV(e);Lg.__r=0}function zT(e,t,n,a,r,s,c,v,f,g,_){var b,x,S,A,E,T,I,R=a&&a.__k||Ig,U=t.length;for(f=$V(n,t,R,f,U),b=0;b<U;b++)(S=n.__k[b])!=null&&(x=S.__i!=-1&&R[S.__i]||WT,S.__i=b,T=XT(e,S,x,r,s,c,v,f,g,_),A=S.__e,S.ref&&x.ref!=S.ref&&(x.ref&&TE(x.ref,null,S),_.push(S.ref,S.__c||A,S)),E==null&&A!=null&&(E=A),(I=!!(4&S.__u))||x.__k===S.__k?f=HT(S,f,e,I):typeof S.type=="function"&&T!==void 0?f=T:A&&(f=A.nextSibling),S.__u&=-7);return n.__e=E,f}function $V(e,t,n,a,r){var s,c,v,f,g,_=n.length,b=_,x=0;for(e.__k=new Array(r),s=0;s<r;s++)(c=t[s])!=null&&typeof c!="boolean"&&typeof c!="function"?(typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?c=e.__k[s]=mg(null,c,null,null,null):E_(c)?c=e.__k[s]=mg(kE,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?c=e.__k[s]=mg(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):e.__k[s]=c,f=s+x,c.__=e,c.__b=e.__b+1,v=null,(g=c.__i=FV(c,n,f,b))!=-1&&(b--,(v=n[g])&&(v.__u|=2)),v==null||v.__v==null?(g==-1&&(r>_?x--:r<_&&x++),typeof c.type!="function"&&(c.__u|=4)):g!=f&&(g==f-1?x--:g==f+1?x++:(g>f?x--:x++,c.__u|=4))):e.__k[s]=null;if(b)for(s=0;s<_;s++)(v=n[s])!=null&&(2&v.__u)==0&&(v.__e==a&&(a=Tv(v)),YT(v,v));return a}function HT(e,t,n,a){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=HT(r[s],t,n,a));return t}e.__e!=t&&(a&&(t&&e.type&&!t.parentNode&&(t=Tv(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function FV(e,t,n,a){var r,s,c,v=e.key,f=e.type,g=t[n],_=g!=null&&(2&g.__u)==0;if(g===null&&v==null||_&&v==g.key&&f==g.type)return n;if(a>(_?1:0)){for(r=n-1,s=n+1;r>=0||s<t.length;)if((g=t[c=r>=0?r--:s++])!=null&&(2&g.__u)==0&&v==g.key&&f==g.type)return c}return-1}function AS(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||IV.test(t)?n:n+"px"}function ig(e,t,n,a,r){var s,c;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof a=="string"&&(e.style.cssText=a=""),a)for(t in a)n&&t in n||AS(e.style,t,"");if(n)for(t in n)a&&n[t]==a[t]||AS(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(UT,"$1")),c=t.toLowerCase(),t=c in e||t=="onFocusOut"||t=="onFocusIn"?c.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?a?n.u=a.u:(n.u=AE,e.addEventListener(t,s?Ew:ww,s)):e.removeEventListener(t,s?Ew:ww,s);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function MS(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=AE++;else if(t.t<n.u)return;return n(Pi.event?Pi.event(t):t)}}}function XT(e,t,n,a,r,s,c,v,f,g){var _,b,x,S,A,E,T,I,R,U,D,L,W,H,B,F=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(f=!!(32&n.__u),s=[v=t.__e=n.__e]),(_=Pi.__b)&&_(t);e:if(typeof F=="function")try{if(I=t.props,R="prototype"in F&&F.prototype.render,U=(_=F.contextType)&&a[_.__c],D=_?U?U.props.value:_.__:a,n.__c?T=(b=t.__c=n.__c).__=b.__E:(R?t.__c=b=new F(I,D):(t.__c=b=new gv(I,D),b.constructor=F,b.render=UV),U&&U.sub(b),b.state||(b.state={}),b.__n=a,x=b.__d=!0,b.__h=[],b._sb=[]),R&&b.__s==null&&(b.__s=b.state),R&&F.getDerivedStateFromProps!=null&&(b.__s==b.state&&(b.__s=Ad({},b.__s)),Ad(b.__s,F.getDerivedStateFromProps(I,b.__s))),S=b.props,A=b.state,b.__v=t,x)R&&F.getDerivedStateFromProps==null&&b.componentWillMount!=null&&b.componentWillMount(),R&&b.componentDidMount!=null&&b.__h.push(b.componentDidMount);else{if(R&&F.getDerivedStateFromProps==null&&I!==S&&b.componentWillReceiveProps!=null&&b.componentWillReceiveProps(I,D),t.__v==n.__v||!b.__e&&b.shouldComponentUpdate!=null&&b.shouldComponentUpdate(I,b.__s,D)===!1){t.__v!=n.__v&&(b.props=I,b.state=b.__s,b.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(q){q&&(q.__=t)}),Ig.push.apply(b.__h,b._sb),b._sb=[],b.__h.length&&c.push(b);break e}b.componentWillUpdate!=null&&b.componentWillUpdate(I,b.__s,D),R&&b.componentDidUpdate!=null&&b.__h.push(function(){b.componentDidUpdate(S,A,E)})}if(b.context=D,b.props=I,b.__P=e,b.__e=!1,L=Pi.__r,W=0,R)b.state=b.__s,b.__d=!1,L&&L(t),_=b.render(b.props,b.state,b.context),Ig.push.apply(b.__h,b._sb),b._sb=[];else do b.__d=!1,L&&L(t),_=b.render(b.props,b.state,b.context),b.state=b.__s;while(b.__d&&++W<25);b.state=b.__s,b.getChildContext!=null&&(a=Ad(Ad({},a),b.getChildContext())),R&&!x&&b.getSnapshotBeforeUpdate!=null&&(E=b.getSnapshotBeforeUpdate(S,A)),H=_!=null&&_.type===kE&&_.key==null?qT(_.props.children):_,v=zT(e,E_(H)?H:[H],t,n,a,r,s,c,v,f,g),b.base=t.__e,t.__u&=-161,b.__h.length&&c.push(b),T&&(b.__E=b.__=null)}catch(q){if(t.__v=null,f||s!=null)if(q.then){for(t.__u|=f?160:128;v&&v.nodeType==8&&v.nextSibling;)v=v.nextSibling;s[s.indexOf(v)]=null,t.__e=v}else{for(B=s.length;B--;)ME(s[B]);Ow(t)}else t.__e=n.__e,t.__k=n.__k,q.then||Ow(t);Pi.__e(q,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):v=t.__e=VV(n.__e,t,n,a,r,s,c,f,g);return(_=Pi.diffed)&&_(t),128&t.__u?void 0:v}function Ow(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ow))}function BV(e,t,n){for(var a=0;a<n.length;a++)TE(n[a],n[++a],n[++a]);Pi.__c&&Pi.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){Pi.__e(s,r.__v)}})}function qT(e){return typeof e!="object"||e==null||e.__b>0?e:E_(e)?e.map(qT):Ad({},e)}function VV(e,t,n,a,r,s,c,v,f){var g,_,b,x,S,A,E,T=n.props||WT,I=t.props,R=t.type;if(R=="svg"?r="http://www.w3.org/2000/svg":R=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(g=0;g<s.length;g++)if((S=s[g])&&"setAttribute"in S==!!R&&(R?S.localName==R:S.nodeType==3)){e=S,s[g]=null;break}}if(e==null){if(R==null)return document.createTextNode(I);e=document.createElementNS(r,R,I.is&&I),v&&(Pi.__m&&Pi.__m(t,s),v=!1),s=null}if(R==null)T===I||v&&e.data==I||(e.data=I);else{if(s=s&&SE.call(e.childNodes),!v&&s!=null)for(T={},g=0;g<e.attributes.length;g++)T[(S=e.attributes[g]).name]=S.value;for(g in T)S=T[g],g=="dangerouslySetInnerHTML"?b=S:g=="children"||g in I||g=="value"&&"defaultValue"in I||g=="checked"&&"defaultChecked"in I||ig(e,g,null,S,r);for(g in I)S=I[g],g=="children"?x=S:g=="dangerouslySetInnerHTML"?_=S:g=="value"?A=S:g=="checked"?E=S:v&&typeof S!="function"||T[g]===S||ig(e,g,S,T[g],r);if(_)v||b&&(_.__html==b.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(b&&(e.innerHTML=""),zT(t.type=="template"?e.content:e,E_(x)?x:[x],t,n,a,R=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,c,s?s[0]:n.__k&&Tv(n,0),v,f),s!=null)for(g=s.length;g--;)ME(s[g]);v||(g="value",R=="progress"&&A==null?e.removeAttribute("value"):A!=null&&(A!==e[g]||R=="progress"&&!A||R=="option"&&A!=T[g])&&ig(e,g,A,T[g],r),g="checked",E!=null&&E!=e[g]&&ig(e,g,E,T[g],r))}return e}function TE(e,t,n){try{if(typeof e=="function"){var a=typeof e.__u=="function";a&&e.__u(),a&&t==null||(e.__u=e(t))}else e.current=t}catch(r){Pi.__e(r,n)}}function YT(e,t,n){var a,r;if(Pi.unmount&&Pi.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||TE(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(s){Pi.__e(s,t)}a.base=a.__P=null}if(a=e.__k)for(r=0;r<a.length;r++)a[r]&&YT(a[r],t,n||typeof e.type!="function");n||ME(e.__e),e.__c=e.__=e.__e=void 0}function UV(e,t,n){return this.constructor(e,n)}SE=Ig.slice,Pi={__e:function(e,t,n,a){for(var r,s,c;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),c=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,a||{}),c=r.__d),c)return r.__E=r}catch(v){e=v}throw e}},FT=0,gv.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ad({},this.state),typeof e=="function"&&(e=e(Ad({},n),this.props)),e&&Ad(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),SS(this))},gv.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),SS(this))},gv.prototype.render=kE,Jp=[],BT=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,VT=function(e,t){return e.__v.__b-t.__v.__b},Lg.__r=0,UT=/(PointerCapture)$|Capture$/i,AE=0,ww=MS(!1),Ew=MS(!0);var Mm=function(){return Mm=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Mm.apply(this,arguments)};function NE(e){var t=e.x,n=e.y,a=e.width,r=e.height,s=e.radius,c=e.className,v=t-a/2,f=n-r/2,g=Mm(Mm({width:10,height:10,cx:0,cy:0,rx:s||0,ry:s||0,fill:"transparent",fillOpacity:1,strokeWidth:"1px",stroke:"#000",strokeOpacity:1,className:"lf-basic-shape "+c},e),{x:v,y:f});return hn.h("rect",Mm({},g))}NE.defaultProps={radius:0,stroke:"",strokeDasharray:"",className:""};var hv;(function(e){e.NODE="node",e.CIRCLE_NODE="circle-node",e.POLYGON_NODE="polygon-node",e.RECT_NODE="rect-node",e.HTML_NODE="html-node",e.TEXT_NODE="text-node",e.ELLIPSE_NODE="ellipse-node",e.DIAMOND_NODE="diamond-node",e.EDGE="edge",e.LINE_EDGE="line-edge",e.POLYLINE_EDGE="polyline-edge",e.BEZIER_EDGE="bezier-edge",e.GRAPH="graph"})(hv||(hv={}));var WV=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Qp=function(){return Qp=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Qp.apply(this,arguments)},GV=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),r,s=[],c;try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(v){c={error:v}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return s},zV=hn.LogicFlowUtil.StepDrag,HV=(function(e){WV(t,e);function t(n){var a=e.call(this)||this;return a.updatePosition=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel,f=v.x,g=v.y;a.nodeModel.x=f+s/2,a.nodeModel.y=g+c/2,a.nodeModel.moveText(s/2,c/2)},a.getResize=function(r){var s=r.index,c=r.deltaX,v=r.deltaY,f=r.width,g=r.height,_=r.PCTResizeInfo,b=r.pct,x=b===void 0?1:b,S=r.freezeWidth,A=S===void 0?!1:S,E=r.freezeHeight,T=E===void 0?!1:E,I={width:f,height:g,deltaX:c,deltaY:v};if(_){var R=4,U=0,D=0;switch(s){case 0:D=(c*-1-v)/R;break;case 1:D=(c-v)/R;break;case 2:D=(c+v)/R;break;case 3:D=(c*-1+v)/R;break}D!==0&&(U=Math.round(D/_.ResizeBasis.basisHeight*1e5)/1e3),_.ResizePCT.widthPCT=Math.max(Math.min(_.ResizePCT.widthPCT+U,_.ScaleLimit.maxScaleLimit),_.ScaleLimit.minScaleLimit),_.ResizePCT.hightPCT=Math.max(Math.min(_.ResizePCT.hightPCT+U,_.ScaleLimit.maxScaleLimit),_.ScaleLimit.minScaleLimit);var L=Math.round(_.ResizePCT.widthPCT*_.ResizeBasis.basisWidth/100),W=Math.round(_.ResizePCT.hightPCT*_.ResizeBasis.basisHeight/100);switch(s){case 0:c=f-L,v=g-W;break;case 1:c=L-f,v=g-W;break;case 2:c=L-f,v=W-g;break;case 3:c=f-L,v=W-g;break}return I.width=L,I.height=W,I.deltaX=c/x,I.deltaY=v/x,I}switch(s){case 0:I.width=A?f:f-c*x,I.height=T?g:g-v*x;break;case 1:I.width=A?f:f+c*x,I.height=T?g:g-v*x;break;case 2:I.width=A?f:f+c*x,I.height=T?g:g+v*x;break;case 3:I.width=A?f:f-c*x,I.height=T?g:g+v*x;break}return I},a.updateEdgePointByAnchors=function(){var r=a.nodeModel,s=r.id,c=r.anchors,v=a.getNodeEdges(s);v.sourceEdges.forEach(function(f){var g=c.find(function(_){return _.id===f.sourceAnchorId});f.updateStartPoint({x:g.x,y:g.y})}),v.targetEdges.forEach(function(f){var g=c.find(function(_){return _.id===f.targetAnchorId});f.updateEndPoint({x:g.x,y:g.y})})},a.updateRect=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel,f=v.id,g=v.x,_=v.y,b=v.width,x=v.height,S=v.radius,A=v.PCTResizeInfo,E=a.nodeModel,T=E.minWidth,I=E.minHeight,R=E.maxWidth,U=E.maxHeight,D=a.index,L=T===R,W=I===U,H=a.getResize({index:D,deltaX:s,deltaY:c,width:b,height:x,PCTResizeInfo:A,pct:1,freezeWidth:L,freezeHeight:W});if(H.width<T||H.width>R||H.height<I||H.height>U){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:L?0:H.deltaX,deltaY:W?0:H.deltaY}),a.nodeModel.width=H.width,a.nodeModel.height=H.height,a.nodeModel.setProperties({nodeSize:{width:H.width,height:H.height}}),a.getNodeEdges(f);var B={x:g,y:_,width:b,height:x,radius:S},F={x:a.nodeModel.x,y:a.nodeModel.y,width:a.nodeModel.width,height:a.nodeModel.height,radius:S};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:B,afterNode:F})},a.updateEllipse=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel,f=v.id,g=v.rx,_=v.ry,b=v.x,x=v.y,S=v.PCTResizeInfo,A=a.index,E=a.nodeModel,T=E.minWidth,I=E.minHeight,R=E.maxWidth,U=E.maxHeight,D=T===R,L=I===U,W=g,H=_,B=a.getResize({index:A,deltaX:s,deltaY:c,width:W,height:H,PCTResizeInfo:S,pct:1/2,freezeWidth:D,freezeHeight:L});if(B.width<T/2||B.width>R/2||B.height<I/2||B.height>U/2){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:D?0:B.deltaX,deltaY:L?0:B.deltaY}),a.nodeModel.rx=B.width,a.nodeModel.ry=B.height,a.nodeModel.setProperties({nodeSize:{rx:B.width,ry:B.height}}),a.getNodeEdges(f);var F={x:b,y:x},q={rx:B.width,ry:B.height,x:a.nodeModel.x,y:a.nodeModel.y};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:Qp(Qp({},F),{rx:g,ry:_}),afterNode:q})},a.updateDiamond=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel;v.id;var f=v.rx,g=v.ry,_=v.x,b=v.y,x=v.PCTResizeInfo,S=a.index,A=a.nodeModel,E=A.minWidth,T=A.minHeight,I=A.maxWidth,R=A.maxHeight,U=E===I,D=T===R,L=f,W=g,H=a.getResize({index:S,deltaX:s,deltaY:c,width:L,height:W,PCTResizeInfo:x,pct:1/2,freezeWidth:U,freezeHeight:D});if(H.width<E/2||H.width>I/2||H.height<T/2||H.height>R/2){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:U?0:H.deltaX,deltaY:D?0:H.deltaY}),a.nodeModel.rx=H.width,a.nodeModel.ry=H.height,a.nodeModel.setProperties({nodeSize:{rx:H.width,ry:H.height}});var B={x:_,y:b,rx:f,ry:g},F={rx:H.width,ry:H.height,x:a.nodeModel.x,y:a.nodeModel.y};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:B,afterNode:F})},a.eventEmit=function(r){var s=r.beforeNode,c=r.afterNode,v=a.nodeModel,f=v.id,g=v.modelType,_=v.type,b=Qp({id:f,modelType:g,type:_},s),x=Qp({id:f,modelType:g,type:_},c);a.graphModel.eventCenter.emit("node:resize",{oldNodeSize:b,newNodeSize:x})},a.onDragging=function(r){var s,c=r.deltaX,v=r.deltaY,f=a.graphModel.transformModel,g=a.nodeModel.modelType;s=GV(f.fixDeltaXY(c,v),2),c=s[0],v=s[1],g===hv.RECT_NODE||g===hv.HTML_NODE?a.updateRect({deltaX:c,deltaY:v}):g===hv.ELLIPSE_NODE?a.updateEllipse({deltaX:c,deltaY:v}):g===hv.DIAMOND_NODE&&a.updateDiamond({deltaX:c,deltaY:v})},a.onDragEnd=function(){var r=a.graphModel.gridSize,s=r===void 0?1:r,c=s*Math.round(a.nodeModel.x/s),v=s*Math.round(a.nodeModel.y/s);a.nodeModel.moveTo(c,v),a.updateEdgePointByAnchors()},a.index=n.index,a.nodeModel=n.model,a.graphModel=n.graphModel,a.state={},a.dragHandler=new zV({onDragging:a.onDragging,onDragEnd:a.onDragEnd,step:1}),a}return t.prototype.getNodeEdges=function(n){for(var a=this.graphModel,r=a.edges,s=[],c=[],v=0;v<r.length;v++){var f=r[v];f.sourceNodeId===n?s.push(f):r[v].targetNodeId===n&&c.push(f)}return{sourceEdges:s,targetEdges:c}},t.prototype.render=function(){var n=this.props,a=n.x,r=n.y,s=n.index,c=n.model,v=c.getControlPointStyle();return Am("g",{className:"lf-resize-control-"+s},Am(NE,Qp({className:"lf-node-control"},{x:a,y:r},v,{onMouseDown:this.dragHandler.handleMouseDown})))},t})(gv),XV=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),$g=function(){return $g=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$g.apply(this,arguments)},O_=(function(e){XV(t,e);function t(){var n=e.call(this)||this;return n.state={},n}return t.prototype.getResizeControl=function(){var n=this.props,a=n.model,r=n.graphModel,s=a.x,c=a.y,v=a.width,f=a.height,g={minX:s-v/2,minY:c-f/2,maxX:s+v/2,maxY:c+f/2},_=g.minX,b=g.minY,x=g.maxX,S=g.maxY,A=[{x:_,y:b},{x,y:b},{x,y:S},{x:_,y:S}];return A.map(function(E,T){return Am(HV,$g({index:T},E,{model:a,graphModel:r}))})},t.prototype.getGroupSolid=function(){var n=this.props.model,a=n.x,r=n.y,s=n.width,c=n.height,v=n.getResizeOutlineStyle();return Am(NE,$g({fill:"none"},v,{x:a,y:r,width:s,height:c}))},t.prototype.render=function(){return Am("g",{className:"lf-resize-control"},this.getGroupSolid(),this.getResizeControl())},t})(gv),KT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),qV=(function(e){KT(t,e);function t(n,a){var r=e.call(this,n,a)||this,s=r.properties.nodeSize;return s&&(r.width=s.width,r.height=s.height),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),a=this.graphModel.editConfigModel.isSilentMode;return a||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.resize=function(n,a){console.log(n,a)},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var a={widthPCT:100,hightPCT:100},r={basisWidth:this.width,basisHeight:this.height},s={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:a,ResizeBasis:r,ScaleLimit:s}}else delete this.PCTResizeInfo},t})(hn.RectNodeModel),YV=(function(e){KT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,a=n.model,r=n.graphModel;return hn.h(O_,{model:a,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,a=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return hn.h("g",null,this.getResizeShape(),a&&!r?this.getControlGroup():"")},t})(hn.RectNode),ZT={view:YV,model:qV},JT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})();(function(e){JT(t,e);function t(n,a){var r=e.call(this,n,a)||this,s=r.properties.nodeSize;return s&&(r.rx=s.rx,r.ry=s.ry),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),a=this.graphModel.editConfigModel.isSilentMode;return a||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{stroke:"#000000",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var a={widthPCT:100,hightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},s={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:a,ResizeBasis:r,ScaleLimit:s}}else delete this.PCTResizeInfo},t})(hn.EllipseNodeModel);(function(e){JT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,a=n.model,r=n.graphModel;return hn.h(O_,{model:a,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,a=n.model,r=n.graphModel.editConfigModel.isSilentMode;return hn.h("g",null,this.getResizeShape(),a.isSelected&&!r?this.getControlGroup():"")},t})(hn.EllipseNode);var xw=function(){return xw=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},xw.apply(this,arguments)};function KV(e){var t=e.fillOpacity,n=t===void 0?1:t,a=e.strokeWidth,r=a===void 0?1:a,s=e.strokeOpacity,c=s===void 0?1:s,v=e.fill,f=v===void 0?"transparent":v,g=e.stroke,_=g===void 0?"#000":g,b=e.points,x=e.className,S=x===void 0?"lf-basic-shape":x,A={fill:f,fillOpacity:n,strokeWidth:r,stroke:_,strokeOpacity:c,points:"",className:S};return A.points=b.map(function(E){return E.join(",")}).join(" "),hn.h("polygon",xw({},A))}var QT=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Sw=function(){return Sw=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Sw.apply(this,arguments)};(function(e){QT(t,e);function t(n,a){var r=e.call(this,n,a)||this,s=r.properties.nodeSize;return s&&(r.rx=s.rx,r.ry=s.ry),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),a=this.graphModel.editConfigModel.isSilentMode;return a||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{stroke:"#000000",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var a={widthPCT:100,hightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},s={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:a,ResizeBasis:r,ScaleLimit:s}}else delete this.PCTResizeInfo},t})(hn.DiamondNodeModel);(function(e){QT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,a=n.model,r=n.graphModel;return hn.h(O_,{model:a,graphModel:r})},t.prototype.getResizeShape=function(){var n=this.props.model,a=n.points,r=n.getNodeStyle();return hn.h("g",null,hn.h(KV,Sw({},r,{points:a})))},t.prototype.getShape=function(){var n=this.props,a=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return hn.h("g",null,this.getResizeShape(),a&&!r?this.getControlGroup():"")},t})(hn.DiamondNode);var eN=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),ZV=(function(e){eN(t,e);function t(n,a){var r=e.call(this,n,a)||this,s=r.properties.nodeSize;return s&&(r.width=s.width,r.height=s.height),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),a=this.graphModel.editConfigModel.isSilentMode;return a||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{stroke:"#000000",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var a={widthPCT:100,hightPCT:100},r={basisWidth:this.width,basisHeight:this.height},s={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:a,ResizeBasis:r,ScaleLimit:s}}else delete this.PCTResizeInfo},t})(hn.HtmlNodeModel),JV=(function(e){eN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,a=n.model,r=n.graphModel;return hn.h(O_,{model:a,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,a=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return hn.h("g",null,this.getResizeShape(),a&&!r?this.getControlGroup():"")},t})(hn.HtmlNode),tN={view:JV,model:ZV},nN=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Fg=function(){return Fg=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Fg.apply(this,arguments)},QV=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),r,s=[],c;try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(v){c={error:v}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return s},eU=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(QV(arguments[t]));return e},kS=500,TS=300,tU=-1e4;(function(e){nN(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.isGroup=!0,n.unfoldedWidth=kS,n.unfoldedHight=TS,n.childrenLastFoldStatus={},n}return t.prototype.initNodeData=function(n){var a=this;e.prototype.initNodeData.call(this,n);var r=[];Array.isArray(n.children)&&(r=n.children),this.children=new Set(r),this.width=kS,this.height=TS,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=tU,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(){a.isFolded&&a.foldGroup(a.isFolded)})},t.prototype.getResizeOutlineStyle=function(){var n=e.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},t.prototype.foldGroup=function(n){var a=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.unfoldedHight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var r=this.incoming.edges.concat(this.outgoing.edges);this.children.forEach(function(s){var c=a.graphModel.getElement(s),v=c.isFolded;if(c.isGroup&&!c.isFolded&&c.foldGroup(n),c.isGroup&&!n){var f=a.childrenLastFoldStatus[s];f!==void 0&&f!==c.isFolded&&c.foldGroup(f)}a.childrenLastFoldStatus[s]=v,c.visible=!n,r=r.concat(c.incoming.edges.concat(c.outgoing.edges))}),this.foldEdge(n,r)}},t.prototype.getAnchorStyle=function(n){var a=e.prototype.getAnchorStyle.call(this,n);return a.stroke="transparent",a.fill="transparent",a.hover.fill="transparent",a.hover.stroke="transparent",a},t.prototype.foldEdge=function(n,a){var r=this;a.forEach(function(s,c){var v=s.id,f=s.sourceNodeId,g=s.targetNodeId,_=s.startPoint,b=s.endPoint,x=s.type,S=s.text,A=s.getProperties(),E={id:v+"__"+c,sourceNodeId:f,targetNodeId:g,startPoint:_,endPoint:b,type:x,properties:A,text:S==null?void 0:S.value};s.virtual&&r.graphModel.deleteEdgeById(s.id);var T=r.graphModel.group.getNodeGroup(g);T||(T=r.graphModel.getNodeModelById(g));var I=r.graphModel.group.getNodeGroup(f);I||(I=r.graphModel.getNodeModelById(f)),n&&s.visible!==!1&&(r.children.has(f)||r.id===f?(E.startPoint=void 0,E.sourceNodeId=r.id):(E.endPoint=void 0,E.targetNodeId=r.id),(T.id!==r.id||I.id!==r.id)&&r.createVirtualEdge(E),s.visible=!1),!n&&s.visible===!1&&(T&&T.isGroup&&T.isFolded?(E.targetNodeId=T.id,E.endPoint=void 0,r.createVirtualEdge(E)):I&&I.isGroup&&I.isFolded?(E.sourceNodeId=I.id,E.startPoint=void 0,r.createVirtualEdge(E)):s.visible=!0)})},t.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var a=this.graphModel.addEdge(n);a.virtual=!0,a.text.editable=!1,a.isFoldedEdge=!0},t.prototype.isInRange=function(n){var a=n.x1,r=n.y1,s=n.x2,c=n.y2;return a>=this.x-this.width/2&&s<=this.x+this.width/2&&r>=this.y-this.height/2&&c<=this.y+this.height/2},t.prototype.isAllowMoveTo=function(n){var a=n.x1,r=n.y1,s=n.x2,c=n.y2;return{x:a>=this.x-this.width/2&&s<=this.x+this.width/2,y:r>=this.y-this.height/2&&c<=this.y+this.height/2}},t.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},t.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},t.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},t.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},t.prototype.getData=function(){var n=this,a=e.prototype.getData.call(this);a.children=[],this.children.forEach(function(s){var c=n.graphModel.getNodeModelById(s);c&&!c.virtual&&a.children.push(s)});var r=a.properties;return delete r.groupAddable,delete r.isFolded,a},t.prototype.getHistoryData=function(){var n=e.prototype.getData.call(this);n.children=eU(this.children),n.isGroup=!0;var a=n.properties;return delete a.groupAddable,a.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHight/2-this.foldedHeight/2),n},t.prototype.isAllowAppendIn=function(n){return!0},t.prototype.toBack=function(){this.zIndex--},t})(ZT.model);(function(e){nN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props.model,a=n.resizable,r=n.properties;return a&&!r.isFolded?e.prototype.getControlGroup.call(this):null},t.prototype.getAddableShape=function(){var n=this.props.model,a=n.width,r=n.height,s=n.x,c=n.y,v=n.radius,f=n.properties;if(!f.groupAddable)return null;var g=this.props.model.getNodeStyle().strokeWidth,_=this.props.model.getAddableOutlineStyle(),b=a+g+8,x=r+g+8;return hn.h("rect",Fg(Fg({},_),{width:b,height:x,x:s-b/2,y:c-x/2,rx:v,ry:v}))},t.prototype.getFoldIcon=function(){var n=this.props.model,a=n.x-n.width/2+5,r=n.y-n.height/2+5;if(!n.foldable)return null;var s=hn.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M "+(a+3)+","+(r+6)+" "+(a+11)+","+(r+6)+" M"+(a+7)+","+(r+2)+" "+(a+7)+","+(r+10):"M "+(a+3)+","+(r+6)+" "+(a+11)+","+(r+6)+" "});return hn.h("g",{},[hn.h("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)}}),s])},t.prototype.getResizeShape=function(){return hn.h("g",{},[this.getAddableShape(),e.prototype.getResizeShape.call(this),this.getFoldIcon()])},t})(ZT.view);var NS=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),km=function(){return km=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},km.apply(this,arguments)};function nU(e){var t=(function(a){NS(r,a);function r(s,c){var v=this;s.id||(s.id="Flow_"+DV());var f=km(km(km({},{}),s.properties),{isDefaultFlow:!1});return s.properties=f,v=a.call(this,s,c)||this,v}return r.extendKey="SequenceFlowModel",r})(hn.PolylineEdgeModel),n=(function(a){NS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.getStartArrow=function(){var s=this.props.model,c=s.properties.isDefaultFlow;return c?hn.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):hn.h("path",{d:""})},r.extendKey="SequenceFlowEdge",r})(hn.PolylineEdge);return{type:"bpmn:sequenceFlow",view:n,model:t}}nU();var PS={width:40,height:40},CS={width:40,height:40},RS={width:100,height:80},Bg={width:100,height:80},jS={width:100,height:80},DS={width:100,height:80},IS={width:100,height:80},LS={width:100,height:80},$S={width:100,height:80},FS={width:100,height:80},vl=function(){};vl.ObjTree=function(){return this};vl.ObjTree.VERSION="0.23";vl.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;vl.ObjTree.prototype.attr_prefix="-";vl.ObjTree.prototype.parseXML=function(e){var t;if(window.DOMParser){var n=new DOMParser,a=n.parseFromString(e,"application/xml");if(!a)return;t=a.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(e),t=n.documentElement);if(t){var r=this.parseDOM(t);return r}};vl.ObjTree.prototype.parseHTTP=function(e,t,n){var a={};for(var r in t)a[r]=t[r];if(a.method||(typeof a.postBody>"u"&&typeof a.postbody>"u"&&typeof a.parameters>"u"?a.method="get":a.method="post"),n){a.asynchronous=!0;var s=this,c=n,v=a.onComplete;a.onComplete=function(_){var b;_&&_.responseXML&&_.responseXML.documentElement&&(b=s.parseDOM(_.responseXML.documentElement)),c(b,_),v&&v(_)}}else a.asynchronous=!1;var f;if(typeof HTTP<"u"&&HTTP.Request){a.uri=e;var g=new HTTP.Request(a);g&&(f=g.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var g=new Ajax.Request(e,a);g&&(f=g.transport)}if(n)return f;if(f&&f.responseXML&&f.responseXML.documentElement)return this.parseDOM(f.responseXML.documentElement)};vl.ObjTree.prototype.parseDOM=function(e){if(e){if(this.__force_array={},this.force_array)for(var t=0;t<this.force_array.length;t++)this.__force_array[this.force_array[t]]=1;var n=this.parseElement(e);if(this.__force_array[e.nodeName]&&(n=[n]),e.nodeType!==11){var a={};a[e.nodeName]=n,n=a}return n}};vl.ObjTree.prototype.parseElement=function(e){if(e.nodeType!==7){if(e.nodeType===3||e.nodeType===4||e.nodeType===8){var t=e.nodeValue.match(/[^\x00-\x20]/);return t==null?void 0:e.nodeValue}var n=null,a={};if(e.attributes&&e.attributes.length){n={};for(var r=0;r<e.attributes.length;r++){var s=e.attributes[r].nodeName;if(typeof s=="string"){var c=e.attributes[r].nodeValue;try{c=JSON.parse(e.attributes[r].nodeValue.replace(/'/g,'"'))}catch{c=e.attributes[r].nodeValue}c!=null&&(s=this.attr_prefix+s,typeof a[s]>"u"&&(a[s]=0),a[s]++,this.addNode(n,s,a[s],c))}}}if(e.childNodes&&e.childNodes.length){var v=!0;n&&(v=!1);for(var r=0;r<e.childNodes.length&&v;r++){var f=e.childNodes[r].nodeType;f===3||f===4||f===8||(v=!1)}if(v){n||(n="");for(var r=0;r<e.childNodes.length;r++)n+=e.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<e.childNodes.length;r++){var s=e.childNodes[r].nodeName;if(typeof s=="string"){var c=this.parseElement(e.childNodes[r]);c&&(typeof a[s]>"u"&&(a[s]=0),a[s]++,this.addNode(n,s,a[s],c))}}}}else n===null&&(n={});return n}};vl.ObjTree.prototype.addNode=function(e,t,n,a){this.__force_array[t]?(n===1&&(e[t]=[]),e[t][e[t].length]=a):n===1?e[t]=a:n===2?e[t]=[e[t],a]:e[t][e[t].length]=a};vl.ObjTree.prototype.writeXML=function(e){var t=this.hash_to_xml(null,e);return this.xmlDecl+t};vl.ObjTree.prototype.hash_to_xml=function(e,t){var n=[],a=[];for(var r in t)if(t!=null&&t.hasOwnProperty(r)){var s=t[r];r.charAt(0)!==this.attr_prefix?typeof s>"u"||s==null?n[n.length]="<"+r+" />":typeof s=="object"&&s.constructor===Array?n[n.length]=this.array_to_xml(r,s):typeof s=="object"?n[n.length]=this.hash_to_xml(r,s):n[n.length]=this.scalar_to_xml(r,s):a[a.length]=" "+r.substring(1)+'="'+this.xml_escape(s)+'"'}var c=a.join(""),v=n.join("");return typeof e>"u"||e==null||(n.length>0?v.match(/\n/)?v="<"+e+c+`>
|
||
`+v+"</"+e+`>
|
||
`:v="<"+e+c+">"+v+"</"+e+`>
|
||
`:v="<"+e+c+` />
|
||
`),v};vl.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],a=0;a<t.length;a++){var r=t[a];typeof r>"u"||r==null?n[n.length]="<"+e+" />":typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(e,r):typeof r=="object"?n[n.length]=this.hash_to_xml(e,r):n[n.length]=this.scalar_to_xml(e,r)}return n.join("")};vl.ObjTree.prototype.scalar_to_xml=function(e,t){return e==="#text"?this.xml_escape(t):"<"+e+">"+this.xml_escape(t)+"</"+e+`>
|
||
`};vl.ObjTree.prototype.xml_escape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var rU=function(e){return new vl.ObjTree().parseXML(e)};function rN(e){return Object.prototype.toString.call(e)}function BS(e){return" ".repeat(e)}function Vg(e){return rN(e)==="[object Object]"?Object.keys(e).reduce(function(t,n){var a=n;return n.charAt(0)==="-"&&(a=n.substring(1)),t[a]=Vg(e[n]),t},{}):Array.isArray(e)?e.map(function(t){return Vg(t)}):e}function oU(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(Vg(e)).replace(/"/g,"'")}return t}var VS=`
|
||
`;function yg(e,t,n){var a=BS(n),r="",s=VS+a;if(t==="-json")return"";if(t==="#text")return s+e;if(t==="#cdata-section")return s+"<![CDATA["+e+"]]>";if(t==="#comment")return s+"<!--"+e+"-->";if((""+t).charAt(0)==="-")return" "+t.substring(1)+'="'+oU(e)+'"';if(Array.isArray(e))r+=e.map(function(g){return yg(g,t,n+1)}).join("");else if(rN(e)==="[object Object]"){var c=Object.keys(e),v="",f=e["-json"]?VS+BS(n+1)+e["-json"]:"";r+=(n===0?"":s)+"<"+t,c.forEach(function(g){g.charAt(0)==="-"?v+=yg(e[g],g,n+1):f+=yg(e[g],g,n+1)}),r+=v+(f!==""?">"+f+s+"</"+t+">":" />")}else r+=s+"<"+t+">"+e.toString()+"</"+t+">";return r}function iU(e){var t="";for(var n in e)t+=yg(e[n],n,0);return t}var aU=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),Aw=function(){return Aw=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Aw.apply(this,arguments)},US=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n},PE=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],a=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Uv=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),r,s=[],c;try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(v){c={error:v}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return s},_v=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Uv(arguments[t]));return e},fl;(function(e){e.START="bpmn:startEvent",e.END="bpmn:endEvent",e.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",e.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",e.BOUNDARY="bpmn:boundaryEvent",e.PARALLEL_GATEWAY="bpmn:parallelGateway",e.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",e.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",e.USER="bpmn:userTask",e.SYSTEM="bpmn:serviceTask",e.FLOW="bpmn:sequenceFlow",e.SUBPROCESS="bpmn:subProcess"})(fl||(fl={}));var oN=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],lU=["properties","startPoint","endPoint","pointsList"],Ug={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},iN=function(e,t){var n=Object.keys(t||{});return n.forEach(function(a){if(e[a]){var r=t[a],s=r.in,c=r.out;s&&(e[a].in=s),c&&(e[a].out=c)}else e[a]=t[a]}),e},Rs={"bpmn:startEvent":{out:function(e){var t,n,a=e.properties;return((n=(t=Rs[a.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:intermediateCatchEvent":{out:function(e){var t,n,a=e.properties;return((n=(t=Rs[a.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:intermediateThrowEvent":{out:function(e){var t,n,a=e.properties;return((n=(t=Rs[a.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:boundaryEvent":{out:function(e){var t,n,a=e.properties;return((n=(t=Rs[a.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:sequenceFlow":{out:function(e){var t=e.properties,n=t.expressionType,a=t.condition;return a?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'+a+"}]]></bpmn:conditionExpression>"}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'+a+"</bpmn:conditionExpression>"}:{json:""}}},"bpmn:timerEventDefinition":{out:function(e){var t=e.properties,n=t.timerType,a=t.timerValue,r=t.definitionId,s=function(){return"<bpmn:"+n+' xsi:type="bpmn:tFormalExpression">'+a+"</bpmn:"+n+">"};return{json:'<bpmn:timerEventDefinition id="'+r+'"'+(n&&a?">"+s()+"</bpmn:timerEventDefinition>":"/>")}},in:function(e,t){var n,a,r,s,c=e,v=t["-id"],f="",g="";try{for(var _=PE(Object.keys(t)),b=_.next();!b.done;b=_.next()){var x=b.value;x.includes("bpmn:")&&(r=Uv(x.split(":"),2),f=r[1],g=(s=t[x])===null||s===void 0?void 0:s["#text"])}}catch(S){n={error:S}}finally{try{b&&!b.done&&(a=_.return)&&a.call(_)}finally{if(n)throw n.error}}return{"-definitionId":v,"-definitionType":c,"-timerType":f,"-timerValue":g}}},"bpmn:conditionExpression":{in:function(e,t){var n,a="",r="";return t["#cdata-section"]?(r="cdata",a=((n=/^\$\{(.*)\}$/g.exec(t["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):t["#text"]&&(r="normal",a=t["#text"]),{"-condition":a,"-expressionType":r}}}};function sU(e){var t=e??{},n=t.retainedAttrsFields,a=t.excludeFields,r=t.transformer,s=new Set(_v(lU,n||[])),c={in:new Set(_v(Ug.in,(a==null?void 0:a.in)||[])),out:new Set(_v(Ug.out,(a==null?void 0:a.out)||[]))};return Rs=iN(Rs,r),function(v){var f=v.nodes,g=v.edges;function _(b,x){var S,A,E;if((b==null?void 0:b.flag)!==1){var T;if((T=Rs[b.type])&&T.out){var I=T.out(b),R=Object.keys(I);R.length>0&&R.forEach(function(q){b[q]=I[q]})}b!=null&&b.children&&(b.children=b.children.map(function(q){var K=f.find(function(X){return X.id===q})||g.find(function(X){return X.id===q});return K||{}}));var U={};if(typeof b=="string")return b;if(Array.isArray(b))return b.map(function(q){return _(q,"")}).filter(function(q){return q!=null});try{for(var D=PE(Object.entries(b)),L=D.next();!L.done;L=D.next()){var W=Uv(L.value,2),H=W[0],B=W[1];if(((E=B)===null||E===void 0?void 0:E.flag)===1)return;var F=[x,H].filter(function(q){return q}).join(".");c.out.has(F)||(typeof B!="object"?H.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(H)?U[H]=B:U["-"+H]=B:s.has(F)?U["-"+H]=_(B,F):U[H]=_(B,F))}}catch(q){S={error:q}}finally{try{L&&!L.done&&(A=D.return)&&A.call(D)}finally{if(S)throw S.error}}return U}}return _(v,"")}}function Wg(e){var t,n,a={};try{for(var r=PE(Object.entries(e)),s=r.next();!s.done;s=r.next()){var c=Uv(s.value,2),v=c[0],f=c[1];v.indexOf("-")===0?a[v.substring(1)]=Vg(f):typeof f=="string"?a[v]=f:Object.prototype.toString.call(f)==="[object Object]"?a[v]=Wg(f):Array.isArray(f)?a[v]=f.map(function(g){return Wg(g)}):a[v]=f}}catch(g){t={error:g}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return a}function uU(e,t,n){var a,r=new Map,s=sU(n)(t);s.nodes.forEach(function(v){var f=v["-id"],g=v["-type"],_=v.text,b=v.children,x=US(v,["-id","-type","text","children"]),S={"-id":f};_!=null&&_["-value"]&&(S["-name"]=_["-value"]),x["-json"]&&(S["-json"]=x["-json"]),x["-properties"]&&Object.assign(S,x["-properties"]),b&&(S.children=b),e[g]||(e[g]=[]),e[g].push(S),r.set(f,S)});var c=s.edges.map(function(v){var f=v["-id"];v["-type"];var g=v["-sourceNodeId"],_=v["-targetNodeId"],b=v.text,x=US(v,["-id","-type","-sourceNodeId","-targetNodeId","text"]),S=r.get(_);S["bpmn:incoming"]||(S["bpmn:incoming"]=[]),S["bpmn:incoming"].push(f);var A={"-id":f,"-sourceRef":g,"-targetRef":_};return b!=null&&b["-value"]&&(A["-name"]=b["-value"]),x["-json"]&&(A["-json"]=x["-json"]),x["-properties"]&&Object.assign(A,x["-properties"]),A});return t.edges.forEach(function(v){var f=v.sourceNodeId,g=v.id,_=r.get(f);_["bpmn:outgoing"]||(_["bpmn:outgoing"]=[]),_["bpmn:outgoing"].push(g)}),(a=e["bpmn:subProcess"])===null||a===void 0||a.forEach(function(v){var f={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},g=[];v.children.forEach(function(E){var T,I=r.get(E["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(U){I[U]&&I[U].forEach(function(D){f[U].add(D)})});var R=(T=e[E["-type"]])===null||T===void 0?void 0:T.findIndex(function(U){return U["-id"]===E["-id"]});R>=0&&e[E["-type"]].splice(R,1),r.delete(E["-id"]),v[E["-type"]]||(v[E["-type"]]=[]),v[E["-type"]].push(I)});var _=f["bpmn:incoming"],b=f["bpmn:outgoing"];b.forEach(function(E){_.has(E)&&g.push(E)});for(var x=function(E){var T=c.findIndex(function(I){return I["-id"]===g[E]});T>=0?(v["bpmn:sequenceFlow"]||(v["bpmn:sequenceFlow"]=[]),v["bpmn:sequenceFlow"].push(c[T]),c.splice(T,1)):E++,S=E},S,A=0;A<g.length;)x(A),A=S;delete v.children}),e[fl.FLOW]=c,e}function cU(e,t){e["bpmndi:BPMNEdge"]=t.edges.map(function(n){var a,r=n.id,s=n.pointsList.map(function(v){var f=v.x,g=v.y;return{"-x":f,"-y":g}}),c={"-id":r+"_di","-bpmnElement":r,"di:waypoint":s};return!((a=n.text)===null||a===void 0)&&a.value&&(c["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}}),c}),e["bpmndi:BPMNShape"]=t.nodes.map(function(n){var a,r=n.id,s=100,c=80,v=n.x,f=n.y,g=Dl.shapeConfigMap.get(n.type);g&&(s=g.width,c=g.height),v-=s/2,f-=c/2;var _={"-id":r+"_di","-bpmnElement":r,"dc:Bounds":{"-x":v,"-y":f,"-width":s,"-height":c}};return!((a=n.text)===null||a===void 0)&&a.value&&(_["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}}),_})}var dU=["bpmn:incoming","bpmn:outgoing"];function fU(e,t){var n=[],a=[],r=new Map,s=t??{},c=s.transformer,v=s.excludeFields,f={in:new Set(_v(Ug.in,(v==null?void 0:v.in)||[])),out:new Set(_v(Ug.out,(v==null?void 0:v.out)||[]))};Rs=iN(Rs,c);var g=e["bpmn:definitions"];if(g){var _=g["bpmn:process"];(function(x,S){S.forEach(function(A){try{Object.keys(x).forEach(function(E){try{A(E)}catch(T){console.error(T)}})}catch(E){console.error(E)}})})(_,[function(x){function S(E){E["-children"]||(E["-children"]=[]),Object.keys(E).forEach(function(T){var I;T.indexOf("bpmn:")===0&&!dU.includes(T)&&(_[T]||(_[T]=[]),!Array.isArray(_[T])&&(_[T]=[_[T]]),Array.isArray(E[T])?(I=_[T]).push.apply(I,_v(E[T])):_[T].push(E[T]),Array.isArray(E[T])?E[T].forEach(function(R){!T.includes("Flow")&&E["-children"].push(R["-id"])}):!T.includes("Flow")&&E["-children"].push(E[T]["-id"]),delete E[T])})}if(x==="bpmn:subProcess"){var A=_[x];Array.isArray(A)?A.forEach(function(E){x==="bpmn:subProcess"&&S(E)}):S(A)}},function(x){var S=function(E){Object.keys(E).forEach(function(T){var I,R;if(T.includes("bpmn:")){var U={};Rs[T]&&Rs[T].in?(U=(R=(I=Rs[T]).in)===null||R===void 0?void 0:R.call(I,T,ce.cloneDeep(E[T])),delete E[T]):A(E[T]);var D=void 0;(D=Reflect.ownKeys(U)).length>0&&D.forEach(function(L){Reflect.set(E,L,U[L])})}})};function A(E){r.set(E["-id"],E),Array.isArray(E)?E.forEach(function(T){A(T)}):typeof E=="object"&&S(E)}A(_[x])},function(x){if(x.indexOf("bpmn:")===0){var S=_[x];if(x==="bpmn:sequenceFlow"){var A=g["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];a=hU(S,A)}else{var E=g["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(x==="bpmn:boundaryEvent"){var T=_[x],I=function(R){var U=R["-attachedToRef"],D=r.get(U);D["-boundaryEvents"]||(D["-boundaryEvents"]=[]),D["-boundaryEvents"].push(R["-id"])};Array.isArray(T)?T.forEach(function(R){I(R)}):I(T)}n=n.concat(pU(S,E,x))}}}])}var b=function(x,S,A){Object.keys(x).forEach(function(E){var T=A?A+"."+E:E;S.has(T)?delete x[E]:typeof x[E]=="object"&&b(x[E],S,T)})};return n.forEach(function(x){var S,A;if(!((S=t==null?void 0:t.mapping)===null||S===void 0)&&S.in){var E=(A=t==null?void 0:t.mapping)===null||A===void 0?void 0:A.in,T=x.type;E[T]&&(x.type=E[T])}b(x,f.in,"")}),a.forEach(function(x){var S,A;if(!((S=t==null?void 0:t.mapping)===null||S===void 0)&&S.in){var E=(A=t==null?void 0:t.mapping)===null||A===void 0?void 0:A.in,T=x.type;E[T]&&(x.type=E[T])}b(x,f.in,"")}),{nodes:n,edges:a}}function pU(e,t,n){var a=[];if(Array.isArray(e))e.forEach(function(c){var v;Array.isArray(t)?v=t.find(function(g){return g["-bpmnElement"]===c["-id"]}):v=t;var f=WS(v,n,c);a.push(f)});else{var r=void 0;Array.isArray(t)?r=t.find(function(c){return c["-bpmnElement"]===e["-id"]}):r=t;var s=WS(r,n,e);a.push(s)}return a}function WS(e,t,n){var a=Number(e["dc:Bounds"]["-x"]),r=Number(e["dc:Bounds"]["-y"]),s=n["-children"],c=n["-name"],v=Dl.shapeConfigMap.get(t);v&&(a+=v.width/2,r+=v.height/2);var f={};Object.entries(n).forEach(function(x){var S=Uv(x,2),A=S[0],E=S[1];oN.includes(A)||(f[A]=E)}),f=Wg(f);var g;if(c&&(g={x:a,y:r,value:c},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var _=e["bpmndi:BPMNLabel"]["dc:Bounds"];g.x=Number(_["-x"])+Number(_["-width"])/2,g.y=Number(_["-y"])+Number(_["-height"])/2}var b={id:e["-bpmnElement"],type:t,x:a,y:r,properties:f};return s&&(b.children=s),g&&(b.text=g),b}function hU(e,t){var n=[];if(Array.isArray(e))e.forEach(function(r){var s;Array.isArray(t)?s=t.find(function(c){return c["-bpmnElement"]===r["-id"]}):s=t,n.push(GS(s,r))});else{var a=void 0;Array.isArray(t)?a=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):a=t,n.push(GS(a,e))}return n}function GS(e,t){var n,a=t["-name"];if(a){var r=e["bpmndi:BPMNLabel"]["dc:Bounds"],s=0;a.split(`
|
||
`).forEach(function(g){s<g.length&&(s=g.length)}),n={value:a,x:Number(r["-x"])+s*10/2,y:Number(r["-y"])+7}}var c={};Object.entries(t).forEach(function(g){var _=Uv(g,2),b=_[0],x=_[1];oN.includes(b)||(c[b]=x)}),c=Wg(c);var v=e["di:waypoint"].map(function(g){return{x:Number(g["-x"]),y:Number(g["-y"])}}),f={id:t["-id"],type:fl.FLOW,pointsList:v,sourceNodeId:t["-sourceRef"],targetNodeId:t["-targetRef"],properties:c};return n&&(f.text=n),f}var Dl=(function(){function e(t){var n=this,a=t.lf;this.adapterOut=function(r,s){var c,v,f=Aw({},n.processAttributes);uU(f,r,s);var g={"-id":"BPMNPlane_1","-bpmnElement":f["-id"]};cU(g,r);var _=n.definitionAttributes;_["bpmn:process"]=f,_["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":g};var b={"bpmn:definitions":_};if(!((c=s==null?void 0:s.mapping)===null||c===void 0)&&c.out){var x=(v=s==null?void 0:s.mapping)===null||v===void 0?void 0:v.out,S=function(A){Array.isArray(A)&&A.forEach(function(E){return S(E)}),typeof A=="object"&&Object.keys(A).forEach(function(E){var T;(T=x[E])?(A[T]=ce.cloneDeep(A[E]),delete A[E],S(A[T])):S(A[E])})};S(b)}return b},this.adapterIn=function(r,s){if(r)return fU(r,s)},a.adapterIn=this.adapterIn,a.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 e.prototype.setCustomShape=function(t,n){e.shapeConfigMap.set(t,n)},e.pluginName="bpmn-adapter",e.shapeConfigMap=new Map,e})();Dl.shapeConfigMap.set(fl.START,{width:PS.width,height:PS.height});Dl.shapeConfigMap.set(fl.END,{width:CS.width,height:CS.height});Dl.shapeConfigMap.set(fl.INTERMEDIATE_CATCH,{width:Bg.width,height:Bg.height});Dl.shapeConfigMap.set(fl.INTERMEDIATE_THROW,{width:Bg.width,height:Bg.height});Dl.shapeConfigMap.set(fl.BOUNDARY,{width:RS.width,height:RS.height});Dl.shapeConfigMap.set(fl.PARALLEL_GATEWAY,{width:jS.width,height:jS.height});Dl.shapeConfigMap.set(fl.INCLUSIVE_GATEWAY,{width:DS.width,height:DS.height});Dl.shapeConfigMap.set(fl.EXCLUSIVE_GATEWAY,{width:IS.width,height:IS.height});Dl.shapeConfigMap.set(fl.SYSTEM,{width:LS.width,height:LS.height});Dl.shapeConfigMap.set(fl.USER,{width:$S.width,height:$S.height});Dl.shapeConfigMap.set(fl.SUBPROCESS,{width:FS.width,height:FS.height});(function(e){aU(t,e);function t(n){var a=e.call(this,n)||this;a.adapterXmlIn=function(c){var v=rU(c);return a.adapterIn(v,a.props)},a.adapterXmlOut=function(c){var v=a.adapterOut(c,a.props);return iU(v)};var r=n.lf,s=n.props;return r.adapterIn=a.adapterXmlIn,r.adapterOut=a.adapterXmlOut,a.props=s,a}return t.pluginName="BPMNAdapter",t})(Dl);var zS;(function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"})(zS||(zS={}));var vU=(function(){function e(t){var n=this,a=t.lf;this.__disabled=!1,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.__draw=function(s){var c=n.lf.getPointByClient(s.clientX,s.clientY).domOverlayPosition,v=c.x,f=c.y;n.endPoint={x:v,y:f};var g=n.startPoint,_=g.x,b=g.y,x=n.wrapper.style,S=_,A=b,E=v-_,T=f-b;v<_&&(S=v,E=_-v),f<b&&(A=f,T=b-f),x.left=S+"px",x.top=A+"px",x.width=E+"px",x.height=T+"px"},this.__drawOff=function(){document.removeEventListener("mousemove",n.__draw),document.removeEventListener("mouseup",n.__drawOff),n.wrapper.oncontextmenu=null,n.__domContainer.removeChild(n.wrapper);var s=n.startPoint,c=s.x,v=s.y,f=n.endPoint,g=f.x,_=f.y;if(!(Math.abs(g-c)<10&&Math.abs(_-v)<10)){var b=[Math.min(c,g),Math.min(v,_)],x=[Math.max(c,g),Math.max(v,_)],S=n.lf.graphModel.getAreaElement(b,x,n.isWholeEdge,n.isWholeNode,!0),A=n.lf.graphModel.group;S.forEach(function(E){(!A||!A.getNodeGroup(E.id))&&n.lf.selectElementById(E.id,!0)}),n.lf.emit("selection:selected",S)}},this.__zoom=function(s){var c,v;s.preventDefault();var f=new WheelEvent("wheel",{deltaX:s.deltaX,deltaY:s.deltaY,clientX:s.clientX,clientY:s.clientY,ctrlKey:s.ctrlKey});(v=(c=n.lf.container)===null||c===void 0?void 0:c.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||v===void 0||v.dispatchEvent(f)},this.lf=a;var r=a.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=r,a.openSelectionSelect=function(){n.openSelectionSelect()},a.closeSelectionSelect=function(){n.closeSelectionSelect()}}return e.prototype.render=function(t,n){var a=this;this.__domContainer=n,t.on("blank:mousedown",function(r){var s=r.e,c=t.getEditConfig();if(!(!c.stopMoveGraph||a.__disabled)){var v=s.button===2;if(!v){var f=t.getPointByClient(s.clientX,s.clientY).domOverlayPosition,g=f.x,_=f.y;a.startPoint={x:g,y:_},a.endPoint={x:g,y:_};var b=document.createElement("div");b.className="lf-selection-select",b.oncontextmenu=function(S){S.preventDefault()},b.style.top=a.startPoint.y+"px",b.style.left=a.startPoint.x+"px",n.appendChild(b),a.wrapper=b,document.addEventListener("mousemove",a.__draw),document.addEventListener("mouseup",a.__drawOff),document.addEventListener("wheel",a.__zoom,{passive:!1})}}})},e.prototype.setSelectionSense=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=!0),this.isWholeEdge=t,this.isWholeNode=n},e.prototype.openSelectionSelect=function(){var t=this.lf.getEditConfig().stopMoveGraph;t||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},e.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},e.prototype.open=function(){this.__disabled=!1},e.prototype.close=function(){this.__disabled=!0},e.pluginName="selectionSelect",e})(),aN=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,r){a.__proto__=r}||function(a,r){for(var s in r)r.hasOwnProperty(s)&&(a[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function a(){this.constructor=t}t.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}})(),vv=function(){return vv=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},vv.apply(this,arguments)},Tm=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var a=n.call(e),r,s=[],c;try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(v){c={error:v}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return s},mU={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function yU(e){for(var t=e,n=1;n<t.length-1;){var a=Tm(t[n-1],2),r=a[0],s=a[1],c=Tm(t[n],2),v=c[0],f=c[1],g=Tm(t[n+1],2),_=g[0],b=g[1];r===v&&v===_||s===f&&f===b?t.splice(n,1):n++}return t}function gU(e,t,n,a){var r=[e[0],e[1]],s=[e[0],e[1]];switch(n){case"tl":return t==="tr"?(r[1]+=a,s[0]+=a):t==="lb"&&(r[0]+=a,s[1]+=a),[r,s];case"tr":return t==="tl"?(r[1]+=a,s[0]-=a):t==="rb"&&(r[0]-=a,s[1]+=a),[r,s];case"bl":return t==="br"?(r[1]-=a,s[0]+=a):t==="lt"&&(r[0]+=a,s[1]-=a),[r,s];case"br":return t==="bl"?(r[1]-=a,s[0]-=a):t==="rt"&&(r[0]-=a,s[1]-=a),[r,s];default:return[]}}function _U(e,t,n,a){var r,s="",c="";e[0]===t[0]?s=e[1]>t[1]?"t":"b":e[1]===t[1]&&(s=e[0]>t[0]?"l":"r"),t[0]===n[0]?c=t[1]>n[1]?"t":"b":t[1]===n[1]&&(c=t[0]>n[0]?"l":"r");var v=Math.min(Math.hypot(t[0]-e[0],t[1]-e[1])/2,Math.hypot(n[0]-t[0],n[1]-t[1])/2,a)||1/5*a,f=""+s+c,g=mU[f]||"-",_="L "+e[0]+" "+e[1];if(g==="-")_+="L "+t[0]+" "+t[1]+" L "+n[0]+" "+n[1];else{var b=Tm(gU(t,f,g,v),2),x=b[0],S=b[1];x&&S&&(_+="L "+x[0]+" "+x[1]+" Q "+t[0]+" "+t[1]+" "+S[0]+" "+S[1],r=Tm(S,2),t[0]=r[0],t[1]=r[1])}return _}function bU(e,t){var n=0,a="";if(e.length===2)a+="M"+e[n][0]+" "+e[n++][1]+" L "+e[n][0]+" "+e[n][1];else{for(a+="M"+e[n][0]+" "+e[n++][1];n+1<e.length;){var r=e[n-1],s=e[n],c=e[n+++1];a+=_U(r,s,c,t)}a+="L "+e[n][0]+" "+e[n][1]}return a}(function(e){aN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEdge=function(){var n=this.props.model,a=n.points,r=n.isAnimation,s=n.arrowConfig,c=n.radius,v=c===void 0?5:c,f=n.getEdgeStyle(),g=n.getEdgeAnimationStyle(),_=yU(a.split(" ").map(function(S){return S.split(",").map(function(A){return+A})})),b=bU(_,v),x=vv(vv(vv({style:r?g:{}},f),s),{fill:"none"});return hn.h("path",vv({d:b},x))},t})(hn.PolylineEdge);(function(e){aN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(hn.PolylineEdgeModel);let x_=!1;const Xf=Zf({});function lN(e,t,n,a,r,s,c){s||(s=(v,f)=>({nodeModel:v,graph:f})),c||(c=(v,f)=>({getNode:()=>v,getGraph:()=>f})),x_&&(Xf[e]=wD(Vn({render:()=>kv(ED,{to:n},[kv(t,s(a,r))]),provide:()=>c(a,r)})))}function sN(e){x_&&delete Xf[e]}function wU(e){Object.keys(Xf).forEach(t=>{t.startsWith(e)&&delete Xf[t]})}function EU(){Object.keys(Xf).forEach(e=>{delete Xf[e]})}function Gg(){return x_}function OU(){return x_=!0,Vn({props:{flowId:{type:String,required:!0}},setup(e){return()=>{const t=[];return Object.keys(Xf).forEach(n=>{t.push(Xf[n])}),kv(ar,{},t.map(n=>kv(n)))}}})}class ho extends tN.view{constructor(n,a){super(n);fa(this,"isMounted");fa(this,"r");fa(this,"component");fa(this,"app");fa(this,"root");fa(this,"VueNode");fa(this,"up_node_field_dict");this.component=a,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 $D[n.model.type].properties.config}getNodeName(n,a){let r=0,s=a;for(;;){if(r>0&&(s=a+r),!n.some(c=>c.properties.stepName===s.trim()))return s;r++}}get_node_field_list(){var a,r,s,c,v,f,g,_;const n=[];return this.props.model.type&&this.props.model.type==="start-node"&&(n.push({value:"global",label:yt("views.applicationWorkflow.variable.global"),type:"global",children:((r=(a=this.props.model.properties)==null?void 0:a.config)==null?void 0:r.globalFields)||[]}),n.push({value:"chat",label:yt("views.applicationWorkflow.variable.chat"),type:"chat",children:((c=(s=this.props.model.properties)==null?void 0:s.config)==null?void 0:c.chatFields)||[]})),n.push({value:this.props.model.id,icon:(f=(v=this.props.model.properties)==null?void 0:v.node_data)==null?void 0:f.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((_=(g=this.props.model.properties)==null?void 0:g.config)==null?void 0:_.fields)||[]}),n}get_up_node_field_dict(n,a){if(!this.up_node_field_dict||!a){const r=this.props.graphModel.getNodeIncomingNode(this.props.model.id);this.up_node_field_dict=r.filter(s=>s.id!="start-node"&&s.id!="loop-start-node").map(s=>s.get_up_node_field_dict(!0,a)).reduce((s,c)=>({...s,...c}),{})}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,a){const r=Object.values(this.get_up_node_field_dict(n,a)).reduce((v,f)=>[...v,...f],[]),s=this.props.graphModel.getNodeModelById("start-node")||this.props.graphModel.getNodeModelById("loop-start-node");return[...s?s.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:a,y:r,type:s}=n;let c=!1;return s=="left"?c=this.props.graphModel.edges.some(v=>v.targetAnchorId==n.id):c=this.props.graphModel.edges.some(v=>v.sourceAnchorId==n.id),hn.h("foreignObject",{...n,x:a-10,y:r-12,width:30,height:30},[hn.h("div",{style:{zindex:0},onClick:()=>{s=="right"&&this.props.model.openNodeMenu(n)},dangerouslySetInnerHTML:{__html:c?`<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 a=document.createElement("div");n.appendChild(a),this.renderVueComponent(a)}}componentWillUnmount(){super.componentWillUnmount(),this.unmount()}getComponentContainer(){return this.root}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}renderVueComponent(n){var s;this.unmountVueComponent(),this.root=n;const{model:a,graphModel:r}=this.props;if(n)if(Gg())lN(this.targetId(),this.component,n,a,r,void 0,this.props.graphModel.get_provide);else{this.r=kv(this.component,{properties:this.props.model.properties,nodeModel:this.props.model}),this.app=JM({render(){return this.r},provide(){return{getNode:()=>a,getGraph:()=>r,workflowMode:Is.Application}}}),this.app.use(OD,{locale:xD}),this.app.use(SD),this.app.use(AD),this.app.use(ZM);for(const[c,v]of Object.entries(MD))this.app.component(c,v);(s=this.app)==null||s.mount(n)}}unmountVueComponent(){return this.app&&(this.app.unmount(),this.app=null),this.root&&(this.root.innerHTML=""),this.root}unmount(){Gg()&&sN(this.targetId()),this.unmountVueComponent()}}class vo extends tN.model{refreshDeges(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}set_position(t){const{x:n,y:a}=t;n&&(this.x=n),a&&(this.y=a),this.refreshDeges()}getResizeOutlineStyle(){const t=super.getResizeOutlineStyle();return t.stroke="none",t}getControlPointStyle(){const t=super.getControlPointStyle();return t.stroke="none",t.fill="none",t}getNodeStyle(){return{overflow:"visible"}}getOutlineStyle(){const t=super.getOutlineStyle();return t.stroke="none",t.hover&&(t.hover.stroke="none"),t}getAnchorStyle(t){const n=super.getAnchorStyle(t);return t.type==="left"?(n.fill="red",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transpanrent"),n.className="lf-hide-default"):n.fill="green",n}setHeight(t){const n=this.height,a=t+100;this.height=a,this.properties.height=a,this.move(0,(a-n)/2),this.outgoing.edges.forEach(r=>{r.updatePathByAnchor()}),this.incoming.edges.forEach(r=>{r.updatePathByAnchor()})}get_width(){var t;return((t=this.properties)==null?void 0:t.width)||340}setAttributes(){const{t}=ZM.global;this.width=this.get_width();const n=(r,s)=>{const c=this.graphModel.getNodeIncomingNode(r);for(const v in c){const f=c[v];if(f.id===s)return!0;if(n(f.id,s))return!0}return!1},a={message:t("views.applicationWorkflow.tip.onlyRight"),validate:(r,s,c)=>c.type==="right"};this.sourceRules.push({message:t("views.applicationWorkflow.tip.notRecyclable"),validate:(r,s,c,v)=>s.id==r.id?!1:!this.graphModel.getNodeIncomingEdge(s.id).find(_=>_.targetAnchorId==v.id&&_.sourceAnchorId==c.id)&&!n(r.id,s.id)}),this.sourceRules.push(a),this.targetRules.push({message:t("views.applicationWorkflow.tip.onlyLeft"),validate:(r,s,c,v)=>v.type==="left"})}getDefaultAnchor(){const{id:t,x:n,y:a,width:r}=this,s=this.properties.showNode===void 0?!0:this.properties.showNode,c=[];return this.type&&this.type!==nr.Base.toString()&&([nr.Start.toString(),nr.LoopStartNode.toString()].includes(this.type)||c.push({x:n-r/2+10,y:s?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),c.push({x:n+r/2-10,y:s?a:a-15,id:`${t}_right`,type:"right"})),c}}let xU=class extends ho{constructor(t){super(t,yV)}};const SU={type:"ai-chat-node",model:vo,view:xU},uN=Object.freeze(Object.defineProperty({__proto__:null,default:SU},Symbol.toStringTag,{value:"Module"})),AU={class:"title-decoration-1 mb-8"},MU={class:"flex align-center"},kU={class:"mr-4"},TU=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Li(),n=$n(()=>t.path.includes("resource-management")?"systemManage":"workspace"),a={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=Re(),s=$n({get:()=>(f.nodeModel.properties.node_data||ge.set(f.nodeModel.properties,"node_data",a),f.nodeModel.properties.node_data),set:_=>{ge.set(f.nodeModel.properties,"node_data",_)}});function c(_,b){const x=`${_}_list`;b?f.nodeModel.properties.node_data[x]||ge.set(f.nodeModel.properties.node_data,x,[]):delete f.nodeModel.properties.node_data[x]}const v=()=>{if(!f.nodeModel.properties.node_data.application_id){ge.set(f.nodeModel.properties,"status",500);return}po({type:"application",systemType:n.value}).getApplicationDetail(f.nodeModel.properties.node_data.application_id).then(_=>{const b=ge.cloneDeep(f.nodeModel.properties.node_data.api_input_field_list),x=ge.cloneDeep(f.nodeModel.properties.node_data.user_input_field_list);if(Hw(_.data.type)){const S=_.data.work_flow.nodes[0].properties.node_data,A=ge.cloneDeep(_.data.work_flow.nodes[0].properties.api_input_field_list),E=ge.cloneDeep(_.data.work_flow.nodes[0].properties.user_input_field_list),T=(A||[]).map(D=>{const L=b==null?void 0:b.find(W=>W.variable==D.variable);return L?{...D,value:L.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});ge.set(f.nodeModel.properties.node_data,"api_input_field_list",T);const I=(E||[]).map(D=>{const L=x==null?void 0:x.find(W=>W.field==D.field);return L?{...D,value:L.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});ge.set(f.nodeModel.properties.node_data,"user_input_field_list",I);const R=S.file_upload_enable,U=S.file_upload_setting;R?(c("document",U.document),c("image",U.image),c("audio",U.audio),c("video",U.video)):["document_list","image_list","audio_list","video_list"].forEach(D=>{delete f.nodeModel.properties.node_data[D]}),ge.set(f.nodeModel.properties,"status",_.data.id?200:500)}}).catch(_=>{console.log(_),ge.set(f.nodeModel.properties,"status",500)})},f=e,g=()=>{var _;return(_=r.value)==null?void 0:_.validate().catch(b=>Promise.reject({node:f.nodeModel,errMessage:b}))};return Ir(()=>{v(),ge.set(f.nodeModel,"validate",g)}),(_,b)=>{const x=J("el-form-item"),S=J("AppIcon"),A=J("el-tooltip"),E=J("el-switch"),T=J("el-form"),I=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",AU,de(_.$t("views.applicationWorkflow.nodeSetting")),1),k(I,{shadow:"never",class:"card-never"},{default:P(()=>[k(T,{onSubmit:b[7]||(b[7]=rn(()=>{},["prevent"])),model:s.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:P(()=>[k(x,{label:_.$t("views.applicationWorkflow.nodes.startNode.question"),prop:"question_reference_address",rules:{message:_.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{default:P(()=>[k(oo,{ref_key:"applicationNodeFormRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.question_reference_address,"onUpdate:modelValue":b[0]||(b[0]=R=>s.value.question_reference_address=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),s.value.hasOwnProperty("document_list")||"document_list"in s.value?(be(),at(x,{key:0,label:_.$t("views.problem.relateParagraph.selectDocument"),prop:"document_list",rules:{message:_.$t("views.chatLog.documentPlaceholder"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.chatLog.documentPlaceholder"),modelValue:s.value.document_list,"onUpdate:modelValue":b[1]||(b[1]=R=>s.value.document_list=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):pn("",!0),s.value.hasOwnProperty("image_list")||"image_list"in s.value?(be(),at(x,{key:1,label:_.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),prop:"image_list",rules:{message:_.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:s.value.image_list,"onUpdate:modelValue":b[2]||(b[2]=R=>s.value.image_list=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):pn("",!0),s.value.hasOwnProperty("audio_list")||"audio_list"in s.value?(be(),at(x,{key:2,label:_.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:_.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:s.value.audio_list,"onUpdate:modelValue":b[3]||(b[3]=R=>s.value.audio_list=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):pn("",!0),s.value.hasOwnProperty("video_list")||"video_list"in s.value?(be(),at(x,{key:3,label:_.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.label"),prop:"video_list",rules:{message:_.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),modelValue:s.value.video_list,"onUpdate:modelValue":b[4]||(b[4]=R=>s.value.video_list=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):pn("",!0),(be(!0),Ht(ar,null,Gr(s.value.api_input_field_list,(R,U)=>(be(),Ht("div",{key:"api-input-"+U},[k(x,{label:R.variable,prop:"api_input_field_list."+U+".value",rules:[{required:R.is_required,message:`${_.$t("common.inputPlaceholder")}${R.variable}`,trigger:"blur"}]},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.api_input_field_list[U].value,"onUpdate:modelValue":D=>s.value.api_input_field_list[U].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(be(!0),Ht(ar,null,Gr(s.value.user_input_field_list,(R,U)=>(be(),Ht("div",{key:"user-input-"+U},[k(x,{label:R.label,prop:"user_input_field_list."+U+".value",rules:[{required:R.required,message:`${_.$t("common.inputPlaceholder")}${R.label}`,trigger:"blur"}]},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.user_input_field_list[U].value,"onUpdate:modelValue":D=>s.value.user_input_field_list[U].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),k(x,{label:_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:b[6]||(b[6]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",MU,[Y("div",kU,[Y("span",null,de(_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(A,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(S,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(E,{size:"small",modelValue:s.value.is_result,"onUpdate:modelValue":b[5]||(b[5]=R=>s.value.is_result=R)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class NU extends ho{constructor(t){super(t,TU)}}const PU={type:"application-node",model:vo,view:NU},cN=Object.freeze(Object.defineProperty({__proto__:null,default:PU},Symbol.toStringTag,{value:"Module"}));/**!
|
||
* Sortable 1.15.6
|
||
* @author RubaXa <trash@rubaxa.org>
|
||
* @author owenm <owen23355@gmail.com>
|
||
* @license MIT
|
||
*/function HS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HS(Object(n),!0).forEach(function(a){CU(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HS(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function gg(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gg=function(t){return typeof t}:gg=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gg(e)}function CU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Td(){return Td=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Td.apply(this,arguments)}function RU(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,s;for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function jU(e,t){if(e==null)return{};var n=RU(e,t),a,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)a=s[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var DU="1.15.6";function Md(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Rd=Md(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Jm=Md(/Edge/i),XS=Md(/firefox/i),Nm=Md(/safari/i)&&!Md(/chrome/i)&&!Md(/android/i),CE=Md(/iP(ad|od|hone)/i),dN=Md(/chrome/i)&&Md(/android/i),fN={capture:!1,passive:!1};function ro(e,t,n){e.addEventListener(t,n,!Rd&&fN)}function Qr(e,t,n){e.removeEventListener(t,n,!Rd&&fN)}function zg(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function pN(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function wu(e,t,n,a){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&zg(e,t):zg(e,t))||a&&e===n)return e;if(e===n)break}while(e=pN(e))}return null}var qS=/\s+/g;function rs(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(qS," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(qS," ")}}function xr(e,t,n){var a=e&&e.style;if(a){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in a)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),a[t]=n+(typeof n=="string"?"":"px")}}function bv(e,t){var n="";if(typeof e=="string")n=e;else do{var a=xr(e,"transform");a&&a!=="none"&&(n=a+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function hN(e,t,n){if(e){var a=e.getElementsByTagName(t),r=0,s=a.length;if(n)for(;r<s;r++)n(a[r],r);return a}return[]}function sc(){var e=document.scrollingElement;return e||document.documentElement}function Yi(e,t,n,a,r){if(!(!e.getBoundingClientRect&&e!==window)){var s,c,v,f,g,_,b;if(e!==window&&e.parentNode&&e!==sc()?(s=e.getBoundingClientRect(),c=s.top,v=s.left,f=s.bottom,g=s.right,_=s.height,b=s.width):(c=0,v=0,f=window.innerHeight,g=window.innerWidth,_=window.innerHeight,b=window.innerWidth),(t||n)&&e!==window&&(r=r||e.parentNode,!Rd))do if(r&&r.getBoundingClientRect&&(xr(r,"transform")!=="none"||n&&xr(r,"position")!=="static")){var x=r.getBoundingClientRect();c-=x.top+parseInt(xr(r,"border-top-width")),v-=x.left+parseInt(xr(r,"border-left-width")),f=c+s.height,g=v+s.width;break}while(r=r.parentNode);if(a&&e!==window){var S=bv(r||e),A=S&&S.a,E=S&&S.d;S&&(c/=E,v/=A,b/=A,_/=E,f=c+_,g=v+b)}return{top:c,left:v,bottom:f,right:g,width:b,height:_}}}function YS(e,t,n){for(var a=Vf(e,!0),r=Yi(e)[t];a;){var s=Yi(a)[n],c=void 0;if(c=r>=s,!c)return a;if(a===sc())break;a=Vf(a,!1)}return!1}function Nv(e,t,n,a){for(var r=0,s=0,c=e.children;s<c.length;){if(c[s].style.display!=="none"&&c[s]!==_r.ghost&&(a||c[s]!==_r.dragged)&&wu(c[s],n.draggable,e,!1)){if(r===t)return c[s];r++}s++}return null}function RE(e,t){for(var n=e.lastElementChild;n&&(n===_r.ghost||xr(n,"display")==="none"||t&&!zg(n,t));)n=n.previousElementSibling;return n||null}function Cs(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==_r.clone&&(!t||zg(e,t))&&n++;return n}function KS(e){var t=0,n=0,a=sc();if(e)do{var r=bv(e),s=r.a,c=r.d;t+=e.scrollLeft*s,n+=e.scrollTop*c}while(e!==a&&(e=e.parentNode));return[t,n]}function IU(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[n][a])return Number(n)}return-1}function Vf(e,t){if(!e||!e.getBoundingClientRect)return sc();var n=e,a=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=xr(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 sc();if(a||t)return n;a=!0}}while(n=n.parentNode);return sc()}function LU(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function w1(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Pm;function vN(e,t){return function(){if(!Pm){var n=arguments,a=this;n.length===1?e.call(a,n[0]):e.apply(a,n),Pm=setTimeout(function(){Pm=void 0},t)}}}function $U(){clearTimeout(Pm),Pm=void 0}function mN(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function yN(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function gN(e,t,n){var a={};return Array.from(e.children).forEach(function(r){var s,c,v,f;if(!(!wu(r,t.draggable,e,!1)||r.animated||r===n)){var g=Yi(r);a.left=Math.min((s=a.left)!==null&&s!==void 0?s:1/0,g.left),a.top=Math.min((c=a.top)!==null&&c!==void 0?c:1/0,g.top),a.right=Math.max((v=a.right)!==null&&v!==void 0?v:-1/0,g.right),a.bottom=Math.max((f=a.bottom)!==null&&f!==void 0?f:-1/0,g.bottom)}}),a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}var Rl="Sortable"+new Date().getTime();function FU(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var a=[].slice.call(this.el.children);a.forEach(function(r){if(!(xr(r,"display")==="none"||r===_r.ghost)){e.push({target:r,rect:Yi(r)});var s=cc({},e[e.length-1].rect);if(r.thisAnimationDuration){var c=bv(r,!0);c&&(s.top-=c.f,s.left-=c.e)}r.fromRect=s}})}},addAnimationState:function(a){e.push(a)},removeAnimationState:function(a){e.splice(IU(e,{target:a}),1)},animateAll:function(a){var r=this;if(!this.options.animation){clearTimeout(t),typeof a=="function"&&a();return}var s=!1,c=0;e.forEach(function(v){var f=0,g=v.target,_=g.fromRect,b=Yi(g),x=g.prevFromRect,S=g.prevToRect,A=v.rect,E=bv(g,!0);E&&(b.top-=E.f,b.left-=E.e),g.toRect=b,g.thisAnimationDuration&&w1(x,b)&&!w1(_,b)&&(A.top-b.top)/(A.left-b.left)===(_.top-b.top)/(_.left-b.left)&&(f=VU(A,x,S,r.options)),w1(b,_)||(g.prevFromRect=_,g.prevToRect=b,f||(f=r.options.animation),r.animate(g,A,b,f)),f&&(s=!0,c=Math.max(c,f),clearTimeout(g.animationResetTimer),g.animationResetTimer=setTimeout(function(){g.animationTime=0,g.prevFromRect=null,g.fromRect=null,g.prevToRect=null,g.thisAnimationDuration=null},f),g.thisAnimationDuration=f)}),clearTimeout(t),s?t=setTimeout(function(){typeof a=="function"&&a()},c):typeof a=="function"&&a(),e=[]},animate:function(a,r,s,c){if(c){xr(a,"transition",""),xr(a,"transform","");var v=bv(this.el),f=v&&v.a,g=v&&v.d,_=(r.left-s.left)/(f||1),b=(r.top-s.top)/(g||1);a.animatingX=!!_,a.animatingY=!!b,xr(a,"transform","translate3d("+_+"px,"+b+"px,0)"),this.forRepaintDummy=BU(a),xr(a,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),xr(a,"transform","translate3d(0,0,0)"),typeof a.animated=="number"&&clearTimeout(a.animated),a.animated=setTimeout(function(){xr(a,"transition",""),xr(a,"transform",""),a.animated=!1,a.animatingX=!1,a.animatingY=!1},c)}}}}function BU(e){return e.offsetWidth}function VU(e,t,n,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*a.animation}var ov=[],E1={initializeByDefault:!0},Qm={mount:function(t){for(var n in E1)E1.hasOwnProperty(n)&&!(n in t)&&(t[n]=E1[n]);ov.forEach(function(a){if(a.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),ov.push(t)},pluginEvent:function(t,n,a){var r=this;this.eventCanceled=!1,a.cancel=function(){r.eventCanceled=!0};var s=t+"Global";ov.forEach(function(c){n[c.pluginName]&&(n[c.pluginName][s]&&n[c.pluginName][s](cc({sortable:n},a)),n.options[c.pluginName]&&n[c.pluginName][t]&&n[c.pluginName][t](cc({sortable:n},a)))})},initializePlugins:function(t,n,a,r){ov.forEach(function(v){var f=v.pluginName;if(!(!t.options[f]&&!v.initializeByDefault)){var g=new v(t,n,t.options);g.sortable=t,g.options=t.options,t[f]=g,Td(a,g.defaults)}});for(var s in t.options)if(t.options.hasOwnProperty(s)){var c=this.modifyOption(t,s,t.options[s]);typeof c<"u"&&(t.options[s]=c)}},getEventProperties:function(t,n){var a={};return ov.forEach(function(r){typeof r.eventProperties=="function"&&Td(a,r.eventProperties.call(n[r.pluginName],t))}),a},modifyOption:function(t,n,a){var r;return ov.forEach(function(s){t[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[n]=="function"&&(r=s.optionListeners[n].call(t[s.pluginName],a))}),r}};function UU(e){var t=e.sortable,n=e.rootEl,a=e.name,r=e.targetEl,s=e.cloneEl,c=e.toEl,v=e.fromEl,f=e.oldIndex,g=e.newIndex,_=e.oldDraggableIndex,b=e.newDraggableIndex,x=e.originalEvent,S=e.putSortable,A=e.extraEventProperties;if(t=t||n&&n[Rl],!!t){var E,T=t.options,I="on"+a.charAt(0).toUpperCase()+a.substr(1);window.CustomEvent&&!Rd&&!Jm?E=new CustomEvent(a,{bubbles:!0,cancelable:!0}):(E=document.createEvent("Event"),E.initEvent(a,!0,!0)),E.to=c||n,E.from=v||n,E.item=r||n,E.clone=s,E.oldIndex=f,E.newIndex=g,E.oldDraggableIndex=_,E.newDraggableIndex=b,E.originalEvent=x,E.pullMode=S?S.lastPutMode:void 0;var R=cc(cc({},A),Qm.getEventProperties(a,t));for(var U in R)E[U]=R[U];n&&n.dispatchEvent(E),T[I]&&T[I].call(t,E)}}var WU=["evt"],Pl=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=a.evt,s=jU(a,WU);Qm.pluginEvent.bind(_r)(t,n,cc({dragEl:On,parentEl:Ni,ghostEl:Pr,rootEl:vi,nextEl:Yp,lastDownEl:_g,cloneEl:wi,cloneHidden:Ff,dragStarted:bm,putSortable:Ta,activeSortable:_r.active,originalEvent:r,oldIndex:mv,oldDraggableIndex:Cm,newIndex:os,newDraggableIndex:$f,hideGhostForTarget:EN,unhideGhostForTarget:ON,cloneNowHidden:function(){Ff=!0},cloneNowShown:function(){Ff=!1},dispatchSortableEvent:function(v){ul({sortable:n,name:v,originalEvent:r})}},s))};function ul(e){UU(cc({putSortable:Ta,cloneEl:wi,targetEl:On,rootEl:vi,oldIndex:mv,oldDraggableIndex:Cm,newIndex:os,newDraggableIndex:$f},e))}var On,Ni,Pr,vi,Yp,_g,wi,Ff,mv,os,Cm,$f,ag,Ta,uv=!1,Hg=!1,Xg=[],Hp,bu,O1,x1,ZS,JS,bm,iv,Rm,jm=!1,lg=!1,bg,Wa,S1=[],Mw=!1,qg=[],S_=typeof document<"u",sg=CE,QS=Jm||Rd?"cssFloat":"float",GU=S_&&!dN&&!CE&&"draggable"in document.createElement("div"),_N=(function(){if(S_){if(Rd)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),bN=function(t,n){var a=xr(t),r=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),s=Nv(t,0,n),c=Nv(t,1,n),v=s&&xr(s),f=c&&xr(c),g=v&&parseInt(v.marginLeft)+parseInt(v.marginRight)+Yi(s).width,_=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+Yi(c).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&v.float&&v.float!=="none"){var b=v.float==="left"?"left":"right";return c&&(f.clear==="both"||f.clear===b)?"vertical":"horizontal"}return s&&(v.display==="block"||v.display==="flex"||v.display==="table"||v.display==="grid"||g>=r&&a[QS]==="none"||c&&a[QS]==="none"&&g+_>r)?"vertical":"horizontal"},zU=function(t,n,a){var r=a?t.left:t.top,s=a?t.right:t.bottom,c=a?t.width:t.height,v=a?n.left:n.top,f=a?n.right:n.bottom,g=a?n.width:n.height;return r===v||s===f||r+c/2===v+g/2},HU=function(t,n){var a;return Xg.some(function(r){var s=r[Rl].options.emptyInsertThreshold;if(!(!s||RE(r))){var c=Yi(r),v=t>=c.left-s&&t<=c.right+s,f=n>=c.top-s&&n<=c.bottom+s;if(v&&f)return a=r}}),a},wN=function(t){function n(s,c){return function(v,f,g,_){var b=v.options.group.name&&f.options.group.name&&v.options.group.name===f.options.group.name;if(s==null&&(c||b))return!0;if(s==null||s===!1)return!1;if(c&&s==="clone")return s;if(typeof s=="function")return n(s(v,f,g,_),c)(v,f,g,_);var x=(c?v:f).options.group.name;return s===!0||typeof s=="string"&&s===x||s.join&&s.indexOf(x)>-1}}var a={},r=t.group;(!r||gg(r)!="object")&&(r={name:r}),a.name=r.name,a.checkPull=n(r.pull,!0),a.checkPut=n(r.put),a.revertClone=r.revertClone,t.group=a},EN=function(){!_N&&Pr&&xr(Pr,"display","none")},ON=function(){!_N&&Pr&&xr(Pr,"display","")};S_&&!dN&&document.addEventListener("click",function(e){if(Hg)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Hg=!1,!1},!0);var Xp=function(t){if(On){t=t.touches?t.touches[0]:t;var n=HU(t.clientX,t.clientY);if(n){var a={};for(var r in t)t.hasOwnProperty(r)&&(a[r]=t[r]);a.target=a.rootEl=n,a.preventDefault=void 0,a.stopPropagation=void 0,n[Rl]._onDragOver(a)}}},XU=function(t){On&&On.parentNode[Rl]._isOutsideThisEl(t.target)};function _r(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Td({},t),e[Rl]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return bN(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,v){c.setData("Text",v.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:_r.supportPointer!==!1&&"PointerEvent"in window&&(!Nm||CE),emptyInsertThreshold:5};Qm.initializePlugins(this,e,n);for(var a in n)!(a in t)&&(t[a]=n[a]);wN(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:GU,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ro(e,"pointerdown",this._onTapStart):(ro(e,"mousedown",this._onTapStart),ro(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ro(e,"dragover",this),ro(e,"dragenter",this)),Xg.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Td(this,FU())}_r.prototype={constructor:_r,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(iv=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,On):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,a=this.el,r=this.options,s=r.preventOnFilter,c=t.type,v=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,f=(v||t).target,g=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||f,_=r.filter;if(tW(a),!On&&!(/mousedown|pointerdown/.test(c)&&t.button!==0||r.disabled)&&!g.isContentEditable&&!(!this.nativeDraggable&&Nm&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=wu(f,r.draggable,a,!1),!(f&&f.animated)&&_g!==f)){if(mv=Cs(f),Cm=Cs(f,r.draggable),typeof _=="function"){if(_.call(this,t,f,this)){ul({sortable:n,rootEl:g,name:"filter",targetEl:f,toEl:a,fromEl:a}),Pl("filter",n,{evt:t}),s&&t.preventDefault();return}}else if(_&&(_=_.split(",").some(function(b){if(b=wu(g,b.trim(),a,!1),b)return ul({sortable:n,rootEl:b,name:"filter",targetEl:f,fromEl:a,toEl:a}),Pl("filter",n,{evt:t}),!0}),_)){s&&t.preventDefault();return}r.handle&&!wu(g,r.handle,a,!1)||this._prepareDragStart(t,v,f)}}},_prepareDragStart:function(t,n,a){var r=this,s=r.el,c=r.options,v=s.ownerDocument,f;if(a&&!On&&a.parentNode===s){var g=Yi(a);if(vi=s,On=a,Ni=On.parentNode,Yp=On.nextSibling,_g=a,ag=c.group,_r.dragged=On,Hp={target:On,clientX:(n||t).clientX,clientY:(n||t).clientY},ZS=Hp.clientX-g.left,JS=Hp.clientY-g.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,On.style["will-change"]="all",f=function(){if(Pl("delayEnded",r,{evt:t}),_r.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!XS&&r.nativeDraggable&&(On.draggable=!0),r._triggerDragStart(t,n),ul({sortable:r,name:"choose",originalEvent:t}),rs(On,c.chosenClass,!0)},c.ignore.split(",").forEach(function(_){hN(On,_.trim(),A1)}),ro(v,"dragover",Xp),ro(v,"mousemove",Xp),ro(v,"touchmove",Xp),c.supportPointer?(ro(v,"pointerup",r._onDrop),!this.nativeDraggable&&ro(v,"pointercancel",r._onDrop)):(ro(v,"mouseup",r._onDrop),ro(v,"touchend",r._onDrop),ro(v,"touchcancel",r._onDrop)),XS&&this.nativeDraggable&&(this.options.touchStartThreshold=4,On.draggable=!0),Pl("delayStart",this,{evt:t}),c.delay&&(!c.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Jm||Rd))){if(_r.eventCanceled){this._onDrop();return}c.supportPointer?(ro(v,"pointerup",r._disableDelayedDrag),ro(v,"pointercancel",r._disableDelayedDrag)):(ro(v,"mouseup",r._disableDelayedDrag),ro(v,"touchend",r._disableDelayedDrag),ro(v,"touchcancel",r._disableDelayedDrag)),ro(v,"mousemove",r._delayedDragTouchMoveHandler),ro(v,"touchmove",r._delayedDragTouchMoveHandler),c.supportPointer&&ro(v,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(f,c.delay)}else f()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;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(){On&&A1(On),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Qr(t,"mouseup",this._disableDelayedDrag),Qr(t,"touchend",this._disableDelayedDrag),Qr(t,"touchcancel",this._disableDelayedDrag),Qr(t,"pointerup",this._disableDelayedDrag),Qr(t,"pointercancel",this._disableDelayedDrag),Qr(t,"mousemove",this._delayedDragTouchMoveHandler),Qr(t,"touchmove",this._delayedDragTouchMoveHandler),Qr(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ro(document,"pointermove",this._onTouchMove):n?ro(document,"touchmove",this._onTouchMove):ro(document,"mousemove",this._onTouchMove):(ro(On,"dragend",this),ro(vi,"dragstart",this._onDragStart));try{document.selection?wg(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(uv=!1,vi&&On){Pl("dragStarted",this,{evt:n}),this.nativeDraggable&&ro(document,"dragover",XU);var a=this.options;!t&&rs(On,a.dragClass,!1),rs(On,a.ghostClass,!0),_r.active=this,t&&this._appendGhost(),ul({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(bu){this._lastX=bu.clientX,this._lastY=bu.clientY,EN();for(var t=document.elementFromPoint(bu.clientX,bu.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(bu.clientX,bu.clientY),t!==n);)n=t;if(On.parentNode[Rl]._isOutsideThisEl(t),n)do{if(n[Rl]){var a=void 0;if(a=n[Rl]._onDragOver({clientX:bu.clientX,clientY:bu.clientY,target:t,rootEl:n}),a&&!this.options.dragoverBubble)break}t=n}while(n=pN(n));ON()}},_onTouchMove:function(t){if(Hp){var n=this.options,a=n.fallbackTolerance,r=n.fallbackOffset,s=t.touches?t.touches[0]:t,c=Pr&&bv(Pr,!0),v=Pr&&c&&c.a,f=Pr&&c&&c.d,g=sg&&Wa&&KS(Wa),_=(s.clientX-Hp.clientX+r.x)/(v||1)+(g?g[0]-S1[0]:0)/(v||1),b=(s.clientY-Hp.clientY+r.y)/(f||1)+(g?g[1]-S1[1]:0)/(f||1);if(!_r.active&&!uv){if(a&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<a)return;this._onDragStart(t,!0)}if(Pr){c?(c.e+=_-(O1||0),c.f+=b-(x1||0)):c={a:1,b:0,c:0,d:1,e:_,f:b};var x="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");xr(Pr,"webkitTransform",x),xr(Pr,"mozTransform",x),xr(Pr,"msTransform",x),xr(Pr,"transform",x),O1=_,x1=b,bu=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Pr){var t=this.options.fallbackOnBody?document.body:vi,n=Yi(On,!0,sg,!0,t),a=this.options;if(sg){for(Wa=t;xr(Wa,"position")==="static"&&xr(Wa,"transform")==="none"&&Wa!==document;)Wa=Wa.parentNode;Wa!==document.body&&Wa!==document.documentElement?(Wa===document&&(Wa=sc()),n.top+=Wa.scrollTop,n.left+=Wa.scrollLeft):Wa=sc(),S1=KS(Wa)}Pr=On.cloneNode(!0),rs(Pr,a.ghostClass,!1),rs(Pr,a.fallbackClass,!0),rs(Pr,a.dragClass,!0),xr(Pr,"transition",""),xr(Pr,"transform",""),xr(Pr,"box-sizing","border-box"),xr(Pr,"margin",0),xr(Pr,"top",n.top),xr(Pr,"left",n.left),xr(Pr,"width",n.width),xr(Pr,"height",n.height),xr(Pr,"opacity","0.8"),xr(Pr,"position",sg?"absolute":"fixed"),xr(Pr,"zIndex","100000"),xr(Pr,"pointerEvents","none"),_r.ghost=Pr,t.appendChild(Pr),xr(Pr,"transform-origin",ZS/parseInt(Pr.style.width)*100+"% "+JS/parseInt(Pr.style.height)*100+"%")}},_onDragStart:function(t,n){var a=this,r=t.dataTransfer,s=a.options;if(Pl("dragStart",this,{evt:t}),_r.eventCanceled){this._onDrop();return}Pl("setupClone",this),_r.eventCanceled||(wi=yN(On),wi.removeAttribute("id"),wi.draggable=!1,wi.style["will-change"]="",this._hideClone(),rs(wi,this.options.chosenClass,!1),_r.clone=wi),a.cloneId=wg(function(){Pl("clone",a),!_r.eventCanceled&&(a.options.removeCloneOnHide||vi.insertBefore(wi,On),a._hideClone(),ul({sortable:a,name:"clone"}))}),!n&&rs(On,s.dragClass,!0),n?(Hg=!0,a._loopId=setInterval(a._emulateDragOver,50)):(Qr(document,"mouseup",a._onDrop),Qr(document,"touchend",a._onDrop),Qr(document,"touchcancel",a._onDrop),r&&(r.effectAllowed="move",s.setData&&s.setData.call(a,r,On)),ro(document,"drop",a),xr(On,"transform","translateZ(0)")),uv=!0,a._dragStartId=wg(a._dragStarted.bind(a,n,t)),ro(document,"selectstart",a),bm=!0,window.getSelection().removeAllRanges(),Nm&&xr(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,a=t.target,r,s,c,v=this.options,f=v.group,g=_r.active,_=ag===f,b=v.sort,x=Ta||g,S,A=this,E=!1;if(Mw)return;function T(Te,Me){Pl(Te,A,cc({evt:t,isOwner:_,axis:S?"vertical":"horizontal",revert:c,dragRect:r,targetRect:s,canSort:b,fromSortable:x,target:a,completed:R,onMove:function(rt,tt){return ug(vi,n,On,r,rt,Yi(rt),t,tt)},changed:U},Me))}function I(){T("dragOverAnimationCapture"),A.captureAnimationState(),A!==x&&x.captureAnimationState()}function R(Te){return T("dragOverCompleted",{insertion:Te}),Te&&(_?g._hideClone():g._showClone(A),A!==x&&(rs(On,Ta?Ta.options.ghostClass:g.options.ghostClass,!1),rs(On,v.ghostClass,!0)),Ta!==A&&A!==_r.active?Ta=A:A===_r.active&&Ta&&(Ta=null),x===A&&(A._ignoreWhileAnimating=a),A.animateAll(function(){T("dragOverAnimationComplete"),A._ignoreWhileAnimating=null}),A!==x&&(x.animateAll(),x._ignoreWhileAnimating=null)),(a===On&&!On.animated||a===n&&!a.animated)&&(iv=null),!v.dragoverBubble&&!t.rootEl&&a!==document&&(On.parentNode[Rl]._isOutsideThisEl(t.target),!Te&&Xp(t)),!v.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),E=!0}function U(){os=Cs(On),$f=Cs(On,v.draggable),ul({sortable:A,name:"change",toEl:n,newIndex:os,newDraggableIndex:$f,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),a=wu(a,v.draggable,n,!0),T("dragOver"),_r.eventCanceled)return E;if(On.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||A._ignoreWhileAnimating===a)return R(!1);if(Hg=!1,g&&!v.disabled&&(_?b||(c=Ni!==vi):Ta===this||(this.lastPutMode=ag.checkPull(this,g,On,t))&&f.checkPut(this,g,On,t))){if(S=this._getDirection(t,a)==="vertical",r=Yi(On),T("dragOverValid"),_r.eventCanceled)return E;if(c)return Ni=vi,I(),this._hideClone(),T("revert"),_r.eventCanceled||(Yp?vi.insertBefore(On,Yp):vi.appendChild(On)),R(!0);var D=RE(n,v.draggable);if(!D||ZU(t,S,this)&&!D.animated){if(D===On)return R(!1);if(D&&n===t.target&&(a=D),a&&(s=Yi(a)),ug(vi,n,On,r,a,s,t,!!a)!==!1)return I(),D&&D.nextSibling?n.insertBefore(On,D.nextSibling):n.appendChild(On),Ni=n,U(),R(!0)}else if(D&&KU(t,S,this)){var L=Nv(n,0,v,!0);if(L===On)return R(!1);if(a=L,s=Yi(a),ug(vi,n,On,r,a,s,t,!1)!==!1)return I(),n.insertBefore(On,L),Ni=n,U(),R(!0)}else if(a.parentNode===n){s=Yi(a);var W=0,H,B=On.parentNode!==n,F=!zU(On.animated&&On.toRect||r,a.animated&&a.toRect||s,S),q=S?"top":"left",K=YS(a,"top","top")||YS(On,"top","top"),X=K?K.scrollTop:void 0;iv!==a&&(H=s[q],jm=!1,lg=!F&&v.invertSwap||B),W=JU(t,a,s,S,F?1:v.swapThreshold,v.invertedSwapThreshold==null?v.swapThreshold:v.invertedSwapThreshold,lg,iv===a);var ee;if(W!==0){var ue=Cs(On);do ue-=W,ee=Ni.children[ue];while(ee&&(xr(ee,"display")==="none"||ee===Pr))}if(W===0||ee===a)return R(!1);iv=a,Rm=W;var ae=a.nextElementSibling,we=!1;we=W===1;var je=ug(vi,n,On,r,a,s,t,we);if(je!==!1)return(je===1||je===-1)&&(we=je===1),Mw=!0,setTimeout(YU,30),I(),we&&!ae?n.appendChild(On):a.parentNode.insertBefore(On,we?ae:a),K&&mN(K,0,X-K.scrollTop),Ni=On.parentNode,H!==void 0&&!lg&&(bg=Math.abs(H-Yi(a)[q])),U(),R(!0)}if(n.contains(On))return R(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Qr(document,"mousemove",this._onTouchMove),Qr(document,"touchmove",this._onTouchMove),Qr(document,"pointermove",this._onTouchMove),Qr(document,"dragover",Xp),Qr(document,"mousemove",Xp),Qr(document,"touchmove",Xp)},_offUpEvents:function(){var t=this.el.ownerDocument;Qr(t,"mouseup",this._onDrop),Qr(t,"touchend",this._onDrop),Qr(t,"pointerup",this._onDrop),Qr(t,"pointercancel",this._onDrop),Qr(t,"touchcancel",this._onDrop),Qr(document,"selectstart",this)},_onDrop:function(t){var n=this.el,a=this.options;if(os=Cs(On),$f=Cs(On,a.draggable),Pl("drop",this,{evt:t}),Ni=On&&On.parentNode,os=Cs(On),$f=Cs(On,a.draggable),_r.eventCanceled){this._nulling();return}uv=!1,lg=!1,jm=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),kw(this.cloneId),kw(this._dragStartId),this.nativeDraggable&&(Qr(document,"drop",this),Qr(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Nm&&xr(document.body,"user-select",""),xr(On,"transform",""),t&&(bm&&(t.cancelable&&t.preventDefault(),!a.dropBubble&&t.stopPropagation()),Pr&&Pr.parentNode&&Pr.parentNode.removeChild(Pr),(vi===Ni||Ta&&Ta.lastPutMode!=="clone")&&wi&&wi.parentNode&&wi.parentNode.removeChild(wi),On&&(this.nativeDraggable&&Qr(On,"dragend",this),A1(On),On.style["will-change"]="",bm&&!uv&&rs(On,Ta?Ta.options.ghostClass:this.options.ghostClass,!1),rs(On,this.options.chosenClass,!1),ul({sortable:this,name:"unchoose",toEl:Ni,newIndex:null,newDraggableIndex:null,originalEvent:t}),vi!==Ni?(os>=0&&(ul({rootEl:Ni,name:"add",toEl:Ni,fromEl:vi,originalEvent:t}),ul({sortable:this,name:"remove",toEl:Ni,originalEvent:t}),ul({rootEl:Ni,name:"sort",toEl:Ni,fromEl:vi,originalEvent:t}),ul({sortable:this,name:"sort",toEl:Ni,originalEvent:t})),Ta&&Ta.save()):os!==mv&&os>=0&&(ul({sortable:this,name:"update",toEl:Ni,originalEvent:t}),ul({sortable:this,name:"sort",toEl:Ni,originalEvent:t})),_r.active&&((os==null||os===-1)&&(os=mv,$f=Cm),ul({sortable:this,name:"end",toEl:Ni,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Pl("nulling",this),vi=On=Ni=Pr=Yp=wi=_g=Ff=Hp=bu=bm=os=$f=mv=Cm=iv=Rm=Ta=ag=_r.dragged=_r.ghost=_r.clone=_r.active=null,qg.forEach(function(t){t.checked=!0}),qg.length=O1=x1=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":On&&(this._onDragOver(t),qU(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,a=this.el.children,r=0,s=a.length,c=this.options;r<s;r++)n=a[r],wu(n,c.draggable,this.el,!1)&&t.push(n.getAttribute(c.dataIdAttr)||eW(n));return t},sort:function(t,n){var a={},r=this.el;this.toArray().forEach(function(s,c){var v=r.children[c];wu(v,this.options.draggable,r,!1)&&(a[s]=v)},this),n&&this.captureAnimationState(),t.forEach(function(s){a[s]&&(r.removeChild(a[s]),r.appendChild(a[s]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return wu(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var a=this.options;if(n===void 0)return a[t];var r=Qm.modifyOption(this,t,n);typeof r<"u"?a[t]=r:a[t]=n,t==="group"&&wN(a)},destroy:function(){Pl("destroy",this);var t=this.el;t[Rl]=null,Qr(t,"mousedown",this._onTapStart),Qr(t,"touchstart",this._onTapStart),Qr(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Qr(t,"dragover",this),Qr(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Xg.splice(Xg.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ff){if(Pl("hideClone",this),_r.eventCanceled)return;xr(wi,"display","none"),this.options.removeCloneOnHide&&wi.parentNode&&wi.parentNode.removeChild(wi),Ff=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ff){if(Pl("showClone",this),_r.eventCanceled)return;On.parentNode==vi&&!this.options.group.revertClone?vi.insertBefore(wi,On):Yp?vi.insertBefore(wi,Yp):vi.appendChild(wi),this.options.group.revertClone&&this.animate(On,wi),xr(wi,"display",""),Ff=!1}}};function qU(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function ug(e,t,n,a,r,s,c,v){var f,g=e[Rl],_=g.options.onMove,b;return window.CustomEvent&&!Rd&&!Jm?f=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent("move",!0,!0)),f.to=t,f.from=e,f.dragged=n,f.draggedRect=a,f.related=r||t,f.relatedRect=s||Yi(t),f.willInsertAfter=v,f.originalEvent=c,e.dispatchEvent(f),_&&(b=_.call(g,f,c)),b}function A1(e){e.draggable=!1}function YU(){Mw=!1}function KU(e,t,n){var a=Yi(Nv(n.el,0,n.options,!0)),r=gN(n.el,n.options,Pr),s=10;return t?e.clientX<r.left-s||e.clientY<a.top&&e.clientX<a.right:e.clientY<r.top-s||e.clientY<a.bottom&&e.clientX<a.left}function ZU(e,t,n){var a=Yi(RE(n.el,n.options.draggable)),r=gN(n.el,n.options,Pr),s=10;return t?e.clientX>r.right+s||e.clientY>a.bottom&&e.clientX>a.left:e.clientY>r.bottom+s||e.clientX>a.right&&e.clientY>a.top}function JU(e,t,n,a,r,s,c,v){var f=a?e.clientY:e.clientX,g=a?n.height:n.width,_=a?n.top:n.left,b=a?n.bottom:n.right,x=!1;if(!c){if(v&&bg<g*r){if(!jm&&(Rm===1?f>_+g*s/2:f<b-g*s/2)&&(jm=!0),jm)x=!0;else if(Rm===1?f<_+bg:f>b-bg)return-Rm}else if(f>_+g*(1-r)/2&&f<b-g*(1-r)/2)return QU(t)}return x=x||c,x&&(f<_+g*s/2||f>b-g*s/2)?f>_+g/2?1:-1:0}function QU(e){return Cs(On)<Cs(e)?1:-1}function eW(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,a=0;n--;)a+=t.charCodeAt(n);return a.toString(36)}function tW(e){qg.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&qg.push(a)}}function wg(e){return setTimeout(e,0)}function kw(e){return clearTimeout(e)}S_&&ro(document,"touchmove",function(e){(_r.active||uv)&&e.cancelable&&e.preventDefault()});_r.utils={on:ro,off:Qr,css:xr,find:hN,is:function(t,n){return!!wu(t,n,t,!1)},extend:LU,throttle:vN,closest:wu,toggleClass:rs,clone:yN,index:Cs,nextTick:wg,cancelNextTick:kw,detectDirection:bN,getChild:Nv,expando:Rl};_r.get=function(e){return e[Rl]};_r.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(a){if(!a.prototype||!a.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(a));a.utils&&(_r.utils=cc(cc({},_r.utils),a.utils)),Qm.mount(a)})};_r.create=function(e,t){return new _r(e,t)};_r.version=DU;var qi=[],wm,Tw,Nw=!1,M1,k1,Yg,Em;function nW(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var a=n.originalEvent;this.sortable.nativeDraggable?ro(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ro(document,"pointermove",this._handleFallbackAutoScroll):a.touches?ro(document,"touchmove",this._handleFallbackAutoScroll):ro(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var a=n.originalEvent;!this.options.dragOverBubble&&!a.rootEl&&this._handleAutoScroll(a)},drop:function(){this.sortable.nativeDraggable?Qr(document,"dragover",this._handleAutoScroll):(Qr(document,"pointermove",this._handleFallbackAutoScroll),Qr(document,"touchmove",this._handleFallbackAutoScroll),Qr(document,"mousemove",this._handleFallbackAutoScroll)),eA(),Eg(),$U()},nulling:function(){Yg=Tw=wm=Nw=Em=M1=k1=null,qi.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,a){var r=this,s=(n.touches?n.touches[0]:n).clientX,c=(n.touches?n.touches[0]:n).clientY,v=document.elementFromPoint(s,c);if(Yg=n,a||this.options.forceAutoScrollFallback||Jm||Rd||Nm){T1(n,this.options,v,a);var f=Vf(v,!0);Nw&&(!Em||s!==M1||c!==k1)&&(Em&&eA(),Em=setInterval(function(){var g=Vf(document.elementFromPoint(s,c),!0);g!==f&&(f=g,Eg()),T1(n,r.options,g,a)},10),M1=s,k1=c)}else{if(!this.options.bubbleScroll||Vf(v,!0)===sc()){Eg();return}T1(n,this.options,Vf(v,!1),!1)}}},Td(e,{pluginName:"scroll",initializeByDefault:!0})}function Eg(){qi.forEach(function(e){clearInterval(e.pid)}),qi=[]}function eA(){clearInterval(Em)}var T1=vN(function(e,t,n,a){if(t.scroll){var r=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,c=t.scrollSensitivity,v=t.scrollSpeed,f=sc(),g=!1,_;Tw!==n&&(Tw=n,Eg(),wm=t.scroll,_=t.scrollFn,wm===!0&&(wm=Vf(n,!0)));var b=0,x=wm;do{var S=x,A=Yi(S),E=A.top,T=A.bottom,I=A.left,R=A.right,U=A.width,D=A.height,L=void 0,W=void 0,H=S.scrollWidth,B=S.scrollHeight,F=xr(S),q=S.scrollLeft,K=S.scrollTop;S===f?(L=U<H&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),W=D<B&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(L=U<H&&(F.overflowX==="auto"||F.overflowX==="scroll"),W=D<B&&(F.overflowY==="auto"||F.overflowY==="scroll"));var X=L&&(Math.abs(R-r)<=c&&q+U<H)-(Math.abs(I-r)<=c&&!!q),ee=W&&(Math.abs(T-s)<=c&&K+D<B)-(Math.abs(E-s)<=c&&!!K);if(!qi[b])for(var ue=0;ue<=b;ue++)qi[ue]||(qi[ue]={});(qi[b].vx!=X||qi[b].vy!=ee||qi[b].el!==S)&&(qi[b].el=S,qi[b].vx=X,qi[b].vy=ee,clearInterval(qi[b].pid),(X!=0||ee!=0)&&(g=!0,qi[b].pid=setInterval((function(){a&&this.layer===0&&_r.active._onTouchMove(Yg);var ae=qi[this.layer].vy?qi[this.layer].vy*v:0,we=qi[this.layer].vx?qi[this.layer].vx*v:0;typeof _=="function"&&_.call(_r.dragged.parentNode[Rl],we,ae,e,Yg,qi[this.layer].el)!=="continue"||mN(qi[this.layer].el,we,ae)}).bind({layer:b}),24))),b++}while(t.bubbleScroll&&x!==f&&(x=Vf(x,!1)));Nw=g}},30),xN=function(t){var n=t.originalEvent,a=t.putSortable,r=t.dragEl,s=t.activeSortable,c=t.dispatchSortableEvent,v=t.hideGhostForTarget,f=t.unhideGhostForTarget;if(n){var g=a||s;v();var _=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,b=document.elementFromPoint(_.clientX,_.clientY);f(),g&&!g.el.contains(b)&&(c("spill"),this.onSpill({dragEl:r,putSortable:a}))}};function jE(){}jE.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,a=t.putSortable;this.sortable.captureAnimationState(),a&&a.captureAnimationState();var r=Nv(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),a&&a.animateAll()},drop:xN};Td(jE,{pluginName:"revertOnSpill"});function DE(){}DE.prototype={onSpill:function(t){var n=t.dragEl,a=t.putSortable,r=a||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:xN};Td(DE,{pluginName:"removeOnSpill"});_r.mount(new nW);_r.mount(DE,jE);const rW={class:"dialog-footer"},oW=Vn({__name:"ApiFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re({name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""}),f=Zf({name:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],variable:[{required:!0,message:yt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),g=Re(!1);Ym(g,S=>{S||(v.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},c.value=!1)});const _=S=>{S&&(v.value=ge.cloneDeep(S),c.value=!0),g.value=!0},b=()=>{g.value=!1,c.value=!1},x=async S=>{S&&await S.validate(A=>{A&&a("refresh",v.value)})};return t({open:_,close:b}),(S,A)=>{const E=J("el-input"),T=J("el-form-item"),I=J("el-switch"),R=J("el-form"),U=J("el-button"),D=J("el-dialog");return be(),at(D,{title:c.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:g.value,"onUpdate:modelValue":A[10]||(A[10]=L=>g.value=L),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:P(()=>[Y("span",rW,[k(U,{onClick:A[8]||(A[8]=rn(L=>g.value=!1,["prevent"]))},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:A[9]||(A[9]=L=>x(r.value)),loading:s.value},{default:P(()=>[et(de(c.value?S.$t("common.save"):S.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(R,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:v.value,"require-asterisk-position":"right"},{default:P(()=>[k(T,{label:S.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:P(()=>[k(E,{modelValue:v.value.variable,"onUpdate:modelValue":A[0]||(A[0]=L=>v.value.variable=L),placeholder:S.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:A[1]||(A[1]=L=>v.value.variable=v.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(T,{label:S.$t("common.desc")},{default:P(()=>[k(E,{modelValue:v.value.desc,"onUpdate:modelValue":A[2]||(A[2]=L=>v.value.desc=L),placeholder:S.$t("common.descPlaceholder"),onBlur:A[3]||(A[3]=L=>v.value.name=v.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(T,{label:S.$t("dynamicsForm.paramForm.required.label"),onClick:A[5]||(A[5]=rn(()=>{},["prevent"]))},{default:P(()=>[k(I,{size:"small",modelValue:v.value.is_required,"onUpdate:modelValue":A[4]||(A[4]=L=>v.value.is_required=L)},null,8,["modelValue"])]),_:1},8,["label"]),k(T,{label:S.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:v.value.is_required,message:S.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:v.value.default_value,"onUpdate:modelValue":A[6]||(A[6]=L=>v.value.default_value=L),placeholder:S.$t("dynamicsForm.default.placeholder"),onBlur:A[7]||(A[7]=L=>v.value.name=v.value.name.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),iW={class:"flex-between mb-16"},aW={class:"lighter"},lW=["title"],sW=["title"],uW=["title"],cW={class:"mr-4"},dW=Vn({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(null),r=Re(),s=Re([]);function c(_,b){typeof b<"u"&&(a.value=b),r.value.open(_)}function v(_){s.value.splice(_,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),g()}function f(_){for(let x=0;x<s.value.length;x++)if(s.value[x].variable===_.variable&&a.value!==x){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+_.variable);return}const b=t.nodeModel.properties.user_input_field_list;for(let x=0;x<b.length;x++)if(b[x].field===_.variable){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+_.variable);return}a.value!==null?s.value.splice(a.value,1,_):s.value.push(_),a.value=null,r.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),g()}function g(){if(!n.value)return;const b=n.value.$el.querySelector(".api-input-field-table .el-table__body-wrapper tbody");b&&_r.create(b,{animation:150,ghostClass:"ghost-row",onEnd:x=>{if(x.oldIndex===void 0||x.newIndex===void 0)return;const S=ge.cloneDeep([...s.value]),[A]=S.splice(x.oldIndex,1);S.splice(x.newIndex,0,A),s.value=S,t.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return Ir(()=>{t.nodeModel.properties.api_input_field_list?s.value.push(...t.nodeModel.properties.api_input_field_list):t.nodeModel.properties.input_field_list&&t.nodeModel.properties.input_field_list.filter(_=>_.assignment_method==="api_input").forEach(_=>{s.value.push(_)}),ge.set(t.nodeModel.properties,"api_input_field_list",s),g()}),(_,b)=>{var R;const x=J("AppIcon"),S=J("el-button"),A=J("el-table-column"),E=J("el-switch"),T=J("el-tooltip"),I=J("el-table");return be(),Ht(ar,null,[Y("div",iW,[Y("h5",aW,de(_.$t("views.model.modelForm.title.apiParamPassing")),1),k(S,{link:"",type:"primary",onClick:b[0]||(b[0]=U=>c())},{default:P(()=>[k(x,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(_.$t("common.add")),1)]),_:1})]),((R=t.nodeModel.properties.api_input_field_list)==null?void 0:R.length)>0?(be(),at(I,{key:0,data:t.nodeModel.properties.api_input_field_list,class:"mb-16 api-input-field-table",ref_key:"tableRef",ref:n,"row-key":"variable"},{default:P(()=>[k(A,{prop:"variable",label:_.$t("dynamicsForm.paramForm.field.label")},{default:P(({row:U})=>[Y("span",{class:"ellipsis-1",title:U.variable},de(U.variable),9,lW)]),_:1},8,["label"]),k(A,{prop:"desc",label:_.$t("common.desc")},{default:P(({row:U})=>[Y("span",{class:"ellipsis-1",title:U.desc},de(U.desc),9,sW)]),_:1},8,["label"]),k(A,{prop:"default_value",label:_.$t("dynamicsForm.default.label")},{default:P(({row:U})=>[Y("span",{class:"ellipsis-1",title:U.default_value},de(U.default_value),9,uW)]),_:1},8,["label"]),k(A,{label:_.$t("common.required")},{default:P(({row:U})=>[Y("div",{onClick:b[1]||(b[1]=rn(()=>{},["stop"]))},[k(E,{disabled:"",size:"small",modelValue:U.is_required,"onUpdate:modelValue":D=>U.is_required=D},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(A,{label:_.$t("common.operation"),align:"left",width:"90"},{default:P(({row:U,$index:D})=>[Y("span",cW,[k(T,{effect:"dark",content:_.$t("common.modify"),placement:"top"},{default:P(()=>[k(S,{type:"primary",text:"",onClick:rn(L=>c(U,D),["stop"])},{default:P(()=>[k(x,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(T,{effect:"dark",content:_.$t("common.delete"),placement:"top"},{default:P(()=>[k(S,{type:"primary",text:"",onClick:L=>v(D)},{default:P(()=>[k(x,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(oW,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:f},null,512)],64)}}}),fW={class:"dialog-footer"},pW=Vn({__name:"UserFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re(),f=(T,I)=>T.every(R=>kD.get(I,R,void 0)!==void 0),g=$n(()=>{if(v.value){const T=v.value;switch(T.type){case"input":return f(["field","input_type","label","required","attrs"],v.value)?v.value:{attrs:T.attrs||{maxlength:200,minlength:0},field:T.field||T.variable,input_type:"TextInput",label:T.label||T.name,default_value:T.default_value,required:T.required!=null?T.required:T.is_required};case"select":return f(["field","input_type","label","required","option_list"],v.value)?v.value:{attrs:T.attrs||{},field:T.field||T.variable,input_type:"SingleSelect",label:T.label||T.name,default_value:T.default_value,required:T.required!=null?T.required:T.is_required,option_list:T.option_list?T.option_list:T.optionList.map(I=>({key:I,value:I}))};case"date":return f(["field","input_type","label","required","attrs.format","attrs.value-format","attrs.type"],v.value)?v.value:{field:T.field||T.variable,input_type:"DatePicker",label:T.label||T.name,default_value:T.default_value,required:T.required!=null?T.required:T.is_required,attrs:{format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",type:"datetime"}};default:return v.value}}else return{input_type:"TextInput",required:!1,attrs:{maxlength:200,minlength:0},show_default_value:!0}}),_=Re(null),b=Re([{label:yt("dynamicsForm.input_type_list.TextInput"),value:"TextInputConstructor"},{label:yt("dynamicsForm.input_type_list.PasswordInput"),value:"PasswordInputConstructor"},{label:yt("dynamicsForm.input_type_list.SingleSelect"),value:"SingleSelectConstructor"},{label:yt("dynamicsForm.input_type_list.MultiSelect"),value:"MultiSelectConstructor"},{label:yt("dynamicsForm.input_type_list.RadioCard"),value:"RadioCardConstructor"},{label:yt("dynamicsForm.input_type_list.DatePicker"),value:"DatePickerConstructor"},{label:yt("dynamicsForm.input_type_list.SwitchInput"),value:"SwitchInputConstructor"}]),x=Re(!1),S=(T,I)=>{x.value=!0,T?(c.value=!0,v.value=ge.cloneDeep(T),_.value=I):v.value=null},A=()=>{x.value=!1,c.value=!1,_.value=null,v.value=null},E=async()=>{const T=r.value;T&&await T.validate().then(()=>{a("refresh",T==null?void 0:T.getData(),_.value),c.value=!1,v.value=null,_.value=null})};return t({open:S,close:A}),(T,I)=>{const R=J("el-button"),U=J("el-dialog");return be(),at(U,{title:c.value?T.$t("common.param.editParam"):T.$t("common.param.addParam"),modelValue:x.value,"onUpdate:modelValue":I[2]||(I[2]=D=>x.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":A,"append-to-body":""},{footer:P(()=>[Y("span",fW,[k(R,{onClick:rn(A,["prevent"])},{default:P(()=>[et(de(T.$t("common.cancel")),1)]),_:1}),k(R,{type:"primary",onClick:I[1]||(I[1]=D=>E()),loading:s.value},{default:P(()=>[et(de(c.value?T.$t("common.save"):T.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(qw,{modelValue:g.value,"onUpdate:modelValue":I[0]||(I[0]=D=>g.value=D),"label-position":"top","require-asterisk-position":"right",input_type_list:b.value,ref_key:"DynamicsFormConstructorRef",ref:r},null,8,["modelValue","input_type_list"])]),_:1},8,["title","modelValue"])}}}),hW={class:"dialog-footer"},vW=Vn({__name:"UserInputTitleDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re({title:yt("chat.userInput")}),v=Zf({title:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),f=Re(!1),g=x=>{x&&(c.value=ge.cloneDeep(x)),f.value=!0},_=()=>{f.value=!1},b=async x=>{x&&await x.validate(S=>{S&&a("refresh",c.value)})};return t({open:g,close:_}),(x,S)=>{const A=J("el-input"),E=J("el-form-item"),T=J("el-form"),I=J("el-button"),R=J("el-dialog");return be(),at(R,{title:x.$t("common.setting"),modelValue:f.value,"onUpdate:modelValue":S[5]||(S[5]=U=>f.value=U),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:P(()=>[Y("span",hW,[k(I,{onClick:S[3]||(S[3]=rn(U=>f.value=!1,["prevent"]))},{default:P(()=>[et(de(x.$t("common.cancel")),1)]),_:1}),k(I,{type:"primary",onClick:S[4]||(S[4]=U=>b(r.value)),loading:s.value},{default:P(()=>[et(de(x.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:v,model:c.value,"require-asterisk-position":"right",onSubmit:S[2]||(S[2]=rn(()=>{},["prevent"]))},{default:P(()=>[k(E,{label:x.$t("common.title"),prop:"title"},{default:P(()=>[k(A,{modelValue:c.value.title,"onUpdate:modelValue":S[0]||(S[0]=U=>c.value.title=U),maxlength:"64","show-word-limit":"",onBlur:S[1]||(S[1]=U=>c.value.title=c.value.title.trim())},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),mW={class:"flex-between mb-16"},yW=["title"],gW={class:"ml-4"},_W=["title"],bW={key:0},wW=["title"],EW={key:1},OW=["title"],xW=["title"],SW={class:"mr-4"},AW=Vn({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re(),s=Re([]),c=Re({title:yt("chat.userInput")});function v(A,E){a.value.open(A,E)}function f(){r.value.open(c.value)}function g(A){s.value.splice(A,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),S()}function _(A,E){for(let I=0;I<s.value.length;I++)if(s.value[I].field===A.field&&E!==I){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+A.field);return}const T=t.nodeModel.properties.api_input_field_list;for(let I=0;I<T.length;I++)if(T[I].variable===A.field){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+A.field);return}E!==null?s.value.splice(E,1,A):s.value.push(A),a.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),S()}function b(A){c.value=A,r.value.close()}const x=A=>{var E;if(A.input_type==="PasswordInput")return"******";if(A.default_value){const T=(E=A.option_list)==null?void 0:E.filter(I=>A.default_value.indexOf(I.value)>-1).map(I=>I.label).join(",");return T||A.default_value}if(A.default_value!==void 0)return A.default_value};function S(){if(!n.value)return;const E=n.value.$el.querySelector(".el-table__body-wrapper tbody");E&&_r.create(E,{animation:150,ghostClass:"ghost-row",onEnd:T=>{if(T.oldIndex===void 0||T.newIndex===void 0)return;const I=ge.cloneDeep([...s.value]),[R]=I.splice(T.oldIndex,1);I.splice(T.newIndex,0,R),s.value=I,t.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return Ir(()=>{t.nodeModel.properties.user_input_field_list?s.value.push(...t.nodeModel.properties.user_input_field_list):t.nodeModel.properties.input_field_list&&t.nodeModel.properties.input_field_list.filter(A=>A.assignment_method==="user_input").forEach(A=>{s.value.push(A)}),s.value.forEach((A,E)=>{switch(A.label=A.label||A.name,A.field=A.field||A.variable,A.required=A.required||A.is_required,A.type){case"input":A.input_type="TextInput";break;case"select":A.input_type="SingleSelect";break;case"date":A.input_type="DatePicker";break}}),ge.set(t.nodeModel.properties,"user_input_field_list",s),t.nodeModel.properties.user_input_config&&(c.value=t.nodeModel.properties.user_input_config),ge.set(t.nodeModel.properties,"user_input_config",c),S()}),(A,E)=>{var H;const T=J("AppIcon"),I=J("el-button"),R=J("el-table-column"),U=J("el-tag"),D=J("el-switch"),L=J("el-tooltip"),W=J("el-table");return be(),Ht(ar,null,[Y("div",mW,[Y("h5",{class:"break-all ellipsis lighter",style:{"max-width":"80%"},title:c.value.title},de(c.value.title),9,yW),Y("div",null,[k(I,{type:"primary",link:"",onClick:f},{default:P(()=>[k(T,{iconName:"app-setting"})]),_:1}),Y("span",gW,[k(I,{link:"",type:"primary",onClick:E[0]||(E[0]=B=>v())},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(A.$t("common.add")),1)]),_:1})])])]),((H=t.nodeModel.properties.user_input_field_list)==null?void 0:H.length)>0?(be(),at(W,{key:0,data:t.nodeModel.properties.user_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:P(()=>[k(R,{prop:"field",label:A.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:B})=>[Y("span",{title:B.field,class:"ellipsis-1"},de(B.field),9,_W)]),_:1},8,["label"]),k(R,{prop:"label",label:A.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:B})=>[B.label&&B.label.input_type==="TooltipLabel"?(be(),Ht("span",bW,[Y("span",{title:B.label.label,class:"ellipsis-1"},de(B.label.label),9,wW)])):(be(),Ht("span",EW,[Y("span",{title:B.label,class:"ellipsis-1"},de(B.label),9,OW)]))]),_:1},8,["label"]),k(R,{label:A.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:P(({row:B})=>[B.input_type==="TextInput"?(be(),at(U,{key:0,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):pn("",!0),B.input_type==="PasswordInput"?(be(),at(U,{key:1,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):pn("",!0),B.input_type==="Slider"?(be(),at(U,{key:2,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):pn("",!0),B.input_type==="SwitchInput"?(be(),at(U,{key:3,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):pn("",!0),B.input_type==="SingleSelect"?(be(),at(U,{key:4,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):pn("",!0),B.input_type==="MultiSelect"?(be(),at(U,{key:5,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):pn("",!0),B.input_type==="RadioCard"?(be(),at(U,{key:6,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):pn("",!0),B.input_type==="DatePicker"?(be(),at(U,{key:7,type:"info",class:"info-tag"},{default:P(()=>[et(de(A.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):pn("",!0)]),_:1},8,["label"]),k(R,{prop:"default_value",label:A.$t("dynamicsForm.default.label")},{default:P(({row:B})=>[Y("span",{title:B.default_value,class:"ellipsis-1"},de(x(B)),9,xW)]),_:1},8,["label"]),k(R,{label:A.$t("common.required")},{default:P(({row:B})=>[Y("div",{onClick:E[1]||(E[1]=rn(()=>{},["stop"]))},[k(D,{disabled:"",size:"small",modelValue:B.required,"onUpdate:modelValue":F=>B.required=F},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(R,{label:A.$t("common.operation"),align:"left",width:"90"},{default:P(({row:B,$index:F})=>[Y("span",SW,[k(L,{effect:"dark",content:A.$t("common.modify"),placement:"top"},{default:P(()=>[k(I,{type:"primary",text:"",onClick:rn(q=>v(B,F),["stop"])},{default:P(()=>[k(T,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(L,{effect:"dark",content:A.$t("common.delete"),placement:"top"},{default:P(()=>[k(I,{type:"primary",text:"",onClick:q=>g(F)},{default:P(()=>[k(T,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(pW,{ref_key:"UserFieldFormDialogRef",ref:a,onRefresh:_},null,512),k(vW,{ref_key:"UserInputTitleDialogRef",ref:r,onRefresh:b},null,512)],64)}}}),MW="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",kW="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",TW="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",NW="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",PW="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",CW={class:"p-8"},RW={class:"flex-between"},jW={class:"flex align-center"},DW={class:"line-height-22 mt-4"},IW={class:"flex-between"},LW={class:"flex align-center"},$W={class:"line-height-22 mt-4"},FW={class:"flex-between"},BW={class:"flex align-center"},VW={class:"line-height-22 mt-4"},UW={class:"flex-between"},WW={class:"flex align-center"},GW={class:"line-height-22 mt-4"},zW={class:"flex-between"},HW={class:"flex align-center"},XW={class:"line-height-22 mt-4"},qW={class:"dialog-footer"},YW=Vn({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=e,s=Re(!1),c=Re(!1),v=Re(""),f=Re(!1),g=Re(),_=Re(),b=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],x=["JPG","JPEG","PNG","GIF"],S=["MP3","WAV","OGG","ACC","M4A"],A=["MP4","AVI","MKV","MOV","FLV","WMV"],E=Re({maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["PPT","DOC"]});function T(W){s.value=!0,Gf(()=>{E.value={...E.value,...W}})}function I(){s.value=!1}const R=W=>{E.value.otherExtensions=E.value.otherExtensions.filter(H=>H!==W)},U=()=>{c.value=!0,Gf(()=>{_.value.input.focus()})},D=()=>{if(v.value){if(v.value=v.value.toUpperCase(),E.value.otherExtensions.includes(v.value)||b.includes(v.value)||x.includes(v.value)||S.includes(v.value)){c.value=!1,v.value="",ND(yt("common.fileUpload.existingExtensionsTip"));return}E.value.otherExtensions.push(v.value)}c.value=!1,v.value=""};async function L(){const W=g.value;W&&await W.validate().then(()=>{const H=ge.cloneDeep(E.value);a("refresh",H),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),s.value=!1})}return t({open:T}),(W,H)=>{const B=J("el-slider"),F=J("el-form-item"),q=J("el-text"),K=J("el-checkbox"),X=J("el-card"),ee=J("el-tag"),ue=J("el-input"),ae=J("el-button"),we=J("el-space"),je=J("el-form"),Te=J("el-scrollbar"),Me=J("el-dialog");return be(),at(Me,{title:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:s.value,"onUpdate:modelValue":H[19]||(H[19]=Ne=>s.value=Ne),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":I,"append-to-body":"",width:"800","align-center":"",class:"scrollbar-dialog"},{footer:P(()=>[Y("span",qW,[k(ae,{onClick:rn(I,["prevent"])},{default:P(()=>[et(de(W.$t("common.cancel")),1)]),_:1}),k(ae,{type:"primary",onClick:H[18]||(H[18]=Ne=>L()),loading:f.value},{default:P(()=>[et(de(W.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(Te,{"max-height":"550"},{default:P(()=>[Y("div",CW,[k(je,{"label-position":"top",ref_key:"fieldFormRef",ref:g,model:E.value,"require-asterisk-position":"right"},{default:P(()=>[k(F,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:P(()=>[k(B,{modelValue:E.value.maxFiles,"onUpdate:modelValue":H[0]||(H[0]=Ne=>E.value.maxFiles=Ne),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),k(F,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:P(()=>[k(B,{modelValue:E.value.fileLimit,"onUpdate:modelValue":H[1]||(H[1]=Ne=>E.value.fileLimit=Ne),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),k(F,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:P(()=>[k(X,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:H[4]||(H[4]=rn(Ne=>E.value.document=!E.value.document,["stop"]))},{default:P(()=>[Y("div",RW,[Y("div",jW,[H[20]||(H[20]=Y("img",{class:"mr-12",src:MW,alt:""},null,-1)),Y("div",null,[Y("p",DW,[et(de(W.$t("common.fileUpload.document"))+" ",1),k(q,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),Y("p",null,de(b.join("、")),1)])]),k(K,{modelValue:E.value.document,"onUpdate:modelValue":H[2]||(H[2]=Ne=>E.value.document=Ne),onChange:H[3]||(H[3]=Ne=>E.value.document=!E.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:H[7]||(H[7]=rn(Ne=>E.value.image=!E.value.image,["stop"]))},{default:P(()=>[Y("div",IW,[Y("div",LW,[H[21]||(H[21]=Y("img",{class:"mr-12",src:kW,alt:""},null,-1)),Y("div",null,[Y("p",$W,[et(de(W.$t("common.fileUpload.image"))+" ",1),k(q,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),Y("p",null,de(x.join("、")),1)])]),k(K,{modelValue:E.value.image,"onUpdate:modelValue":H[5]||(H[5]=Ne=>E.value.image=Ne),onChange:H[6]||(H[6]=Ne=>E.value.image=!E.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:H[10]||(H[10]=rn(Ne=>E.value.audio=!E.value.audio,["stop"]))},{default:P(()=>[Y("div",FW,[Y("div",BW,[H[22]||(H[22]=Y("img",{class:"mr-12",src:TW,alt:""},null,-1)),Y("div",null,[Y("p",VW,[et(de(W.$t("common.fileUpload.audio"))+" ",1),k(q,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),Y("p",null,de(S.join("、")),1)])]),k(K,{modelValue:E.value.audio,"onUpdate:modelValue":H[8]||(H[8]=Ne=>E.value.audio=Ne),onChange:H[9]||(H[9]=Ne=>E.value.audio=!E.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:H[13]||(H[13]=rn(Ne=>E.value.video=!E.value.video,["stop"]))},{default:P(()=>[Y("div",UW,[Y("div",WW,[H[23]||(H[23]=Y("img",{class:"mr-12",width:"32",src:NW,alt:""},null,-1)),Y("div",null,[Y("p",GW,[et(de(W.$t("common.fileUpload.video"))+" ",1),k(q,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),Y("p",null,de(A.join("、")),1)])]),k(K,{modelValue:E.value.video,"onUpdate:modelValue":H[11]||(H[11]=Ne=>E.value.video=Ne),onChange:H[12]||(H[12]=Ne=>E.value.video=!E.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:H[17]||(H[17]=rn(Ne=>E.value.other=!E.value.other,["stop"]))},{default:P(()=>[Y("div",zW,[Y("div",HW,[H[24]||(H[24]=Y("img",{class:"mr-12",width:32,src:PW,alt:""},null,-1)),Y("div",null,[Y("p",XW,[et(de(W.$t("common.fileUpload.other"))+" ",1),k(q,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),k(we,{wrap:"",size:2,class:"mt-4"},{default:P(()=>[(be(!0),Ht(ar,null,Gr(E.value.otherExtensions,Ne=>(be(),at(ee,{key:Ne,closable:"","disable-transitions":!1,onClose:rt=>R(Ne),type:"info",class:"mr-4",effect:"plain",style:{"--el-tag-border-radius":"4px","--el-tag-border-color":"var(--el-border-color)"}},{default:P(()=>[et(de(Ne),1)]),_:2},1032,["onClose"]))),128)),c.value?(be(),at(ue,{key:0,ref_key:"InputRef",ref:_,modelValue:v.value,"onUpdate:modelValue":H[14]||(H[14]=Ne=>v.value=Ne),size:"small",onKeyup:TD(D,["enter"]),onBlur:D},null,8,["modelValue"])):(be(),at(ae,{key:1,class:"button-new-tag",size:"small",onClick:rn(U,["stop"])},{default:P(()=>[et(" + "+de(W.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),k(K,{modelValue:E.value.other,"onUpdate:modelValue":H[15]||(H[15]=Ne=>E.value.other=Ne),onChange:H[16]||(H[16]=Ne=>E.value.other=!E.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),KW={class:"dialog-footer"},ZW=Vn({__name:"ChatFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re(null),f=Re({field:"",label:""}),g=Zf({label:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:yt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),_=Re(!1),b=(A,E)=>{A&&(f.value=ge.cloneDeep(A),c.value=!0,v.value=E),_.value=!0},x=()=>{_.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},S=async A=>{A&&await A.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(A,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),D=J("el-dialog");return be(),at(D,{title:c.value?A.$t("common.param.editParam"):A.$t("common.param.addParam"),modelValue:_.value,"onUpdate:modelValue":E[3]||(E[3]=L=>_.value=L),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[Y("span",KW,[k(U,{onClick:rn(x,["prevent"])},{default:P(()=>[et(de(A.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=L=>S(r.value)),loading:s.value},{default:P(()=>[et(de(c.value?A.$t("common.save"):A.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(R,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:g,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:A.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:g.field},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=L=>f.value.field=L),maxlength:64,placeholder:A.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(I,{label:A.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:g.label},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=L=>f.value.label=L),maxlength:64,"show-word-limit":"",placeholder:A.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),JW={class:"flex-between mb-16"},QW={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},eG={class:"ml-4"},tG=["title"],nG=["title"],rG={class:"mr-4"},oG=Vn({__name:"ChatFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re([]);function s(f,g){a.value.open(f,g)}function c(f){r.value.splice(f,1),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function v(f,g){for(let _=0;_<r.value.length;_++)if(r.value[_].field===f.field&&g!==_){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(g)?r.value.push(f):r.value.splice(g,1,f),a.value.close(),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return Ir(()=>{t.nodeModel.properties.chat_input_field_list&&(r.value=ge.cloneDeep(t.nodeModel.properties.chat_input_field_list)),ge.set(t.nodeModel.properties,"chat_input_field_list",r)}),(f,g)=>{var E;const _=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),S=J("el-tooltip"),A=J("el-table");return be(),Ht(ar,null,[Y("div",JW,[Y("h5",QW,de(f.$t("views.applicationWorkflow.variable.chat")),1),Y("div",null,[Y("span",eG,[k(b,{link:"",type:"primary",onClick:g[0]||(g[0]=T=>s())},{default:P(()=>[k(_,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(f.$t("common.add")),1)]),_:1})])])]),((E=t.nodeModel.properties.chat_input_field_list)==null?void 0:E.length)>0?(be(),at(A,{key:0,data:t.nodeModel.properties.chat_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:P(()=>[k(x,{prop:"field",label:f.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:T})=>[Y("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,tG)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[Y("span",null,[Y("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,nG)])]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[Y("span",rG,[k(S,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:rn(R=>s(T,I),["stop"])},{default:P(()=>[k(_,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:f.$t("common.delete"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:R=>c(I)},{default:P(()=>[k(_,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(ZW,{ref_key:"ChatFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),iG={class:"flex-between"},aG={class:"flex align-center"},lG={class:"mr-4"},sG={class:"flex-between"},uG={class:"mr-4"},cG={class:"flex"},dG={class:"flex-between"},fG={class:"mr-4"},pG={class:"flex"},hG={class:"w-full"},vG={class:"flex-between w-full"},mG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(null),f=Re(),g=Re(),_=Re(),b=Re(),x={name:"",desc:"",prologue:yt("views.application.form.defaultPrologue")},S=ee=>ee.ctrlKey===!0?(ee.preventDefault(),!0):(ee.stopPropagation(),!0);function A(ee){ge.set(s.nodeModel.properties.node_data,"prologue",ee)}const E=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:ee=>{ge.set(s.nodeModel.properties,"node_data",ee)}}),T=Re(),I=()=>{var ee;return E.value.tts_model_enable&&!E.value.tts_model_id&&E.value.tts_type==="TTS"?Promise.reject({node:s.nodeModel,errMessage:yt("views.application.form.voicePlay.requiredMessage")}):E.value.stt_model_enable&&!E.value.stt_model_id?Promise.reject({node:s.nodeModel,errMessage:yt("views.application.form.voiceInput.requiredMessage")}):(ee=T.value)==null?void 0:ee.validate().catch(ue=>Promise.reject({node:s.nodeModel,errMessage:ue}))},R=t();function U(){var ue;const ee=r.value==="systemManage"?{model_type:"STT",workspace_id:(ue=R.value)==null?void 0:ue.workspace_id}:{model_type:"STT"};po({type:"model",systemType:r.value}).getSelectModelList(ee).then(ae=>{c.value=ge.groupBy(ae==null?void 0:ae.data,"provider")})}function D(){var ue;const ee=r.value==="systemManage"?{model_type:"TTS",workspace_id:(ue=R.value)==null?void 0:ue.workspace_id}:{model_type:"TTS"};po({type:"model",systemType:r.value}).getSelectModelList(ee).then(ae=>{v.value=ge.groupBy(ae==null?void 0:ae.data,"provider")})}function L(){Gf(()=>{var ee;E.value.tts_model_id?(ee=f.value)==null||ee.reset_default(E.value.tts_model_id,a):F({})})}function W(){E.value.tts_model_enable||(E.value.tts_model_id="",E.value.tts_type="BROWSER")}function H(){E.value.stt_model_enable||(E.value.stt_model_id="")}const B=()=>{var ue;const ee=E.value.tts_model_id;if(!ee){zf(yt("views.application.form.voicePlay.requiredMessage"));return}(ue=f.value)==null||ue.open(ee,a,E.value.tts_model_params_setting)},F=ee=>{E.value.tts_model_params_setting=ee},q=()=>{const ee={maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["ppt","doc"]};E.value.file_upload_enable&&(E.value.file_upload_setting=E.value.file_upload_setting||ee),s.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig")},K=()=>{var ee;(ee=b.value)==null||ee.open(E.value.file_upload_setting)},X=ee=>{E.value.file_upload_setting=ee};return Ir(()=>{ge.set(s.nodeModel,"validate",I),s.nodeModel.properties.node_data.tts_type||ge.set(s.nodeModel.properties.node_data,"tts_type","BROWSER"),D(),U()}),(ee,ue)=>{const ae=J("el-input"),we=J("el-form-item"),je=J("MdEditorMagnify"),Te=J("AppIcon"),Me=J("el-tooltip"),Ne=J("el-button"),rt=J("el-switch"),tt=J("el-checkbox"),Be=J("ModelSelect"),lt=J("el-radio"),St=J("el-radio-group"),He=J("Operation"),Jt=J("el-icon"),Fe=J("el-form");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(Fe,{onSubmit:ue[13]||(ue[13]=rn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right",class:"mb-24","label-width":"auto",ref_key:"baseNodeFormRef",ref:T},{default:P(()=>[k(we,{label:ee.$t("views.applicationWorkflow.nodes.baseNode.appName.label"),prop:"name",rules:{message:_n(yt)("views.application.form.appName.requiredMessage"),trigger:"blur",required:!0}},{default:P(()=>[k(ae,{modelValue:E.value.name,"onUpdate:modelValue":ue[0]||(ue[0]=me=>E.value.name=me),maxlength:"64",placeholder:_n(yt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:ue[1]||(ue[1]=me=>{var Le;return E.value.name=(Le=E.value.name)==null?void 0:Le.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(we,{label:ee.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:P(()=>[k(ae,{modelValue:E.value.desc,"onUpdate:modelValue":ue[2]||(ue[2]=me=>E.value.desc=me),placeholder:ee.$t("views.application.form.appDescription.placeholder"),rows:3,type:"textarea",maxlength:"256","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(we,{label:ee.$t("views.application.form.prologue")},{default:P(()=>[k(je,{onWheel:S,title:ee.$t("views.application.form.prologue"),modelValue:E.value.prologue,"onUpdate:modelValue":ue[3]||(ue[3]=me=>E.value.prologue=me),style:{height:"150px"},onSubmitDialog:A},null,8,["title","modelValue"])]),_:1},8,["label"]),k(we,null,{label:P(()=>[Y("div",iG,[Y("div",aG,[Y("span",lG,de(ee.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),k(Me,{effect:"dark",content:ee.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:P(()=>[k(Te,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),Y("div",null,[E.value.file_upload_enable?(be(),at(Ne,{key:0,type:"primary",link:"",onClick:K,class:"mr-4"},{default:P(()=>[k(Te,{iconName:"app-setting",class:"mr-4"})]),_:1})):pn("",!0),k(rt,{size:"small",modelValue:E.value.file_upload_enable,"onUpdate:modelValue":ue[4]||(ue[4]=me=>E.value.file_upload_enable=me),onChange:q},null,8,["modelValue"])])])]),_:1}),k(AW,{ref_key:"UserInputFieldTableFef",ref:g,"node-model":e.nodeModel},null,8,["node-model"]),k(dW,{ref_key:"ApiInputFieldTableFef",ref:_,"node-model":e.nodeModel},null,8,["node-model"]),k(oG,{ref:"ChatFieldTeble","node-model":e.nodeModel},null,8,["node-model"]),k(we,null,{label:P(()=>[Y("div",sG,[Y("span",uG,de(ee.$t("views.application.form.voiceInput.label")),1),Y("div",cG,[E.value.stt_model_enable?(be(),at(tt,{key:0,modelValue:E.value.stt_autosend,"onUpdate:modelValue":ue[5]||(ue[5]=me=>E.value.stt_autosend=me)},{default:P(()=>[et(de(ee.$t("views.application.form.voiceInput.autoSend")),1)]),_:1},8,["modelValue"])):pn("",!0),k(rt,{class:"ml-8",size:"small",modelValue:E.value.stt_model_enable,"onUpdate:modelValue":ue[6]||(ue[6]=me=>E.value.stt_model_enable=me),onChange:H},null,8,["modelValue"])])])]),default:P(()=>[Ga(k(Be,{onWheel:S,modelValue:E.value.stt_model_id,"onUpdate:modelValue":ue[7]||(ue[7]=me=>E.value.stt_model_id=me),placeholder:ee.$t("views.application.form.voiceInput.placeholder"),options:c.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"]),[[Wf,E.value.stt_model_enable]])]),_:1}),k(we,null,{label:P(()=>[Y("div",dG,[Y("span",fG,de(ee.$t("views.application.form.voicePlay.label")),1),Y("div",pG,[E.value.tts_model_enable?(be(),at(tt,{key:0,modelValue:E.value.tts_autoplay,"onUpdate:modelValue":ue[8]||(ue[8]=me=>E.value.tts_autoplay=me)},{default:P(()=>[et(de(ee.$t("views.application.form.voicePlay.autoPlay")),1)]),_:1},8,["modelValue"])):pn("",!0),k(rt,{class:"ml-8",size:"small",modelValue:E.value.tts_model_enable,"onUpdate:modelValue":ue[9]||(ue[9]=me=>E.value.tts_model_enable=me),onChange:W},null,8,["modelValue"])])])]),default:P(()=>[Y("div",hG,[Ga(k(St,{modelValue:E.value.tts_type,"onUpdate:modelValue":ue[10]||(ue[10]=me=>E.value.tts_type=me)},{default:P(()=>[k(lt,{label:ee.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),k(lt,{label:ee.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Wf,E.value.tts_model_enable]])]),Y("div",vG,[E.value.tts_type==="TTS"&&E.value.tts_model_enable?(be(),at(Be,{key:0,onWheel:S,modelValue:E.value.tts_model_id,"onUpdate:modelValue":ue[11]||(ue[11]=me=>E.value.tts_model_id=me),placeholder:ee.$t("views.application.form.voicePlay.placeholder"),options:v.value,onChange:ue[12]||(ue[12]=me=>L()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):pn("",!0),E.value.tts_type==="TTS"&&E.value.tts_model_enable?(be(),at(Ne,{key:1,onClick:B,disabled:!E.value.tts_model_id,class:"ml-8"},{default:P(()=>[k(Jt,null,{default:P(()=>[k(Jt,null,{default:P(()=>[k(He)]),_:1})]),_:1})]),_:1},8,["disabled"])):pn("",!0)])]),_:1})]),_:1},8,["model"]),k(ek,{ref_key:"TTSModeParamSettingDialogRef",ref:f,onRefresh:F},null,512),k(YW,{ref_key:"FileUploadSettingDialogRef",ref:b,"node-model":e.nodeModel,onRefresh:X},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),yG=Kf(mG,[["__scopeId","data-v-940d4dcd"]]);class gG extends ho{constructor(t){super(t,yG)}}class _G extends vo{constructor(t,n){super(t,n)}get_width(){return 600}}const bG={type:"base-node",model:_G,view:gG},SN=Object.freeze(Object.defineProperty({__proto__:null,default:bG},Symbol.toStringTag,{value:"Module"})),wG={class:"handle flex-between lighter"},EG={class:"flex align-center"},OG={key:0,class:"info"},xG={key:0,class:"mt-8"},SG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={branch:[{conditions:[{field:[],compare:"",value:""}],id:is(),type:"IF",condition:"and"},{conditions:[],id:is(),type:"ELSE",condition:"and"}]},a=E=>E.ctrlKey===!0?(E.preventDefault(),!0):(E.stopPropagation(),!0),r=(E,T,I)=>{const U=ge.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]).map(D=>D.id===T.id?{...D,height:E.height,index:I}:D);ge.set(t.nodeModel.properties,"branch_condition_list",U),b(t.nodeModel.properties.node_data.branch,!0)},s=$n({get:()=>(t.nodeModel.properties.node_data||(ge.set(t.nodeModel.properties,"node_data",n),b(n.branch,!0)),t.nodeModel.properties.node_data),set:E=>{ge.set(t.nodeModel.properties,"node_data",E)}}),c=Re(),v=Re(),f=()=>{var T;const E=[(T=c.value)==null?void 0:T.validate(),...v.value.map(I=>I.validate())];return Promise.all(E).catch(I=>Promise.reject({node:t.nodeModel,errMessage:I}))};function g(E){const{oldIndex:T,newIndex:I}=E;if(T===void 0||I===void 0)return;const R=ge.cloneDeep(t.nodeModel.properties.node_data.branch);if(T===R.length-1||I===R.length-1)return;const U={...R[T],type:R[I].type,id:R[I].id},D={...R[I],type:R[T].type,id:R[T].id};R[I]=U,R[T]=D,ge.set(t.nodeModel.properties.node_data,"branch",R)}function _(){const E=ge.cloneDeep(t.nodeModel.properties.node_data.branch),T={conditions:[{field:[],compare:"",value:""}],type:"ELSE IF "+(E.length-1),id:is(),condition:"and"};E.splice(E.length-1,0,T),b(E,!0),ge.set(t.nodeModel.properties.node_data,"branch",E)}function b(E,T){const I=ge.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]),R=E.map((U,D)=>{const L=I.find(W=>W.id===U.id);if(L)return{index:D,height:L.height,id:U.id};if(T)return{index:D,height:12,id:U.id}}).filter(U=>U);ge.set(t.nodeModel.properties,"branch_condition_list",R),t.nodeModel.refreshBranch()}function x(E){const T=ge.cloneDeep(t.nodeModel.properties.node_data.branch);T[E].conditions.push({field:[],compare:"",value:""}),ge.set(t.nodeModel.properties.node_data,"branch",T)}function S(E,T){const I=ge.cloneDeep(t.nodeModel.properties.node_data.branch);if(I[E].conditions.splice(T,1),I[E].conditions.length===0){const U=I.splice(E,1).map(D=>t.nodeModel.id+"_"+D.id+"_right");t.nodeModel.graphModel.eventCenter.emit("delete_edge",t.nodeModel.outgoing.edges.filter(D=>U.includes(D.sourceAnchorId)).map(D=>D.id)),b(I,!1),I.forEach((D,L)=>{D.type==="ELSE IF "+(L+1)&&(D.type="ELSE IF "+L)})}ge.set(t.nodeModel.properties.node_data,"branch",I)}function A(E,T,I){if(["is_null","is_not_null","is_true","is_not_true"].includes(E)){const R=ge.cloneDeep(t.nodeModel.properties.node_data.branch);R[T].conditions[I].value=1,ge.set(t.nodeModel.properties.node_data,"branch",R)}}return Ir(()=>{ge.set(t.nodeModel,"validate",f)}),(E,T)=>{const I=J("el-option"),R=J("el-select"),U=J("el-form-item"),D=J("el-col"),L=J("el-input"),W=J("AppIcon"),H=J("el-button"),B=J("el-row"),F=J("el-card"),q=J("el-form"),K=Mv("resize");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(q,{model:s.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:c,onSubmit:T[0]||(T[0]=rn(()=>{},["prevent"]))},{default:P(()=>[k(_n(ak),{ref:"el",modelValue:s.value.branch,disabled:s.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:g},{default:P(()=>[(be(!0),Ht(ar,null,Gr(s.value.branch,(X,ee)=>Ga((be(),at(F,{key:X.id,shadow:"never",class:Cl(["drag-card card-never mb-8",{"no-drag":ee===s.value.branch.length-1||s.value.branch.length===2}]),style:{"--el-card-padding":"12px"}},{default:P(()=>[Y("div",wG,[Y("span",EG,[T[1]||(T[1]=Y("img",{src:lk,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),et(" "+de(X.type),1)]),X.conditions.length>1?(be(),Ht("div",OG,[Y("span",null,de(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(R,{teleported:!1,modelValue:X.condition,"onUpdate:modelValue":ue=>X.condition=ue,size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(I,{label:E.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(I,{label:E.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"]),Y("span",null,de(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),ee!==s.value.branch.length-1?(be(),Ht("div",xG,[(be(!0),Ht(ar,null,Gr(X.conditions,(ue,ae)=>(be(),at(B,{key:ae,gutter:8},{default:P(()=>[k(D,{span:11},{default:P(()=>[k(U,{prop:"branch."+ee+".conditions."+ae+".field",rules:{type:"array",required:!0,message:E.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:v,nodeModel:e.nodeModel,class:"w-full",placeholder:E.$t("views.applicationWorkflow.variable.placeholder"),modelValue:ue.field,"onUpdate:modelValue":we=>ue.field=we},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:P(()=>[k(U,{prop:"branch."+ee+".conditions."+ae+".compare",rules:{required:!0,message:E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:P(()=>[k(R,{onWheel:a,teleported:!1,modelValue:ue.compare,"onUpdate:modelValue":we=>ue.compare=we,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:we=>A(we,ee,ae)},{default:P(()=>[(be(!0),Ht(ar,null,Gr(_n(Zw),(we,je)=>(be(),at(I,{key:je,label:we.label,value:we.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(ue.compare)?pn("",!0):(be(),at(U,{key:0,prop:"branch."+ee+".conditions."+ae+".value",rules:{required:!0,message:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(L,{modelValue:ue.value,"onUpdate:modelValue":we=>ue.value=we,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(D,{span:1},{default:P(()=>[k(H,{disabled:s.value.branch.length===2&&X.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:we=>S(ee,ae)},{default:P(()=>[k(W,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):pn("",!0),ee!==s.value.branch.length-1?(be(),at(H,{key:1,link:"",type:"primary",onClick:ue=>x(ee)},{default:P(()=>[k(W,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(E.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1},8,["onClick"])):pn("",!0)]),_:2},1032,["class"])),[[K,ue=>r(ue,X,ee)]])),128))]),_:1},8,["modelValue","disabled"]),k(H,{link:"",type:"primary",onClick:_},{default:P(()=>[k(W,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(E.$t("views.applicationWorkflow.nodes.conditionNode.addBranch")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class AG extends ho{constructor(t){super(t,SG)}}const MG=(e,t)=>e.filter((n,a)=>a<t).map(n=>n.height+8).reduce((n,a)=>n+a,0);class kG extends vo{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:a,width:r,height:s,properties:{branch_condition_list:c}}=this;this.height===void 0&&(this.height=200);const v=this.properties.showNode===void 0?!0:this.properties.showNode,f=[];f.push({x:n-r/2+10,y:v?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"});const g=Array.isArray(c)?c:[];if(g.length>0)for(let _=0;_<g.length;_++){const b=g[_],x=MG(g,_);f.push({x:n+r/2-10,y:v?a-s/2+75+x+(b.height||0)/2:a-15,id:`${t}_${b.id}_right`,type:"right"})}return f}}const TG={type:"condition-node",model:kG,view:AG},AN=Object.freeze(Object.defineProperty({__proto__:null,default:TG},Symbol.toStringTag,{value:"Module"})),NG={class:"title-decoration-1 mb-8"},PG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={document_list:["start-node","document"]},a=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:r=>{ge.set(t.nodeModel.properties,"node_data",r)}});return(r,s)=>{const c=J("el-form-item"),v=J("el-form"),f=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",NG,de(r.$t("views.applicationWorkflow.nodeSetting")),1),k(f,{shadow:"never",class:"card-never"},{default:P(()=>[k(v,{onSubmit:s[1]||(s[1]=rn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto"},{default:P(()=>[k(c,{label:r.$t("views.problem.relateParagraph.selectDocument"),rules:{type:"array",required:!0,message:r.$t("views.chatLog.documentPlaceholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:r.$t("views.chatLog.documentPlaceholder"),modelValue:a.value.document_list,"onUpdate:modelValue":s[0]||(s[0]=g=>a.value.document_list=g)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});let CG=class extends ho{constructor(t){super(t,PG)}};const RG={type:"document-extract-node",model:vo,view:CG},MN=Object.freeze(Object.defineProperty({__proto__:null,default:RG},Symbol.toStringTag,{value:"Module"})),jG={class:"dialog-footer"},DG=Vn({__name:"AddFormCollect",props:{title:{default:yt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const a=e,r=Re(!1),s=Re(),c=Re({}),v=Re(!1),f=()=>{r.value=!0},g=()=>{r.value=!1,c.value={}},_=()=>{var b;(b=s.value)==null||b.validate().then(()=>{var x;a.addFormField((x=s.value)==null?void 0:x.getData()),g()})};return t({close:g,open:f}),(b,x)=>{const S=J("el-button"),A=J("el-dialog");return be(),at(A,{title:e.title,modelValue:r.value,"onUpdate:modelValue":x[3]||(x[3]=E=>r.value=E),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":g,"append-to-body":""},{footer:P(()=>[Y("span",jG,[k(S,{onClick:x[1]||(x[1]=rn(E=>r.value=!1,["prevent"]))},{default:P(()=>[et(de(b.$t("common.cancel")),1)]),_:1}),k(S,{type:"primary",onClick:x[2]||(x[2]=E=>_()),loading:v.value},{default:P(()=>[et(de(b.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[x[4]||(x[4]=et("l ",-1)),k(qw,{modelValue:c.value,"onUpdate:modelValue":x[0]||(x[0]=E=>c.value=E),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:s},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),IG={class:"dialog-footer"},LG=Vn({__name:"EditFormCollect",props:{title:{default:yt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const a=e,r=Re(!1),s=Re(),c=Re({}),v=Re(0),f=Re(!1),g=(x,S)=>{r.value=!0,c.value=x,v.value=S},_=()=>{r.value=!1,c.value={}},b=()=>{var x;(x=s.value)==null||x.validate().then(()=>{var S;a.editFormField((S=s.value)==null?void 0:S.getData(),v.value),_()})};return t({close:_,open:g}),(x,S)=>{const A=J("el-button"),E=J("el-dialog");return be(),at(E,{title:e.title,modelValue:r.value,"onUpdate:modelValue":S[3]||(S[3]=T=>r.value=T),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:P(()=>[Y("span",IG,[k(A,{onClick:S[1]||(S[1]=rn(T=>r.value=!1,["prevent"]))},{default:P(()=>[et(de(x.$t("common.cancel")),1)]),_:1}),k(A,{type:"primary",onClick:S[2]||(S[2]=T=>b()),loading:f.value},{default:P(()=>[et(de(x.$t("common.modify")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(qw,{modelValue:c.value,"onUpdate:modelValue":S[0]||(S[0]=T=>c.value=T),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:s},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),$G={class:"title-decoration-1 mb-8"},FG={class:"flex align-center"},BG={class:"mr-4"},VG={class:"flex-between"},UG={class:"lighter"},WG=["title"],GG={key:0},zG=["title"],HG={key:1},XG=["title"],qG=["title"],YG={class:"mr-4"},KG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e;$m("getModel",()=>t.nodeModel);const n=Re(),a=Re(),r=(R,U)=>{const D=S.value.form_field_list.map((L,W)=>U===W?ge.cloneDeep(R):ge.cloneDeep(L));S.value.form_field_list=D,c()},s=R=>{if(S.value.form_field_list.some(U=>U.field===R.field)){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+R.field);return}S.value.form_field_list=ge.cloneDeep([...S.value.form_field_list,R]),c()},c=()=>{const R=[{label:yt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...S.value.form_field_list.map(U=>({value:U.field,label:typeof U.label=="string"?U.label:U.label.label}))];ge.set(t.nodeModel.properties.config,"fields",R),t.nodeModel.clear_next_node_field(!1),I()},v=Re(),f=Re(),g=()=>{var R;(R=v.value)==null||R.open()},_=(R,U)=>{var D;(D=f.value)==null||D.open(ge.cloneDeep(R),U)},b=R=>{S.value.form_field_list=S.value.form_field_list.filter(U=>U.field!==R.field),c()},x=Re({is_result:!0,form_content_format:`${yt("views.applicationWorkflow.nodes.formNode.form_content_format1")}
|
||
{{form}}
|
||
${yt("views.applicationWorkflow.nodes.formNode.form_content_format2")}`,form_field_list:[]}),S=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",x.value),t.nodeModel.properties.node_data),set:R=>{ge.set(t.nodeModel.properties,"node_data",R)}}),A=R=>{var U;if(R.default_value){const D=(U=R.option_list)==null?void 0:U.filter(L=>R.default_value.indexOf(L.value)>-1).map(L=>L.label).join(",");return D||R.default_value}if(R.default_value!==void 0)return R.default_value},E=()=>{var R;return(R=n.value)==null?void 0:R.validate()};function T(R){ge.set(t.nodeModel.properties.node_data,"form_content_format",R)}function I(){if(!a.value)return;const U=a.value.$el.querySelector(".el-table__body-wrapper tbody");U&&_r.create(U,{animation:150,ghostClass:"ghost-row",onEnd:D=>{if(D.oldIndex===void 0||D.newIndex===void 0)return;const L=ge.cloneDeep([...S.value.form_field_list]),[W]=L.splice(D.oldIndex,1);L.splice(D.newIndex,0,W),S.value.form_field_list=L,c()}})}return Ir(()=>{ge.set(t.nodeModel,"validate",E),c(),t.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(R,U)=>{const D=J("AppIcon"),L=J("el-tooltip"),W=J("MdEditorMagnify"),H=J("el-form-item"),B=J("el-button"),F=J("el-table-column"),q=J("el-tag"),K=J("el-switch"),X=J("el-table"),ee=J("el-form"),ue=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",$G,de(R.$t("views.applicationWorkflow.nodeSetting")),1),k(ue,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(ee,{onSubmit:U[4]||(U[4]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:P(()=>[k(H,{label:R.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),prop:"form_content_format",rules:{required:!0,message:R.$t("views.applicationWorkflow.nodes.formNode.formContent.requiredMessage"),trigger:"blur"}},{label:P(()=>[Y("div",FG,[Y("div",BG,[Y("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),U[5]||(U[5]=Y("span",{class:"color-danger"},"*",-1))])]),k(L,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(R.$t("views.applicationWorkflow.nodes.formNode.formContent.tooltip",{form:"{ form }"})),1)]),default:P(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(W,{title:R.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:S.value.form_content_format,"onUpdate:modelValue":U[0]||(U[0]=ae=>S.value.form_content_format=ae),style:{height:"150px"},onSubmitDialog:T},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(H,{label:R.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:U[3]||(U[3]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",VG,[Y("h5",UG,de(R.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),k(B,{link:"",type:"primary",onClick:U[1]||(U[1]=ae=>g())},{default:P(()=>[k(D,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(R.$t("common.add")),1)]),_:1})])]),default:P(()=>[S.value.form_field_list.length>0?(be(),at(X,{key:0,class:"border",data:S.value.form_field_list,ref_key:"tableRef",ref:a,"row-key":"field"},{default:P(()=>[k(F,{prop:"field",label:R.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:ae})=>[Y("span",{title:ae.field,class:"ellipsis-1"},de(ae.field),9,WG)]),_:1},8,["label"]),k(F,{prop:"label",label:R.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:ae})=>[ae.label&&ae.label.input_type==="TooltipLabel"?(be(),Ht("span",GG,[Y("span",{title:ae.label.label,class:"ellipsis-1"},de(ae.label.label),9,zG)])):(be(),Ht("span",HG,[Y("span",{title:ae.label,class:"ellipsis-1"},de(ae.label),9,XG)]))]),_:1},8,["label"]),k(F,{label:R.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:P(({row:ae})=>[k(q,{type:"info",class:"info-tag"},{default:P(()=>{var we;return[et(de((we=_n(PD).find(je=>je.value===ae.input_type))==null?void 0:we.label),1)]}),_:2},1024)]),_:1},8,["label"]),k(F,{prop:"default_value",label:R.$t("dynamicsForm.default.label")},{default:P(({row:ae})=>[Y("span",{title:ae.default_value,class:"ellipsis-1"},de(A(ae)),9,qG)]),_:1},8,["label"]),k(F,{label:R.$t("common.required"),width:"55"},{default:P(({row:ae})=>[Y("div",{onClick:U[2]||(U[2]=rn(()=>{},["stop"]))},[k(K,{disabled:"",size:"small",modelValue:ae.required,"onUpdate:modelValue":we=>ae.required=we},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(F,{label:R.$t("common.operation"),align:"left",width:"80"},{default:P(({row:ae,$index:we})=>[Y("span",YG,[k(L,{effect:"dark",content:R.$t("common.modify"),placement:"top"},{default:P(()=>[k(B,{type:"primary",text:"",onClick:rn(je=>_(ae,we),["stop"])},{default:P(()=>[k(D,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(L,{effect:"dark",content:R.$t("common.delete"),placement:"top"},{default:P(()=>[k(B,{type:"primary",text:"",onClick:je=>b(ae)},{default:P(()=>[k(D,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(DG,{ref_key:"addFormCollectRef",ref:v,addFormField:s},null,512),k(LG,{ref_key:"editFormCollectRef",ref:f,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class ZG extends ho{constructor(t){super(t,KG)}getConfig(t){return t.model.properties.config}}const JG={type:"form-node",model:vo,view:ZG},kN=Object.freeze(Object.defineProperty({__proto__:null,default:JG},Symbol.toStringTag,{value:"Module"})),QG={class:"title-decoration-1 mb-8"},ez={class:"flex-between w-full"},tz={class:"flex align-center"},nz={class:"mr-4"},rz={class:"flex align-center"},oz={class:"mr-4"},iz={class:"flex align-center"},az={class:"mr-4"},lz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=()=>{var L;return(L=f.value)==null?void 0:L.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},_=L=>L.ctrlKey===!0?(L.preventDefault(),!0):(L.stopPropagation(),!0),x={model_id:"",system:"",prompt:`{{${yt("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"]},S=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:L=>{ge.set(s.nodeModel.properties,"node_data",L)}}),A=t();function E(){var W;const L=r.value==="systemManage"?{model_type:"TTI",workspace_id:(W=A.value)==null?void 0:W.workspace_id}:{model_type:"TTI"};po({type:"model",systemType:r.value}).getSelectModelList(L).then(H=>{c.value=ge.groupBy(H==null?void 0:H.data,"provider")})}const T=()=>{Gf(()=>{var L;S.value.model_id?(L=v.value)==null||L.reset_default(S.value.model_id,a):R({})})},I=L=>{var W;L&&((W=v.value)==null||W.open(L,a,S.value.model_params_setting))};function R(L){ge.set(s.nodeModel.properties.node_data,"model_params_setting",L)}function U(L){ge.set(s.nodeModel.properties.node_data,"prompt",L)}function D(L){ge.set(s.nodeModel.properties.node_data,"negative_prompt",L)}return Ir(()=>{E(),ge.set(s.nodeModel,"validate",g)}),(L,W)=>{const H=J("AppIcon"),B=J("el-button"),F=J("ModelSelect"),q=J("el-form-item"),K=J("el-tooltip"),X=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ae=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",QG,de(L.$t("views.applicationWorkflow.nodeSetting")),1),k(ae,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[6]||(W[6]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(q,{label:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:P(()=>[Y("div",ez,[Y("div",null,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),W[7]||(W[7]=Y("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!S.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=we=>I(S.value.model_id)),onRefreshForm:R},{default:P(()=>[k(H,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(F,{onChange:T,onWheel:_,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=we=>S.value.model_id=we),placeholder:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),options:c.value,showFooter:"",onFocus:E,"model-type":"TTI"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",tz,[Y("div",nz,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),W[8]||(W[8]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=we=>S.value.prompt=we),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",rz,[Y("div",oz,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:S.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=we=>S.value.negative_prompt=we),placeholder:L.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[5]||(W[5]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",iz,[Y("div",az,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":W[4]||(W[4]=we=>S.value.is_result=we)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:R},null,512)]),_:1},8,["node-model"])}}});let sz=class extends ho{constructor(t){super(t,lz)}};const uz={type:"image-generate-node",model:vo,view:sz},TN=Object.freeze(Object.defineProperty({__proto__:null,default:uz},Symbol.toStringTag,{value:"Module"})),cz={class:"title-decoration-1 mb-8"},dz={class:"flex-between w-full"},fz={class:"flex align-center"},pz={class:"mr-4"},hz={class:"flex align-center"},vz={class:"mr-4"},mz={class:"flex align-center"},yz={class:"mr-4"},gz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=()=>{var L;return(L=f.value)==null?void 0:L.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},_=L=>L.ctrlKey===!0?(L.preventDefault(),!0):(L.stopPropagation(),!0),x={model_id:"",system:"",prompt:`{{${yt("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:[]},S=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:L=>{ge.set(s.nodeModel.properties,"node_data",L)}}),A=t();function E(){var W;const L=r.value==="systemManage"?{model_type:"ITV",workspace_id:(W=A.value)==null?void 0:W.workspace_id}:{model_type:"ITV"};po({type:"model",systemType:r.value}).getSelectModelList(L).then(H=>{c.value=ge.groupBy(H==null?void 0:H.data,"provider")})}const T=()=>{Gf(()=>{var L;S.value.model_id?(L=v.value)==null||L.reset_default(S.value.model_id,a):R({})})},I=L=>{var W;L&&((W=v.value)==null||W.open(L,a,S.value.model_params_setting))};function R(L){ge.set(s.nodeModel.properties.node_data,"model_params_setting",L)}function U(L){ge.set(s.nodeModel.properties.node_data,"prompt",L)}function D(L){ge.set(s.nodeModel.properties.node_data,"negative_prompt",L)}return Ir(()=>{E(),ge.set(s.nodeModel,"validate",g)}),(L,W)=>{const H=J("AppIcon"),B=J("el-button"),F=J("ModelSelect"),q=J("el-form-item"),K=J("el-tooltip"),X=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ae=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",cz,de(L.$t("views.applicationWorkflow.nodeSetting")),1),k(ae,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[8]||(W[8]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(q,{label:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:P(()=>[Y("div",dz,[Y("div",null,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),W[9]||(W[9]=Y("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!S.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=we=>I(S.value.model_id)),onRefreshForm:R},{default:P(()=>[k(H,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(F,{onChange:T,onWheel:_,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=we=>S.value.model_id=we),onFocus:E,placeholder:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:c.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",fz,[Y("div",pz,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),W[10]||(W[10]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=we=>S.value.prompt=we),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",hz,[Y("div",vz,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:S.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=we=>S.value.negative_prompt=we),placeholder:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),W[11]||(W[11]=Y("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:S.value.first_frame_url,"onUpdate:modelValue":W[4]||(W[4]=we=>S.value.first_frame_url=we)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:L.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:S.value.last_frame_url,"onUpdate:modelValue":W[5]||(W[5]=we=>S.value.last_frame_url=we)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[7]||(W[7]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",mz,[Y("div",yz,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":W[6]||(W[6]=we=>S.value.is_result=we)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:R},null,512)]),_:1},8,["node-model"])}}});class _z extends ho{constructor(t){super(t,gz)}}const bz={type:"image-to-video-node",model:vo,view:_z},NN=Object.freeze(Object.defineProperty({__proto__:null,default:bz},Symbol.toStringTag,{value:"Module"})),wz={class:"title-decoration-1 mb-8"},Ez={class:"flex-between w-full"},Oz={class:"flex-between"},xz={class:"flex align-center"},Sz={class:"flex align-center"},Az={class:"mr-4"},Mz={class:"flex-between"},kz={class:"flex align-center"},Tz={class:"mr-4"},Nz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=Re(),_=()=>{var B;return Promise.all([g.value?g.value.validate():Promise.resolve(""),(B=f.value)==null?void 0:B.validate()]).catch(F=>Promise.reject({node:s.nodeModel,errMessage:F}))},b=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),S={model_id:"",system:"",prompt:`{{${yt("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"]},A=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",S),s.nodeModel.properties.node_data),set:B=>{ge.set(s.nodeModel.properties,"node_data",B)}}),E=t();function T(){var F;const B=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(F=E.value)==null?void 0:F.workspace_id}:{model_type:"IMAGE"};po({type:"model",systemType:r.value}).getSelectModelList(B).then(q=>{c.value=ge.groupBy(q==null?void 0:q.data,"provider")})}function I(B){ge.set(s.nodeModel.properties.node_data,"system",B)}function R(B){ge.set(s.nodeModel.properties.node_data,"prompt",B)}const U=B=>{var F;B&&((F=v.value)==null||F.open(B,a,A.value.model_params_setting))};function D(B){ge.set(s.nodeModel.properties.node_data,"model_params_setting",B)}const L=Re(),W=B=>{var F;B&&((F=L.value)==null||F.open(B,a))},H=B=>{ge.set(s.nodeModel.properties.node_data,"system",B)};return Ir(()=>{T(),ge.set(s.nodeModel,"validate",_)}),(B,F)=>{const q=J("AppIcon"),K=J("el-button"),X=J("ModelSelect"),ee=J("el-form-item"),ue=J("el-tooltip"),ae=J("MdEditorMagnify"),we=J("el-option"),je=J("el-select"),Te=J("el-input-number"),Me=J("el-switch"),Ne=J("el-form"),rt=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",wz,de(B.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Ne,{onSubmit:F[10]||(F[10]=rn(()=>{},["prevent"])),model:A.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(ee,{label:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:P(()=>[Y("div",Ez,[Y("div",null,[Y("span",null,[et(de(_n(yt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),F[11]||(F[11]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{disabled:!A.value.model_id,type:"primary",link:"",onClick:F[0]||(F[0]=tt=>U(A.value.model_id)),onRefreshForm:D},{default:P(()=>[k(q,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(X,{onWheel:b,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":F[1]||(F[1]=tt=>A.value.model_id=tt),placeholder:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),options:c.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(ee,null,{label:P(()=>[Y("div",Oz,[Y("div",xz,[Y("span",null,de(B.$t("views.application.form.roleSettings.label")),1),k(ue,{effect:"dark",content:B.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(K,{type:"primary",link:"",onClick:F[2]||(F[2]=tt=>W(A.value.model_id)),disabled:!A.value.model_id},{default:P(()=>[k(q,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:P(()=>[k(ae,{title:B.$t("views.application.form.roleSettings.label"),modelValue:A.value.system,"onUpdate:modelValue":F[3]||(F[3]=tt=>A.value.system=tt),style:{height:"100px"},onSubmitDialog:I,placeholder:`${_n(yt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(ee,{label:B.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:B.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:P(()=>[Y("div",Sz,[Y("div",Az,[Y("span",null,[et(de(B.$t("views.application.form.prompt.label")),1),F[12]||(F[12]=Y("span",{class:"color-danger"},"*",-1))])]),k(ue,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(B.$t("views.application.form.prompt.tooltip")),1)]),default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ae,{onWheel:b,title:B.$t("views.application.form.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":F[4]||(F[4]=tt=>A.value.prompt=tt),style:{height:"150px"},onSubmitDialog:R,placeholder:`${_n(yt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(ee,null,{label:P(()=>[Y("div",Mz,[Y("div",null,de(B.$t("views.application.form.historyRecord.label")),1),k(je,{modelValue:A.value.dialogue_type,"onUpdate:modelValue":F[5]||(F[5]=tt=>A.value.dialogue_type=tt),type:"small",style:{width:"100px"}},{default:P(()=>[k(we,{label:B.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(we,{label:B.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[k(Te,{modelValue:A.value.dialogue_number,"onUpdate:modelValue":F[6]||(F[6]=tt=>A.value.dialogue_number=tt),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(ee,{label:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),rules:{type:"array",required:!0,message:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label")),1),F[13]||(F[13]=Y("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:g,nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:A.value.image_list,"onUpdate:modelValue":F[7]||(F[7]=tt=>A.value.image_list=tt)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(ee,{label:B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:F[9]||(F[9]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",kz,[Y("div",Tz,[Y("span",null,de(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(ue,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Me,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":F[8]||(F[8]=tt=>A.value.is_result=tt)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:D},null,512),k(Jw,{onReplace:H,ref_key:"GeneratePromptDialogRef",ref:L},null,512)]),_:1},8,["node-model"])}}});let Pz=class extends ho{constructor(t){super(t,Nz)}};const Cz={type:"image-understand-node",model:vo,view:Pz},PN=Object.freeze(Object.defineProperty({__proto__:null,default:Cz},Symbol.toStringTag,{value:"Module"})),Rz={class:"title-decoration-1 mb-8"},jz={class:"flex-between"},Dz={class:"flex-between"},Iz={class:"flex-between"},Lz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=Re(),c=Re();function v(){const W=ge.cloneDeep(T.nodeModel.properties.node_data.branch),H={id:is(),content:"",isOther:!1};W.splice(W.length-1,0,H),g(W,!0),ge.set(T.nodeModel.properties.node_data,"branch",W),T.nodeModel.refreshBranch()}function f(W){var ee;const H=ge.cloneDeep(T.nodeModel.properties.node_data.branch),B=H.find(ue=>ue.id===W);if(!B||B.isOther||H.filter(ue=>!ue.isOther).length<=1)return;const q=`${T.nodeModel.id}_${W}_right`,K=(((ee=T.nodeModel.outgoing)==null?void 0:ee.edges)||[]).filter(ue=>ue.sourceAnchorId===q).map(ue=>ue.id);K.length>0&&T.nodeModel.graphModel.eventCenter.emit("delete_edge",K);const X=H.filter(ue=>ue.id!==W);ge.set(T.nodeModel.properties.node_data,"branch",X),g(X,!1)}function g(W,H){const B=ge.cloneDeep(T.nodeModel.properties.branch_condition_list?T.nodeModel.properties.branch_condition_list:[]),F=W.map((q,K)=>{const X=B.find(ee=>ee.id===q.id);if(X)return{index:K,height:X.height,id:q.id};if(H)return{index:K,height:12,id:q.id}}).filter(q=>q);ge.set(T.nodeModel.properties,"branch_condition_list",F),T.nodeModel.refreshBranch()}const _=W=>W.ctrlKey===!0?(W.preventDefault(),!0):(W.stopPropagation(),!0),b=W=>{var H;W?(H=c.value)==null||H.reset_default(W,a):S({})},x={model_id:"",branch:[{id:is(),content:"",isOther:!1},{id:is(),content:yt("views.applicationWorkflow.nodes.intentNode.other"),isOther:!0}],dialogue_number:1,content_list:[]};function S(W){ge.set(T.nodeModel.properties.node_data,"model_params_setting",W)}const A=W=>{var H;W&&((H=c.value)==null||H.open(W,a,E.value.model_params_setting))},E=$n({get:()=>(T.nodeModel.properties.node_data||(ge.set(T.nodeModel.properties,"node_data",x),g(x.branch,!0)),T.nodeModel.properties.node_data),set:W=>{ge.set(T.nodeModel.properties,"node_data",W)}}),T=e,I=Re(),R=Re(null),U=()=>{var W;return Promise.all([s.value?s.value.validate():Promise.resolve(""),(W=I.value)==null?void 0:W.validate()]).then(()=>{if(E.value.branch.length!=new Set(E.value.branch.map(H=>H.content)).size)throw yt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(H=>Promise.reject({node:T.nodeModel,errMessage:H}))},D=t();function L(){var H;const W=r.value==="systemManage"?{model_type:"LLM",workspace_id:(H=D.value)==null?void 0:H.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:r.value}).getSelectModelList(W).then(B=>{R.value=ge.groupBy(B==null?void 0:B.data,"provider")})}return Ir(()=>{var W;L(),typeof((W=T.nodeModel.properties.node_data)==null?void 0:W.is_result)>"u"&&vc(T.nodeModel)&&ge.set(T.nodeModel.properties.node_data,"is_result",!0),ge.set(T.nodeModel,"validate",U)}),(W,H)=>{const B=J("AppIcon"),F=J("el-button"),q=J("ModelSelect"),K=J("el-form-item"),X=J("el-input-number"),ee=J("el-input"),ue=J("el-col"),ae=J("el-row"),we=J("el-form"),je=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",Rz,de(W.$t("views.applicationWorkflow.nodeSetting")),1),k(je,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(we,{onSubmit:H[4]||(H[4]=rn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"IntentClassifyNodeFormRef",ref:I,"hide-required-asterisk":""},{default:P(()=>[k(K,{label:W.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:W.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:P(()=>[Y("div",jz,[Y("div",null,[Y("span",null,[et(de(W.$t("views.application.form.aiModel.label")),1),H[5]||(H[5]=Y("span",{class:"color-danger"},"*",-1))])]),k(F,{type:"primary",link:"",disabled:!E.value.model_id,onClick:H[0]||(H[0]=Te=>A(E.value.model_id)),onRefreshForm:S},{default:P(()=>[k(B,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(q,{onChange:b,onWheel:_,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":H[1]||(H[1]=Te=>E.value.model_id=Te),placeholder:W.$t("views.application.form.aiModel.placeholder"),options:R.value,onSubmitModel:L,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(K,{prop:"content_list",label:W.$t("views.applicationWorkflow.nodes.intentNode.input.label"),rules:{message:W.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"change",required:!0}},{label:P(()=>[Y("div",Dz,[Y("div",null,[Y("span",null,[et(de(W.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),H[6]||(H[6]=Y("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:s,nodeModel:e.nodeModel,class:"w-full",placeholder:W.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:E.value.content_list,"onUpdate:modelValue":H[2]||(H[2]=Te=>E.value.content_list=Te)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(K,{label:W.$t("views.application.form.historyRecord.label")},{default:P(()=>[k(X,{modelValue:E.value.dialogue_number,"onUpdate:modelValue":H[3]||(H[3]=Te=>E.value.dialogue_number=Te),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(K,null,{label:P(()=>[Y("div",Iz,[Y("div",null,[Y("span",null,[et(de(W.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),H[7]||(H[7]=Y("span",{class:"color-danger"},"*",-1))])]),k(F,{onClick:v,type:"primary",size:"large",link:""},{default:P(()=>[k(B,{iconName:"app-add-outlined"})]),_:1})])]),default:P(()=>[Y("div",null,[(be(!0),Ht(ar,null,Gr(E.value.branch,(Te,Me)=>(be(),Ht("div",{key:Te.id,class:"mb-8"},[k(K,{prop:`branch.${Me}.content`,rules:{message:W.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:P(()=>[k(ae,{gutter:12,align:"middle"},{default:P(()=>[k(ue,{span:21},{default:P(()=>[k(ee,{modelValue:Te.content,"onUpdate:modelValue":Ne=>Te.content=Ne,style:{width:"210px"},disabled:Te.isOther,placeholder:W.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])]),_:2},1024),k(ue,{span:3},{default:P(()=>[Te.isOther?pn("",!0):(be(),at(F,{key:0,link:"",size:"large",disabled:E.value.branch.filter(Ne=>!Ne.isOther).length<=1,onClick:Ne=>f(Te.id)},{default:P(()=>[k(B,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"]))]),_:2},1024)]),_:2},1024)]),_:2},1032,["prop","rules"])]))),128))])]),_:1})]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:c,onRefresh:S},null,512)]),_:1},8,["nodeModel"])}}});class $z extends ho{constructor(t){super(t,Lz)}}class Fz extends vo{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:a,width:r,height:s,properties:{branch_condition_list:c}}=this;this.height===void 0&&(this.height=200);const v=this.properties.showNode===void 0?!0:this.properties.showNode,f=[];f.push({x:n-r/2+10,y:v?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"});const g=Array.isArray(c)?c:[];if(g.length>0)for(let b=0;b<g.length;b++){const x=g[b];f.push({x:n+r/2-10,y:v?a-s/2+397+b*41.36:a-15,id:`${t}_${x.id}_right`,type:"right"}),console.log(a-s/2+397+100/2)}return f}}const Bz={type:"intent-node",model:Fz,view:$z},CN=Object.freeze(Object.defineProperty({__proto__:null,default:Bz},Symbol.toStringTag,{value:"Module"})),Vz={class:"handle flex-between lighter mb-8"},Uz={key:0,class:"info"},Wz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},a=g=>g.ctrlKey===!0?(g.preventDefault(),!0):(g.stopPropagation(),!0),r=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:g=>{ge.set(t.nodeModel.properties,"node_data",g)}}),s=()=>{var _;const g=ge.cloneDeep(((_=r.value)==null?void 0:_.condition_list)||[]);g.push({field:[],compare:"",value:""}),ge.set(t.nodeModel.properties.node_data,"condition_list",g)},c=g=>{var b;const _=ge.cloneDeep(((b=r.value)==null?void 0:b.condition_list)||[]);_.splice(g,1),ge.set(t.nodeModel.properties.node_data,"condition_list",_)},v=Re(),f=()=>{var _;const g=[(_=v.value)==null?void 0:_.validate()];return Promise.all(g).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))};return Ir(()=>{ge.set(t.nodeModel,"validate",f)}),(g,_)=>{const b=J("el-option"),x=J("el-select"),S=J("el-form-item"),A=J("el-col"),E=J("el-input"),T=J("AppIcon"),I=J("el-button"),R=J("el-row"),U=J("el-form"),D=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(U,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:v,onSubmit:_[1]||(_[1]=rn(()=>{},["prevent"]))},{default:P(()=>[Y("div",Vz,[r.value.condition_list.length>1?(be(),Ht("div",Uz,[Y("span",null,de(g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(x,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":_[0]||(_[0]=L=>r.value.condition=L),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(b,{label:g.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(b,{label:g.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),Y("span",null,de(g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),(be(!0),Ht(ar,null,Gr(r.value.condition_list,(L,W)=>(be(),at(R,{key:W,gutter:8},{default:P(()=>[k(A,{span:11},{default:P(()=>[k(S,{prop:"condition_list."+W+".field",rules:{type:"array",required:!0,message:g.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.applicationWorkflow.variable.placeholder"),modelValue:L.field,"onUpdate:modelValue":H=>L.field=H},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(A,{span:6},{default:P(()=>[k(S,{prop:"condition_list."+W+".compare",rules:{required:!0,message:g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:P(()=>[k(x,{onWheel:a,teleported:!1,modelValue:L.compare,"onUpdate:modelValue":H=>L.compare=H,placeholder:g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:P(()=>[(be(!0),Ht(ar,null,Gr(_n(Zw),(H,B)=>(be(),at(b,{key:B,label:H.label,value:H.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(A,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(L.compare)?pn("",!0):(be(),at(S,{key:0,prop:"condition_list."+W+".value",rules:{required:!0,message:g.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:L.value,"onUpdate:modelValue":H=>L.value=H,placeholder:g.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(A,{span:1},{default:P(()=>[k(I,{link:"",type:"info",class:"mt-4",onClick:H=>c(W)},{default:P(()=>[k(T,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(I,{link:"",type:"primary",onClick:_[2]||(_[2]=L=>s())},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(g.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class Gz extends ho{constructor(t){super(t,Wz)}}const zz={type:"loop-break-node",model:vo,view:Gz},RN=Object.freeze(Object.defineProperty({__proto__:null,default:zz},Symbol.toStringTag,{value:"Module"})),Hz={class:"handle flex-between lighter mb-8"},Xz={key:0,class:"info"},qz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},a=g=>g.ctrlKey===!0?(g.preventDefault(),!0):(g.stopPropagation(),!0),r=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:g=>{ge.set(t.nodeModel.properties,"node_data",g)}}),s=()=>{var _;const g=ge.cloneDeep(((_=r.value)==null?void 0:_.condition_list)||[]);g.push({field:[],compare:"",value:""}),ge.set(t.nodeModel.properties.node_data,"condition_list",g)},c=g=>{var b;const _=ge.cloneDeep(((b=r.value)==null?void 0:b.condition_list)||[]);_.splice(g,1),ge.set(t.nodeModel.properties.node_data,"condition_list",_)},v=Re(),f=()=>{var _;const g=[(_=v.value)==null?void 0:_.validate()];return Promise.all(g).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))};return Ir(()=>{ge.set(t.nodeModel,"validate",f)}),(g,_)=>{const b=J("el-option"),x=J("el-select"),S=J("el-form-item"),A=J("el-col"),E=J("el-input"),T=J("AppIcon"),I=J("el-button"),R=J("el-row"),U=J("el-form"),D=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(U,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:v,onSubmit:_[1]||(_[1]=rn(()=>{},["prevent"]))},{default:P(()=>[Y("div",Hz,[r.value.condition_list.length>1?(be(),Ht("div",Xz,[Y("span",null,de(g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(x,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":_[0]||(_[0]=L=>r.value.condition=L),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(b,{label:g.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(b,{label:g.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),Y("span",null,de(g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),(be(!0),Ht(ar,null,Gr(r.value.condition_list,(L,W)=>(be(),at(R,{key:W,gutter:8},{default:P(()=>[k(A,{span:11},{default:P(()=>[k(S,{prop:"condition_list."+W+".field",rules:{type:"array",required:!0,message:g.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.applicationWorkflow.variable.placeholder"),modelValue:L.field,"onUpdate:modelValue":H=>L.field=H},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(A,{span:6},{default:P(()=>[k(S,{prop:"condition_list."+W+".compare",rules:{required:!0,message:g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:P(()=>[k(x,{onWheel:a,teleported:!1,modelValue:L.compare,"onUpdate:modelValue":H=>L.compare=H,placeholder:g.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:P(()=>[(be(!0),Ht(ar,null,Gr(_n(Zw),(H,B)=>(be(),at(b,{key:B,label:H.label,value:H.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(A,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(L.compare)?pn("",!0):(be(),at(S,{key:0,prop:"condition_list."+W+".value",rules:{required:!0,message:g.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:L.value,"onUpdate:modelValue":H=>L.value=H,placeholder:g.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(A,{span:1},{default:P(()=>[k(I,{link:"",type:"info",class:"mt-4",onClick:H=>c(W)},{default:P(()=>[k(T,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(I,{link:"",type:"primary",onClick:_[2]||(_[2]=L=>s())},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(g.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class Yz extends ho{constructor(t){super(t,qz)}}const Kz={type:"loop-continue-node",model:vo,view:Yz},jN=Object.freeze(Object.defineProperty({__proto__:null,default:Kz},Symbol.toStringTag,{value:"Module"})),Zz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={loop_type:"ARRAY",array:[],number:1},a=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:_=>{ge.set(t.nodeModel.properties,"node_data",_)}}),r=$n(()=>t.nodeModel.properties.showNode!==void 0?t.nodeModel.properties.showNode:(ge.set(t.nodeModel.properties,"showNode",!0),!0));Ym(r,()=>{r.value?ge.throttle(g,1e3)():ge.throttle(f,1e3)()});const s=Re(),c=Re(),v=()=>{var _;return Promise.all([c.value?c.value.validate():Promise.resolve(""),(_=s.value)==null?void 0:_.validate()]).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))},f=()=>{const b=t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).find(x=>x.type==ng.type);b&&(b.set_loop_body(),t.nodeModel.graphModel.deleteNode(b.id))},g=()=>{if(!t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).some(b=>b.type==ng.type)){let b={nodes:[FD],edges:[]},x=t.nodeModel.x,S=t.nodeModel.y+350;t.nodeModel.properties.node_data.loop_body&&(b=t.nodeModel.properties.node_data.loop_body),t.nodeModel.properties.node_data.loop&&(x=t.nodeModel.properties.node_data.loop.x,S=t.nodeModel.properties.node_data.loop.y);const A=t.nodeModel.graphModel.addNode({type:ng.type,properties:{...ng.properties,workflow:b,loop_node_id:t.nodeModel.id},x,y:S});t.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:t.nodeModel.id,sourceAnchorId:t.nodeModel.id+"_children",targetNodeId:A.id,virtual:!0})}};return Ir(()=>{var _;typeof((_=t.nodeModel.properties.node_data)==null?void 0:_.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),ge.set(t.nodeModel,"validate",v),t.nodeModel.virtual||g()}),(_,b)=>{const x=J("el-option"),S=J("el-select"),A=J("el-form-item"),E=J("el-input-number"),T=J("el-form"),I=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(I,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(T,{onSubmit:b[6]||(b[6]=rn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:s},{default:P(()=>[k(A,{label:_.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:b[1]||(b[1]=rn(()=>{},["prevent"])),prop:"loop_type",rules:{message:_.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:P(()=>[k(S,{modelValue:a.value.loop_type,"onUpdate:modelValue":b[0]||(b[0]=R=>a.value.loop_type=R),type:"small"},{default:P(()=>[k(x,{label:_.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),k(x,{label:_.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),k(x,{label:_.$t("views.applicationWorkflow.nodes.loopNode.loopType.infiniteLoop"),value:"LOOP"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),a.value.loop_type=="ARRAY"?(be(),at(A,{key:0,label:_.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:b[3]||(b[3]=rn(()=>{},["prevent"])),prop:"array",rules:{message:_.$t("views.applicationWorkflow.nodes.loopNode.loopArray.requiredMessage"),trigger:"blur",required:!0}},{default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:c,nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.loopNode.loopArray.placeholder"),modelValue:a.value.array,"onUpdate:modelValue":b[2]||(b[2]=R=>a.value.array=R)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):a.value.loop_type=="NUMBER"?(be(),at(A,{key:1,label:_.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:b[5]||(b[5]=rn(()=>{},["prevent"])),prop:"number",rules:{message:_.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.requiredMessage"),trigger:"blur",required:!0}},{default:P(()=>[k(E,{modelValue:a.value.number,"onUpdate:modelValue":b[4]||(b[4]=R=>a.value.number=R),min:1},null,8,["modelValue"])]),_:1},8,["label","rules"])):pn("",!0)]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Jz extends ho{constructor(t){const n=t.model.properties.config;super(t,Zz),t.model.properties.config=n}}class Qz extends vo{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:a,width:r,height:s}=this,c=this.properties.showNode===void 0?!0:this.properties.showNode,v=[];return this.type&&this.type!==nr.Base.toString()&&(this.type!==nr.Start.toString()&&v.push({x:n-r/2+10,y:c?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),v.push({x:n+r/2-10,y:c?a:a-15,id:`${t}_right`,type:"right"})),v.push({x:n,y:a+s/2-25,id:`${t}_children`,type:"children"}),v}}const eH={type:"loop-node",model:Qz,view:Jz},DN=Object.freeze(Object.defineProperty({__proto__:null,default:eH},Symbol.toStringTag,{value:"Module"})),tH={class:"dialog-footer"},nH=Vn({__name:"LoopFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re(null),f=Re({field:"",label:""}),g=Zf({label:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:yt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),_=Re(!1),b=(A,E)=>{A&&(f.value=ge.cloneDeep(A),c.value=!0,v.value=E),_.value=!0},x=()=>{_.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},S=async A=>{A&&await A.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(A,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),D=J("el-dialog");return be(),at(D,{title:c.value?A.$t("common.param.editParam"):A.$t("common.param.addParam"),modelValue:_.value,"onUpdate:modelValue":E[3]||(E[3]=L=>_.value=L),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[Y("span",tH,[k(U,{onClick:rn(x,["prevent"])},{default:P(()=>[et(de(A.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=L=>S(r.value)),loading:s.value},{default:P(()=>[et(de(c.value?A.$t("common.save"):A.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(R,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:g,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:A.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:g.field},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=L=>f.value.field=L),maxlength:64,placeholder:A.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(I,{label:A.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:g.label},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=L=>f.value.label=L),maxlength:64,"show-word-limit":"",placeholder:A.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),rH={class:"flex-between mb-16"},oH={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},iH={class:"ml-4"},aH=["title"],lH=["title"],sH={class:"mr-4"},uH=Vn({__name:"LoopFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re([]);function s(f,g){a.value.open(f,g)}function c(f){r.value.splice(f,1)}function v(f,g){for(let _=0;_<r.value.length;_++)if(r.value[_].field===f.field&&g!==_){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(g)?r.value.push(f):r.value.splice(g,1,f),a.value.close()}return Ir(()=>{t.nodeModel.properties.loop_input_field_list&&(r.value=ge.cloneDeep(t.nodeModel.properties.loop_input_field_list)),ge.set(t.nodeModel.properties,"loop_input_field_list",r)}),(f,g)=>{var E;const _=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),S=J("el-tooltip"),A=J("el-table");return be(),Ht(ar,null,[Y("div",rH,[Y("h5",oH,de(f.$t("views.applicationWorkflow.variable.loop")),1),Y("div",null,[Y("span",iH,[k(b,{link:"",type:"primary",onClick:g[0]||(g[0]=T=>s())},{default:P(()=>[k(_,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(f.$t("common.add")),1)]),_:1})])])]),((E=t.nodeModel.properties.loop_input_field_list)==null?void 0:E.length)>0?(be(),at(A,{key:0,data:t.nodeModel.properties.loop_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:P(()=>[k(x,{prop:"field",label:f.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:T})=>[Y("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,aH)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[Y("span",null,[Y("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,lH)])]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[Y("span",sH,[k(S,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:rn(R=>s(T,I),["stop"])},{default:P(()=>[k(_,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:f.$t("common.delete"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:R=>c(I)},{default:P(()=>[k(_,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(nH,{ref_key:"ChatFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),cH={class:"title-decoration-1 mb-8"},dH={class:"title-decoration-1 mb-8"},fH={class:"break-all"},pH=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=$n(()=>(t.nodeModel.properties.loop_input_field_list?t.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}));Ym(n,()=>{t.nodeModel.graphModel.refresh_loop_fields(ge.cloneDeep(n.value))});const a=Re(!1);return Ir(()=>{t.nodeModel.graphModel.refresh_loop_fields(ge.cloneDeep(n.value))}),(r,s)=>{const c=J("AppIcon"),v=J("el-button"),f=J("el-tooltip");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>{var g;return[Y("h5",cH,de(r.$t("views.applicationWorkflow.nodeSetting")),1),k(uH,{nodeModel:e.nodeModel},null,8,["nodeModel"]),(g=n.value)!=null&&g.length?(be(),Ht(ar,{key:0},[Y("h5",dH,de(r.$t("views.applicationWorkflow.variable.loop")),1),(be(!0),Ht(ar,null,Gr(n.value||[],(_,b)=>(be(),Ht("div",{key:b,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:s[0]||(s[0]=x=>a.value=!0),onMouseleave:s[1]||(s[1]=x=>a.value=!1)},[Y("span",fH,de(_.label)+" "+de("{"+_.value+"}"),1),a.value===!0?(be(),at(f,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(v,{link:"",onClick:x=>_n(Lm)(`{{loop.${_.value}}}`),style:{padding:"0"}},{default:P(()=>[k(c,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],32))),128))],64)):pn("",!0)]}),_:1},8,["nodeModel"])}}});class hH extends ho{constructor(t){super(t,pH)}get_node_field_list(){var n,a,r,s;const t=[];return this.props.model.type&&this.props.model.type==="loop-start-node"&&t.push({value:"loop",label:yt("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(c=>c.label&&c.label.input_type==="TooltipLabel"?{label:c.label.label,value:c.field||c.variable}:{label:c.label||c.name,value:c.field||c.variable})||[]}),t.push({value:this.props.model.id,icon:(a=(n=this.props.model.properties)==null?void 0:n.node_data)==null?void 0:a.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((s=(r=this.props.model.properties)==null?void 0:r.config)==null?void 0:s.fields)||[]}),t}}const vH={type:"loop-start-node",model:vo,view:hH},IN=Object.freeze(Object.defineProperty({__proto__:null,default:vH},Symbol.toStringTag,{value:"Module"})),mH={class:"dialog-footer"},yH=Vn({__name:"McpServerInputDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(!1),s=Re(!1),c=Re(),v=Re({}),f=Re([]);function g(b){r.value=!0,f.value=b}const _=async b=>{b&&await b.validate(x=>{x&&(a("refresh",v.value),r.value=!1)})};return t({open:g}),(b,x)=>{const S=J("el-input"),A=J("el-form-item"),E=J("el-form"),T=J("el-button"),I=J("el-dialog");return be(),at(I,{width:"600",title:"设置变量",modelValue:r.value,"onUpdate:modelValue":x[2]||(x[2]=R=>r.value=R),"close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0},{footer:P(()=>[Y("span",mH,[k(T,{onClick:x[0]||(x[0]=rn(R=>r.value=!1,["prevent"]))},{default:P(()=>[et(de(b.$t("common.cancel")),1)]),_:1}),k(T,{type:"primary",onClick:x[1]||(x[1]=R=>_(c.value)),loading:s.value},{default:P(()=>[et(de(b.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(E,{"label-position":"top",ref_key:"formRef",ref:c,model:v.value,"require-asterisk-position":"right"},{default:P(()=>[(be(!0),Ht(ar,null,Gr(f.value,R=>(be(),at(A,{label:R,key:R,prop:R,rules:{required:!0,message:b.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:P(()=>[k(S,{modelValue:v.value[R],"onUpdate:modelValue":U=>v.value[R]=U},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"]))),128))]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),gH={class:"title-decoration-1 mb-8"},_H={class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},bH={class:"flex-between"},wH={class:"flex align-center"},EH=["src"],OH={class:"flex-between"},xH={class:"ml-4"},SH={class:"title-decoration-1 mb-8"},AH={key:0,class:"p-8-12"},MH={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},kH={class:"flex-between"},TH={key:1},NH={key:2,class:"color-danger"},PH={key:0,class:"p-8-12"},CH={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},RH={class:"flex-between"},jH={key:1},DH={key:2,class:"color-danger"},IH=`{
|
||
"math": {
|
||
"url": "your_server",
|
||
"transport": "sse"
|
||
}
|
||
}`,LH=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Li(),{params:{id:a}}=n,s=ha("getApplicationDetail")(),c=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),v=Re(),f=Re(!1),g=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),_={mcp_tool:"",mcp_tools:[],mcp_servers:"",mcp_server:"",mcp_source:"referencing",mcp_tool_id:"",tool_params:{},tool_form_field:[],params_nested:""},b=Re([]);function x(B){ge.set(t.nodeModel.properties.node_data,"mcp_servers",B)}async function S(){const B=await po({type:"tool",systemType:c.value}).getToolById(D.value.mcp_tool_id,f);D.value.mcp_servers=B.data.code}function A(){if(D.value.mcp_source==="referencing"&&!D.value.mcp_tool_id){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="referencing"&&D.value.mcp_tool_id&&!b.value.find(B=>B.id===D.value.mcp_tool_id)){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="custom"&&!D.value.mcp_servers){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(D.value.mcp_servers);const B=I(D.value.mcp_servers);if(B.length>0){T.value.open(B);return}}catch{ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}E(D.value.mcp_servers)}function E(B){po({type:"application",systemType:c.value}).getMcpTools(a,B,f).then(F=>{var q;D.value.mcp_tools=F.data,zf(yt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),D.value.mcp_server=(q=D.value.mcp_tools.find(K=>K.name===D.value.mcp_tool))==null?void 0:q.server})}const T=Re();function I(B){const F=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,q=new Set,K=X=>{if(typeof X=="string"){let ee;for(;(ee=F.exec(X))!==null;)q.add(ee[1])}else Array.isArray(X)?X.forEach(K):X&&typeof X=="object"&&Object.values(X).forEach(K)};if(typeof B=="string")try{K(JSON.parse(B))}catch{K(B)}else K(B);return[...q]}function R(B){let F=D.value.mcp_servers;for(const q in B)F=F.replace(`{{${q}}}`,B[q]);E(F)}function U(){var F,q,K,X,ee,ue;D.value.mcp_server=(F=D.value.mcp_tools.find(ae=>ae.name===D.value.mcp_tool))==null?void 0:F.server;const B=(q=D.value.mcp_tools.find(ae=>ae.name===D.value.mcp_tool))==null?void 0:q.args_schema;D.value.tool_form_field=[];for(const ae in B==null?void 0:B.properties){const we=B==null?void 0:B.properties[ae].properties;if(we){D.value.params_nested=ae;for(const je in we){let Te="TextInput";we[je].type==="string"?Te="TextInput":we[je].type==="number"?Te="NumberInput":we[je].type==="boolean"?Te="SwitchInput":(we[je].type==="array"||we[je].type==="object")&&(Te="JsonInput"),D.value.tool_form_field.push({field:je,label:{input_type:"TooltipLabel",label:je,attrs:{tooltip:we[je].description},props_info:{}},input_type:Te,source:"referencing",required:((K=B.properties[ae].required)==null?void 0:K.indexOf(je))!==-1,props_info:{rules:[{required:((X=B.properties[ae].required)==null?void 0:X.indexOf(je))!==-1,message:yt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{D.value.params_nested="";let je="TextInput";B.properties[ae].type==="string"?je="TextInput":B.properties[ae].type==="number"?je="NumberInput":B.properties[ae].type==="boolean"?je="SwitchInput":(B.properties[ae].type==="array"||B.properties[ae].type==="object")&&(je="JsonInput"),D.value.tool_form_field.push({field:ae,label:{input_type:"TooltipLabel",label:ae,attrs:{tooltip:B.properties[ae].description},props_info:{}},input_type:je,source:"referencing",required:((ee=B.required)==null?void 0:ee.indexOf(ae))!==-1,props_info:{rules:[{required:((ue=B.required)==null?void 0:ue.indexOf(ae))!==-1,message:yt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}D.value.params_nested?D.value.tool_params={[D.value.params_nested]:{}}:D.value.tool_params={}}const D=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",_),t.nodeModel.properties.node_data),set:B=>{ge.set(t.nodeModel.properties,"node_data",B)}}),L=Re(),W=async()=>{if(v.value){const B=D.value.tool_form_field.filter(F=>F.required).map(F=>F.label.label);if(B.length>0){for(const F of B)if(D.value.params_nested){if(!D.value.tool_params[D.value.params_nested][F])return Promise.reject({node:t.nodeModel,errMessage:F+yt("dynamicsForm.tip.requiredMessage")})}else if(!D.value.tool_params[F])return Promise.reject({node:t.nodeModel,errMessage:F+yt("dynamicsForm.tip.requiredMessage")})}}if(L.value){const B=ge.cloneDeep(D.value);if(!B.mcp_servers)return Promise.reject({node:t.nodeModel,errMessage:yt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip")});if(!B.mcp_tool)return Promise.reject({node:t.nodeModel,errMessage:yt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip")})}};function H(){var F;const B=c.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(F=s.value)==null?void 0:F.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};po({type:"tool",systemType:c.value}).getAllToolList(B,f).then(q=>{b.value=[...q.data.shared_tools,...q.data.tools].filter(K=>K.is_active)})}return Ir(()=>{var B;typeof((B=t.nodeModel.properties.node_data)==null?void 0:B.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),t.nodeModel.properties.node_data.mcp_servers&&!t.nodeModel.properties.node_data.mcp_source&&ge.set(t.nodeModel.properties.node_data,"mcp_source","custom"),H(),ge.set(t.nodeModel,"validate",W)}),(B,F)=>{const q=J("el-option"),K=J("el-select"),X=J("MdEditorMagnify"),ee=J("el-avatar"),ue=J("ToolIcon"),ae=J("el-tag"),we=J("el-form-item"),je=J("AppIcon"),Te=J("el-button"),Me=J("el-tooltip"),Ne=J("el-form"),rt=J("el-text"),tt=J("el-input"),Be=J("el-input-number"),lt=J("el-switch"),St=Mv("loading");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",gH,de(B.$t("views.applicationWorkflow.nodeSetting")),1),Y("div",_H,[k(Ne,{onSubmit:F[5]||(F[5]=rn(()=>{},["prevent"])),model:D.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:L,"hide-required-asterisk":""},{default:P(()=>[k(we,{label:"MCP Server Config"},{label:P(()=>[Y("div",bH,[F[8]||(F[8]=Y("div",null,[et(" MCP Server Config "),Y("span",{class:"color-danger"},"*")],-1)),k(K,{teleported:!1,modelValue:D.value.mcp_source,"onUpdate:modelValue":F[0]||(F[0]=He=>D.value.mcp_source=He),size:"small",style:{width:"85px"}},{default:P(()=>[k(q,{label:B.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),k(q,{label:B.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[D.value.mcp_source==="custom"?(be(),at(X,{key:0,onWheel:g,title:"MCP Server Config",modelValue:D.value.mcp_servers,"onUpdate:modelValue":F[1]||(F[1]=He=>D.value.mcp_servers=He),style:{height:"150px"},onSubmitDialog:x,placeholder:IH},null,8,["modelValue"])):(be(),at(K,{key:1,modelValue:D.value.mcp_tool_id,"onUpdate:modelValue":F[2]||(F[2]=He=>D.value.mcp_tool_id=He),filterable:"",onChange:S},{default:P(()=>[(be(!0),Ht(ar,null,Gr(b.value,He=>(be(),at(q,{key:He.id,label:He.name,value:He.id},{default:P(()=>[Y("div",wH,[He!=null&&He.icon?(be(),at(ee,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>[Y("img",{src:_n(Bf)(He==null?void 0:He.icon),alt:""},null,8,EH)]),_:2},1024)):(be(),at(ue,{key:1,size:20,type:He==null?void 0:He.tool_type,class:"mr-8"},null,8,["type"])),Y("span",null,de(He.name),1),He.scope==="SHARED"?(be(),at(ae,{key:2,type:"info",class:"info-tag ml-8"},{default:P(()=>[et(de(_n(yt)("views.shared.title")),1)]),_:1})):pn("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),k(we,null,{label:P(()=>[Y("div",OH,[Y("span",null,de(B.$t("views.tool.title")),1),k(Te,{type:"primary",link:"",onClick:F[3]||(F[3]=He=>A())},{default:P(()=>[k(je,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(B.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:P(()=>[k(K,{modelValue:D.value.mcp_tool,"onUpdate:modelValue":F[4]||(F[4]=He=>D.value.mcp_tool=He),onChange:U,filterable:""},{default:P(()=>[(be(!0),Ht(ar,null,Gr(D.value.mcp_tools,He=>(be(),at(q,{key:He.value,label:He.name,value:He.name,class:"flex align-center"},{default:P(()=>[k(Me,{effect:"dark",content:He.description,placement:"top-start","popper-class":"max-w-350"},{default:P(()=>[k(je,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),Y("span",xH,de(He.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),Y("h5",SH,de(B.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),D.value.tool_params[D.value.params_nested]?(be(),Ht(ar,{key:0},[D.value.mcp_tool?(be(),Ht("div",MH,[D.value.mcp_tool?Ga((be(),at(Ne,{key:0,ref_key:"dynamicsFormRef",ref:v,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:F[6]||(F[6]=rn(()=>{},["prevent"]))},{default:P(()=>[(be(!0),Ht(ar,null,Gr(D.value.tool_form_field,He=>(be(),at(we,{key:He.field,required:He.required},{label:P(()=>[Y("div",kH,[Y("div",null,[He.label.attrs.tooltip?(be(),at(Ix,{key:0,label:He.label,tooltip:He.label.attrs.tooltip},null,8,["label","tooltip"])):(be(),Ht("span",TH,de(He.label.label),1)),He.required?(be(),Ht("span",NH,"*")):pn("",!0)]),k(K,{teleported:!1,modelValue:He.source,"onUpdate:modelValue":Jt=>He.source=Jt,size:"small",style:{width:"85px"},onChange:Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=""},{default:P(()=>[k(q,{label:B.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(q,{label:B.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:P(()=>[He.source==="custom"&&He.input_type==="TextInput"?(be(),at(tt,{key:0,modelValue:D.value.tool_params[D.value.params_nested][He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="NumberInput"?(be(),at(Be,{key:1,modelValue:D.value.tool_params[D.value.params_nested][He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="SwitchInput"?(be(),at(lt,{key:2,modelValue:D.value.tool_params[D.value.params_nested][He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="JsonInput"?(be(),at(tt,{key:3,modelValue:D.value.tool_params[D.value.params_nested][He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=Jt,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):pn("",!0),He.source==="referencing"?(be(),at(oo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[D.value.params_nested][He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[D.value.params_nested][He.label.label]=Jt},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):pn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[St,f.value]]):pn("",!0)])):(be(),Ht("div",AH,[k(rt,{type:"info"},{default:P(()=>[et(de(B.$t("common.noData")),1)]),_:1})]))],64)):(be(),Ht(ar,{key:1},[D.value.mcp_tool?(be(),Ht("div",CH,[D.value.mcp_tool?Ga((be(),at(Ne,{key:0,ref_key:"dynamicsFormRef",ref:v,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:F[7]||(F[7]=rn(()=>{},["prevent"]))},{default:P(()=>[(be(!0),Ht(ar,null,Gr(D.value.tool_form_field,He=>(be(),at(we,{key:He.field,required:He.required},{label:P(()=>[Y("div",RH,[Y("div",null,[He.label.attrs.tooltip?(be(),at(Ix,{key:0,label:He.label,tooltip:He.label.attrs.tooltip},null,8,["label","tooltip"])):(be(),Ht("span",jH,de(He.label.label),1)),He.required?(be(),Ht("span",DH,"*")):pn("",!0)]),k(K,{teleported:!1,modelValue:He.source,"onUpdate:modelValue":Jt=>He.source=Jt,size:"small",style:{width:"85px"},onChange:Jt=>D.value.tool_params[He.label.label]=""},{default:P(()=>[k(q,{label:B.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(q,{label:B.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:P(()=>[He.source==="custom"&&He.input_type==="TextInput"?(be(),at(tt,{key:0,modelValue:D.value.tool_params[He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="NumberInput"?(be(),at(Be,{key:1,modelValue:D.value.tool_params[He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="SwitchInput"?(be(),at(lt,{key:2,modelValue:D.value.tool_params[He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[He.label.label]=Jt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="JsonInput"?(be(),at(tt,{key:3,modelValue:D.value.tool_params[He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[He.label.label]=Jt,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):pn("",!0),He.source==="referencing"?(be(),at(oo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[He.label.label],"onUpdate:modelValue":Jt=>D.value.tool_params[He.label.label]=Jt},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):pn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[St,f.value]]):pn("",!0)])):(be(),Ht("div",PH,[k(rt,{type:"info"},{default:P(()=>[et(de(B.$t("common.noData")),1)]),_:1})]))],64)),k(yH,{ref_key:"mcpServerInputDialogRef",ref:T,onRefresh:R},null,512)]),_:1},8,["nodeModel"])}}});class $H extends ho{constructor(t){super(t,LH)}}const FH={type:"mcp-node",model:vo,view:$H},LN=Object.freeze(Object.defineProperty({__proto__:null,default:FH},Symbol.toStringTag,{value:"Module"})),BH={class:"dialog-footer"},VH=Vn({__name:"ParametersFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"object",label:"Object"},{value:"boolean",label:"Boolean"},{value:"array",label:"Array"}],s=Re(),c=Re(!1),v=Re(!1),f=Re(null),g=Re({field:"",label:"",parameter_type:"",desc:""}),_=Zf({label:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:yt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),b=Re(!1),x=(E,T)=>{E&&(g.value=ge.cloneDeep(E),v.value=!0,f.value=T),b.value=!0},S=()=>{b.value=!1,v.value=!1,f.value=null,g.value={field:"",label:""}},A=async E=>{E&&await E.validate(T=>{T&&a("refresh",g.value,f.value)})};return t({open:x,close:S}),(E,T)=>{const I=J("el-input"),R=J("el-form-item"),U=J("el-option"),D=J("el-select"),L=J("el-form"),W=J("el-button"),H=J("el-dialog");return be(),at(H,{title:v.value?E.$t("common.param.editParam"):E.$t("common.param.addParam"),modelValue:b.value,"onUpdate:modelValue":T[5]||(T[5]=B=>b.value=B),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":S,"append-to-body":""},{footer:P(()=>[Y("span",BH,[k(W,{onClick:rn(S,["prevent"])},{default:P(()=>[et(de(E.$t("common.cancel")),1)]),_:1}),k(W,{type:"primary",onClick:T[4]||(T[4]=B=>A(s.value)),loading:c.value},{default:P(()=>[et(de(E.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(L,{"label-position":"top",ref_key:"fieldFormRef",ref:s,rules:_,model:g.value,"require-asterisk-position":"right"},{default:P(()=>[k(R,{label:E.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:_.field},{default:P(()=>[k(I,{modelValue:g.value.field,"onUpdate:modelValue":T[0]||(T[0]=B=>g.value.field=B),maxlength:64,placeholder:E.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(R,{label:E.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:_.label},{default:P(()=>[k(I,{modelValue:g.value.label,"onUpdate:modelValue":T[1]||(T[1]=B=>g.value.label=B),maxlength:64,"show-word-limit":"",placeholder:E.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(R,{label:E.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),required:!0,prop:"parameter_type",rules:_.label},{default:P(()=>[k(D,{modelValue:g.value.parameter_type,"onUpdate:modelValue":T[2]||(T[2]=B=>g.value.parameter_type=B),placeholder:E.$t("common.selectPlaceholder")+E.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:P(()=>[(be(),Ht(ar,null,Gr(r,B=>k(U,{key:B.value,label:B.label,value:B.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(R,{label:E.$t("common.desc"),prop:"desc"},{default:P(()=>[k(I,{modelValue:g.value.desc,"onUpdate:modelValue":T[3]||(T[3]=B=>g.value.desc=B),style:{width:"100%"},rows:2,type:"textarea",placeholder:E.$t("common.descPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),UH={class:"flex-between w-full"},WH={class:"break-all lighter"},GH={class:"ml-4",style:{"margin-top":"-4px"}},zH=["title"],HH=["title"],XH={class:"mr-4"},qH=Vn({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re([]);function s(f,g){a.value.open(f,g)}function c(f){r.value.splice(f,1);const g=[{label:yt("common.result"),value:"result"},...r.value.map(_=>({label:_.label,value:_.field}))];ge.set(t.nodeModel.properties.config,"fields",g),t.nodeModel.clear_next_node_field(!1)}function v(f,g){for(let b=0;b<r.value.length;b++)if(r.value[b].field===f.field&&g!==b){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(g)?r.value.push(f):r.value.splice(g,1,f),a.value.close();const _=[{label:yt("common.result"),value:"result"},...r.value.map(b=>({label:b.label,value:b.field}))];ge.set(t.nodeModel.properties.config,"fields",_),t.nodeModel.clear_next_node_field(!1)}return Ir(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=ge.cloneDeep(t.nodeModel.properties.node_data.variable_list)),ge.set(t.nodeModel.properties.node_data,"variable_list",r);const f=[{label:yt("common.result"),value:"result"},...r.value.map(g=>({label:g.label,value:g.field}))];ge.set(t.nodeModel.properties.config,"fields",f)}),(f,g)=>{var T;const _=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),S=J("el-tag"),A=J("el-tooltip"),E=J("el-table");return be(),Ht(ar,null,[Y("div",UH,[Y("h5",WH,[et(de(f.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),g[1]||(g[1]=Y("span",{class:"color-danger"},"*",-1))]),Y("span",GH,[k(b,{link:"",type:"primary",onClick:g[0]||(g[0]=I=>s())},{default:P(()=>[k(_,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((T=t.nodeModel.properties.node_data.variable_list)==null?void 0:T.length)>0?(be(),at(E,{key:0,data:t.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:P(()=>[k(x,{prop:"field",label:f.$t("dynamicsForm.paramForm.field.label"),width:"90"},{default:P(({row:I})=>[Y("span",{title:I.field,class:"ellipsis-1"},de(I.field),9,zH)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:I})=>[Y("span",null,[Y("span",{title:I.label,class:"ellipsis-1"},de(I.label),9,HH)])]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:P(({row:I})=>[k(S,{type:"info",class:"info-tag"},{default:P(()=>[et(de(I.parameter_type),1)]),_:2},1024)]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"80"},{default:P(({row:I,$index:R})=>[Y("span",XH,[k(A,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:rn(U=>s(I,R),["stop"])},{default:P(()=>[k(_,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(A,{effect:"dark",content:f.$t("common.delete"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:U=>c(R)},{default:P(()=>[k(_,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(VH,{ref_key:"ParametersFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),YH={class:"title-decoration-1 mb-8"},KH={class:"flex-between w-full"},ZH={class:"flex-between"},JH=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=e,a=Re(),r=Li(),{params:{id:s}}=r,c=R=>{var U;R&&((U=a.value)==null||U.open(R,s,A.value.model_params_setting))};function v(R){ge.set(n.nodeModel.properties.node_data,"model_params_setting",R)}const f=t(),g=Re(null),_=R=>R.ctrlKey===!0?(R.preventDefault(),!0):(R.stopPropagation(),!0),b=$n(()=>r.path.includes("resource-management")?"systemManage":"workspace");function x(){var U;const R=b.value==="systemManage"?{model_type:"LLM",workspace_id:(U=f.value)==null?void 0:U.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:b.value}).getSelectModelList(R).then(D=>{g.value=ge.groupBy(D==null?void 0:D.data,"provider")})}const S={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},A=$n({get:()=>(n.nodeModel.properties.node_data||ge.set(n.nodeModel.properties,"node_data",S),n.nodeModel.properties.node_data),set:R=>{ge.set(n.nodeModel.properties,"node_data",R)}}),E=R=>{var U;R?(U=a.value)==null||U.reset_default(R,s):v({})},T=Re(),I=async()=>T.value.validate().catch(R=>Promise.reject({node:n.nodeModel,errMessage:R}));return Ir(()=>{x(),ge.set(n.nodeModel,"validate",I)}),(R,U)=>{const D=J("AppIcon"),L=J("el-button"),W=J("ModelSelect"),H=J("el-form-item"),B=J("el-form"),F=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",YH,de(R.$t("views.applicationWorkflow.nodeSetting")),1),k(F,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(B,{onSubmit:U[3]||(U[3]=rn(()=>{},["prevent"])),model:A.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:T,"hide-required-asterisk":""},{default:P(()=>[k(H,{label:R.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:R.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:P(()=>[Y("div",KH,[Y("div",null,[Y("span",null,[et(de(R.$t("views.application.form.aiModel.label")),1),U[4]||(U[4]=Y("span",{class:"color-danger ml-4"},"*",-1))])]),k(L,{disabled:!A.value.model_id,type:"primary",link:"",onClick:U[0]||(U[0]=q=>c(A.value.model_id)),onRefreshForm:v},{default:P(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(W,{onChange:E,onWheel:_,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":U[1]||(U[1]=q=>A.value.model_id=q),placeholder:R.$t("views.application.form.aiModel.placeholder"),options:g.value,onSubmitModel:x,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(H,{prop:"input_variable",rules:{message:R.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",ZH,[Y("div",null,[et(de(R.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),U[5]||(U[5]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.variable.placeholder"),modelValue:A.value.input_variable,"onUpdate:modelValue":U[2]||(U[2]=q=>A.value.input_variable=q)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(H,{prop:"variable_list",rules:{message:R.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(qH,{ref:"ParametersFieldTableRef","node-model":e.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:a,onRefresh:v},null,512)]),_:1},8,["nodeModel"])}}});class QH extends ho{constructor(t){super(t,JH)}getConfig(t){return t.model.properties.config}}const eX={type:"parameter-extraction-node",model:vo,view:QH},$N=Object.freeze(Object.defineProperty({__proto__:null,default:eX},Symbol.toStringTag,{value:"Module"})),tX={class:"title-decoration-1 mb-8"},nX={class:"flex-between"},rX={class:"flex-between"},oX={class:"flex align-center"},iX={class:"flex align-center"},aX={class:"mr-4"},lX={class:"flex align-center"},sX={class:"mr-4"},uX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=Re(),c=L=>L.ctrlKey===!0?(L.preventDefault(),!0):(L.stopPropagation(),!0),v=L=>{var W;L?(W=s.value)==null||W.reset_default(L,a):x({})};function f(L){ge.set(E.nodeModel.properties.node_data,"prompt",L)}function g(L){ge.set(E.nodeModel.properties.node_data,"system",L)}const _=`{{${yt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,b={model_id:"",system:yt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:_,dialogue_number:1,is_result:!1};function x(L){ge.set(E.nodeModel.properties.node_data,"model_params_setting",L)}const S=L=>{var W;L&&((W=s.value)==null||W.open(L,a,A.value.model_params_setting))},A=$n({get:()=>(E.nodeModel.properties.node_data||ge.set(E.nodeModel.properties,"node_data",b),E.nodeModel.properties.node_data),set:L=>{ge.set(E.nodeModel.properties,"node_data",L)}}),E=e,T=Re(),I=Re(null),R=()=>{var L;return(L=T.value)==null?void 0:L.validate().catch(W=>Promise.reject({node:E.nodeModel,errMessage:W}))},U=t();function D(){var W;const L=r.value==="systemManage"?{model_type:"LLM",workspace_id:(W=U.value)==null?void 0:W.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:r.value}).getSelectModelList(L).then(H=>{I.value=ge.groupBy(H==null?void 0:H.data,"provider")})}return Ir(()=>{var L;D(),typeof((L=E.nodeModel.properties.node_data)==null?void 0:L.is_result)>"u"&&vc(E.nodeModel)&&ge.set(E.nodeModel.properties.node_data,"is_result",!0),ge.set(E.nodeModel,"validate",R)}),(L,W)=>{const H=J("AppIcon"),B=J("el-button"),F=J("ModelSelect"),q=J("el-form-item"),K=J("el-tooltip"),X=J("MdEditorMagnify"),ee=J("el-input-number"),ue=J("el-switch"),ae=J("el-form"),we=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",tX,de(L.$t("views.applicationWorkflow.nodeSetting")),1),k(we,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(ae,{onSubmit:W[7]||(W[7]=rn(()=>{},["prevent"])),model:A.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:T,"hide-required-asterisk":""},{default:P(()=>[k(q,{label:L.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:L.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:P(()=>[Y("div",nX,[Y("div",null,[Y("span",null,[et(de(L.$t("views.application.form.aiModel.label")),1),W[8]||(W[8]=Y("span",{class:"color-danger"},"*",-1))])]),k(B,{type:"primary",link:"",disabled:!A.value.model_id,onClick:W[0]||(W[0]=je=>S(A.value.model_id)),onRefreshForm:x},{default:P(()=>[k(H,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(F,{onChange:v,onWheel:c,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=je=>A.value.model_id=je),placeholder:L.$t("views.application.form.aiModel.placeholder"),options:I.value,onSubmitModel:D,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(q,null,{label:P(()=>[Y("div",rX,[Y("div",oX,[Y("span",null,de(L.$t("views.application.form.roleSettings.label")),1),k(K,{effect:"dark",content:L.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:P(()=>[k(X,{title:L.$t("views.application.form.roleSettings.label"),modelValue:A.value.system,"onUpdate:modelValue":W[2]||(W[2]=je=>A.value.system=je),style:{height:"100px"},onSubmitDialog:g,placeholder:`${_n(yt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(q,{label:L.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:L.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:P(()=>[Y("div",iX,[Y("div",aX,[Y("span",null,[et(de(L.$t("views.application.form.prompt.label")),1),W[9]||(W[9]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.application.form.prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:c,title:L.$t("views.application.form.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":W[3]||(W[3]=je=>A.value.prompt=je),style:{height:"150px"},onSubmitDialog:f,placeholder:`${_n(yt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.application.form.historyRecord.label")},{default:P(()=>[k(ee,{modelValue:A.value.dialogue_number,"onUpdate:modelValue":W[4]||(W[4]=je=>A.value.dialogue_number=je),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[6]||(W[6]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",lX,[Y("div",sX,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ue,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":W[5]||(W[5]=je=>A.value.is_result=je)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:x},null,512)]),_:1},8,["nodeModel"])}}});class cX extends ho{constructor(t){super(t,uX)}}const dX={type:"question-node",model:vo,view:cX},FN=Object.freeze(Object.defineProperty({__proto__:null,default:dX},Symbol.toStringTag,{value:"Module"})),fX={class:"flex-between"},pX={class:"flex align-center"},hX={class:"mr-4"},vX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=g=>g.ctrlKey===!0?(g.preventDefault(),!0):(g.stopPropagation(),!0),a={reply_type:"content",content:"",fields:[],is_result:!0},r=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",a),t.nodeModel.properties.node_data),set:g=>{ge.set(t.nodeModel.properties,"node_data",g)}});function s(g){ge.set(t.nodeModel.properties.node_data,"content",g)}const c=Re(),v=Re(),f=()=>{var g;return Promise.all([v.value?v.value.validate():Promise.resolve(""),(g=c.value)==null?void 0:g.validate()]).catch(_=>Promise.reject({node:t.nodeModel,errMessage:_}))};return Ir(()=>{var g;typeof((g=t.nodeModel.properties.node_data)==null?void 0:g.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),ge.set(t.nodeModel,"validate",f)}),(g,_)=>{const b=J("el-option"),x=J("el-select"),S=J("MdEditorMagnify"),A=J("el-form-item"),E=J("AppIcon"),T=J("el-tooltip"),I=J("el-switch"),R=J("el-form"),U=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(U,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(R,{onSubmit:_[5]||(_[5]=rn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:c},{default:P(()=>[k(A,{label:g.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:P(()=>[Y("div",fX,[Y("span",null,de(g.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),k(x,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":_[0]||(_[0]=D=>r.value.reply_type=D),size:"small",style:{width:"85px"}},{default:P(()=>[k(b,{label:g.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(b,{label:g.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[r.value.reply_type==="content"?(be(),at(S,{key:0,onWheel:n,title:g.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":_[1]||(_[1]=D=>r.value.content=D),style:{height:"150px"},onSubmitDialog:s},null,8,["title","modelValue"])):(be(),at(oo,{key:1,ref_key:"nodeCascaderRef",ref:v,nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.fields,"onUpdate:modelValue":_[2]||(_[2]=D=>r.value.fields=D)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),k(A,{label:g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:_[4]||(_[4]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",pX,[Y("div",hX,[Y("span",null,de(g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(T,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(I,{size:"small",modelValue:r.value.is_result,"onUpdate:modelValue":_[3]||(_[3]=D=>r.value.is_result=D)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class mX extends ho{constructor(t){super(t,vX)}}const yX={type:"reply-node",model:vo,view:mX},BN=Object.freeze(Object.defineProperty({__proto__:null,default:yX},Symbol.toStringTag,{value:"Module"})),gX={class:"flex align-center"},_X={class:"mr-4"},bX={class:"dialog-footer"},wX=Vn({__name:"ParamSettingDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re({top_n:3,similarity:0,max_paragraph_char_number:5e3}),c=Re(!1),v=Re(!1);Ym(c,_=>{_||(s.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const f=_=>{s.value={...s.value,...ge.cloneDeep(_)},c.value=!0},g=()=>{var _;(_=r==null?void 0:r.value)==null||_.validate((b,x)=>{b&&(a("refresh",ge.cloneDeep(s.value)),c.value=!1)})};return t({open:f}),(_,b)=>{const x=J("AppIcon"),S=J("el-tooltip"),A=J("el-input-number"),E=J("el-form-item"),T=J("el-col"),I=J("el-row"),R=J("el-slider"),U=J("el-form"),D=J("el-button"),L=J("el-dialog");return be(),at(L,{"align-center":"",title:_.$t("common.paramSetting"),class:"param-dialog",modelValue:c.value,"onUpdate:modelValue":b[5]||(b[5]=W=>c.value=W),style:{width:"550px"},"append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:P(()=>[Y("span",bX,[k(D,{onClick:b[3]||(b[3]=rn(W=>c.value=!1,["prevent"]))},{default:P(()=>[et(de(_.$t("common.cancel")),1)]),_:1}),k(D,{type:"primary",onClick:b[4]||(b[4]=W=>g()),loading:v.value},{default:P(()=>[et(de(_.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(U,{"label-position":"top",ref_key:"paramFormRef",ref:r,model:s.value},{default:P(()=>[k(I,{gutter:12},{default:P(()=>[k(T,{span:12},{default:P(()=>[k(E,null,{label:P(()=>[Y("div",gX,[Y("span",_X,"Score "+de(_.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),k(S,{effect:"dark",content:_.$t("views.applicationWorkflow.nodes.rerankerNode.ScoreTooltip"),placement:"right"},{default:P(()=>[k(x,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:P(()=>[k(A,{modelValue:s.value.similarity,"onUpdate:modelValue":b[0]||(b[0]=W=>s.value.similarity=W),min:0,max:s.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(T,{span:12},{default:P(()=>[k(E,{label:_.$t("views.application.dialog.topReferences")},{default:P(()=>[k(A,{modelValue:s.value.top_n,"onUpdate:modelValue":b[1]||(b[1]=W=>s.value.top_n=W),min:1,max:1e4,"value-on-clear":1,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),k(E,{label:_.$t("views.application.dialog.maxCharacters")},{default:P(()=>[k(R,{modelValue:s.value.max_paragraph_char_number,"onUpdate:modelValue":b[2]||(b[2]=W=>s.value.max_paragraph_char_number=W),"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"])}}}),EX={class:"flex-between"},OX={class:"flex-between"},xX={class:"w-full"},SX={class:"flex-between"},AX={class:"flex-between"},MX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(),v={reranker_reference_list:[[]],reranker_model_id:"",question_reference_address:[],reranker_setting:{top_n:3,similarity:0,max_paragraph_char_number:5e3},show_knowledge:!1},f=Re(null),g=()=>{var D;(D=c.value)==null||D.open(x.value.reranker_setting)},_=D=>{const L=ge.cloneDeep(s.nodeModel.properties.node_data.reranker_reference_list);L.splice(D,1),ge.set(s.nodeModel.properties.node_data,"reranker_reference_list",L)},b=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.stopPropagation(),!0),x=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",v),s.nodeModel.properties.node_data),set:D=>{ge.set(s.nodeModel.properties,"node_data",D)}});function S(D){ge.set(s.nodeModel.properties.node_data,"reranker_setting",D)}const A=t();function E(){var L;const D=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(L=A.value)==null?void 0:L.workspace_id}:{model_type:"RERANKER"};po({type:"model",systemType:r.value}).getSelectModelList(D).then(W=>{f.value=ge.groupBy(W==null?void 0:W.data,"provider")})}const T=()=>{const D=ge.cloneDeep(s.nodeModel.properties.node_data.reranker_reference_list);D.push([]),ge.set(s.nodeModel.properties.node_data,"reranker_reference_list",D)},I=Re(),R=Re(),U=()=>{var D;return Promise.all([R.value?R.value.validate():Promise.resolve(""),(D=I.value)==null?void 0:D.validate()]).catch(L=>Promise.reject({node:s.nodeModel,errMessage:L}))};return Ir(()=>{E(),x.value.show_knowledge=x.value.show_knowledge?x.value.show_knowledge:!1,ge.set(s.nodeModel,"validate",U)}),(D,L)=>{const W=J("AppIcon"),H=J("el-button"),B=J("el-form-item"),F=J("el-col"),q=J("el-row"),K=J("ModelSelect"),X=J("el-switch"),ee=J("el-form"),ue=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(ue,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(ee,{onSubmit:L[4]||(L[4]=rn(()=>{},["prevent"])),model:x.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"rerankerNodeFormRef",ref:I,"hide-required-asterisk":""},{default:P(()=>[k(B,{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:P(()=>[Y("div",EX,[Y("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),L[5]||(L[5]=Y("span",{class:"color-danger"},"*",-1))]),k(H,{onClick:T,link:"",type:"primary"},{default:P(()=>[k(W,{iconName:"app-add-outlined"})]),_:1})])]),default:P(()=>[(be(!0),Ht(ar,null,Gr(x.value.reranker_reference_list,(ae,we)=>(be(),at(q,{gutter:8,style:{"margin-bottom":"8px"},key:we,class:"w-full"},{default:P(()=>[k(F,{span:22},{default:P(()=>[k(B,{prop:"reranker_reference_list."+we,rules:{type:"array",required:!0,message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[(be(),at(oo,{key:we,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:x.value.reranker_reference_list[we],"onUpdate:modelValue":je=>x.value.reranker_reference_list[we]=je},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),k(F,{span:2},{default:P(()=>[k(H,{link:"",type:"info",onClick:je=>_(we)},{default:P(()=>[k(W,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),k(B,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:P(()=>[Y("div",OX,[Y("span",null,de(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(H,{type:"primary",link:"",onClick:g},{default:P(()=>[k(W,{iconName:"app-setting"})]),_:1})])]),default:P(()=>[Y("div",xX,[k(q,null,{default:P(()=>[k(F,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(" Score "+de(D.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),k(F,{span:12,class:"lighter"},{default:P(()=>{var ae;return[et(de((ae=x.value.reranker_setting.similarity)==null?void 0:ae.toFixed(3)),1)]}),_:1}),k(F,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(D.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),k(F,{span:12,class:"lighter"},{default:P(()=>[et(de(x.value.reranker_setting.top_n),1)]),_:1}),k(F,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),k(F,{span:12,class:"lighter"},{default:P(()=>[et(de(x.value.reranker_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(B,{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:P(()=>[Y("div",SX,[Y("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),L[6]||(L[6]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:R,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:x.value.question_reference_address,"onUpdate:modelValue":L[0]||(L[0]=ae=>x.value.question_reference_address=ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(B,{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:P(()=>[Y("div",AX,[Y("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),L[7]||(L[7]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(K,{onWheel:b,teleported:!1,modelValue:x.value.reranker_model_id,"onUpdate:modelValue":L[1]||(L[1]=ae=>x.value.reranker_model_id=ae),placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),options:f.value,onSubmitModel:E,showFooter:"","model-type":"RERANKER"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(B,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:L[3]||(L[3]=rn(()=>{},["prevent"]))},{default:P(()=>[k(X,{size:"small",modelValue:x.value.show_knowledge,"onUpdate:modelValue":L[2]||(L[2]=ae=>x.value.show_knowledge=ae)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(wX,{ref_key:"ParamSettingDialogRef",ref:c,onRefresh:S},null,512)]),_:1},8,["nodeModel"])}}}),kX=Kf(MX,[["__scopeId","data-v-298ea2ea"]]);class TX extends ho{constructor(t){super(t,kX)}}const NX={type:"reranker-node",model:vo,view:TX},VN=Object.freeze(Object.defineProperty({__proto__:null,default:NX},Symbol.toStringTag,{value:"Module"})),PX={class:"title-decoration-1 mb-8"},CX={class:"flex-between"},RX={key:0,class:"w-full"},jX={class:"flex align-center",style:{"line-height":"20px"}},DX=["title"],IX={key:1,class:"w-full"},LX={class:"flex-between"},$X={class:"flex align-center"},FX={class:"flex align-center"},BX={class:"w-full"},VX={key:1},UX={class:"flex align-center mb-8"},WX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Li(),n=e,a=Re(),r=Re(),s=[{value:"contain",label:yt("views.applicationWorkflow.compare.contain")},{value:"not_contain",label:yt("views.applicationWorkflow.compare.not_contain")},{value:"eq",label:yt("views.applicationWorkflow.compare.eq")}],c=$n(()=>t.path.includes("shared")?"systemShare":t.path.includes("resource-management")?"systemManage":t.path.includes("share/")?"workspaceShare":"workspace"),v={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:[]},f=$n({get:()=>(n.nodeModel.properties.node_data||ge.set(n.nodeModel.properties,"node_data",v),n.nodeModel.properties.node_data),set:D=>{ge.set(n.nodeModel.properties,"node_data",D)}}),g=Re(),_=Re(),b=Re([]),x=Re(!1);function S(D){const L=n.nodeModel.properties.node_data.knowledge_id_list.filter(W=>W!==D);ge.set(n.nodeModel.properties.node_data,"knowledge_id_list",L)}function A(D){ge.set(n.nodeModel.properties.node_data,"knowledge_id_list",D.map(L=>L.id)),ge.set(n.nodeModel.properties.node_data,"knowledge_list",D),b.value=D}function E(){_.value&&_.value.open(f.value.knowledge_id_list)}function T(){const D=ge.cloneDeep(f.value.search_condition_list);D.push({key:"",compare:"contain",value:""}),ge.set(f.value,"search_condition_list",D)}function I(D){const L=ge.cloneDeep(f.value.search_condition_list);L.splice(D,1),ge.set(f.value,"search_condition_list",L)}function R(D){if(D.length===0){ge.set(f.value,"knowledge_tags",[]);return}po({type:"knowledge",systemType:c.value}).getAllTags({knowledge_ids:D},{}).then(L=>{ge.set(f.value,"knowledge_tags",L.data)})}const U=()=>{var D,L,W;return Promise.all([(D=a.value)==null?void 0:D.validate(),(L=r.value)==null?void 0:L.validate(),(W=g.value)==null?void 0:W.validate()]).catch(H=>Promise.reject({node:n.nodeModel,errMessage:H}))};return Ir(()=>{b.value=n.nodeModel.properties.node_data.knowledge_list,ge.set(n.nodeModel,"validate",U)}),(D,L)=>{const W=J("el-button"),H=J("el-option"),B=J("el-select"),F=J("el-text"),q=J("KnowledgeIcon"),K=J("Close"),X=J("el-icon"),ee=J("el-form-item"),ue=J("el-tooltip"),ae=J("el-radio"),we=J("el-radio-group"),je=J("el-col"),Te=J("el-input"),Me=J("el-row"),Ne=J("el-form"),rt=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",PX,de(D.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Ne,{onSubmit:L[8]||(L[8]=rn(()=>{},["prevent"])),model:f.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:g},{default:P(()=>[k(ee,null,{label:P(()=>[Y("div",CX,[Y("span",null,de(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),Y("span",null,[f.value.search_scope_type==="custom"?(be(),at(W,{key:0,type:"primary",link:"",onClick:E},{default:P(()=>[k(Zp,{iconName:"app-add-outlined"})]),_:1})):pn("",!0),k(B,{teleported:!1,size:"small",modelValue:f.value.search_scope_type,"onUpdate:modelValue":L[0]||(L[0]=tt=>f.value.search_scope_type=tt),style:{width:"85px"}},{default:P(()=>[k(H,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(H,{label:D.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:P(()=>{var tt;return[f.value.search_scope_type==="custom"?(be(),Ht("div",RX,[((tt=f.value.knowledge_id_list)==null?void 0:tt.length)===0?(be(),at(F,{key:0,type:"info"},{default:P(()=>[et(de(D.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(be(!0),Ht(ar,{key:1},Gr(f.value.knowledge_id_list,(Be,lt)=>{var St,He,Jt;return be(),Ht("div",{key:lt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[Y("div",jX,[k(q,{type:(St=_n(cl)(b.value,Be,"id"))==null?void 0:St.type,class:"mr-8",size:20},null,8,["type"]),Y("div",{class:"ellipsis",title:(He=_n(cl)(b.value,Be,"id"))==null?void 0:He.name},de((Jt=_n(cl)(b.value,Be,"id"))==null?void 0:Jt.name),9,DX)]),k(W,{text:"",onClick:Fe=>S(Be)},{default:P(()=>[k(X,null,{default:P(()=>[k(K)]),_:1})]),_:1},8,["onClick"])])}),128))])):(be(),Ht("div",IX,[k(ee,{prop:"search_scope_reference",rules:{message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",LX,[Y("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),L[9]||(L[9]=Y("span",{class:"color-danger"},"*",-1))]),Y("span",null,[k(B,{teleported:!1,size:"small",modelValue:f.value.search_scope_source,"onUpdate:modelValue":L[1]||(L[1]=Be=>f.value.search_scope_source=Be),style:{width:"95px"},onChange:L[2]||(L[2]=Be=>f.value.search_scope_reference=[])},{default:P(()=>[k(H,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(H,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:a,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.variable.placeholder"),modelValue:f.value.search_scope_reference,"onUpdate:modelValue":L[3]||(L[3]=Be=>f.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(ee,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:P(()=>[k(we,{modelValue:f.value.search_mode,"onUpdate:modelValue":L[4]||(L[4]=tt=>f.value.search_mode=tt)},{default:P(()=>[k(ae,{value:"auto"},{default:P(()=>[Y("span",$X,[et(de(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),k(ue,{content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.autoTooltip"),placement:"top"},{default:P(()=>[k(Zp,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1}),f.value.search_scope_type==="custom"?(be(),at(ae,{key:0,value:"custom"},{default:P(()=>[Y("span",FX,[et(de(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),k(ue,{c:"",content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.customTooltip"),placement:"top"},{default:P(()=>[k(Zp,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1})):pn("",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),Y("div",BX,[f.value.search_mode==="auto"?(be(),at(ee,{key:0,prop:"question_reference",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:P(()=>[Y("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),L[10]||(L[10]=Y("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:f.value.question_reference,"onUpdate:modelValue":L[5]||(L[5]=tt=>f.value.question_reference=tt)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(be(),Ht("div",VX,[Y("div",UX,[k(F,{type:"info",class:"lighter",size:"small"},{default:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),k(B,{modelValue:f.value.search_condition_type,"onUpdate:modelValue":L[6]||(L[6]=tt=>f.value.search_condition_type=tt),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(H,{label:D.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(H,{label:D.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),k(F,{type:"info",class:"lighter",size:"small"},{default:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(be(!0),Ht(ar,null,Gr(f.value.search_condition_list,(tt,Be)=>(be(),Ht("div",{key:Be},[k(Me,{gutter:8,class:"mb-8"},{default:P(()=>[k(je,{span:8},{default:P(()=>[k(B,{modelValue:tt.key,"onUpdate:modelValue":lt=>tt.key=lt,filterable:"",onFocus:L[7]||(L[7]=lt=>R(f.value.knowledge_id_list))},{default:P(()=>[(be(!0),Ht(ar,null,Gr(f.value.knowledge_tags,lt=>(be(),at(H,{key:lt,label:lt.key,value:lt.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(je,{span:7},{default:P(()=>[k(B,{modelValue:tt.compare,"onUpdate:modelValue":lt=>tt.compare=lt},{default:P(()=>[(be(),Ht(ar,null,Gr(s,lt=>k(H,{key:lt.value,value:lt.value,label:lt.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(je,{span:8},{default:P(()=>[k(Te,{modelValue:tt.value,"onUpdate:modelValue":lt=>tt.value=lt,placeholder:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),k(je,{span:1},{default:P(()=>[k(W,{link:"",onClick:lt=>I(Be),type:"info",class:"mt-4"},{default:P(()=>[k(Zp,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128)),k(W,{link:"",type:"primary",onClick:T,class:"mt-8"},{default:P(()=>[k(Zp,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(D.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),k(tk,{ref_key:"AddKnowledgeDialogRef",ref:_,onAddData:A,data:b.value,loading:x.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class GX extends ho{constructor(t){super(t,WX)}}const zX={type:"search-document-node",model:vo,view:GX},UN=Object.freeze(Object.defineProperty({__proto__:null,default:zX},Symbol.toStringTag,{value:"Module"})),HX={class:"title-decoration-1 mb-8"},XX={class:"flex-between"},qX={key:0,class:"w-full"},YX={class:"flex align-center",style:{"line-height":"20px"}},KX=["title"],ZX={key:1,class:"w-full"},JX={class:"flex-between"},QX={class:"flex-between"},eq={class:"w-full"},tq={class:"flex-between"},nq={class:"flex-between"},rq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a={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=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",a),t.nodeModel.properties.node_data),set:T=>{ge.set(t.nodeModel.properties,"node_data",T)}}),s=Re(),c=Re(),v=Re(),f=Re([]),g=Re(!1);function _(T){ge.set(t.nodeModel.properties.node_data,"knowledge_setting",T.knowledge_setting)}const b=()=>{var T;(T=c.value)==null||T.open(r.value,"WORK_FLOW")};function x(T){const I=t.nodeModel.properties.node_data.knowledge_id_list.filter(R=>R!==T);ge.set(t.nodeModel.properties.node_data,"knowledge_id_list",I)}function S(T){ge.set(t.nodeModel.properties.node_data,"knowledge_id_list",T.map(I=>I.id)),ge.set(t.nodeModel.properties.node_data,"knowledge_list",T),f.value=T}function A(){v.value&&v.value.open(r.value.knowledge_id_list)}const E=()=>{var T;return Promise.all([n.value.validate(),(T=s.value)==null?void 0:T.validate()]).catch(I=>Promise.reject({node:t.nodeModel,errMessage:I}))};return Ir(()=>{f.value=t.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:[],ge.set(t.nodeModel,"validate",E)}),(T,I)=>{const R=J("el-button"),U=J("el-option"),D=J("el-select"),L=J("el-text"),W=J("KnowledgeIcon"),H=J("Close"),B=J("el-icon"),F=J("el-form-item"),q=J("el-col"),K=J("el-row"),X=J("el-switch"),ee=J("el-form"),ue=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",HX,de(T.$t("views.applicationWorkflow.nodeSetting")),1),k(ue,{shadow:"never",class:"card-never"},{default:P(()=>[k(ee,{onSubmit:I[7]||(I[7]=rn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:s,"hide-required-asterisk":""},{default:P(()=>[k(F,null,{label:P(()=>[Y("div",XX,[Y("span",null,de(T.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),Y("span",null,[r.value.search_scope_type==="custom"?(be(),at(R,{key:0,type:"primary",link:"",onClick:A},{default:P(()=>[k(Zp,{iconName:"app-add-outlined"})]),_:1})):pn("",!0),k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_type,"onUpdate:modelValue":I[0]||(I[0]=ae=>r.value.search_scope_type=ae),style:{width:"85px"}},{default:P(()=>[k(U,{label:T.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(U,{label:T.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:P(()=>{var ae;return[r.value.search_scope_type==="custom"?(be(),Ht("div",qX,[((ae=r.value.knowledge_id_list)==null?void 0:ae.length)===0?(be(),at(L,{key:0,type:"info"},{default:P(()=>[et(de(T.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(be(!0),Ht(ar,{key:1},Gr(r.value.knowledge_id_list,(we,je)=>{var Te,Me,Ne;return be(),Ht("div",{key:je,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[Y("div",YX,[k(W,{type:(Te=_n(cl)(f.value,we,"id"))==null?void 0:Te.type,class:"mr-8",size:20},null,8,["type"]),Y("div",{class:"ellipsis",title:(Me=_n(cl)(f.value,we,"id"))==null?void 0:Me.name},de((Ne=_n(cl)(f.value,we,"id"))==null?void 0:Ne.name),9,KX)]),k(R,{text:"",onClick:rt=>x(we)},{default:P(()=>[k(B,null,{default:P(()=>[k(H)]),_:1})]),_:1},8,["onClick"])])}),128))])):(be(),Ht("div",ZX,[k(F,{prop:"search_scope_reference",rules:{message:T.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",JX,[Y("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),I[8]||(I[8]=Y("span",{class:"color-danger"},"*",-1))]),Y("span",null,[k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_source,"onUpdate:modelValue":I[1]||(I[1]=we=>r.value.search_scope_source=we),style:{width:"95px"},onChange:I[2]||(I[2]=we=>r.value.search_scope_reference=[])},{default:P(()=>[k(U,{label:T.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(U,{label:T.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:n,nodeModel:e.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.variable.placeholder"),modelValue:r.value.search_scope_reference,"onUpdate:modelValue":I[3]||(I[3]=we=>r.value.search_scope_reference=we)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(F,{label:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:P(()=>[Y("div",QX,[Y("span",null,de(T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(R,{type:"primary",link:"",onClick:b},{default:P(()=>[k(Zp,{iconName:"app-setting"})]),_:1})])]),default:P(()=>[Y("div",eq,[k(K,null,{default:P(()=>[k(q,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),k(q,{span:12,class:"lighter"},{default:P(()=>[et(de(T.$t(_n(CD)[r.value.knowledge_setting.search_mode])),1)]),_:1}),k(q,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),k(q,{span:12,class:"lighter"},{default:P(()=>{var ae;return[et(de((ae=r.value.knowledge_setting.similarity)==null?void 0:ae.toFixed(3)),1)]}),_:1}),k(q,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.topReferences")),1)]),_:1}),k(q,{span:12,class:"lighter"},{default:P(()=>[et(de(r.value.knowledge_setting.top_n),1)]),_:1}),k(q,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.maxCharacters")),1)]),_:1}),k(q,{span:12,class:"lighter"},{default:P(()=>[et(de(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(F,{prop:"question_reference_address",rules:{message:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",tq,[Y("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),I[9]||(I[9]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:n,nodeModel:e.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.question_reference_address,"onUpdate:modelValue":I[4]||(I[4]=ae=>r.value.question_reference_address=ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(F,{prop:"show_knowledge",rules:{message:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:I[6]||(I[6]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",nq,[Y("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"))+" ",1),I[10]||(I[10]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(X,{size:"small",modelValue:r.value.show_knowledge,"onUpdate:modelValue":I[5]||(I[5]=ae=>r.value.show_knowledge=ae)},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(WD,{ref_key:"ParamSettingDialogRef",ref:c,onRefresh:_},null,512),k(tk,{ref_key:"AddknowledgeDialogRef",ref:v,onAddData:S,data:f.value,loading:g.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class oq extends ho{constructor(t){super(t,rq)}}const iq={type:"search-knowledge-node",model:vo,view:oq},WN=Object.freeze(Object.defineProperty({__proto__:null,default:iq},Symbol.toStringTag,{value:"Module"})),aq={class:"title-decoration-1 mb-8"},lq={class:"flex-between w-full"},sq={class:"flex-between w-full"},uq={class:"flex align-center"},cq={class:"mr-4"},dq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=Re(),_=()=>{var U;return Promise.all([g.value?g.value.validate():Promise.resolve(""),(U=f.value)==null?void 0:U.validate()]).catch(D=>Promise.reject({node:s.nodeModel,errMessage:D}))},b=U=>U.ctrlKey===!0?(U.preventDefault(),!0):(U.stopPropagation(),!0),x={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},S=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:U=>{ge.set(s.nodeModel.properties,"node_data",U)}}),A=()=>{var D;const U=S.value.stt_model_id;if(!U){zf(yt("views.application.form.voiceInput.requiredMessage"));return}(D=v.value)==null||D.open(U,a,S.value.model_params_setting)},E=U=>{ge.set(s.nodeModel.properties.node_data,"model_params_setting",U)};function T(U){var D;U?(D=v.value)==null||D.reset_default(U,a):E({})}const I=t();function R(){var D;const U=r.value==="systemManage"?{model_type:"STT",workspace_id:(D=I.value)==null?void 0:D.workspace_id}:{model_type:"STT"};po({type:"model",systemType:r.value}).getSelectModelList(U).then(L=>{c.value=ge.groupBy(L==null?void 0:L.data,"provider")})}return Ir(()=>{R(),ge.set(s.nodeModel,"validate",_)}),(U,D)=>{const L=J("AppIcon"),W=J("el-button"),H=J("ModelSelect"),B=J("el-form-item"),F=J("el-tooltip"),q=J("el-switch"),K=J("el-form"),X=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",aq,de(U.$t("views.applicationWorkflow.nodeSetting")),1),k(X,{shadow:"never",class:"card-never"},{default:P(()=>[k(K,{onSubmit:D[4]||(D[4]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(B,{label:U.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label"),prop:"stt_model_id",rules:{required:!0,message:U.$t("views.application.form.voiceInput.placeholder"),trigger:"change"}},{label:P(()=>[Y("div",lq,[Y("div",null,[Y("span",null,[et(de(U.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),D[5]||(D[5]=Y("span",{class:"color-danger"},"*",-1))])]),k(W,{type:"primary",link:"",onClick:A,disabled:!S.value.stt_model_id,class:"mr-4"},{default:P(()=>[k(L,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(H,{onWheel:b,teleported:!1,onChange:T,modelValue:S.value.stt_model_id,"onUpdate:modelValue":D[0]||(D[0]=ee=>S.value.stt_model_id=ee),placeholder:U.$t("views.application.form.voiceInput.placeholder"),options:c.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(B,{label:U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),trigger:"change",required:!0}},{label:P(()=>[Y("div",sq,[Y("div",null,[Y("span",null,[et(de(U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),D[6]||(D[6]=Y("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:g,nodeModel:e.nodeModel,class:"w-full",placeholder:U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:S.value.audio_list,"onUpdate:modelValue":D[1]||(D[1]=ee=>S.value.audio_list=ee)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(B,{label:U.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:D[3]||(D[3]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",uq,[Y("div",cq,[Y("span",null,de(U.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(F,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(U.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(L,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":D[2]||(D[2]=ee=>S.value.is_result=ee)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(GD,{ref_key:"STTModeParamSettingDialogRef",ref:v,onRefresh:E},null,512)]),_:1},8,["node-model"])}}});class fq extends ho{constructor(t){super(t,dq)}}const pq={type:"speech-to-text-node",model:vo,view:fq},GN=Object.freeze(Object.defineProperty({__proto__:null,default:pq},Symbol.toStringTag,{value:"Module"})),hq={class:"title-decoration-1 mb-8"},vq={class:"break-all"},mq={class:"title-decoration-1 mb-8"},yq={class:"break-all"},gq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Re(!1),a=[{label:yt("views.applicationWorkflow.nodes.startNode.currentTime"),value:"time"},{label:yt("views.application.form.historyRecord.label"),value:"history_context"},{label:yt("chat.chatId"),value:"chat_id"},{label:yt("chat.chatUserId"),value:"chat_user_id"},{label:yt("chat.chatUserType"),value:"chat_user_type"},{label:yt("views.chatUser.title"),value:"chat_user"}],r=()=>{const f=t.nodeModel.graphModel.nodes.filter(_=>_.id==="base-node").map(_=>ge.cloneDeep(_.properties.user_input_field_list)).reduce((_,b)=>[..._,...b],[]).map(_=>_.label&&_.label.input_type==="TooltipLabel"?{label:_.label.label,value:_.field||_.variable}:{label:_.label||_.name,value:_.field||_.variable}),g=t.nodeModel.graphModel.nodes.filter(_=>_.id==="base-node").map(_=>ge.cloneDeep(_.properties.api_input_field_list)).reduce((_,b)=>[..._,...b],[]).map(_=>({label:_.name||_.variable,value:_.variable}));return[...f,...g]},s=()=>{const f=r();ge.set(t.nodeModel.properties.config,"globalFields",[...a,...f])},c=()=>{const f=t.nodeModel.graphModel.nodes.filter(g=>g.id==="base-node").map(g=>ge.cloneDeep(g.properties.chat_input_field_list)).reduce((g,_)=>[...g,..._],[]).map(g=>({label:g.label,value:g.field}));ge.set(t.nodeModel.properties.config,"chatFields",f)};t.nodeModel.graphModel.eventCenter.on("refreshFieldList",s),t.nodeModel.graphModel.eventCenter.on("chatFieldList",c);const v=()=>{let f=ge.cloneDeep(t.nodeModel.properties.config.fields);const g=t.nodeModel.graphModel.nodes.filter(b=>b.id==="base-node").filter(b=>b.properties.node_data.file_upload_enable).map(b=>ge.cloneDeep(b.properties.node_data.file_upload_setting)).filter(b=>b);if(f=f.filter(b=>b.value!=="image"&&b.value!=="document"&&b.value!=="audio"&&b.value!=="video"&&b.value!=="other"),g.length===0){ge.set(t.nodeModel.properties.config,"fields",f);return}const _=[];g[0].document&&_.push({label:yt("common.fileUpload.document"),value:"document"}),g[0].image&&_.push({label:yt("common.fileUpload.image"),value:"image"}),g[0].audio&&_.push({label:yt("common.fileUpload.audio"),value:"audio"}),g[0].video&&_.push({label:yt("common.fileUpload.video"),value:"video"}),g[0].other&&_.push({label:yt("common.fileUpload.other"),value:"other"}),ge.set(t.nodeModel.properties.config,"fields",[...f,..._])};return t.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",v),Ir(()=>{c(),s(),v()}),(f,g)=>{const _=J("AppIcon"),b=J("el-button"),x=J("el-tooltip");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>{var S;return[Y("h5",hq,de(f.$t("views.applicationWorkflow.variable.global")),1),(be(!0),Ht(ar,null,Gr(e.nodeModel.properties.config.globalFields,(A,E)=>(be(),Ht("div",{key:E,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:g[0]||(g[0]=T=>n.value=!0),onMouseleave:g[1]||(g[1]=T=>n.value=!1)},[Y("span",vq,de(A.label)+" "+de("{"+A.value+"}"),1),n.value===!0?(be(),at(x,{key:0,effect:"dark",content:f.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(b,{link:"",onClick:T=>_n(Lm)(`{{global.${A.value}}}`),style:{padding:"0"}},{default:P(()=>[k(_,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],32))),128)),(S=e.nodeModel.properties.config.chatFields)!=null&&S.length?(be(),Ht(ar,{key:0},[Y("h5",mq,de(f.$t("views.applicationWorkflow.variable.chat")),1),(be(!0),Ht(ar,null,Gr(e.nodeModel.properties.config.chatFields||[],(A,E)=>(be(),Ht("div",{key:E,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:g[2]||(g[2]=T=>n.value=!0),onMouseleave:g[3]||(g[3]=T=>n.value=!1)},[Y("span",yq,de(A.label)+" "+de("{"+A.value+"}"),1),n.value===!0?(be(),at(x,{key:0,effect:"dark",content:f.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(b,{link:"",onClick:T=>_n(Lm)(`{{chat.${A.value}}}`),style:{padding:"0"}},{default:P(()=>[k(_,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],32))),128))],64)):pn("",!0)]}),_:1},8,["nodeModel"])}}});class _q extends ho{constructor(t){super(t,gq)}}const bq={type:"start-node",model:vo,view:_q},zN=Object.freeze(Object.defineProperty({__proto__:null,default:bq},Symbol.toStringTag,{value:"Module"})),wq={class:"title-decoration-1 mb-8"},Eq={class:"flex-between w-full"},Oq={class:"flex-between w-full"},xq={class:"flex align-center"},Sq={class:"mr-4"},Aq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(),v=Re(null),f=Re(),g=Re(),_=()=>{var R;return Promise.all([g.value?g.value.validate():Promise.resolve(""),(R=f.value)==null?void 0:R.validate()]).catch(U=>Promise.reject({node:s.nodeModel,errMessage:U}))},b=R=>R.ctrlKey===!0?(R.preventDefault(),!0):(R.stopPropagation(),!0),x={tts_model_id:"",is_result:!0,content_list:[],model_params_setting:{}},S=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:R=>{ge.set(s.nodeModel.properties,"node_data",R)}}),A=t();function E(){var U;const R=r.value==="systemManage"?{model_type:"TTS",workspace_id:(U=A.value)==null?void 0:U.workspace_id}:{model_type:"TTS"};po({type:"model",systemType:r.value}).getSelectModelList(R).then(D=>{v.value=ge.groupBy(D==null?void 0:D.data,"provider")})}const T=()=>{var U;const R=S.value.tts_model_id;if(!R){zf(yt("views.application.form.voicePlay.requiredMessage"));return}(U=c.value)==null||U.open(R,a,S.value.model_params_setting)},I=R=>{S.value.model_params_setting=R};return Ir(()=>{E(),ge.set(s.nodeModel,"validate",_)}),(R,U)=>{const D=J("AppIcon"),L=J("el-button"),W=J("ModelSelect"),H=J("el-form-item"),B=J("el-tooltip"),F=J("el-switch"),q=J("el-form"),K=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",wq,de(R.$t("views.applicationWorkflow.nodeSetting")),1),k(K,{shadow:"never",class:"card-never"},{default:P(()=>[k(q,{onSubmit:U[4]||(U[4]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(H,{label:R.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label"),prop:"tts_model_id",rules:{required:!0,message:R.$t("views.application.form.voicePlay.placeholder"),trigger:"change"}},{label:P(()=>[Y("div",Eq,[Y("div",null,[Y("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),U[5]||(U[5]=Y("span",{class:"color-danger"},"*",-1))])]),k(L,{type:"primary",link:"",onClick:T,disabled:!S.value.tts_model_id,class:"mr-4"},{default:P(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(W,{onWheel:b,teleported:!1,modelValue:S.value.tts_model_id,"onUpdate:modelValue":U[0]||(U[0]=X=>S.value.tts_model_id=X),placeholder:R.$t("views.application.form.voicePlay.placeholder"),options:v.value,showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(H,{prop:"content_list",label:R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),rules:{message:R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",Oq,[Y("div",null,[Y("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),U[6]||(U[6]=Y("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:g,nodeModel:e.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:S.value.content_list,"onUpdate:modelValue":U[1]||(U[1]=X=>S.value.content_list=X)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(H,{label:R.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:U[3]||(U[3]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",xq,[Y("div",Sq,[Y("span",null,de(R.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(B,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(R.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(F,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":U[2]||(U[2]=X=>S.value.is_result=X)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(ek,{ref_key:"TTSModeParamSettingDialogRef",ref:c,onRefresh:I},null,512)]),_:1},8,["node-model"])}}});class Mq extends ho{constructor(t){super(t,Aq)}}const kq={type:"text-to-speech-node",model:vo,view:Mq},HN=Object.freeze(Object.defineProperty({__proto__:null,default:kq},Symbol.toStringTag,{value:"Module"})),Tq={class:"title-decoration-1 mb-8"},Nq={class:"flex-between w-full"},Pq={class:"flex align-center"},Cq={class:"mr-4"},Rq={class:"flex align-center"},jq={class:"mr-4"},Dq={class:"flex align-center"},Iq={class:"mr-4"},Lq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=()=>{var L;return(L=f.value)==null?void 0:L.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},_=L=>L.ctrlKey===!0?(L.preventDefault(),!0):(L.stopPropagation(),!0),x={model_id:"",system:"",prompt:`{{${yt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null},S=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:L=>{ge.set(s.nodeModel.properties,"node_data",L)}}),A=t();function E(){var W;const L=r.value==="systemManage"?{model_type:"TTV",workspace_id:(W=A.value)==null?void 0:W.workspace_id}:{model_type:"TTV"};po({type:"model",systemType:r.value}).getSelectModelList(L).then(H=>{c.value=ge.groupBy(H==null?void 0:H.data,"provider")})}const T=()=>{Gf(()=>{var L;S.value.model_id?(L=v.value)==null||L.reset_default(S.value.model_id,a):R({})})},I=L=>{var W;L&&((W=v.value)==null||W.open(L,a,S.value.model_params_setting))};function R(L){ge.set(s.nodeModel.properties.node_data,"model_params_setting",L)}function U(L){ge.set(s.nodeModel.properties.node_data,"prompt",L)}function D(L){ge.set(s.nodeModel.properties.node_data,"negative_prompt",L)}return Ir(()=>{E(),ge.set(s.nodeModel,"validate",g)}),(L,W)=>{const H=J("AppIcon"),B=J("el-button"),F=J("ModelSelect"),q=J("el-form-item"),K=J("el-tooltip"),X=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ae=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",Tq,de(L.$t("views.applicationWorkflow.nodeSetting")),1),k(ae,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[6]||(W[6]=rn(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(q,{label:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:P(()=>[Y("div",Nq,[Y("div",null,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),W[7]||(W[7]=Y("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!S.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=we=>I(S.value.model_id)),onRefreshForm:R},{default:P(()=>[k(H,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(F,{onChange:T,onWheel:_,onFocus:E,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=we=>S.value.model_id=we),placeholder:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:c.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",Pq,[Y("div",Cq,[Y("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),W[8]||(W[8]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=we=>S.value.prompt=we),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:L.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[Y("div",Rq,[Y("div",jq,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(X,{onWheel:_,title:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:S.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=we=>S.value.negative_prompt=we),placeholder:L.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(q,{label:L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[5]||(W[5]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",Dq,[Y("div",Iq,[Y("span",null,de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(K,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(H,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":W[4]||(W[4]=we=>S.value.is_result=we)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:R},null,512)]),_:1},8,["node-model"])}}});class $q extends ho{constructor(t){super(t,Lq)}}const Fq={type:"text-to-video-node",model:vo,view:$q},XN=Object.freeze(Object.defineProperty({__proto__:null,default:Fq},Symbol.toStringTag,{value:"Module"})),Bq={class:"title-decoration-1 mb-16"},Vq={class:"lighter mb-8"},Uq={key:0},Wq={class:"flex-between"},Gq={class:"flex align-center"},zq={class:"mr-4"},Hq={key:1,class:"color-danger"},Xq={class:"flex align-center"},qq={class:"mr-4"},Yq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Li(),a=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=Re(),s={input_field_list:[],is_result:!1},c=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:_=>{ge.set(t.nodeModel.properties,"node_data",_)}}),v=Re(),f=()=>{var _;return(_=v.value)==null?void 0:_.validate().catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))},g=()=>{if(!t.nodeModel.properties.node_data.tool_lib_id){ge.set(t.nodeModel.properties,"status",500);return}po({type:"tool",systemType:a.value}).getToolById(t.nodeModel.properties.node_data.tool_lib_id).then(_=>{const b=t.nodeModel.properties.node_data.input_field_list,x=_.data.input_field_list.map(S=>{const A=b.find(E=>E.name==S.name);return A&&A.source==S.source?{...S,value:JSON.parse(JSON.stringify(A.value))}:{...S,value:S.source=="reference"?[]:""}});ge.set(t.nodeModel.properties.node_data,"input_field_list",x),ge.set(t.nodeModel.properties,"status",_.data.is_active?200:500)}).catch(()=>{ge.set(t.nodeModel.properties,"status",500)})};return Ir(()=>{var _;typeof((_=t.nodeModel.properties.node_data)==null?void 0:_.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),g(),ge.set(t.nodeModel,"validate",f)}),(_,b)=>{const x=J("auto-tooltip"),S=J("AppIcon"),A=J("el-tooltip"),E=J("el-tag"),T=J("el-input"),I=J("el-form-item"),R=J("el-text"),U=J("el-card"),D=J("el-switch"),L=J("el-form");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",Bq,de(_.$t("views.applicationWorkflow.nodeSetting")),1),Y("h5",Vq,de(_.$t("common.param.inputParam")),1),k(L,{onSubmit:b[2]||(b[2]=rn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:v,model:c.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:P(()=>[k(U,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:P(()=>{var W;return[((W=c.value.input_field_list)==null?void 0:W.length)>0?(be(),Ht("div",Uq,[(be(!0),Ht(ar,null,Gr(c.value.input_field_list,(H,B)=>(be(),at(I,{key:H.name,label:H.name,prop:"input_field_list."+B+".value",rules:{required:H.is_required,message:H.source==="reference"?_.$t("views.tool.form.param.selectPlaceholder"):_.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:P(()=>[Y("div",Wq,[Y("div",Gq,[Y("div",zq,[k(x,{content:H.name,style:{"max-width":"130px"}},{default:P(()=>[et(de(H.name),1)]),_:2},1032,["content"])]),H.desc?(be(),at(A,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(H.desc),1)]),default:P(()=>[k(S,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):pn("",!0),H.is_required?(be(),Ht("span",Hq,"*")):pn("",!0),k(E,{type:"info",class:"info-tag ml-4"},{default:P(()=>[et(de(H.type),1)]),_:2},1024)])])]),default:P(()=>[H.source==="reference"?(be(),at(oo,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.tool.form.param.selectPlaceholder"),modelValue:H.value,"onUpdate:modelValue":F=>H.value=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(be(),at(T,{key:1,modelValue:H.value,"onUpdate:modelValue":F=>H.value=F,placeholder:_.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(be(),at(R,{key:1,type:"info"},{default:P(()=>[et(de(_.$t("common.noData")),1)]),_:1}))]}),_:1}),k(I,{label:_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:b[1]||(b[1]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",Xq,[Y("div",qq,[Y("span",null,de(_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(A,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(S,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(D,{size:"small",modelValue:c.value.is_result,"onUpdate:modelValue":b[0]||(b[0]=W=>c.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Kq extends ho{constructor(t){super(t,Yq)}}const Zq={type:"tool-lib-node",model:vo,view:Kq},qN=Object.freeze(Object.defineProperty({__proto__:null,default:Zq},Symbol.toStringTag,{value:"Module"})),Jq={class:"title-decoration-1 mb-16"},Qq={class:"flex-between"},eY={class:"lighter mb-8"},tY={key:0},nY={class:"flex-between"},rY={class:"flex align-center"},oY={class:"mr-4"},iY={key:1,class:"color-danger"},aY={class:"lighter mb-8"},lY={key:0,class:"mb-8"},sY={class:"flex align-center"},uY={class:"mr-4"},cY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=E=>E.ctrlKey===!0?(E.preventDefault(),!0):(E.stopPropagation(),!0),a=Re(),r=Re(),s={code:"",input_field_list:[],is_result:!1},c=Re(null),v=Re(!1),f=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:E=>{ge.set(t.nodeModel.properties,"node_data",E)}}),g=Re(),_=()=>{var E;return(E=g.value)==null?void 0:E.validate().catch(T=>Promise.reject({node:t.nodeModel,errMessage:T}))};function b(E){ge.set(t.nodeModel.properties.node_data,"code",E)}function x(E,T){typeof T<"u"&&(c.value=T),a.value.open(E)}function S(E){const T=ge.cloneDeep(t.nodeModel.properties.node_data.input_field_list);T.splice(E,1),ge.set(t.nodeModel.properties.node_data,"input_field_list",T)}function A(E){const T=ge.cloneDeep(t.nodeModel.properties.node_data.input_field_list),I={...E,value:E.source==="reference"?[]:""};c.value!==null?T.splice(c.value,1,I):T.push(I),ge.set(t.nodeModel.properties.node_data,"input_field_list",T),c.value=null}return Ir(()=>{var E;typeof((E=t.nodeModel.properties.node_data)==null?void 0:E.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),ge.set(t.nodeModel,"validate",_),setTimeout(()=>{v.value=!0},100)}),(E,T)=>{const I=J("AppIcon"),R=J("el-button"),U=J("auto-tooltip"),D=J("el-tooltip"),L=J("el-tag"),W=J("el-input"),H=J("el-form-item"),B=J("el-text"),F=J("el-card"),q=J("CodemirrorEditor"),K=J("el-switch"),X=J("el-form");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",Jq,de(E.$t("views.applicationWorkflow.nodeSetting")),1),Y("div",Qq,[Y("h5",eY,de(E.$t("common.param.inputParam")),1),k(R,{link:"",type:"primary",onClick:T[0]||(T[0]=ee=>x())},{default:P(()=>[k(I,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(E.$t("common.add")),1)]),_:1})]),k(X,{onSubmit:T[4]||(T[4]=rn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:g,model:f.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:P(()=>[k(F,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:P(()=>{var ee;return[((ee=f.value.input_field_list)==null?void 0:ee.length)>0?(be(),Ht("div",tY,[(be(!0),Ht(ar,null,Gr(f.value.input_field_list,(ue,ae)=>(be(),at(H,{key:ae,label:ue.name,prop:"input_field_list."+ae+".value",rules:{required:ue.is_required,message:ue.source==="reference"?E.$t("views.tool.form.param.selectPlaceholder"):E.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:P(()=>[Y("div",nY,[Y("div",rY,[Y("div",oY,[k(U,{content:ue.name,style:{"max-width":"130px"}},{default:P(()=>[et(de(ue.name),1)]),_:2},1032,["content"])]),ue.desc?(be(),at(D,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(ue.desc),1)]),default:P(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):pn("",!0),ue.is_required?(be(),Ht("span",iY,"*")):pn("",!0),k(L,{type:"info",class:"info-tag ml-4"},{default:P(()=>[et(de(ue.type),1)]),_:2},1024)]),Y("div",null,[k(R,{text:"",onClick:rn(we=>x(ue,ae),["stop"])},{default:P(()=>[k(I,{iconName:"app-edit"})]),_:1},8,["onClick"]),k(R,{text:"",onClick:we=>S(ae),style:{"margin-left":"4px !important"}},{default:P(()=>[k(I,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:P(()=>[ue.source==="reference"?(be(),at(oo,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:E.$t("views.tool.form.param.selectPlaceholder"),modelValue:ue.value,"onUpdate:modelValue":we=>ue.value=we,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(be(),at(W,{key:1,modelValue:ue.value,"onUpdate:modelValue":we=>ue.value=we,placeholder:E.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(be(),at(B,{key:1,type:"info"},{default:P(()=>[et(de(E.$t("common.noData")),1)]),_:1}))]}),_:1}),Y("h5",aY,de(E.$t("views.tool.form.param.code")),1),v.value?(be(),Ht("div",lY,[k(q,{title:E.$t("views.tool.form.param.code"),modelValue:f.value.code,"onUpdate:modelValue":T[1]||(T[1]=ee=>f.value.code=ee),onWheel:n,style:{height:"130px !important"},onSubmitDialog:b},null,8,["title","modelValue"])])):pn("",!0),k(H,{label:E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:T[3]||(T[3]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",sY,[Y("div",uY,[Y("span",null,de(E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(D,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(K,{size:"small",modelValue:f.value.is_result,"onUpdate:modelValue":T[2]||(T[2]=ee=>f.value.is_result=ee)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"]),k(PI,{ref_key:"FieldFormDialogRef",ref:a,onRefresh:A},null,512)]),_:1},8,["nodeModel"])}}});class dY extends ho{constructor(t){super(t,cY)}}const fY={type:"tool-node",model:vo,view:dY},YN=Object.freeze(Object.defineProperty({__proto__:null,default:fY},Symbol.toStringTag,{value:"Module"})),pY={class:"dialog-footer"},hY=Vn({__name:"GroupFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re(null),f=Re({field:"",label:""}),g=Zf({label:[{required:!0,message:yt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:yt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),_=Re(!1),b=(A,E)=>{A&&(f.value=ge.cloneDeep(A),c.value=!0,v.value=E),_.value=!0},x=()=>{_.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},S=async A=>{A&&await A.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(A,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),D=J("el-dialog");return be(),at(D,{title:c.value?A.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):A.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:_.value,"onUpdate:modelValue":E[3]||(E[3]=L=>_.value=L),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[Y("span",pY,[k(U,{onClick:rn(x,["prevent"])},{default:P(()=>[et(de(A.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=L=>S(r.value)),loading:s.value},{default:P(()=>[et(de(c.value?A.$t("common.save"):A.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(R,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:g,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:A.$t("common.variable"),prop:"field"},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=L=>f.value.field=L),maxlength:64,placeholder:A.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(I,{label:A.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=L=>f.value.label=L),maxlength:64,"show-word-limit":"",placeholder:A.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),vY={class:"title-decoration-1 mb-8"},mY={class:"flex-between"},yY={class:"flex-between mb-12"},gY=["title"],_Y={class:"flex align-center",style:{"margin-right":"-3px"}},bY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re(),s={strategy:"first_non_null",group_list:[{id:is(),label:"Group1",field:"Group1",variable_list:[{v_id:is(),variable:[]}]}]},c=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:I=>{ge.set(t.nodeModel.properties,"node_data",I)}}),v=Re([]);function f(I,R){let U=null;I&&R!==void 0&&(U={field:I.field,label:I.label}),r.value.open(U,R)}function g(I,R){for(let D=0;D<v.value.length;D++)if(v.value[D].field===I.field&&R!==D){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+I.field);return}[void 0,null].includes(R)?(v.value.push(I),A(I)):(v.value.splice(R,1,I),_(I,R)),r.value.close();const U=[...v.value.map(D=>({label:D.label,value:D.field}))];ge.set(t.nodeModel.properties.config,"fields",U)}const _=(I,R)=>{const U=ge.cloneDeep(c.value.group_list);U[R].field=I.field,U[R].label=I.label,c.value.group_list=U},b=I=>{const R=ge.cloneDeep(c.value.group_list);R.splice(I,1),c.value.group_list=R,v.value.splice(I,1);const U=R.map(D=>({label:D.label,value:D.field}));ge.set(t.nodeModel.properties.config,"fields",U)},x=I=>{const R=ge.cloneDeep(c.value.group_list);R[I].variable_list.push({v_id:is(),variable:[]}),c.value.group_list=R},S=(I,R)=>{const U=ge.cloneDeep(c.value.group_list);U[I].variable_list.splice(R,1),c.value.group_list=U},A=I=>{const R=ge.cloneDeep(c.value.group_list);R.push({id:is(),field:I.field,label:I.label,variable_list:[{v_id:is(),variable:[]}]}),c.value.group_list=R},E=async()=>{var R;const I=[...a.value.map(U=>U.validate()),(R=n.value)==null?void 0:R.validate()];return Promise.all(I).catch(U=>Promise.reject({node:t.nodeModel,errMessage:U}))};function T(I,R){const{oldIndex:U,newIndex:D}=I;if(U===void 0||D===void 0)return;const L=ge.cloneDeep(t.nodeModel.properties.node_data.group_list[R].variable_list),W={...L[U]},H={...L[D]};L[D]=W,L[U]=H,ge.set(t.nodeModel.properties.node_data.group_list[R],"variable_list",L)}return Ir(()=>{var R;typeof((R=t.nodeModel.properties.node_data)==null?void 0:R.is_result)>"u"&&vc(t.nodeModel)&&ge.set(t.nodeModel.properties.node_data,"is_result",!0),ge.set(t.nodeModel,"validate",E),t.nodeModel.properties.node_data.group_list&&(v.value=c.value.group_list.map(U=>({label:U.label,field:U.field})));const I=c.value.group_list.map(U=>({label:U.label,value:U.field}));ge.set(t.nodeModel.properties.config,"fields",I)}),(I,R)=>{const U=J("el-option"),D=J("el-select"),L=J("el-form-item"),W=J("EditPen"),H=J("el-icon"),B=J("el-button"),F=J("AppIcon"),q=J("el-col"),K=J("el-row"),X=J("el-card"),ee=J("el-form");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",vY,de(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ee,{onSubmit:R[2]||(R[2]=rn(()=>{},["prevent"])),model:c.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableAggregationRef",ref:n,"hide-required-asterisk":""},{default:P(()=>[k(L,{label:I.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"),rules:{required:!0,trigger:"change"}},{label:P(()=>[Y("div",mY,[Y("div",null,[Y("span",null,[et(de(I.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"))+" ",1),R[3]||(R[3]=Y("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(D,{modelValue:c.value.strategy,"onUpdate:modelValue":R[0]||(R[0]=ue=>c.value.strategy=ue)},{default:P(()=>[k(U,{label:_n(yt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder"),value:"first_non_null"},null,8,["label"]),k(U,{label:_n(yt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder1"),value:"variable_to_json"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),(be(!0),Ht(ar,null,Gr(c.value.group_list,(ue,ae)=>(be(),Ht("div",{key:ue.id,class:"mb-8"},[k(X,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[Y("div",yY,[Y("span",{class:"ellipsis",title:ue.label},de(ue.label),9,gY),Y("div",_Y,[k(B,{onClick:we=>f(ue,ae),link:""},{default:P(()=>[k(H,null,{default:P(()=>[k(W)]),_:1})]),_:1},8,["onClick"]),k(B,{onClick:we=>b(ae),link:"",disabled:c.value.group_list.length<=1},{default:P(()=>[k(F,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),k(_n(ak),{ref_for:!0,ref:"el",modelValue:ue.variable_list,disabled:ue.variable_list.length===1,handle:".handle",animation:150,ghostClass:"ghost",onEnd:we=>T(we,ae)},{default:P(()=>[(be(!0),Ht(ar,null,Gr(ue.variable_list,(we,je)=>(be(),Ht("div",{key:we.v_id,class:"drag-card"},[k(K,{class:"handle"},{default:P(()=>[k(q,{span:22,class:"flex"},{default:P(()=>[R[4]||(R[4]=Y("img",{src:lk,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),k(L,{prop:`group_list.${ae}.variable_list.${je}.variable`,rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:a,nodeModel:e.nodeModel,style:{width:"200px"},placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:we.variable,"onUpdate:modelValue":Te=>we.variable=Te},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(q,{span:2},{default:P(()=>[k(B,{link:"",class:"mt-4 ml-4",disabled:ue.variable_list.length<=1,onClick:Te=>S(ae,je)},{default:P(()=>[k(F,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),k(B,{onClick:we=>x(ae),type:"primary",size:"large",link:""},{default:P(()=>[k(F,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(I.$t("common.add")),1)]),_:1},8,["onClick"])]),_:2},1024)]))),128)),k(B,{onClick:R[1]||(R[1]=ue=>f()),type:"primary",size:"large",link:""},{default:P(()=>[k(F,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(I.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),k(hY,{ref_key:"GroupFieldDialogRef",ref:r,onRefresh:g},null,512)]),_:1},8,["nodeModel"])}}});class wY extends ho{constructor(t){super(t,bY)}getConfig(t){return t.model.properties.config}}const EY={type:"variable-aggregation-node",model:vo,view:wY},KN=Object.freeze(Object.defineProperty({__proto__:null,default:EY},Symbol.toStringTag,{value:"Module"})),OY={class:"flex-between"},xY={class:"flex-between mb-8"},SY={class:"lighter"},AY={key:0,class:"flex w-full"},MY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("workflowMode"),n=e,a=["string","num","json","bool"],r=A=>A.ctrlKey===!0?(A.preventDefault(),!0):(A.stopPropagation(),!0),s={variable_list:[{id:is(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""}]};Re(1);const c=$n({get:()=>(n.nodeModel.properties.node_data||ge.set(n.nodeModel.properties,"node_data",s),n.nodeModel.properties.node_data),set:A=>{ge.set(n.nodeModel.properties,"node_data",A)}}),v=Re(),f=Re(),g=Re(),_=async()=>{var E;let A=[(E=v.value)==null?void 0:E.validate(),...f.value.map(T=>T.validate())];return g.value&&(A=[...A,...f.value.map(T=>T.validate())]),Promise.all(A).catch(T=>Promise.reject({node:n.nodeModel,errMessage:T}))};function b(){const A=ge.cloneDeep(n.nodeModel.properties.node_data.variable_list),E={id:is(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};A.push(E),ge.set(n.nodeModel.properties.node_data,"variable_list",A)}function x(A){const E=ge.cloneDeep(n.nodeModel.properties.node_data.variable_list);E.splice(A,1),ge.set(n.nodeModel.properties.node_data,"variable_list",E)}function S(A){(t==Is.ApplicationLoop?[...n.nodeModel.graphModel.nodes,...n.nodeModel.graphModel.get_parent_nodes()]:n.nodeModel.graphModel.nodes).map(E=>{E.id==="start-node"&&(E.properties.config.globalFields.forEach(T=>{T.value===A.fields[1]&&(A.name=T.label)}),E.properties.config.chatFields.forEach(T=>{T.value===A.fields[1]&&(A.name=T.label)})),E.id==="loop-start-node"&&E.properties.loop_input_field_list.forEach(T=>{T.field===A.fields[1]&&(A.name=T.label)})})}return Ir(()=>{var A;typeof((A=n.nodeModel.properties.node_data)==null?void 0:A.is_result)>"u"&&vc(n.nodeModel)&&ge.set(n.nodeModel.properties.node_data,"is_result",!0),ge.set(n.nodeModel,"validate",_)}),(A,E)=>{const T=J("AppIcon"),I=J("el-button"),R=J("el-form-item"),U=J("el-option"),D=J("el-select"),L=J("el-input"),W=J("el-input-number"),H=J("CodemirrorEditor"),B=J("el-card"),F=J("el-form");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(F,{onSubmit:E[0]||(E[0]=rn(()=>{},["prevent"])),model:c.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:v,"hide-required-asterisk":""},{default:P(()=>[(be(!0),Ht(ar,null,Gr(c.value.variable_list,(q,K)=>(be(),at(B,{key:q.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(R,null,{label:P(()=>[Y("div",OY,[Y("div",null,[et(de(A.$t("common.variable"))+" ",1),E[1]||(E[1]=Y("span",{class:"color-danger"},"*",-1))]),c.value.variable_list.length>1?(be(),at(I,{key:0,text:"",onClick:X=>x(K)},{default:P(()=>[k(T,{iconName:"app-delete"})]),_:1},8,["onClick"])):pn("",!0)])]),default:P(()=>[k(oo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:A.$t("views.applicationWorkflow.variable.placeholder"),modelValue:q.fields,"onUpdate:modelValue":X=>q.fields=X,global:!0,onChange:X=>S(q)},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),Y("div",xY,[Y("span",SY,[et(de(A.$t("views.applicationWorkflow.nodes.variableAssignNode.assign")),1),E[2]||(E[2]=Y("span",{class:"color-danger"},"*",-1))]),k(D,{teleported:!1,modelValue:q.source,"onUpdate:modelValue":X=>q.source=X,size:"small",style:{width:"85px"}},{default:P(()=>[k(U,{label:A.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(U,{label:A.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),q.source==="custom"?(be(),Ht("div",AY,[k(D,{modelValue:q.type,"onUpdate:modelValue":X=>q.type=X,style:{"max-width":"85px"},class:"mr-8",onChange:X=>{X==="bool"?c.value.variable_list[K].value=!0:c.value.variable_list[K].value=null}},{default:P(()=>[(be(),Ht(ar,null,Gr(a,X=>k(U,{key:X,label:X,value:X},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),q.type==="string"?(be(),at(R,{key:0,prop:"variable_list."+K+".value",rules:{message:_n(yt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(L,{modelValue:q.value,"onUpdate:modelValue":X=>q.value=X,placeholder:A.$t("common.inputPlaceholder"),"show-word-limit":"",clearable:"",onWheel:r},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])):q.type==="num"?(be(),at(R,{key:1,prop:"variable_list."+K+".value",rules:{message:A.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(W,{modelValue:q.value,"onUpdate:modelValue":X=>q.value=X},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):q.type==="json"?(be(),at(R,{key:2,class:"w-full",prop:"variable_list."+K+".value",rules:[{message:A.$t("common.inputPlaceholder"),trigger:"blur",required:!0},{validator:(X,ee,ue)=>{try{JSON.parse(ee),ue()}catch{ue(new Error("Invalid JSON format"))}},trigger:"blur"}]},{default:P(()=>[k(H,{title:"JSON",modelValue:q.value,"onUpdate:modelValue":X=>q.value=X,style:{height:"100px",width:"155px"},onSubmitDialog:X=>c.value.variable_list[K].value=X},null,8,["modelValue","onUpdate:modelValue","onSubmitDialog"])]),_:2},1032,["prop","rules"])):q.type==="bool"?(be(),at(R,{key:3,prop:"variable_list."+K+".value",rules:{message:A.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(D,{modelValue:q.value,"onUpdate:modelValue":X=>q.value=X,style:{width:"155px"}},{default:P(()=>[k(U,{label:"true",value:!0}),k(U,{label:"false",value:!1})]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):pn("",!0)])):(be(),at(R,{key:1},{default:P(()=>[k(oo,{ref_for:!0,ref_key:"nodeCascaderRef2",ref:g,nodeModel:e.nodeModel,class:"w-full",placeholder:A.$t("views.applicationWorkflow.variable.placeholder"),modelValue:q.reference,"onUpdate:modelValue":X=>q.reference=X},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1024))]),_:2},1024))),128)),k(I,{link:"",type:"primary",onClick:b},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(A.$t("common.add")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class kY extends ho{constructor(t){super(t,MY)}}const TY={type:"variable-assign-node",model:vo,view:kY},ZN=Object.freeze(Object.defineProperty({__proto__:null,default:TY},Symbol.toStringTag,{value:"Module"})),NY={class:"flex align-center"},PY={class:"mr-4"},CY={class:"flex align-center"},RY={class:"mr-4"},jY={class:"flex align-center"},DY={class:"mr-4"},IY={class:"dialog-footer"},LY=Vn({__name:"VariableFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=Re(),s=Re(!1),c=Re(!1),v=Re(null),f=Re({field:"",label:"",expression:""}),g=Zf({label:[{required:!0,message:yt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:yt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:yt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}],expression:[{required:!0,message:yt("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder"),trigger:"blur"}]}),_=Re(!1),b=(A,E)=>{A&&(f.value=ge.cloneDeep(A),c.value=!0,v.value=E),_.value=!0},x=()=>{_.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},S=async A=>{A&&await A.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(A,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("AppIcon"),U=J("el-tooltip"),D=J("el-form"),L=J("el-button"),W=J("el-dialog");return be(),at(W,{title:c.value?A.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):A.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:_.value,"onUpdate:modelValue":E[4]||(E[4]=H=>_.value=H),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[Y("span",IY,[k(L,{onClick:rn(x,["prevent"])},{default:P(()=>[et(de(A.$t("common.cancel")),1)]),_:1}),k(L,{type:"primary",onClick:E[3]||(E[3]=H=>S(r.value)),loading:s.value},{default:P(()=>[et(de(A.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(D,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:g,model:f.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:P(()=>[k(I,{prop:"field"},{label:P(()=>[Y("div",NY,[Y("span",PY,de(A.$t("common.variable")),1),E[5]||(E[5]=Y("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=H=>f.value.field=H),maxlength:64,placeholder:A.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),k(I,{prop:"label"},{label:P(()=>[Y("div",CY,[Y("span",RY,de(A.$t("dynamicsForm.paramForm.name.label")),1),E[6]||(E[6]=Y("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=H=>f.value.label=H),maxlength:64,"show-word-limit":"",placeholder:A.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),k(I,{prop:"expression"},{label:P(()=>[Y("div",jY,[Y("span",DY,[et(de(A.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),E[7]||(E[7]=Y("span",{class:"color-danger"},"*",-1))]),k(U,{effect:"dark",content:A.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.tooltip"),placement:"right"},{default:P(()=>[k(R,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:P(()=>[k(T,{modelValue:f.value.expression,"onUpdate:modelValue":E[2]||(E[2]=H=>f.value.expression=H),maxlength:64,"show-word-limit":"",placeholder:A.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),$Y={class:"flex-between w-full"},FY={class:"break-all lighter"},BY={class:"ml-4",style:{"margin-top":"-4px"}},VY=["title"],UY=["title"],WY={class:"mr-4"},GY=Vn({__name:"VariableFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=Re(),a=Re(),r=Re([]);function s(f,g){a.value.open(f,g)}function c(f){r.value.splice(f,1);const g=[{label:yt("common.result"),value:"result"},...r.value.map(_=>({label:_.label,value:_.field}))];ge.set(t.nodeModel.properties.config,"fields",g),t.nodeModel.clear_next_node_field(!1)}function v(f,g){for(let b=0;b<r.value.length;b++)if(r.value[b].field===f.field&&g!==b){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(g)?r.value.push(f):r.value.splice(g,1,f),a.value.close();const _=[{label:yt("common.result"),value:"result"},...r.value.map(b=>({label:b.label,value:b.field}))];ge.set(t.nodeModel.properties.config,"fields",_),t.nodeModel.clear_next_node_field(!1)}return Ir(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=ge.cloneDeep(t.nodeModel.properties.node_data.variable_list)),ge.set(t.nodeModel.properties.node_data,"variable_list",r);const f=[{label:yt("common.result"),value:"result"},...r.value.map(g=>({label:g.label,value:g.field}))];ge.set(t.nodeModel.properties.config,"fields",f)}),(f,g)=>{var E;const _=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),S=J("el-tooltip"),A=J("el-table");return be(),Ht(ar,null,[Y("div",$Y,[Y("h5",FY,[et(de(f.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),g[1]||(g[1]=Y("span",{class:"color-danger"},"*",-1))]),Y("span",BY,[k(b,{link:"",type:"primary",onClick:g[0]||(g[0]=T=>s())},{default:P(()=>[k(_,{iconName:"app-add-outlined"})]),_:1})])]),((E=t.nodeModel.properties.node_data.variable_list)==null?void 0:E.length)>0?(be(),at(A,{key:0,data:t.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:P(()=>[k(x,{prop:"field",label:f.$t("common.variable"),width:"95"},{default:P(({row:T})=>[Y("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,VY)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[Y("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,UY)]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[Y("span",WY,[k(S,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:rn(R=>s(T,I),["stop"])},{default:P(()=>[k(_,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:f.$t("common.delete"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:R=>c(I)},{default:P(()=>[k(_,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(LY,{ref_key:"VariableFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),zY={class:"title-decoration-1 mb-8"},HY={class:"flex-between"},XY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={input_variable:[],variable_list:[]},a=$n({get:()=>(t.nodeModel.properties.node_data||ge.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:c=>{ge.set(t.nodeModel.properties,"node_data",c)}}),r=Re(),s=async()=>r.value.validate().catch(c=>Promise.reject({node:t.nodeModel,errMessage:c}));return Ir(()=>{ge.set(t.nodeModel,"validate",s)}),(c,v)=>{const f=J("el-form-item"),g=J("el-form"),_=J("el-card");return be(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[Y("h5",zY,de(c.$t("views.applicationWorkflow.nodeSetting")),1),k(_,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(g,{onSubmit:v[1]||(v[1]=rn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:r,"hide-required-asterisk":""},{default:P(()=>[k(f,{prop:"input_variable",rules:{message:c.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[Y("div",HY,[Y("div",null,[et(de(c.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),v[2]||(v[2]=Y("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:c.$t("views.applicationWorkflow.variable.placeholder"),modelValue:a.value.input_variable,"onUpdate:modelValue":v[0]||(v[0]=b=>a.value.input_variable=b)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(f,{prop:"variable_list",rules:{message:c.$t("views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(GY,{ref:"VariableFieldTableRef","node-model":e.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class qY extends ho{constructor(t){super(t,XY)}getConfig(t){return t.model.properties.config}}const YY={type:"variable-splitting-node",model:vo,view:qY},JN=Object.freeze(Object.defineProperty({__proto__:null,default:YY},Symbol.toStringTag,{value:"Module"})),KY={class:"title-decoration-1 mb-8"},ZY={class:"flex-between w-full"},JY={class:"flex-between"},QY={class:"flex align-center"},eK={class:"flex align-center"},tK={class:"mr-4"},nK={class:"flex-between"},rK={class:"flex align-center"},oK={class:"mr-4"},iK=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=ha("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=Re(null),v=Re(),f=Re(),g=Re(),_=()=>{var B;return Promise.all([g.value?g.value.validate():Promise.resolve(""),(B=f.value)==null?void 0:B.validate()]).catch(F=>Promise.reject({node:s.nodeModel,errMessage:F}))},b=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),S={model_id:"",system:"",prompt:`{{${yt("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"]},A=$n({get:()=>(s.nodeModel.properties.node_data||ge.set(s.nodeModel.properties,"node_data",S),s.nodeModel.properties.node_data),set:B=>{ge.set(s.nodeModel.properties,"node_data",B)}}),E=t();function T(){var F;const B=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(F=E.value)==null?void 0:F.workspace_id}:{model_type:"IMAGE"};po({type:"model",systemType:r.value}).getSelectModelList(B).then(q=>{c.value=ge.groupBy(q==null?void 0:q.data,"provider")})}function I(B){ge.set(s.nodeModel.properties.node_data,"system",B)}function R(B){ge.set(s.nodeModel.properties.node_data,"prompt",B)}const U=B=>{var F;B&&((F=v.value)==null||F.open(B,a,A.value.model_params_setting))},D=Re(),L=B=>{var F;B&&((F=D.value)==null||F.open(B,a))},W=B=>{ge.set(s.nodeModel.properties.node_data,"system",B)};function H(B){ge.set(s.nodeModel.properties.node_data,"model_params_setting",B)}return Ir(()=>{T(),ge.set(s.nodeModel,"validate",_)}),(B,F)=>{const q=J("AppIcon"),K=J("el-button"),X=J("ModelSelect"),ee=J("el-form-item"),ue=J("el-tooltip"),ae=J("MdEditorMagnify"),we=J("el-option"),je=J("el-select"),Te=J("el-input-number"),Me=J("el-switch"),Ne=J("el-form"),rt=J("el-card");return be(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[Y("h5",KY,de(B.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Ne,{onSubmit:F[10]||(F[10]=rn(()=>{},["prevent"])),model:A.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:f,"hide-required-asterisk":""},{default:P(()=>[k(ee,{label:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:P(()=>[Y("div",ZY,[Y("div",null,[Y("span",null,[et(de(_n(yt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),F[11]||(F[11]=Y("span",{class:"color-danger"},"*",-1))])]),k(K,{disabled:!A.value.model_id,type:"primary",link:"",onClick:F[0]||(F[0]=tt=>U(A.value.model_id)),onRefreshForm:H},{default:P(()=>[k(q,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(X,{onWheel:b,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":F[1]||(F[1]=tt=>A.value.model_id=tt),placeholder:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),options:c.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(ee,null,{label:P(()=>[Y("div",JY,[Y("div",QY,[Y("span",null,de(B.$t("views.application.form.roleSettings.label")),1),k(ue,{effect:"dark",content:B.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(K,{type:"primary",link:"",onClick:F[2]||(F[2]=tt=>L(A.value.model_id)),disabled:!A.value.model_id},{default:P(()=>[k(q,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:P(()=>[k(ae,{title:B.$t("views.application.form.roleSettings.label"),modelValue:A.value.system,"onUpdate:modelValue":F[3]||(F[3]=tt=>A.value.system=tt),style:{height:"100px"},onSubmitDialog:I,placeholder:`${_n(yt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(ee,{label:B.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:B.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:P(()=>[Y("div",eK,[Y("div",tK,[Y("span",null,[et(de(B.$t("views.application.form.prompt.label")),1),F[12]||(F[12]=Y("span",{class:"color-danger"},"*",-1))])]),k(ue,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(B.$t("views.application.form.prompt.tooltip")),1)]),default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ae,{onWheel:b,title:B.$t("views.application.form.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":F[4]||(F[4]=tt=>A.value.prompt=tt),style:{height:"150px"},onSubmitDialog:R,placeholder:`${_n(yt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(ee,null,{label:P(()=>[Y("div",nK,[Y("div",null,de(B.$t("views.application.form.historyRecord.label")),1),k(je,{modelValue:A.value.dialogue_type,"onUpdate:modelValue":F[5]||(F[5]=tt=>A.value.dialogue_type=tt),type:"small",style:{width:"100px"}},{default:P(()=>[k(we,{label:B.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(we,{label:B.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[k(Te,{modelValue:A.value.dialogue_number,"onUpdate:modelValue":F[6]||(F[6]=tt=>A.value.dialogue_number=tt),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(ee,{label:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label"),rules:{type:"array",required:!0,message:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label")),1),F[13]||(F[13]=Y("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:g,nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:A.value.video_list,"onUpdate:modelValue":F[7]||(F[7]=tt=>A.value.video_list=tt)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(ee,{label:B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:F[9]||(F[9]=rn(()=>{},["prevent"]))},{label:P(()=>[Y("div",rK,[Y("div",oK,[Y("span",null,de(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(ue,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(q,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Me,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":F[8]||(F[8]=tt=>A.value.is_result=tt)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:H},null,512),k(Jw,{onReplace:W,ref_key:"GeneratePromptDialogRef",ref:D},null,512)]),_:1},8,["node-model"])}}});class aK extends ho{constructor(t){super(t,iK)}}const lK={type:"video-understand-node",model:vo,view:aK},QN=Object.freeze(Object.defineProperty({__proto__:null,default:lK},Symbol.toStringTag,{value:"Module"})),tA=Vn({__name:"CustomLine",props:{model:{}},setup(e){const t=e,n=()=>{t.model.graphModel.deleteEdgeById(t.model.id)};return(a,r)=>Ga((be(),Ht("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=rn(()=>{},["stop"])),onClick:r[1]||(r[1]=rn(()=>{},["stop"]))},[(be(),Ht("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]=[Y("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),Y("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)),[[Wf,t.model.isHovered]])}});function sK(e,t){const n=e.getBoundingClientRect();return t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom}const uK=32,cK=32;class dK extends hn.BezierEdge{constructor(){super();fa(this,"isMounted");fa(this,"customLineApp");fa(this,"root");this.isMounted=!1,this.handleMouseUp=n=>{this.props.graphModel.clearSelectElements(),this.props.model.isSelected=!0;const a=n.target.parentNode.parentNode.querySelector(".lf-custom-edge-wrapper");sK(a,n)&&this.props.model.graphModel.deleteEdgeById(this.props.model.id)}}renderVueComponent(n){var r;this.unmountVueComponent(),this.root=n;const{graphModel:a}=this.props;n&&(Gg()?lN(this.targetId(),tA,n,this.props.model,a,(s,c)=>({model:s,graph:c})):(this.customLineApp=JM({render:()=>kv(tA,{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(),Gg()&&sN(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,a=n.id,{customWidth:r=uK,customHeight:s=cK}=n.getProperties(),{startPoint:c,endPoint:v,path:f,isAnimation:g,arrowConfig:_}=n,b=n.getEdgeAnimationStyle(),{strokeDasharray:x,stroke:S,strokeDashoffset:A,animationName:E,animationDuration:T,animationIterationCount:I,animationTimingFunction:R,animationDirection:U}=b,D={x:(c.x+v.x-r)/2,y:(c.y+v.y-s)/2,width:r,height:s},L=n.getEdgeStyle(),W={width:r,height:s};return setTimeout(()=>{const H=document.getElementById(a);H&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(H))},0),delete L.stroke,hn.h("g",{},[hn.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),hn.h("path",{d:f,...L,..._,...g?{strokeDasharray:x,stroke:S,style:{strokeDashoffset:A,animationName:E,animationDuration:T,animationIterationCount:I,animationTimingFunction:R,animationDirection:U}}:{}}),hn.h("foreignObject",{...D,y:D.y+5,x:D.x+5,style:{}},[hn.h("div",{id:a,style:{...W},className:"lf-custom-edge-wrapper"})])])}}let fK=class extends hn.BezierEdgeModel{getArrowStyle(){const t=super.getArrowStyle();return t.offset=1,t.verticalLength=0,t}getEdgeStyle(){const t=super.getEdgeStyle();return t.strokeWidth=2,t.stroke="#BBBFC4",t.offset=0,t}getData(){const t=super.getData();return t&&(t.sourceAnchorId=this.sourceAnchorId,t.targetAnchorId=this.targetAnchorId),t}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(s=>s.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(s=>s.id===this.targetAnchorId);if(n&&r){const s={x:n.x,y:n.y};this.updateStartPoint(s);const c={x:r.x,y:r.y};this.updateEndPoint(c)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}};const eP={type:"app-edge",view:dK,model:fK};class pK{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(t){return this.init(t),this.execute(!0)}init(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]}execute(t){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(t){t&&Object.assign(this,t)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}}const hK=e=>typeof e=="string",nA=Array.isArray,Kg=e=>typeof e=="number",tP=e=>e!==null&&typeof e=="object",Zg=e=>{if(e===null)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){const t=[];return e.forEach(n=>{t.push(n)}),t.map(n=>Zg(n))}if(typeof e=="object"&&Object.keys(e).length){const t=Object.assign({},e);return Object.keys(t).forEach(n=>{t[n]=Zg(t[n])}),t}return e},av=(e,t)=>{const n=e[t];return tP(n)?n.cell:n},rA=(e,t,n)=>{let a;return n?a=n:Kg(e)?a=()=>e:a=()=>t,a},vK=(e,t)=>{if(e!=="next"&&e!=="prev")return t},oA=e=>{e.prev.next=e.next,e.next.prev=e.prev,delete e.next,delete e.prev};let mK=class{constructor(){const t={};t.prev=t,t.next=t.prev,this.shortcut=t}dequeue(){const t=this.shortcut,n=t.prev;if(n&&n!==t)return oA(n),n}enqueue(t){const n=this.shortcut;t.prev&&t.next&&oA(t),t.next=n.next,n.next.prev=t,n.next=t,t.prev=n}toString(){const t=[],n=this.shortcut;let a=n.prev;for(;a!==n;)t.push(JSON.stringify(a,vK)),a=a==null?void 0:a.prev;return`[${t.join(", ")}]`}};var wv;(function(e){e.DEFAULT_EDGE_NAME="\0",e.GRAPH_NODE="\0",e.EDGE_KEY_DELIM=""})(wv||(wv={}));function iA(e,t){var n=e.get(t)||0;e.set(t,n+1)}function aA(e,t){var n=e.get(t);n!==void 0&&(n=n-1,n>0?e.set(t,n):e.delete(t))}function nP(e,t,n,a){var r=String(t),s=String(n);if(!e&&r>s){var c=r;r=s,s=c}return r+wv.EDGE_KEY_DELIM+s+wv.EDGE_KEY_DELIM+(a===void 0?wv.DEFAULT_EDGE_NAME:a)}function lA(e,t,n,a){var r=String(t),s=String(n),c={v:t,w:n};if(!e&&r>s){var v=c.v;c.v=c.w,c.w=v}return a!==void 0&&(c.name=a),c}function N1(e,t){return nP(e,t.v,t.w,t.name)}function sA(e){return typeof e=="function"}var yK=function(t){return t.nodes().map(function(n){var a=t.node(n),r=t.parent(n),s={id:n,value:a,parent:r};return s.value===void 0&&delete s.value,s.parent===void 0&&delete s.parent,s})},gK=function(t){return t.edges().map(function(n){var a=t.edge(n),r={v:n.v,w:n.w,value:a,name:n.name};return r.name===void 0&&delete r.name,r.value===void 0&&delete r.value,r})},_K=function(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yK(t),edges:gK(t),value:t.graph()};return n.value===void 0&&delete n.value,n},bK=function(t){var n=new ey(t.options);return t.value!==void 0&&n.setGraph(t.value),t.nodes.forEach(function(a){n.setNode(a.id,a.value),a.parent&&n.setParent(a.id,a.parent)}),t.edges.forEach(function(a){n.setEdge(a.v,a.w,a.value,a.name)}),n};function uA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uA(Object(n),!0).forEach(function(a){wK(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uA(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function wK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OK(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function xK(e,t,n){return t&&OK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var SK={compound:!1,multigraph:!1,directed:!0},ey=(function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};EK(this,e),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=wv.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 t.directed},this.isMultigraph=function(){return t.multigraph},this.isCompound=function(){return t.compound},this.setGraph=function(r){return t.label=r,t},this.graph=function(){return t.label},this.setDefaultNodeLabel=function(r){return sA(r)?t.defaultNodeLabelFn=r:t.defaultNodeLabelFn=function(){return r},t},this.nodeCount=function(){return t.nodeCountNum},this.node=function(r){return t.nodesLabelMap.get(r)},this.nodes=function(){return Array.from(t.nodesLabelMap.keys())},this.sources=function(){return t.nodes().filter(function(r){var s;return!(!((s=t.inEdgesMap.get(r))===null||s===void 0)&&s.size)})},this.sinks=function(){return t.nodes().filter(function(r){var s;return!(!((s=t.outEdgesMap.get(r))===null||s===void 0)&&s.size)})},this.setNodes=function(r,s){return r.map(function(c){return t.setNode(c,s)}),t},this.hasNode=function(r){return t.nodesLabelMap.has(r)},this.checkCompound=function(){if(!t.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(r){if(t.isCompound()){var s,c=(s=t.parentMap)===null||s===void 0?void 0:s.get(r);if(c!==t.GRAPH_NODE)return c}},this.removeFromParentsChildList=function(r){var s=t.parentMap.get(r);t.childrenMap.get(s).delete(r)},this.setParent=function(r,s){var c,v;t.checkCompound();for(var f=s===void 0?t.GRAPH_NODE:s,g=t.parent(f);g;){if(r===g)throw new Error("Setting "+s+" as parent of "+r+" would create a cycle");g=t.parent(g)}s&&t.setNode(s),t.setNode(r),t.removeFromParentsChildList(r),(c=t.parentMap)===null||c===void 0||c.set(r,f);var _=t.childrenMap.get(f);return _.set(r,!0),(v=t.childrenMap)===null||v===void 0||v.set(f,_),t},this.children=function(r){var s=r===void 0?t.GRAPH_NODE:r;if(t.isCompound()){var c,v=(c=t.childrenMap)===null||c===void 0?void 0:c.get(s);return v?Array.from(v.keys()):void 0}if(s===t.GRAPH_NODE)return t.nodes();if(r&&t.hasNode(r))return[]},this.predecessors=function(r){var s=t.predecessorsMap.get(r);return s?Array.from(s.keys()):void 0},this.successors=function(r){var s=t.successorsMap.get(r);return s?Array.from(s.keys()):void 0},this.neighbors=function(r){var s;if(t.hasNode(r))return Array.from(new Set((s=t.predecessors(r))===null||s===void 0?void 0:s.concat(t.successors(r))))},this.isLeaf=function(r){var s;if(t.isDirected()){var c;return!(!((c=t.successors(r))===null||c===void 0)&&c.length)}return!(!((s=t.neighbors(r))===null||s===void 0)&&s.length)},this.filterNodes=function(r){var s=t.directed,c=t.multigraph,v=t.compound,f=new e({directed:s,multigraph:c,compound:v});if(f.setGraph(t.graph()),t.nodes().forEach(function(_){r(_)&&f.setNode(_,t.node(_))}),t.edges().forEach(function(_){f.hasNode(_.v)&&f.hasNode(_.w)&&f.setEdgeObj(_,t.edge(_))}),v){var g=function(b){for(var x=t.parent(b);x!==void 0&&!f.hasNode(x);)x=t.parent(x);return x};f.nodes().forEach(function(_){f.setParent(_,g(_))})}return f},this.setDefaultEdgeLabel=function(r){return sA(r)?t.defaultEdgeLabelFn=r:t.defaultEdgeLabelFn=function(){return r},t},this.edgeCount=function(){return t.edgeCountNum},this.setEdgeObj=function(r,s){return t.setEdge(r.v,r.w,s,r.name)},this.setPath=function(r,s){return r.reduce(function(c,v){return t.setEdge(c,v,s),v}),t},this.edgeFromArgs=function(r,s,c){return t.edge({v:r,w:s,name:c})},this.edge=function(r){return t.edgesLabelsMap.get(N1(t.isDirected(),r))},this.hasEdge=function(r,s,c){return t.edgesLabelsMap.has(N1(t.isDirected(),{v:r,w:s,name:c}))},this.removeEdgeObj=function(r){var s=r.v,c=r.w,v=r.name;return t.removeEdge(s,c,v)},this.edges=function(){return Array.from(t.edgesMap.values())},this.inEdges=function(r,s){var c=t.inEdgesMap.get(r);if(c)return Array.from(c.values()).filter(function(v){return!s||v.v===s})},this.outEdges=function(r,s){var c=t.outEdgesMap.get(r);if(c)return Array.from(c.values()).filter(function(v){return!s||v.w===s})},this.nodeEdges=function(r,s){var c;if(t.hasNode(r))return(c=t.inEdges(r,s))===null||c===void 0?void 0:c.concat(t.outEdges(r,s))},this.toJSON=function(){return _K(t)},this.nodeInDegree=function(r){var s=t.inEdgesMap.get(r);return s?s.size:0},this.nodeOutDegree=function(r){var s=t.outEdgesMap.get(r);return s?s.size:0},this.nodeDegree=function(r){return t.nodeInDegree(r)+t.nodeOutDegree(r)},this.source=function(r){return r.v},this.target=function(r){return r.w};var a=cA(cA({},SK),n);this.compound=a.compound,this.directed=a.directed,this.multigraph=a.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return xK(e,[{key:"setNode",value:function(n,a){var r=this.nodesLabelMap,s=this.defaultNodeLabelFn,c=this.isCompound,v=this.parentMap,f=this.childrenMap,g=this.inEdgesMap,_=this.outEdgesMap,b=this.predecessorsMap,x=this.successorsMap;if(r.has(n))return a!==void 0&&r.set(n,a),this;if(r.set(n,a||s(n)),c()){var S;v==null||v.set(n,this.GRAPH_NODE),f==null||f.set(n,new Map),f!=null&&f.has(this.GRAPH_NODE)||f==null||f.set(this.GRAPH_NODE,new Map),f==null||(S=f.get(this.GRAPH_NODE))===null||S===void 0||S.set(n,!0)}return[g,_,b,x].forEach(function(A){return A.set(n,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(n){var a=this;if(this.hasNode(n)){var r=function(T){a.removeEdge(T.v,T.w,T.name)},s=this.inEdgesMap,c=this.outEdgesMap,v=this.predecessorsMap,f=this.successorsMap,g=this.nodesLabelMap;if(this.isCompound()){var _,b,x;this.removeFromParentsChildList(n),(_=this.parentMap)===null||_===void 0||_.delete(n),(b=this.children(n))===null||b===void 0||b.forEach(function(E){return a.setParent(E)}),(x=this.childrenMap)===null||x===void 0||x.delete(n)}var S=s.get(n),A=c.get(n);Array.from(S.values()).forEach(function(E){return r(E)}),Array.from(A.values()).forEach(function(E){return r(E)}),g.delete(n),s.delete(n),c.delete(n),v.delete(n),f.delete(n),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(n,a,r,s){var c,v,f=lA(this.isDirected(),n,a,s),g=N1(this.isDirected(),f),_=f.v,b=f.w;if(this.edgesLabelsMap.has(g))return this.edgesLabelsMap.set(g,r),this;if(s!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(_),this.setNode(b),this.edgesLabelsMap.set(g,r||this.defaultEdgeLabelFn(_,b,s)),Object.freeze(f),this.edgesMap.set(g,f);var x=this.predecessorsMap.get(b),S=this.successorsMap.get(_);return iA(x,_),iA(S,b),(c=this.inEdgesMap.get(b))===null||c===void 0||c.set(g,f),(v=this.outEdgesMap.get(_))===null||v===void 0||v.set(g,f),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,a,r){var s=nP(this.isDirected(),n,a,r),c=this.edgesMap.get(s);if(c){var v=lA(this.isDirected(),n,a,r),f=v.v,g=v.w;this.edgesLabelsMap.delete(s),this.edgesMap.delete(s);var _=this.predecessorsMap.get(g),b=this.successorsMap.get(f);aA(_,f),aA(b,g),this.inEdgesMap.get(g).delete(s),this.outEdgesMap.get(f).delete(s),this.edgeCountNum-=1}return this}}]),e})();ey.fromJSON=bK;var AK=function e(t,n,a,r,s,c){r.includes(n)||(r.push(n),a||c.push(n),s(n).forEach(function(v){return e(t,v,a,r,s,c)}),a&&c.push(n))},IE=function(t,n,a){var r=Array.isArray(n)?n:[n],s=function(g){return t.isDirected()?t.successors(g):t.neighbors(g)},c=[],v=[];return r.forEach(function(f){if(t.hasNode(f))AK(t,f,a==="post",v,s,c);else throw new Error("Graph does not have node: "+f)}),c},MK=function(t,n){return IE(t,n,"post")},kK=function(t,n){return IE(t,n,"pre")};const TK=Object.freeze(Object.defineProperty({__proto__:null,dfs:IE,postorder:MK,preorder:kK},Symbol.toStringTag,{value:"Module"}));class NK extends mK{}class PK extends ey{}const CK=()=>1,RK=(e,t)=>{var n;if(e.nodeCount()<=1)return[];const a=DK(e,t||CK);return(n=jK(a.graph,a.buckets,a.zeroIdx).map(s=>e.outEdges(s.v,s.w)))===null||n===void 0?void 0:n.flat()},jK=(e,t,n)=>{let a=[];const r=t[t.length-1],s=t[0];let c;for(;e.nodeCount();){for(;c=s.dequeue();)P1(e,t,n,c);for(;c=r.dequeue();)P1(e,t,n,c);if(e.nodeCount()){for(let v=t.length-2;v>0;--v)if(c=t[v].dequeue(),c){a=a.concat(P1(e,t,n,c,!0));break}}}return a},P1=(e,t,n,a,r)=>{var s,c;const v=[];return(s=e.inEdges(a.v))===null||s===void 0||s.forEach(f=>{const g=e.edge(f),_=e.node(f.v);r&&v.push({v:f.v,w:f.w,in:0,out:0}),_.out===void 0&&(_.out=0),_.out-=g,Pw(t,n,_)}),(c=e.outEdges(a.v))===null||c===void 0||c.forEach(f=>{const g=e.edge(f),_=f.w,b=e.node(_);b.in===void 0&&(b.in=0),b.in-=g,Pw(t,n,b)}),e.removeNode(a.v),r?v:void 0},DK=(e,t)=>{const n=new PK;let a=0,r=0;e.nodes().forEach(f=>{n.setNode(f,{v:f,in:0,out:0})}),e.edges().forEach(f=>{const g=n.edge(f)||0,_=(t==null?void 0:t(f))||1,b=g+_;n.setEdge(f.v,f.w,b),r=Math.max(r,n.node(f.v).out+=_),a=Math.max(a,n.node(f.w).in+=_)});const s=[],c=r+a+3;for(let f=0;f<c;f++)s.push(new NK);const v=a+1;return n.nodes().forEach(f=>{Pw(s,v,n.node(f))}),{buckets:s,zeroIdx:v,graph:n}},Pw=(e,t,n)=>{n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)},IK=e=>{const t=a=>r=>{var s;return((s=a.edge(r))===null||s===void 0?void 0:s.weight)||1},n=e.graph().acyclicer==="greedy"?RK(e,t(e)):LK(e);n==null||n.forEach(a=>{const r=e.edge(a);e.removeEdgeObj(a),r.forwardName=a.name,r.reversed=!0,e.setEdge(a.w,a.v,r,`rev-${Math.random()}`)})},LK=e=>{const t=[],n={},a={},r=s=>{var c;a[s]||(a[s]=!0,n[s]=!0,(c=e.outEdges(s))===null||c===void 0||c.forEach(v=>{n[v.w]?t.push(v):r(v.w)}),delete n[s])};return e.nodes().forEach(r),t},$K=e=>{e.edges().forEach(t=>{const n=e.edge(t);if(n.reversed){e.removeEdgeObj(t);const a=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,a)}})},dA={run:IK,undo:$K};class Nd extends ey{}const FK=(e,t)=>Number(e)-Number(t),Wv=(e,t,n,a)=>{let r;do r=`${a}${Math.random()}`;while(e.hasNode(r));return n.dummy=t,e.setNode(r,n),r},BK=e=>{const t=new Nd().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{const a=t.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:a.weight+r.weight,minlen:Math.max(a.minlen,r.minlen)})}),t},rP=e=>{const t=new Nd({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{var a;!((a=e.children(n))===null||a===void 0)&&a.length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdgeObj(n,e.edge(n))}),t},VK=(e,t)=>e==null?void 0:e.reduce((n,a,r)=>(n[a]=t[r],n),{}),fA=(e,t)=>{const n=Number(e.x),a=Number(e.y),r=Number(t.x)-n,s=Number(t.y)-a;let c=Number(e.width)/2,v=Number(e.height)/2;if(!r&&!s)return{x:0,y:0};let f,g;return Math.abs(s)*c>Math.abs(r)*v?(s<0&&(v=-v),f=v*r/s,g=v):(r<0&&(c=-c),f=c,g=c*s/r),{x:n+f,y:a+g}},Bm=e=>{const t=[],n=oP(e)+1;for(let a=0;a<n;a++)t.push([]);e.nodes().forEach(a=>{const r=e.node(a);if(!r)return;const s=r.rank;s!==void 0&&t[s]&&t[s].push(a)});for(let a=0;a<n;a++)t[a]=t[a].sort((r,s)=>{var c,v;return FK((c=e.node(r))===null||c===void 0?void 0:c.order,(v=e.node(s))===null||v===void 0?void 0:v.order)});return t},UK=e=>{const t=e.nodes().filter(a=>{var r;return((r=e.node(a))===null||r===void 0?void 0:r.rank)!==void 0}).map(a=>e.node(a).rank),n=Math.min(...t);e.nodes().forEach(a=>{const r=e.node(a);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)})},WK=e=>{const t=e.nodes(),n=t.filter(v=>{var f;return((f=e.node(v))===null||f===void 0?void 0:f.rank)!==void 0}).map(v=>e.node(v).rank),a=Math.min(...n),r=[];t.forEach(v=>{var f;const g=(((f=e.node(v))===null||f===void 0?void 0:f.rank)||0)-a;r[g]||(r[g]=[]),r[g].push(v)});let s=0;const c=e.graph().nodeRankFactor||0;for(let v=0;v<r.length;v++){const f=r[v];f===void 0?v%c!==0&&(s-=1):s&&(f==null||f.forEach(g=>{const _=e.node(g);_&&(_.rank=_.rank||0,_.rank+=s)}))}},pA=(e,t,n,a)=>{const r={width:0,height:0};return Kg(n)&&Kg(a)&&(r.rank=n,r.order=a),Wv(e,"border",r,t)},oP=e=>{let t;return e.nodes().forEach(n=>{var a;const r=(a=e.node(n))===null||a===void 0?void 0:a.rank;r!==void 0&&(t===void 0||r>t)&&(t=r)}),t||(t=0),t},GK=(e,t)=>{const n={lhs:[],rhs:[]};return e==null||e.forEach(a=>{t(a)?n.lhs.push(a):n.rhs.push(a)}),n},iP=(e,t)=>{const n=Date.now();try{return t()}finally{console.log(`${e} time: ${Date.now()-n}ms`)}},aP=(e,t)=>t(),LE=(e,t)=>e.reduce((n,a)=>{const r=t(n),s=t(a);return r>s?a:n}),zK=e=>{e.graph().dummyChains=[],e.edges().forEach(t=>HK(e,t))},HK=(e,t)=>{let n=t.v,a=e.node(n).rank;const r=t.w,s=e.node(r).rank,c=t.name,v=e.edge(t),f=v.labelRank;if(s===a+1)return;e.removeEdgeObj(t);const g=e.graph();let _,b,x;for(x=0,++a;a<s;++x,++a)v.points=[],b={edgeLabel:v,width:0,height:0,edgeObj:t,rank:a},_=Wv(e,"edge",b,"_d"),a===f&&(b.width=v.width,b.height=v.height,b.dummy="edge-label",b.labelpos=v.labelpos),e.setEdge(n,_,{weight:v.weight},c),x===0&&(g.dummyChains||(g.dummyChains=[]),g.dummyChains.push(_)),n=_;e.setEdge(n,r,{weight:v.weight},c)},XK=e=>{var t;(t=e.graph().dummyChains)===null||t===void 0||t.forEach(n=>{let a=e.node(n);const r=a.edgeLabel;let s;a.edgeObj&&e.setEdgeObj(a.edgeObj,r);let c=n;for(;a.dummy;)s=e.successors(c)[0],e.removeNode(c),r.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(r.x=a.x,r.y=a.y,r.width=a.width,r.height=a.height),c=s,a=e.node(c)})},hA={run:zK,undo:XK},lP=e=>{var t;const n={},a=r=>{var s;const c=e.node(r);if(!c)return 0;if(n[r])return c.rank;n[r]=!0;let v;return(s=e.outEdges(r))===null||s===void 0||s.forEach(f=>{const g=a(f.w),_=e.edge(f).minlen,b=g-_;b&&(v===void 0||b<v)&&(v=b)}),v||(v=0),c.rank=v,v};(t=e.sources())===null||t===void 0||t.forEach(r=>a(r))},qK=e=>{var t;const n={};let a;const r=v=>{var f;const g=e.node(v);if(!g)return 0;if(n[v])return g.rank;n[v]=!0;let _;return(f=e.outEdges(v))===null||f===void 0||f.forEach(b=>{const x=r(b.w),S=e.edge(b).minlen,A=x-S;A&&(_===void 0||A<_)&&(_=A)}),_||(_=0),(a===void 0||_<a)&&(a=_),g.rank=_,_};(t=e.sources())===null||t===void 0||t.forEach(v=>{e.node(v)&&r(v)}),a===void 0&&(a=0);const s={},c=(v,f)=>{var g;const _=e.node(v),b=isNaN(_.layer)?f:_.layer;(_.rank===void 0||_.rank<b)&&(_.rank=b),!s[v]&&(s[v]=!0,(g=e.outEdges(v))===null||g===void 0||g.map(x=>{c(x.w,b+e.edge(x).minlen)}))};e.nodes().forEach(v=>{const f=e.node(v);f&&(isNaN(f.layer)?f.rank-=a:c(v,f.layer))})},qf=(e,t)=>e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen,YK=e=>{const t=new Nd({directed:!1}),n=e.nodes()[0],a=e.nodeCount();t.setNode(n,{});let r,s;for(;KK(t,e)<a;)r=sP(t,e),s=t.hasNode(r.v)?qf(e,r):-qf(e,r),uP(t,e,s);return t},KK=(e,t)=>{const n=a=>{t.nodeEdges(a).forEach(r=>{const s=r.v,c=a===s?r.w:s;!e.hasNode(c)&&!qf(t,r)&&(e.setNode(c,{}),e.setEdge(a,c,{}),n(c))})};return e.nodes().forEach(n),e.nodeCount()},ZK=e=>{const t=new Nd({directed:!1}),n=e.nodes()[0],a=e.nodes().filter(c=>!!e.node(c)).length;t.setNode(n,{});let r,s;for(;JK(t,e)<a;)r=sP(t,e),s=t.hasNode(r.v)?qf(e,r):-qf(e,r),uP(t,e,s);return t},JK=(e,t)=>{const n=a=>{var r;(r=t.nodeEdges(a))===null||r===void 0||r.forEach(s=>{const c=s.v,v=a===c?s.w:c;!e.hasNode(v)&&(t.node(v).layer!==void 0||!qf(t,s))&&(e.setNode(v,{}),e.setEdge(a,v,{}),n(v))})};return e.nodes().forEach(n),e.nodeCount()},sP=(e,t)=>LE(t.edges(),n=>e.hasNode(n.v)!==e.hasNode(n.w)?qf(t,n):1/0),uP=(e,t,n)=>{e.nodes().forEach(a=>{t.node(a).rank||(t.node(a).rank=0),t.node(a).rank+=n})},{preorder:QK,postorder:eZ}=TK,tZ=e=>{const t=BK(e);lP(t);const n=YK(t);dP(n),cP(n,t);let a,r;for(;a=oZ(n);)r=iZ(n,t,a),aZ(n,t,a,r)},cP=(e,t)=>{let n=eZ(e,e.nodes());n=n==null?void 0:n.slice(0,(n==null?void 0:n.length)-1),n==null||n.forEach(a=>{nZ(e,t,a)})},nZ=(e,t,n)=>{const r=e.node(n).parent;e.edgeFromArgs(n,r).cutvalue=rZ(e,t,n)},rZ=(e,t,n)=>{var a;const s=e.node(n).parent;let c=!0,v=t.edgeFromArgs(n,s),f=0;return v||(c=!1,v=t.edgeFromArgs(s,n)),f=v.weight,(a=t.nodeEdges(n))===null||a===void 0||a.forEach(g=>{const _=g.v===n,b=_?g.w:g.v;if(b!==s){const x=_===c,S=t.edge(g).weight;if(f+=x?S:-S,sZ(e,n,b)){const A=e.edgeFromArgs(n,b).cutvalue;f+=x?-A:A}}}),f},dP=(e,t=e.nodes()[0])=>{fP(e,{},1,t)},fP=(e,t,n,a,r)=>{var s;const c=n;let v=n;const f=e.node(a);return t[a]=!0,(s=e.neighbors(a))===null||s===void 0||s.forEach(g=>{t[g]||(v=fP(e,t,v,g,a))}),f.low=c,f.lim=v++,r?f.parent=r:delete f.parent,v},oZ=e=>e.edges().find(t=>e.edge(t).cutvalue<0),iZ=(e,t,n)=>{let a=n.v,r=n.w;t.hasEdge(a,r)||(a=n.w,r=n.v);const s=e.node(a),c=e.node(r);let v=s,f=!1;s.lim>c.lim&&(v=c,f=!0);const g=t.edges().filter(_=>f===vA(e,e.node(_.v),v)&&f!==vA(e,e.node(_.w),v));return LE(g,_=>qf(t,_))},aZ=(e,t,n,a)=>{const r=n.v,s=n.w;e.removeEdge(r,s),e.setEdge(a.v,a.w,{}),dP(e),cP(e,t),lZ(e,t)},lZ=(e,t)=>{const n=e.nodes().find(r=>{var s;return!(!((s=t.node(r))===null||s===void 0)&&s.parent)});let a=QK(e,n);a=a==null?void 0:a.slice(1),a==null||a.forEach(r=>{const s=e.node(r).parent;let c=t.edgeFromArgs(r,s),v=!1;c||(c=t.edgeFromArgs(s,r),v=!0),t.node(r).rank=t.node(s).rank+(v?c.minlen:-c.minlen)})},sZ=(e,t,n)=>e.hasEdge(t,n),vA=(e,t,n)=>n.low<=t.lim&&t.lim<=n.lim,uZ=e=>{switch(e.graph().ranker){case"network-simplex":dZ(e);break;case"tight-tree":mA(e);break;case"longest-path":cZ(e);break;default:mA(e)}},cZ=lP,mA=e=>{qK(e),ZK(e)},dZ=e=>{tZ(e)},fZ=e=>{var t;const n={};let a=0;const r=s=>{var c;const v=a;(c=e.children(s))===null||c===void 0||c.forEach(r),n[s]={low:v,lim:a++}};return(t=e.children())===null||t===void 0||t.forEach(r),n},pZ=(e,t,n,a)=>{const r=[],s=[],c=Math.min(t[n].low,t[a].low),v=Math.max(t[n].lim,t[a].lim);let f,g;f=n;do f=e.parent(f),r.push(f);while(f&&(t[f].low>c||v>t[f].lim));for(g=f,f=a;f&&f!==g;)s.push(f),f=e.parent(f);return{lca:g,path:r.concat(s.reverse())}},hZ=e=>{var t;const n=fZ(e);(t=e.graph().dummyChains)===null||t===void 0||t.forEach(a=>{var r,s;let c=a,v=e.node(c);const f=v.edgeObj;if(!f)return;const g=pZ(e,n,f.v,f.w),_=g.path,b=g.lca;let x=0,S=_[x],A=!0;for(;c!==f.w;){if(v=e.node(c),A){for(;S!==b&&((r=e.node(S))===null||r===void 0?void 0:r.maxRank)<v.rank;)x++,S=_[x];S===b&&(A=!1)}if(!A){for(;x<_.length-1&&((s=e.node(_[x+1]))===null||s===void 0?void 0:s.minRank)<=v.rank;)x++;S=_[x]}e.setParent(c,S),c=e.successors(c)[0]}})},vZ=e=>{var t;const n=Wv(e,"root",{},"_root"),a=mZ(e);let r=Math.max(...Object.values(a));Math.abs(r)===1/0&&(r=1);const s=r-1,c=2*s+1;e.graph().nestingRoot=n,e.edges().forEach(f=>{e.edge(f).minlen*=c});const v=yZ(e)+1;(t=e.children())===null||t===void 0||t.forEach(f=>{pP(e,n,c,v,s,a,f)}),e.graph().nodeRankFactor=c},pP=(e,t,n,a,r,s,c)=>{const v=e.children(c);if(!(v!=null&&v.length)){c!==t&&e.setEdge(t,c,{weight:0,minlen:n});return}const f=pA(e,"_bt"),g=pA(e,"_bb"),_=e.node(c);e.setParent(f,c),_.borderTop=f,e.setParent(g,c),_.borderBottom=g,v==null||v.forEach(b=>{pP(e,t,n,a,r,s,b);const x=e.node(b),S=x.borderTop?x.borderTop:b,A=x.borderBottom?x.borderBottom:b,E=x.borderTop?a:2*a,T=S!==A?1:r-s[c]+1;e.setEdge(f,S,{minlen:T,weight:E,nestingEdge:!0}),e.setEdge(A,g,{minlen:T,weight:E,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,f,{weight:0,minlen:r+s[c]})},mZ=e=>{var t;const n={},a=(r,s)=>{const c=e.children(r);c==null||c.forEach(v=>a(v,s+1)),n[r]=s};return(t=e.children())===null||t===void 0||t.forEach(r=>a(r,1)),n},yZ=e=>{let t=0;return e.edges().forEach(n=>{t+=e.edge(n).weight}),t},gZ=e=>{const t=e.graph();t.nestingRoot&&e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdgeObj(n)})},yA={run:vZ,cleanup:gZ},_Z=e=>{var t;const n=a=>{const r=e.children(a),s=e.node(a);if(r!=null&&r.length&&r.forEach(c=>n(c)),s.hasOwnProperty("minRank")){s.borderLeft=[],s.borderRight=[];for(let c=s.minRank,v=s.maxRank+1;c<v;c+=1)gA(e,"borderLeft","_bl",a,s,c),gA(e,"borderRight","_br",a,s,c)}};(t=e.children())===null||t===void 0||t.forEach(a=>n(a))},gA=(e,t,n,a,r,s)=>{const c={rank:s,borderType:t,width:0,height:0},v=r[t][s-1],f=Wv(e,"border",c,n);r[t][s]=f,e.setParent(f,a),v&&e.setEdge(v,f,{weight:1})},bZ=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&hP(e)},wZ=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&EZ(e),(n==="lr"||n==="rl")&&(OZ(e),hP(e))},hP=e=>{e.nodes().forEach(t=>{_A(e.node(t))}),e.edges().forEach(t=>{_A(e.edge(t))})},_A=e=>{const t=e.width;e.width=e.height,e.height=t},EZ=e=>{e.nodes().forEach(t=>{C1(e.node(t))}),e.edges().forEach(t=>{var n;const a=e.edge(t);(n=a.points)===null||n===void 0||n.forEach(r=>C1(r)),a.hasOwnProperty("y")&&C1(a)})},C1=e=>{e!=null&&e.y&&(e.y=-e.y)},OZ=e=>{e.nodes().forEach(t=>{R1(e.node(t))}),e.edges().forEach(t=>{var n;const a=e.edge(t);(n=a.points)===null||n===void 0||n.forEach(r=>R1(r)),a.hasOwnProperty("x")&&R1(a)})},R1=e=>{const t=e.x;e.x=e.y,e.y=t},bA={adjust:bZ,undo:wZ};function xZ(e){return Array.isArray(e)}function Cw(e){if(!Array.isArray(e))return-1/0;var t=e.length;if(!t)return-1/0;for(var n=e[0],a=1;a<t;a++)n=Math.max(n,e[a]);return n}const wA=(function(e){if(xZ(e))return e.reduce(function(t,n){return Math.min(t,n)},e[0])}),EA=e=>{const t={},n=e.nodes().filter(_=>{var b;return!(!((b=e.children(_))===null||b===void 0)&&b.length)}),a=n.map(_=>e.node(_).rank),r=Cw(a),s=[];for(let _=0;_<r+1;_++)s.push([]);const c=_=>{var b;if(t.hasOwnProperty(_))return;t[_]=!0;const x=e.node(_);isNaN(x.rank)||s[x.rank].push(_),(b=e.successors(_))===null||b===void 0||b.forEach(S=>c(S))},v=n.sort((_,b)=>e.node(_).rank-e.node(b).rank),g=v.filter(_=>e.node(_).fixorder!==void 0).sort((_,b)=>e.node(_).fixorder-e.node(b).fixorder);return g==null||g.forEach(_=>{isNaN(e.node(_).rank)||s[e.node(_).rank].push(_),t[_]=!0}),v==null||v.forEach(c),s},SZ=(e,t,n)=>{const a=VK(n,n.map((_,b)=>b)),s=t.map(_=>{var b;const x=(b=e.outEdges(_))===null||b===void 0?void 0:b.map(S=>({pos:a[S.w]||0,weight:e.edge(S).weight}));return x==null?void 0:x.sort((S,A)=>S.pos-A.pos)}).flat().filter(_=>_!==void 0);let c=1;for(;c<n.length;)c<<=1;const v=2*c-1;c-=1;const f=Array(v).fill(0,0,v);let g=0;return s==null||s.forEach(_=>{if(_){let b=_.pos+c;f[b]+=_.weight;let x=0;for(;b>0;)b%2&&(x+=f[b+1]),b=b-1>>1,f[b]+=_.weight;g+=_.weight*x}}),g},OA=(e,t)=>{let n=0;for(let a=1;a<(t==null?void 0:t.length);a+=1)n+=SZ(e,t[a-1],t[a]);return n},AZ=(e,t,n)=>{const a=MZ(e),r=new Nd({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(s=>e.node(s));return e.nodes().forEach(s=>{var c;const v=e.node(s),f=e.parent(s);(v.rank===t||v.minRank<=t&&t<=v.maxRank)&&(r.setNode(s),r.setParent(s,f||a),(c=e[n](s))===null||c===void 0||c.forEach(g=>{const _=g.v===s?g.w:g.v,b=r.edgeFromArgs(_,s),x=b!==void 0?b.weight:0;r.setEdge(_,s,{weight:e.edge(g).weight+x})}),v.hasOwnProperty("minRank")&&r.setNode(s,{borderLeft:v.borderLeft[t],borderRight:v.borderRight[t]}))}),r},MZ=e=>{let t;for(;e.hasNode(t=`_root${Math.random()}`););return t},kZ=(e,t,n)=>{const a={};let r;n==null||n.forEach(s=>{let c=e.parent(s),v,f;for(;c;){if(v=e.parent(c),v?(f=a[v],a[v]=c):(f=r,r=c),f&&f!==c){t.setEdge(f,c);return}c=v}})},TZ=(e,t)=>t.map(n=>{const a=e.inEdges(n);if(!(a!=null&&a.length))return{v:n};{const r={sum:0,weight:0};return a==null||a.forEach(s=>{const c=e.edge(s),v=e.node(s.v);r.sum+=c.weight*v.order,r.weight+=c.weight}),{v:n,barycenter:r.sum/r.weight,weight:r.weight}}}),NZ=(e,t)=>{var n,a,r;const s={};e==null||e.forEach((v,f)=>{s[v.v]={i:f,indegree:0,in:[],out:[],vs:[v.v]};const g=s[v.v];v.barycenter!==void 0&&(g.barycenter=v.barycenter,g.weight=v.weight)}),(n=t.edges())===null||n===void 0||n.forEach(v=>{const f=s[v.v],g=s[v.w];f!==void 0&&g!==void 0&&(g.indegree++,f.out.push(s[v.w]))});const c=(r=(a=Object.values(s)).filter)===null||r===void 0?void 0:r.call(a,v=>!v.indegree);return PZ(c)},PZ=e=>{var t,n;const a=[],r=f=>g=>{g.merged||(g.barycenter===void 0||f.barycenter===void 0||g.barycenter>=f.barycenter)&&CZ(f,g)},s=f=>g=>{g.in.push(f),--g.indegree===0&&e.push(g)};for(;e!=null&&e.length;){const f=e.pop();a.push(f),(t=f.in.reverse())===null||t===void 0||t.forEach(g=>r(f)(g)),(n=f.out)===null||n===void 0||n.forEach(g=>s(f)(g))}const c=a.filter(f=>!f.merged),v=["vs","i","barycenter","weight"];return c.map(f=>{const g={};return v==null||v.forEach(_=>{f[_]!==void 0&&(g[_]=f[_])}),g})},CZ=(e,t)=>{var n;let a=0,r=0;e.weight&&(a+=e.barycenter*e.weight,r+=e.weight),t.weight&&(a+=t.barycenter*t.weight,r+=t.weight),e.vs=(n=t.vs)===null||n===void 0?void 0:n.concat(e.vs),e.barycenter=a/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0},RZ=(e,t,n,a)=>{const r=GK(e,x=>{const S=x.hasOwnProperty("fixorder")&&!isNaN(x.fixorder);return a?!S&&x.hasOwnProperty("barycenter"):S||x.hasOwnProperty("barycenter")}),s=r.lhs,c=r.rhs.sort((x,S)=>-x.i- -S.i),v=[];let f=0,g=0,_=0;s==null||s.sort(jZ(!!t,!!n)),_=xA(v,c,_),s==null||s.forEach(x=>{var S;_+=(S=x.vs)===null||S===void 0?void 0:S.length,v.push(x.vs),f+=x.barycenter*x.weight,g+=x.weight,_=xA(v,c,_)});const b={vs:v.flat()};return g&&(b.barycenter=f/g,b.weight=g),b},xA=(e,t,n)=>{let a=n,r;for(;t.length&&(r=t[t.length-1]).i<=a;)t.pop(),e==null||e.push(r.vs),a++;return a},jZ=(e,t)=>(n,a)=>{if(n.fixorder!==void 0&&a.fixorder!==void 0)return n.fixorder-a.fixorder;if(n.barycenter<a.barycenter)return-1;if(n.barycenter>a.barycenter)return 1;if(t&&n.order!==void 0&&a.order!==void 0){if(n.order<a.order)return-1;if(n.order>a.order)return 1}return e?a.i-n.i:n.i-a.i},vP=(e,t,n,a,r,s)=>{var c,v,f,g;let _=e.children(t);const b=e.node(t),x=b?b.borderLeft:void 0,S=b?b.borderRight:void 0,A={};x&&(_=_==null?void 0:_.filter(R=>R!==x&&R!==S));const E=TZ(e,_||[]);E==null||E.forEach(R=>{var U;if(!((U=e.children(R.v))===null||U===void 0)&&U.length){const D=vP(e,R.v,n,a,s);A[R.v]=D,D.hasOwnProperty("barycenter")&&IZ(R,D)}});const T=NZ(E,n);DZ(T,A),(c=T.filter(R=>R.vs.length>0))===null||c===void 0||c.forEach(R=>{const U=e.node(R.vs[0]);U&&(R.fixorder=U.fixorder,R.order=U.order)});const I=RZ(T,a,r,s);if(x&&(I.vs=[x,I.vs,S].flat(),!((v=e.predecessors(x))===null||v===void 0)&&v.length)){const R=e.node(((f=e.predecessors(x))===null||f===void 0?void 0:f[0])||""),U=e.node(((g=e.predecessors(S))===null||g===void 0?void 0:g[0])||"");I.hasOwnProperty("barycenter")||(I.barycenter=0,I.weight=0),I.barycenter=(I.barycenter*I.weight+R.order+U.order)/(I.weight+2),I.weight+=2}return I},DZ=(e,t)=>{e==null||e.forEach(n=>{var a;const r=(a=n.vs)===null||a===void 0?void 0:a.map(s=>t[s]?t[s].vs:s);n.vs=r.flat()})},IZ=(e,t)=>{e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)},LZ=(e,t)=>{const n=oP(e),a=[],r=[];for(let _=1;_<n+1;_++)a.push(_);for(let _=n-1;_>-1;_--)r.push(_);const s=SA(e,a,"inEdges"),c=SA(e,r,"outEdges");let v=EA(e);j1(e,v);let f=Number.POSITIVE_INFINITY,g;for(let _=0,b=0;b<4;++_,++b){AA(_%2?s:c,_%4>=2,!1,t),v=Bm(e);const x=OA(e,v);x<f&&(b=0,g=Zg(v),f=x)}v=EA(e),j1(e,v);for(let _=0,b=0;b<4;++_,++b){AA(_%2?s:c,_%4>=2,!0,t),v=Bm(e);const x=OA(e,v);x<f&&(b=0,g=Zg(v),f=x)}j1(e,g)},SA=(e,t,n)=>t.map(a=>AZ(e,a,n)),AA=(e,t,n,a)=>{const r=new Nd;e==null||e.forEach(s=>{var c;const v=s.graph().root,f=vP(s,v,r,t,n,a);for(let g=0;g<((c=f.vs)===null||c===void 0?void 0:c.length);g++){const _=s.node(f.vs[g]);_&&(_.order=g)}kZ(s,r,f.vs)})},j1=(e,t)=>{t==null||t.forEach(n=>{n==null||n.forEach((a,r)=>{e.node(a).order=r})})};class $Z extends ey{}const FZ=(e,t)=>{const n={},a=(r,s)=>{let c=0,v=0;const f=r.length,g=s==null?void 0:s[(s==null?void 0:s.length)-1];return s==null||s.forEach((_,b)=>{var x;const S=VZ(e,_),A=S?e.node(S).order:f;(S||_===g)&&((x=s.slice(v,b+1))===null||x===void 0||x.forEach(E=>{var T;(T=e.predecessors(E))===null||T===void 0||T.forEach(I=>{var R;const U=e.node(I),D=U.order;(D<c||A<D)&&!(U.dummy&&(!((R=e.node(E))===null||R===void 0)&&R.dummy))&&mP(n,I,E)})}),v=b+1,c=A)}),s};return t!=null&&t.length&&t.reduce(a),n},BZ=(e,t)=>{const n={};function a(v,f,g,_,b){var x,S;let A;for(let E=f;E<g;E++)A=v[E],!((x=e.node(A))===null||x===void 0)&&x.dummy&&((S=e.predecessors(A))===null||S===void 0||S.forEach(T=>{const I=e.node(T);I.dummy&&(I.order<_||I.order>b)&&mP(n,T,A)}))}function r(v){return JSON.stringify(v.slice(1))}function s(v,f){const g=r(v);f.get(g)||(a(...v),f.set(g,!0))}const c=(v,f)=>{let g=-1,_,b=0;const x=new Map;return f==null||f.forEach((S,A)=>{var E;if(((E=e.node(S))===null||E===void 0?void 0:E.dummy)==="border"){const T=e.predecessors(S)||[];T.length&&(_=e.node(T[0]).order,s([f,b,A,g,_],x),b=A,g=_)}s([f,b,f.length,_,v.length],x)}),f};return t!=null&&t.length&&t.reduce(c),n},VZ=(e,t)=>{var n,a;if(!((n=e.node(t))===null||n===void 0)&&n.dummy)return(a=e.predecessors(t))===null||a===void 0?void 0:a.find(r=>e.node(r).dummy)},mP=(e,t,n)=>{let a=t,r=n;if(a>r){const c=a;a=r,r=c}let s=e[a];s||(e[a]=s={}),s[r]=!0},UZ=(e,t,n)=>{let a=t,r=n;if(a>r){const s=t;a=r,r=s}return!!e[a]},WZ=(e,t,n,a)=>{const r={},s={},c={};return t==null||t.forEach(v=>{v==null||v.forEach((f,g)=>{r[f]=f,s[f]=f,c[f]=g})}),t==null||t.forEach(v=>{let f=-1;v==null||v.forEach(g=>{let _=a(g);if(_.length){_=_.sort((x,S)=>c[x]-c[S]);const b=(_.length-1)/2;for(let x=Math.floor(b),S=Math.ceil(b);x<=S;++x){const A=_[x];s[g]===g&&f<c[A]&&!UZ(n,g,A)&&(s[A]=g,s[g]=r[g]=r[A],f=c[A])}}})}),{root:r,align:s}},GZ=(e,t,n,a,r)=>{var s;const c={},v=zZ(e,t,n,r),f=r?"borderLeft":"borderRight",g=(x,S)=>{let A=v.nodes(),E=A.pop();const T={};for(;E;)T[E]?x(E):(T[E]=!0,A.push(E),A=A.concat(S(E))),E=A.pop()},_=x=>{c[x]=(v.inEdges(x)||[]).reduce((S,A)=>Math.max(S,(c[A.v]||0)+v.edge(A)),0)},b=x=>{const S=(v.outEdges(x)||[]).reduce((E,T)=>Math.min(E,(c[T.w]||0)-v.edge(T)),Number.POSITIVE_INFINITY),A=e.node(x);S!==Number.POSITIVE_INFINITY&&A.borderType!==f&&(c[x]=Math.max(c[x],S))};return g(_,v.predecessors.bind(v)),g(b,v.successors.bind(v)),(s=Object.values(a))===null||s===void 0||s.forEach(x=>{c[x]=c[n[x]]}),c},zZ=(e,t,n,a)=>{const r=new $Z,s=e.graph(),c=YZ(s.nodesep,s.edgesep,a);return t==null||t.forEach(v=>{let f;v==null||v.forEach(g=>{const _=n[g];if(r.setNode(_),f){const b=n[f],x=r.edgeFromArgs(b,_);r.setEdge(b,_,Math.max(c(e,g,f),x||0))}f=g})}),r},HZ=(e,t)=>LE(Object.values(t),n=>{var a;let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;return(a=Object.keys(n))===null||a===void 0||a.forEach(c=>{const v=n[c],f=KZ(e,c)/2;r=Math.max(v+f,r),s=Math.min(v-f,s)}),r-s});function XZ(e,t){const n=Object.values(t),a=wA(n),r=Cw(n);["u","d"].forEach(s=>{["l","r"].forEach(c=>{const v=s+c,f=e[v];let g;if(f===t)return;const _=Object.values(f);g=c==="l"?a-wA(_):r-Cw(_),g&&(e[v]={},Object.keys(f).forEach(b=>{e[v][b]=f[b]+g}))})})}const qZ=(e,t)=>{const n={};return Object.keys(e.ul).forEach(a=>{if(t)n[a]=e[t.toLowerCase()][a];else{const r=Object.values(e).map(s=>s[a]);n[a]=(r[0]+r[1])/2}}),n},YZ=(e,t,n)=>(a,r,s)=>{const c=a.node(r),v=a.node(s);let f=0,g;if(f+=c.width/2,c.hasOwnProperty("labelpos"))switch((c.labelpos||"").toLowerCase()){case"l":g=-c.width/2;break;case"r":g=c.width/2;break}if(g&&(f+=n?g:-g),g=0,f+=(c.dummy?t:e)/2,f+=(v.dummy?t:e)/2,f+=v.width/2,v.labelpos)switch((v.labelpos||"").toLowerCase()){case"l":g=v.width/2;break;case"r":g=-v.width/2;break}return g&&(f+=n?g:-g),g=0,f},KZ=(e,t)=>e.node(t).width||0,ZZ=e=>{const t=Bm(e),n=e.graph().ranksep;let a=0;t==null||t.forEach(r=>{const s=r.map(v=>e.node(v).height),c=Math.max(...s,0);r==null||r.forEach(v=>{e.node(v).y=a+c/2}),a+=c+n})},JZ=e=>{const t=Bm(e),n=Object.assign(FZ(e,t),BZ(e,t)),a={};let r=[];["u","d"].forEach(c=>{r=c==="u"?t:Object.values(t).reverse(),["l","r"].forEach(v=>{v==="r"&&(r=r.map(b=>Object.values(b).reverse()));const f=(c==="u"?e.predecessors:e.successors).bind(e),g=WZ(e,r,n,f),_=GZ(e,r,g.root,g.align,v==="r");v==="r"&&Object.keys(_).forEach(b=>_[b]=-_[b]),a[c+v]=_})});const s=HZ(e,a);return s&&XZ(a,s),qZ(a,e.graph().align)},QZ=e=>{var t;const n=rP(e);ZZ(n);const a=JZ(n);(t=Object.keys(a))===null||t===void 0||t.forEach(r=>{n.node(r).x=a[r]})},eJ=(e,t)=>{const a=e.nodes().filter(c=>{var v;return!(!((v=e.children(c))===null||v===void 0)&&v.length)}).map(c=>e.node(c).rank),r=Math.max(...a),s=[];for(let c=0;c<r+1;c++)s[c]=[];t==null||t.forEach(c=>{const v=e.node(c);!v||v!=null&&v.dummy||isNaN(v.rank)||(v.fixorder=s[v.rank].length,s[v.rank].push(c))})},tJ=(e,t)=>{const n=t&&t.debugTiming?iP:aP;n("layout",()=>{t&&!t.keepNodeOrder&&t.prevGraph&&n(" inheritOrder",()=>{rJ(e,t.prevGraph)});const a=n(" buildLayoutGraph",()=>dJ(e));t&&t.edgeLabelSpace===!1||n(" makeSpaceForEdgeLabels",()=>{fJ(a)});try{n(" runLayout",()=>{nJ(a,n,t)})}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",()=>{oJ(e,a)})})},nJ=(e,t,n)=>{t(" removeSelfEdges",()=>{wJ(e)}),t(" acyclic",()=>{dA.run(e)}),t(" nestingGraph.run",()=>{yA.run(e)}),t(" rank",()=>{uZ(rP(e))}),t(" injectEdgeLabelProxies",()=>{pJ(e)}),t(" removeEmptyRanks",()=>{WK(e)}),t(" nestingGraph.cleanup",()=>{yA.cleanup(e)}),t(" normalizeRanks",()=>{UK(e)}),t(" assignRankMinMax",()=>{hJ(e)}),t(" removeEdgeLabelProxies",()=>{vJ(e)}),t(" normalize.run",()=>{hA.run(e)}),t(" parentDummyChains",()=>{hZ(e)}),t(" addBorderSegments",()=>{_Z(e)}),n&&n.keepNodeOrder&&t(" initDataOrder",()=>{eJ(e,n.nodeOrder)}),t(" order",()=>{LZ(e,n==null?void 0:n.keepNodeOrder)}),t(" insertSelfEdges",()=>{EJ(e)}),t(" adjustCoordinateSystem",()=>{bA.adjust(e)}),t(" position",()=>{QZ(e)}),t(" positionSelfEdges",()=>{OJ(e)}),t(" removeBorderNodes",()=>{bJ(e)}),t(" normalize.undo",()=>{hA.undo(e)}),t(" fixupEdgeLabelCoords",()=>{gJ(e)}),t(" undoCoordinateSystem",()=>{bA.undo(e)}),t(" translateGraph",()=>{mJ(e)}),t(" assignNodeIntersects",()=>{yJ(e)}),t(" reversePoints",()=>{_J(e)}),t(" acyclic.undo",()=>{dA.undo(e)})},rJ=(e,t)=>{e.nodes().forEach(n=>{const a=e.node(n),r=t.node(n);r!==void 0?(a.fixorder=r._order,delete r._order):delete a.fixorder})},oJ=(e,t)=>{e.nodes().forEach(n=>{var a;const r=e.node(n);if(r){const s=t.node(n);r.x=s.x,r.y=s.y,r._order=s.order,r._rank=s.rank,!((a=t.children(n))===null||a===void 0)&&a.length&&(r.width=s.width,r.height=s.height)}}),e.edges().forEach(n=>{const a=e.edge(n),r=t.edge(n);a.points=r?r.points:[],r&&r.hasOwnProperty("x")&&(a.x=r.x,a.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height},iJ=["nodesep","edgesep","ranksep","marginx","marginy"],aJ={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},D1=["acyclicer","ranker","rankdir","align"],lJ=["width","height","layer","fixorder"],sJ={width:0,height:0},uJ=["minlen","weight","width","height","labeloffset"],cJ={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},I1=["labelpos"],dJ=e=>{const t=new Nd({multigraph:!0,compound:!0}),n=$1(e.graph()),a={};return D1==null||D1.forEach(r=>{n[r]!==void 0&&(a[r]=n[r])}),t.setGraph(Object.assign({},aJ,L1(n,iJ),a)),e.nodes().forEach(r=>{const s=$1(e.node(r)),c=Object.assign(Object.assign({},sJ),s),v=L1(c,lJ);t.setNode(r,v),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{const s=$1(e.edge(r)),c={};I1==null||I1.forEach(v=>{s[v]!==void 0&&(c[v]=s[v])}),t.setEdgeObj(r,Object.assign({},cJ,L1(s,uJ),c))}),t},fJ=e=>{const t=e.graph();t.ranksep||(t.ranksep=0),t.ranksep/=2,e.nodes().forEach(n=>{const a=e.node(n);isNaN(a.layer)||a.layer||(a.layer=0)}),e.edges().forEach(n=>{var a;const r=e.edge(n);r.minlen*=2,((a=r.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})},pJ=e=>{e.edges().forEach(t=>{const n=e.edge(t);if(n.width&&n.height){const a=e.node(t.v),r=e.node(t.w),s={e:t,rank:(r.rank-a.rank)/2+a.rank};Wv(e,"edge-proxy",s,"_ep")}})},hJ=e=>{let t=0;e.nodes().forEach(n=>{var a,r;const s=e.node(n);s.borderTop&&(s.minRank=(a=e.node(s.borderTop))===null||a===void 0?void 0:a.rank,s.maxRank=(r=e.node(s.borderBottom))===null||r===void 0?void 0:r.rank,t=Math.max(t,s.maxRank||-1/0))}),e.graph().maxRank=t},vJ=e=>{e.nodes().forEach(t=>{const n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})},mJ=e=>{let t,n=0,a,r=0;const s=e.graph(),c=s.marginx||0,v=s.marginy||0,f=g=>{if(!g)return;const _=g.x,b=g.y,x=g.width,S=g.height;!isNaN(_)&&!isNaN(x)&&(t===void 0&&(t=_-x/2),t=Math.min(t,_-x/2),n=Math.max(n,_+x/2)),!isNaN(b)&&!isNaN(S)&&(a===void 0&&(a=b-S/2),a=Math.min(a,b-S/2),r=Math.max(r,b+S/2))};e.nodes().forEach(g=>{f(e.node(g))}),e.edges().forEach(g=>{const _=e.edge(g);_!=null&&_.hasOwnProperty("x")&&f(_)}),t-=c,a-=v,e.nodes().forEach(g=>{const _=e.node(g);_&&(_.x-=t,_.y-=a)}),e.edges().forEach(g=>{var _;const b=e.edge(g);(_=b.points)===null||_===void 0||_.forEach(x=>{x.x-=t,x.y-=a}),b.hasOwnProperty("x")&&(b.x-=t),b.hasOwnProperty("y")&&(b.y-=a)}),s.width=n-t+c,s.height=r-a+v},yJ=e=>{e.edges().forEach(t=>{const n=e.edge(t),a=e.node(t.v),r=e.node(t.w);let s,c;n.points?(s=n.points[0],c=n.points[n.points.length-1]):(n.points=[],s=r,c=a),n.points.unshift(fA(a,s)),n.points.push(fA(r,c))})},gJ=e=>{e.edges().forEach(t=>{const n=e.edge(t);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}})},_J=e=>{e.edges().forEach(t=>{var n;const a=e.edge(t);a.reversed&&((n=a.points)===null||n===void 0||n.reverse())})},bJ=e=>{e.nodes().forEach(t=>{var n,a,r;if(!((n=e.children(t))===null||n===void 0)&&n.length){const s=e.node(t),c=e.node(s.borderTop),v=e.node(s.borderBottom),f=e.node(s.borderLeft[((a=s.borderLeft)===null||a===void 0?void 0:a.length)-1]),g=e.node(s.borderRight[((r=s.borderRight)===null||r===void 0?void 0:r.length)-1]);s.width=Math.abs((g==null?void 0:g.x)-(f==null?void 0:f.x))||10,s.height=Math.abs((v==null?void 0:v.y)-(c==null?void 0:c.y))||10,s.x=((f==null?void 0:f.x)||0)+s.width/2,s.y=((c==null?void 0:c.y)||0)+s.height/2}}),e.nodes().forEach(t=>{var n;((n=e.node(t))===null||n===void 0?void 0:n.dummy)==="border"&&e.removeNode(t)})},wJ=e=>{e.edges().forEach(t=>{if(t.v===t.w){const n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdgeObj(t)}})},EJ=e=>{const t=Bm(e);t==null||t.forEach(n=>{let a=0;n==null||n.forEach((r,s)=>{var c;const v=e.node(r);v.order=s+a,(c=v.selfEdges)===null||c===void 0||c.forEach(f=>{Wv(e,"selfedge",{width:f.label.width,height:f.label.height,rank:v.rank,order:s+ ++a,e:f.e,label:f.label},"_se")}),delete v.selfEdges})})},OJ=e=>{e.nodes().forEach(t=>{const n=e.node(t);if(n.dummy==="selfedge"){const a=e.node(n.e.v),r=a.x+a.width/2,s=a.y,c=n.x-r,v=a.height/2;e.setEdgeObj(n.e,n.label),e.removeNode(t),n.label.points=[{x:r+2*c/3,y:s-v},{x:r+5*c/6,y:s-v},{y:s,x:r+c},{x:r+5*c/6,y:s+v},{x:r+2*c/3,y:s+v}],n.label.x=n.x,n.label.y=n.y}})},L1=(e,t)=>{const n={};return t==null||t.forEach(a=>{e[a]!==void 0&&(n[a]=+e[a])}),n},$1=(e={})=>{const t={};return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t},xJ={layout:tJ,util:{time:iP,notime:aP}};class SJ extends pK{constructor(t){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 a=this,{nodes:r}=a,s=r.find(c=>c.id===n);return s?s.layout!==!1:!0},this.updateCfg(t)}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 t,n,a,r;const s=this,{nodes:c,nodeSize:v,rankdir:f,combos:g,begin:_,radial:b,comboEdges:x=[],vedges:S=[]}=s;if(!c)return;const A=s.edges||[],E=new Nd({multigraph:!0,compound:!0});s.nodeMap={};const T={};c.forEach(X=>{s.nodeMap[X.id]=X,X.comboId&&(T[X.comboId]=T[X.comboId]||[],T[X.comboId].push(X.id))});let I=[];const R={};!((t=s.nodeOrder)===null||t===void 0)&&t.length?(s.nodeOrder.forEach(X=>{R[X]=!0,I.push(s.nodeMap[X])}),c.forEach(X=>{R[X.id]||I.push(X)})):I=c;let U;v?nA(v)?U=()=>v:U=()=>[v,v]:U=X=>X.size?nA(X.size)?X.size:tP(X.size)?[X.size.width||40,X.size.height||40]:[X.size,X.size]:[40,40];const D=rA(s.ranksep,50,s.ranksepFunc),L=rA(s.nodesep,50,s.nodesepFunc);let W=L,H=D;(f==="LR"||f==="RL")&&(W=D,H=L),E.setDefaultEdgeLabel(()=>({})),E.setGraph(s);const B={};this.sortByCombo&&g&&g.forEach(X=>{if(B[X.id]=X,X.collapsed){const ee=U(X),ue=H(X),ae=W(X),we=ee[0]+2*ae,je=ee[1]+2*ue;E.setNode(X.id,{width:we,height:je})}X.parentId&&(B[X.parentId]||E.setNode(X.parentId,{}),E.setParent(X.id,X.parentId))}),I.filter(X=>X.layout!==!1).forEach(X=>{const ee=U(X),ue=H(X),ae=W(X),we=ee[0]+2*ae,je=ee[1]+2*ue,Te=X.layer;Kg(Te)?E.setNode(X.id,{width:we,height:je,layer:Te}):E.setNode(X.id,{width:we,height:je}),this.sortByCombo&&X.comboId&&(B[X.comboId]||(B[X.comboId]={id:X.comboId},E.setNode(X.comboId,{})),E.setParent(X.id,X.comboId))}),A.forEach(X=>{const ee=av(X,"source"),ue=av(X,"target");this.layoutNode(ee)&&this.layoutNode(ue)&&E.setEdge(ee,ue,{weight:X.weight||1})}),(n=x==null?void 0:x.concat(S||[]))===null||n===void 0||n.forEach(X=>{var ee,ue;const{source:ae,target:we}=X,je=!((ee=B[ae])===null||ee===void 0)&&ee.collapsed?[ae]:T[ae]||[ae],Te=!((ue=B[we])===null||ue===void 0)&&ue.collapsed?[we]:T[we]||[we];je.forEach(Me=>{Te.forEach(Ne=>{E.setEdge(Me,Ne,{weight:X.weight||1})})})});let F;!((a=s.preset)===null||a===void 0)&&a.nodes&&(F=new Nd({multigraph:!0,compound:!0}),s.preset.nodes.forEach(X=>{F==null||F.setNode(X.id,X)})),xJ.layout(E,{prevGraph:F,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:!!s.nodeOrder,nodeOrder:s.nodeOrder});const q=[0,0];if(_){let X=1/0,ee=1/0;E.nodes().forEach(ue=>{const ae=E.node(ue);X>ae.x&&(X=ae.x),ee>ae.y&&(ee=ae.y)}),E.edges().forEach(ue=>{var ae;(ae=E.edge(ue).points)===null||ae===void 0||ae.forEach(je=>{X>je.x&&(X=je.x),ee>je.y&&(ee=je.y)})}),q[0]=_[0]-X,q[1]=_[1]-ee}const K=f==="LR"||f==="RL";if(b){const{focusNode:X,ranksep:ee,getRadialPos:ue}=this,ae=hK(X)?X:X==null?void 0:X.id,we=ae?(r=E.node(ae))===null||r===void 0?void 0:r._rank:0,je=[],Te=K?"y":"x",Me=K?"height":"width";let Ne=1/0,rt=-1/0;E.nodes().forEach(me=>{const Le=E.node(me);if(!s.nodeMap[me])return;const Ye=L(s.nodeMap[me]);if(we===0)je[Le._rank]||(je[Le._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),je[Le._rank].nodes.push(me),je[Le._rank].totalWidth+=Ye*2+Le[Me],je[Le._rank].maxSize<Math.max(Le.width,Le.height)&&(je[Le._rank].maxSize=Math.max(Le.width,Le.height));else{const Ft=Le._rank-we;if(Ft===0)je[Ft]||(je[Ft]={nodes:[],totalWidth:0,maxSize:-1/0}),je[Ft].nodes.push(me),je[Ft].totalWidth+=Ye*2+Le[Me],je[Ft].maxSize<Math.max(Le.width,Le.height)&&(je[Ft].maxSize=Math.max(Le.width,Le.height));else{const Qt=Math.abs(Ft);je[Qt]||(je[Qt]={left:[],right:[],totalWidth:0,maxSize:-1/0}),je[Qt].totalWidth+=Ye*2+Le[Me],je[Qt].maxSize<Math.max(Le.width,Le.height)&&(je[Qt].maxSize=Math.max(Le.width,Le.height)),Ft<0?je[Qt].left.push(me):je[Qt].right.push(me)}}const Ot=Le[Te]-Le[Me]/2-Ye,bt=Le[Te]+Le[Me]/2+Ye;Ot<Ne&&(Ne=Ot),bt>rt&&(rt=bt)});let tt=ee||50;const Be={},lt=(rt-Ne)/.9,St=[(Ne+rt-lt)*.5,(Ne+rt+lt)*.5],He=(me,Le,Ye=-1/0,Ot=[0,1])=>{let bt=Ye;return me.forEach(Ft=>{const Qt=E.node(Ft);Be[Ft]=Le;const{x:on,y:Wt}=ue(Qt[Te],St,lt,Le,Ot);if(!s.nodeMap[Ft])return;s.nodeMap[Ft].x=on+q[0],s.nodeMap[Ft].y=Wt+q[1],s.nodeMap[Ft]._order=Qt._order;const nt=D(s.nodeMap[Ft]);bt<nt&&(bt=nt)}),bt};let Jt=!0;const Fe=0;je.forEach(me=>{var Le,Ye,Ot,bt,Ft,Qt,on;if(!(!((Le=me==null?void 0:me.nodes)===null||Le===void 0)&&Le.length)&&!(!((Ye=me==null?void 0:me.left)===null||Ye===void 0)&&Ye.length)&&!(!((Ot=me==null?void 0:me.right)===null||Ot===void 0)&&Ot.length))return;if(Jt&&me.nodes.length===1){const nt=me.nodes[0];if(!s.nodeMap[nt])return;s.nodeMap[nt].x=q[0],s.nodeMap[nt].y=q[1],Be[me.nodes[0]]=0,tt=D(s.nodeMap[nt]),Jt=!1;return}tt=Math.max(tt,me.totalWidth/(2*Math.PI));let Wt=-1/0;if(we===0||!((bt=me.nodes)===null||bt===void 0)&&bt.length)Wt=He(me.nodes,tt,Wt,[0,1]);else{const nt=((Ft=me.left)===null||Ft===void 0?void 0:Ft.length)/(((Qt=me.left)===null||Qt===void 0?void 0:Qt.length)+((on=me.right)===null||on===void 0?void 0:on.length));Wt=He(me.left,tt,Wt,[0,nt]),Wt=He(me.right,tt,Wt,[nt+.05,1])}tt+=Wt,Jt=!1,Fe-me.maxSize}),E.edges().forEach(me=>{var Le,Ye,Ot;const bt=E.edge(me),Ft=A.findIndex(Qt=>{const on=av(Qt,"source"),Wt=av(Qt,"target");return on===me.v&&Wt===me.w});if(!(Ft<=-1)&&s.edgeLabelSpace&&s.controlPoints&&A[Ft].type!=="loop"){const Qt=Te==="x"?"y":"x",on=(Le=bt==null?void 0:bt.points)===null||Le===void 0?void 0:Le.slice(1,bt.points.length-1),Wt=[],nt=(Ye=E.node(me.v))===null||Ye===void 0?void 0:Ye[Qt],sn=nt-((Ot=E.node(me.w))===null||Ot===void 0?void 0:Ot[Qt]),We=Be[me.v],yn=We-Be[me.w];on==null||on.forEach(Kn=>{const te=(Kn[Qt]-nt)/sn*yn+We,Gn=ue(Kn[Te],St,lt,te);Wt.push({x:Gn.x+q[0],y:Gn.y+q[1]})}),A[Ft].controlPoints=Wt}})}else{const X=new Set,ue=f==="BT"||f==="RL"?(Te,Me)=>Me-Te:(Te,Me)=>Te-Me;E.nodes().forEach(Te=>{const Me=E.node(Te);if(!Me)return;let Ne=this.nodeMap[Te];Ne||(Ne=g==null?void 0:g.find(rt=>rt.id===Te)),Ne&&(Ne.x=Me.x+q[0],Ne.y=Me.y+q[1],Ne._order=Me._order,X.add(K?Ne.x:Ne.y))});const ae=Array.from(X).sort(ue),we=K?(Te,Me)=>Te.x!==Me.x:(Te,Me)=>Te.y!==Me.y,je=K?(Te,Me,Ne)=>{const rt=Math.max(Me.y,Ne.y),tt=Math.min(Me.y,Ne.y);return Te.filter(Be=>Be.y<=rt&&Be.y>=tt)}:(Te,Me,Ne)=>{const rt=Math.max(Me.x,Ne.x),tt=Math.min(Me.x,Ne.x);return Te.filter(Be=>Be.x<=rt&&Be.x>=tt)};E.edges().forEach(Te=>{var Me;const Ne=E.edge(Te),rt=A.findIndex(tt=>{const Be=av(tt,"source"),lt=av(tt,"target");return Be===Te.v&<===Te.w});if(!(rt<=-1)&&s.edgeLabelSpace&&s.controlPoints&&A[rt].type!=="loop"){(Me=Ne==null?void 0:Ne.points)===null||Me===void 0||Me.forEach(lt=>{lt.x+=q[0],lt.y+=q[1]});const tt=s.nodeMap[Te.v],Be=s.nodeMap[Te.w];A[rt].controlPoints=AJ(Ne==null?void 0:Ne.points,tt,Be,ae,K,we,je)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:c,edges:A}}getRadialPos(t,n,a,r,s=[0,1]){let c=(t-n[0])/a;c=c*(s[1]-s[0])+s[0];const v=c*2*Math.PI;return{x:Math.cos(v)*r,y:Math.sin(v)*r}}getType(){return"dagre"}}const AJ=(e,t,n,a,r,s,c)=>{let v=(e==null?void 0:e.slice(1,e.length-1))||[];if(t&&n){let{x:f,y:g}=t,{x:_,y:b}=n;if(r&&(f=t.y,g=t.x,_=n.y,b=n.x),b!==g&&f!==_){const x=a.indexOf(g),S=a[x+1];if(S){const T=v[0],I=r?{x:(g+S)/2,y:(T==null?void 0:T.y)||_}:{x:(T==null?void 0:T.x)||_,y:(g+S)/2};(!T||s(T,I))&&v.unshift(I)}const A=a.indexOf(b),E=Math.abs(A-x);if(E===1)v=c(v,t,n),v.length||v.push(r?{x:(g+b)/2,y:f}:{x:f,y:(g+b)/2});else if(E>1){const T=a[A-1];if(T){const I=v[v.length-1],R=r?{x:(b+T)/2,y:(I==null?void 0:I.y)||_}:{x:(I==null?void 0:I.x)||f,y:(b+T)/2};(!I||s(I,R))&&v.push(R)}}}}return v};var MA,kA,TA,NA;(function(e){e[e.META=0]="META",e[e.NODE=1]="NODE",e[e.BRIDGE=2]="BRIDGE"})(MA||(MA={})),(function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE",e[e.UNSPECIFIED=2]="UNSPECIFIED"})(kA||(kA={})),(function(e){e[e.META=0]="META",e[e.CORE=1]="CORE",e[e.BRIDGE=2]="BRIDGE"})(TA||(TA={})),(function(e){e[e.META=0]="META",e[e.OP=1]="OP",e[e.SERIES=2]="SERIES"})(NA||(NA={}));var cg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $E(e,t){return e(t={exports:{}},t.exports),t.exports}var MJ=function(){this.__data__=[],this.size=0},Gv=function(e,t){return e===t||e!=e&&t!=t},A_=function(e,t){for(var n=e.length;n--;)if(Gv(e[n][0],t))return n;return-1},kJ=Array.prototype.splice,TJ=function(e){var t=this.__data__,n=A_(t,e);return!(n<0)&&(n==t.length-1?t.pop():kJ.call(t,n,1),--this.size,!0)},NJ=function(e){var t=this.__data__,n=A_(t,e);return n<0?void 0:t[n][1]},PJ=function(e){return A_(this.__data__,e)>-1},CJ=function(e,t){var n=this.__data__,a=A_(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this};function cv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}cv.prototype.clear=MJ,cv.prototype.delete=TJ,cv.prototype.get=NJ,cv.prototype.has=PJ,cv.prototype.set=CJ;var M_=cv,RJ=function(){this.__data__=new M_,this.size=0},jJ=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},DJ=function(e){return this.__data__.get(e)},IJ=function(e){return this.__data__.has(e)},yP=typeof cg=="object"&&cg&&cg.Object===Object&&cg,LJ=typeof self=="object"&&self&&self.Object===Object&&self,Au=yP||LJ||Function("return this")(),$s=Au.Symbol,gP=Object.prototype,$J=gP.hasOwnProperty,FJ=gP.toString,mm=$s?$s.toStringTag:void 0,BJ=function(e){var t=$J.call(e,mm),n=e[mm];try{e[mm]=void 0;var a=!0}catch{}var r=FJ.call(e);return a&&(t?e[mm]=n:delete e[mm]),r},VJ=Object.prototype.toString,UJ=function(e){return VJ.call(e)},PA=$s?$s.toStringTag:void 0,ep=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":PA&&PA in Object(e)?BJ(e):UJ(e)},jl=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},CA,ty=function(e){if(!jl(e))return!1;var t=ep(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},F1=Au["__core-js_shared__"],RA=(CA=/[^.]+$/.exec(F1&&F1.keys&&F1.keys.IE_PROTO||""))?"Symbol(src)_1."+CA:"",WJ=function(e){return!!RA&&RA in e},GJ=Function.prototype.toString,ch=function(e){if(e!=null){try{return GJ.call(e)}catch{}try{return e+""}catch{}}return""},zJ=/^\[object .+?Constructor\]$/,HJ=Function.prototype,XJ=Object.prototype,qJ=HJ.toString,YJ=XJ.hasOwnProperty,KJ=RegExp("^"+qJ.call(YJ).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZJ=function(e){return!(!jl(e)||WJ(e))&&(ty(e)?KJ:zJ).test(ch(e))},JJ=function(e,t){return e==null?void 0:e[t]},dh=function(e,t){var n=JJ(e,t);return ZJ(n)?n:void 0},Vm=dh(Au,"Map"),Um=dh(Object,"create"),QJ=function(){this.__data__=Um?Um(null):{},this.size=0},eQ=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},tQ=Object.prototype.hasOwnProperty,nQ=function(e){var t=this.__data__;if(Um){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return tQ.call(t,e)?t[e]:void 0},rQ=Object.prototype.hasOwnProperty,oQ=function(e){var t=this.__data__;return Um?t[e]!==void 0:rQ.call(t,e)},iQ=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Um&&t===void 0?"__lodash_hash_undefined__":t,this};function dv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}dv.prototype.clear=QJ,dv.prototype.delete=eQ,dv.prototype.get=nQ,dv.prototype.has=oQ,dv.prototype.set=iQ;var jA=dv,aQ=function(){this.size=0,this.__data__={hash:new jA,map:new(Vm||M_),string:new jA}},lQ=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},k_=function(e,t){var n=e.__data__;return lQ(t)?n[typeof t=="string"?"string":"hash"]:n.map},sQ=function(e){var t=k_(this,e).delete(e);return this.size-=t?1:0,t},uQ=function(e){return k_(this,e).get(e)},cQ=function(e){return k_(this,e).has(e)},dQ=function(e,t){var n=k_(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this};function fv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}fv.prototype.clear=aQ,fv.prototype.delete=sQ,fv.prototype.get=uQ,fv.prototype.has=cQ,fv.prototype.set=dQ;var T_=fv,fQ=function(e,t){var n=this.__data__;if(n instanceof M_){var a=n.__data__;if(!Vm||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new T_(a)}return n.set(e,t),this.size=n.size,this};function pv(e){var t=this.__data__=new M_(e);this.size=t.size}pv.prototype.clear=RJ,pv.prototype.delete=jJ,pv.prototype.get=DJ,pv.prototype.has=IJ,pv.prototype.set=fQ;var Ev=pv,FE=function(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e},Jg=(function(){try{var e=dh(Object,"defineProperty");return e({},"",{}),e}catch{}})(),N_=function(e,t,n){t=="__proto__"&&Jg?Jg(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},pQ=Object.prototype.hasOwnProperty,P_=function(e,t,n){var a=e[t];pQ.call(e,t)&&Gv(a,n)&&(n!==void 0||t in e)||N_(e,t,n)},ny=function(e,t,n,a){var r=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var v=t[s],f=void 0;f===void 0&&(f=e[v]),r?N_(n,v,f):P_(n,v,f)}return n},hQ=function(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a},Su=function(e){return e!=null&&typeof e=="object"},DA=function(e){return Su(e)&&ep(e)=="[object Arguments]"},_P=Object.prototype,vQ=_P.hasOwnProperty,mQ=_P.propertyIsEnumerable,Pv=DA((function(){return arguments})())?DA:function(e){return Su(e)&&vQ.call(e,"callee")&&!mQ.call(e,"callee")},Ci=Array.isArray,yQ=function(){return!1},th=$E((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n?Au.Buffer:void 0,s=(r?r.isBuffer:void 0)||yQ;e.exports=s})),gQ=/^(?:0|[1-9]\d*)$/,C_=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&gQ.test(e))&&e>-1&&e%1==0&&e<t},BE=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},ai={};ai["[object Float32Array]"]=ai["[object Float64Array]"]=ai["[object Int8Array]"]=ai["[object Int16Array]"]=ai["[object Int32Array]"]=ai["[object Uint8Array]"]=ai["[object Uint8ClampedArray]"]=ai["[object Uint16Array]"]=ai["[object Uint32Array]"]=!0,ai["[object Arguments]"]=ai["[object Array]"]=ai["[object ArrayBuffer]"]=ai["[object Boolean]"]=ai["[object DataView]"]=ai["[object Date]"]=ai["[object Error]"]=ai["[object Function]"]=ai["[object Map]"]=ai["[object Number]"]=ai["[object Object]"]=ai["[object RegExp]"]=ai["[object Set]"]=ai["[object String]"]=ai["[object WeakMap]"]=!1;var _Q=function(e){return Su(e)&&BE(e.length)&&!!ai[ep(e)]},R_=function(e){return function(t){return e(t)}},Cv=$E((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n&&yP.process,s=(function(){try{var c=a&&a.require&&a.require("util").types;return c||r&&r.binding&&r.binding("util")}catch{}})();e.exports=s})),IA=Cv&&Cv.isTypedArray,ry=IA?R_(IA):_Q,bQ=Object.prototype.hasOwnProperty,bP=function(e,t){var n=Ci(e),a=!n&&Pv(e),r=!n&&!a&&th(e),s=!n&&!a&&!r&&ry(e),c=n||a||r||s,v=c?hQ(e.length,String):[],f=v.length;for(var g in e)!t&&!bQ.call(e,g)||c&&(g=="length"||r&&(g=="offset"||g=="parent")||s&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||C_(g,f))||v.push(g);return v},wQ=Object.prototype,j_=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||wQ)},wP=function(e,t){return function(n){return e(t(n))}},EQ=wP(Object.keys,Object),OQ=Object.prototype.hasOwnProperty,VE=function(e){if(!j_(e))return EQ(e);var t=[];for(var n in Object(e))OQ.call(e,n)&&n!="constructor"&&t.push(n);return t},jd=function(e){return e!=null&&BE(e.length)&&!ty(e)},tp=function(e){return jd(e)?bP(e):VE(e)},xQ=function(e,t){return e&&ny(t,tp(t),e)},SQ=function(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t},AQ=Object.prototype.hasOwnProperty,MQ=function(e){if(!jl(e))return SQ(e);var t=j_(e),n=[];for(var a in e)(a!="constructor"||!t&&AQ.call(e,a))&&n.push(a);return n},fh=function(e){return jd(e)?bP(e,!0):MQ(e)},kQ=function(e,t){return e&&ny(t,fh(t),e)},EP=$E((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n?Au.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(c,v){if(v)return c.slice();var f=c.length,g=s?s(f):new c.constructor(f);return c.copy(g),g}})),OP=function(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t},xP=function(e,t){for(var n=-1,a=e==null?0:e.length,r=0,s=[];++n<a;){var c=e[n];t(c,n,e)&&(s[r++]=c)}return s},SP=function(){return[]},TQ=Object.prototype.propertyIsEnumerable,LA=Object.getOwnPropertySymbols,UE=LA?function(e){return e==null?[]:(e=Object(e),xP(LA(e),(function(t){return TQ.call(e,t)})))}:SP,NQ=function(e,t){return ny(e,UE(e),t)},WE=function(e,t){for(var n=-1,a=t.length,r=e.length;++n<a;)e[r+n]=t[n];return e},D_=wP(Object.getPrototypeOf,Object),AP=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)WE(t,UE(e)),e=D_(e);return t}:SP,PQ=function(e,t){return ny(e,AP(e),t)},MP=function(e,t,n){var a=t(e);return Ci(e)?a:WE(a,n(e))},Rw=function(e){return MP(e,tp,UE)},CQ=function(e){return MP(e,fh,AP)},jw=dh(Au,"DataView"),Dw=dh(Au,"Promise"),Ov=dh(Au,"Set"),Iw=dh(Au,"WeakMap"),RQ=ch(jw),jQ=ch(Vm),DQ=ch(Dw),IQ=ch(Ov),LQ=ch(Iw),Kp=ep;(jw&&Kp(new jw(new ArrayBuffer(1)))!="[object DataView]"||Vm&&Kp(new Vm)!="[object Map]"||Dw&&Kp(Dw.resolve())!="[object Promise]"||Ov&&Kp(new Ov)!="[object Set]"||Iw&&Kp(new Iw)!="[object WeakMap]")&&(Kp=function(e){var t=ep(e),n=t=="[object Object]"?e.constructor:void 0,a=n?ch(n):"";if(a)switch(a){case RQ:return"[object DataView]";case jQ:return"[object Map]";case DQ:return"[object Promise]";case IQ:return"[object Set]";case LQ:return"[object WeakMap]"}return t});var nh=Kp,$Q=Object.prototype.hasOwnProperty,FQ=function(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$Q.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Qg=Au.Uint8Array,GE=function(e){var t=new e.constructor(e.byteLength);return new Qg(t).set(new Qg(e)),t},BQ=function(e,t){var n=t?GE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},VQ=/\w*$/,UQ=function(e){var t=new e.constructor(e.source,VQ.exec(e));return t.lastIndex=e.lastIndex,t},$A=$s?$s.prototype:void 0,FA=$A?$A.valueOf:void 0,WQ=function(e){return FA?Object(FA.call(e)):{}},kP=function(e,t){var n=t?GE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},GQ=function(e,t,n){var a=e.constructor;switch(t){case"[object ArrayBuffer]":return GE(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return BQ(e,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 kP(e,n);case"[object Map]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return UQ(e);case"[object Set]":return new a;case"[object Symbol]":return WQ(e)}},BA=Object.create,TP=(function(){function e(){}return function(t){if(!jl(t))return{};if(BA)return BA(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),NP=function(e){return typeof e.constructor!="function"||j_(e)?{}:TP(D_(e))},zQ=function(e){return Su(e)&&nh(e)=="[object Map]"},VA=Cv&&Cv.isMap,HQ=VA?R_(VA):zQ,XQ=function(e){return Su(e)&&nh(e)=="[object Set]"},UA=Cv&&Cv.isSet,qQ=UA?R_(UA):XQ,Qo={};Qo["[object Arguments]"]=Qo["[object Array]"]=Qo["[object ArrayBuffer]"]=Qo["[object DataView]"]=Qo["[object Boolean]"]=Qo["[object Date]"]=Qo["[object Float32Array]"]=Qo["[object Float64Array]"]=Qo["[object Int8Array]"]=Qo["[object Int16Array]"]=Qo["[object Int32Array]"]=Qo["[object Map]"]=Qo["[object Number]"]=Qo["[object Object]"]=Qo["[object RegExp]"]=Qo["[object Set]"]=Qo["[object String]"]=Qo["[object Symbol]"]=Qo["[object Uint8Array]"]=Qo["[object Uint8ClampedArray]"]=Qo["[object Uint16Array]"]=Qo["[object Uint32Array]"]=!0,Qo["[object Error]"]=Qo["[object Function]"]=Qo["[object WeakMap]"]=!1;var PP=function e(t,n,a,r,s,c){var v,f=1&n,g=2&n,_=4&n;if(v!==void 0)return v;if(!jl(t))return t;var b=Ci(t);if(b){if(v=FQ(t),!f)return OP(t,v)}else{var x=nh(t),S=x=="[object Function]"||x=="[object GeneratorFunction]";if(th(t))return EP(t,f);if(x=="[object Object]"||x=="[object Arguments]"||S&&!s){if(v=g||S?{}:NP(t),!f)return g?PQ(t,kQ(v,t)):NQ(t,xQ(v,t))}else{if(!Qo[x])return s?t:{};v=GQ(t,x,f)}}c||(c=new Ev);var A=c.get(t);if(A)return A;c.set(t,v),qQ(t)?t.forEach((function(T){v.add(e(T,n,a,T,t,c))})):HQ(t)&&t.forEach((function(T,I){v.set(I,e(T,n,a,I,t,c))}));var E=b?void 0:(_?g?CQ:Rw:g?fh:tp)(t);return FE(E||t,(function(T,I){E&&(T=t[I=T]),P_(v,I,e(T,n,a,I,t,c))})),v},YQ=function(e){return PP(e,4)},zE=function(e){return function(){return e}},HE=(function(e){return function(t,n,a){for(var r=-1,s=Object(t),c=a(t),v=c.length;v--;){var f=c[++r];if(n(s[f],f,s)===!1)break}return t}})(),XE=function(e,t){return e&&HE(e,t,tp)},I_=(function(e,t){return function(n,a){if(n==null)return n;if(!jd(n))return e(n,a);for(var r=n.length,s=-1,c=Object(n);++s<r&&a(c[s],s,c)!==!1;);return n}})(XE),ph=function(e){return e},CP=function(e){return typeof e=="function"?e:ph},RP=function(e,t){return(Ci(e)?FE:I_)(e,CP(t))},jP=RP,KQ=function(e,t){var n=[];return I_(e,(function(a,r,s){t(a,r,s)&&n.push(a)})),n},ZQ=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},JQ=function(e){return this.__data__.has(e)};function Og(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new T_;++t<n;)this.add(e[t])}Og.prototype.add=Og.prototype.push=ZQ,Og.prototype.has=JQ;var DP=Og,QQ=function(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1},IP=function(e,t){return e.has(t)},LP=function(e,t,n,a,r,s){var c=1&n,v=e.length,f=t.length;if(v!=f&&!(c&&f>v))return!1;var g=s.get(e),_=s.get(t);if(g&&_)return g==t&&_==e;var b=-1,x=!0,S=2&n?new DP:void 0;for(s.set(e,t),s.set(t,e);++b<v;){var A=e[b],E=t[b];if(a)var T=c?a(E,A,b,t,e,s):a(A,E,b,e,t,s);if(T!==void 0){if(T)continue;x=!1;break}if(S){if(!QQ(t,(function(I,R){if(!IP(S,R)&&(A===I||r(A,I,n,a,s)))return S.push(R)}))){x=!1;break}}else if(A!==E&&!r(A,E,n,a,s)){x=!1;break}}return s.delete(e),s.delete(t),x},eee=function(e){var t=-1,n=Array(e.size);return e.forEach((function(a,r){n[++t]=[r,a]})),n},qE=function(e){var t=-1,n=Array(e.size);return e.forEach((function(a){n[++t]=a})),n},WA=$s?$s.prototype:void 0,B1=WA?WA.valueOf:void 0,tee=function(e,t,n,a,r,s,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Qg(e),new Qg(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Gv(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var v=eee;case"[object Set]":var f=1&a;if(v||(v=qE),e.size!=t.size&&!f)return!1;var g=c.get(e);if(g)return g==t;a|=2,c.set(e,t);var _=LP(v(e),v(t),a,r,s,c);return c.delete(e),_;case"[object Symbol]":if(B1)return B1.call(e)==B1.call(t)}return!1},nee=Object.prototype.hasOwnProperty,ree=function(e,t,n,a,r,s){var c=1&n,v=Rw(e),f=v.length;if(f!=Rw(t).length&&!c)return!1;for(var g=f;g--;){var _=v[g];if(!(c?_ in t:nee.call(t,_)))return!1}var b=s.get(e),x=s.get(t);if(b&&x)return b==t&&x==e;var S=!0;s.set(e,t),s.set(t,e);for(var A=c;++g<f;){var E=e[_=v[g]],T=t[_];if(a)var I=c?a(T,E,_,t,e,s):a(E,T,_,e,t,s);if(!(I===void 0?E===T||r(E,T,n,a,s):I)){S=!1;break}A||(A=_=="constructor")}if(S&&!A){var R=e.constructor,U=t.constructor;R==U||!("constructor"in e)||!("constructor"in t)||typeof R=="function"&&R instanceof R&&typeof U=="function"&&U instanceof U||(S=!1)}return s.delete(e),s.delete(t),S},GA=Object.prototype.hasOwnProperty,oee=function(e,t,n,a,r,s){var c=Ci(e),v=Ci(t),f=c?"[object Array]":nh(e),g=v?"[object Array]":nh(t),_=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",b=(g=g=="[object Arguments]"?"[object Object]":g)=="[object Object]",x=f==g;if(x&&th(e)){if(!th(t))return!1;c=!0,_=!1}if(x&&!_)return s||(s=new Ev),c||ry(e)?LP(e,t,n,a,r,s):tee(e,t,f,n,a,r,s);if(!(1&n)){var S=_&&GA.call(e,"__wrapped__"),A=b&&GA.call(t,"__wrapped__");if(S||A){var E=S?e.value():e,T=A?t.value():t;return s||(s=new Ev),r(E,T,n,a,s)}}return!!x&&(s||(s=new Ev),ree(e,t,n,a,r,s))},$P=function e(t,n,a,r,s){return t===n||(t==null||n==null||!Su(t)&&!Su(n)?t!=t&&n!=n:oee(t,n,a,r,e,s))},iee=function(e,t,n,a){var r=n.length,s=r;if(e==null)return!s;for(e=Object(e);r--;){var c=n[r];if(c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++r<s;){var v=(c=n[r])[0],f=e[v],g=c[1];if(c[2]){if(f===void 0&&!(v in e))return!1}else{var _=new Ev,b;if(!(b===void 0?$P(g,f,3,a,_):b))return!1}}return!0},FP=function(e){return e==e&&!jl(e)},aee=function(e){for(var t=tp(e),n=t.length;n--;){var a=t[n],r=e[a];t[n]=[a,r,FP(r)]}return t},BP=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},lee=function(e){var t=aee(e);return t.length==1&&t[0][2]?BP(t[0][0],t[0][1]):function(n){return n===e||iee(n,e,t)}},rh=function(e){return typeof e=="symbol"||Su(e)&&ep(e)=="[object Symbol]"},see=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uee=/^\w*$/,YE=function(e,t){if(Ci(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!rh(e))||uee.test(e)||!see.test(e)||t!=null&&e in Object(t)};function KE(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var a=arguments,r=t?t.apply(this,a):a[0],s=n.cache;if(s.has(r))return s.get(r);var c=e.apply(this,a);return n.cache=s.set(r,c)||s,c};return n.cache=new(KE.Cache||T_),n}KE.Cache=T_;var cee=KE,dee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fee=/\\(\\)?/g,pee=(function(e){var t=cee(e,(function(a){return n.size===500&&n.clear(),a})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dee,(function(n,a,r,s){t.push(r?s.replace(fee,"$1"):a||n)})),t})),xv=function(e,t){for(var n=-1,a=e==null?0:e.length,r=Array(a);++n<a;)r[n]=t(e[n],n,e);return r},zA=$s?$s.prototype:void 0,HA=zA?zA.toString:void 0,hee=function e(t){if(typeof t=="string")return t;if(Ci(t))return xv(t,e)+"";if(rh(t))return HA?HA.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},VP=function(e){return e==null?"":hee(e)},L_=function(e,t){return Ci(e)?e:YE(e,t)?[e]:pee(VP(e))},oy=function(e){if(typeof e=="string"||rh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},$_=function(e,t){for(var n=0,a=(t=L_(t,e)).length;e!=null&&n<a;)e=e[oy(t[n++])];return n&&n==a?e:void 0},vee=function(e,t,n){var a=e==null?void 0:$_(e,t);return a===void 0?n:a},mee=function(e,t){return e!=null&&t in Object(e)},UP=function(e,t,n){for(var a=-1,r=(t=L_(t,e)).length,s=!1;++a<r;){var c=oy(t[a]);if(!(s=e!=null&&n(e,c)))break;e=e[c]}return s||++a!=r?s:!!(r=e==null?0:e.length)&&BE(r)&&C_(c,r)&&(Ci(e)||Pv(e))},WP=function(e,t){return e!=null&&UP(e,t,mee)},yee=function(e,t){return YE(e)&&FP(t)?BP(oy(e),t):function(n){var a=vee(n,e);return a===void 0&&a===t?WP(n,e):$P(t,a,3)}},GP=function(e){return function(t){return t==null?void 0:t[e]}},gee=function(e){return function(t){return $_(t,e)}},_ee=function(e){return YE(e)?GP(oy(e)):gee(e)},Dd=function(e){return typeof e=="function"?e:e==null?ph:typeof e=="object"?Ci(e)?yee(e[0],e[1]):lee(e):_ee(e)},zP=function(e,t){return(Ci(e)?xP:KQ)(e,Dd(t))},bee=Object.prototype.hasOwnProperty,wee=function(e,t){return e!=null&&bee.call(e,t)},HP=function(e,t){return e!=null&&UP(e,t,wee)},Eee=Object.prototype.hasOwnProperty,Oee=function(e){if(e==null)return!0;if(jd(e)&&(Ci(e)||typeof e=="string"||typeof e.splice=="function"||th(e)||ry(e)||Pv(e)))return!e.length;var t=nh(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(j_(e))return!VE(e).length;for(var n in e)if(Eee.call(e,n))return!1;return!0},XP=function(e){return e===void 0},qP=function(e,t){var n=-1,a=jd(e)?Array(e.length):[];return I_(e,(function(r,s,c){a[++n]=t(r,s,c)})),a},YP=function(e,t){return(Ci(e)?xv:qP)(e,Dd(t))},xee=function(e,t,n,a){var r=-1,s=e==null?0:e.length;for(a&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n},See=function(e,t,n,a,r){return r(e,(function(s,c,v){n=a?(a=!1,s):t(n,s,c,v)})),n},KP=function(e,t,n){var a=Ci(e)?xee:See,r=arguments.length<3;return a(e,Dd(t),n,r,I_)},Aee=function(e){return typeof e=="string"||!Ci(e)&&Su(e)&&ep(e)=="[object String]"},Mee=GP("length"),kee=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Tee=function(e){return kee.test(e)},Nee="[\\ud800-\\udfff]",Lw="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",$w="\\ud83c[\\udffb-\\udfff]",ZP="[^\\ud800-\\udfff]",JP="(?:\\ud83c[\\udde6-\\uddff]){2}",QP="[\\ud800-\\udbff][\\udc00-\\udfff]",XA="(?:"+Lw+"|"+$w+")?",Pee="[\\ufe0e\\ufe0f]?"+XA+("(?:\\u200d(?:"+[ZP,JP,QP].join("|")+")[\\ufe0e\\ufe0f]?"+XA+")*"),Cee="(?:"+[ZP+Lw+"?",Lw,JP,QP,Nee].join("|")+")",qA=RegExp($w+"(?="+$w+")|"+Cee+Pee,"g"),Ree=function(e){for(var t=qA.lastIndex=0;qA.test(e);)++t;return t},jee=function(e){return Tee(e)?Ree(e):Mee(e)},Dee=function(e){if(e==null)return 0;if(jd(e))return Aee(e)?jee(e):e.length;var t=nh(e);return t=="[object Map]"||t=="[object Set]"?e.size:VE(e).length},Iee=function(e,t,n){var a=Ci(e),r=a||th(e)||ry(e);if(t=Dd(t),n==null){var s=e&&e.constructor;n=r?a?new s:[]:jl(e)&&ty(s)?TP(D_(e)):{}}return(r?FE:XE)(e,(function(c,v,f){return t(n,c,v,f)})),n},YA=$s?$s.isConcatSpreadable:void 0,Lee=function(e){return Ci(e)||Pv(e)||!!(YA&&e&&e[YA])},ZE=function(t,n,a,r,s){var c=-1,v=t.length;for(a||(a=Lee),s||(s=[]);++c<v;){var f=t[c];a(f)?WE(s,f):r||(s[s.length]=f)}return s},$ee=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},KA=Math.max,eC=function(e,t,n){return t=KA(t===void 0?e.length-1:t,0),function(){for(var a=arguments,r=-1,s=KA(a.length-t,0),c=Array(s);++r<s;)c[r]=a[t+r];r=-1;for(var v=Array(t+1);++r<t;)v[r]=a[r];return v[t]=n(c),$ee(e,this,v)}},Fee=Jg?function(e,t){return Jg(e,"toString",{configurable:!0,enumerable:!1,value:zE(t),writable:!0})}:ph,Bee=Date.now,tC=(function(e){var t=0,n=0;return function(){var a=Bee(),r=16-(a-n);if(n=a,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}})(Fee),F_=function(e,t){return tC(eC(e,t,ph),e+"")},nC=function(e,t,n,a){for(var r=e.length,s=n+-1;++s<r;)if(t(e[s],s,e))return s;return-1},Vee=function(e){return e!=e},Uee=function(e,t,n){for(var a=n-1,r=e.length;++a<r;)if(e[a]===t)return a;return-1},Wee=function(e,t,n){return t==t?Uee(e,t,n):nC(e,Vee,n)},Gee=function(e,t){return!!(e!=null&&e.length)&&Wee(e,t,0)>-1},zee=function(){},Hee=Ov&&1/qE(new Ov([,-0]))[1]==1/0?function(e){return new Ov(e)}:zee,Xee=function(e,t,n){var a=-1,r=Gee,s=e.length,c=!0,v=[],f=v;if(s>=200){var g=Hee(e);if(g)return qE(g);c=!1,r=IP,f=new DP}else f=v;e:for(;++a<s;){var _=e[a],b=_;if(_=_!==0?_:0,c&&b==b){for(var x=f.length;x--;)if(f[x]===b)continue e;v.push(_)}else r(f,b,n)||(f!==v&&f.push(b),v.push(_))}return v},rC=function(e){return Su(e)&&jd(e)},qee=F_((function(e){return Xee(ZE(e,1,rC,!0))})),Yee=function(e,t){return xv(t,(function(n){return e[n]}))},e_,oC=function(e){return e==null?[]:Yee(e,tp(e))};try{e_={clone:YQ,constant:zE,each:jP,filter:zP,has:HP,isArray:Ci,isEmpty:Oee,isFunction:ty,isUndefined:XP,keys:tp,map:YP,reduce:KP,size:Dee,transform:Iee,union:qee,values:oC}}catch{}e_||(e_=window._);var kn=e_,JE=Hr;function Hr(e){this._isDirected=!kn.has(e,"directed")||e.directed,this._isMultigraph=!!kn.has(e,"multigraph")&&e.multigraph,this._isCompound=!!kn.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=kn.constant(void 0),this._defaultEdgeLabelFn=kn.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 ZA(e,t){e[t]?e[t]++:e[t]=1}function JA(e,t){--e[t]||delete e[t]}function Om(e,t,n,a){var r=""+t,s=""+n;if(!e&&r>s){var c=r;r=s,s=c}return r+""+s+""+(kn.isUndefined(a)?"\0":a)}function Kee(e,t,n,a){var r=""+t,s=""+n;if(!e&&r>s){var c=r;r=s,s=c}var v={v:r,w:s};return a&&(v.name=a),v}function V1(e,t){return Om(e,t.v,t.w,t.name)}Hr.prototype._nodeCount=0,Hr.prototype._edgeCount=0,Hr.prototype.isDirected=function(){return this._isDirected},Hr.prototype.isMultigraph=function(){return this._isMultigraph},Hr.prototype.isCompound=function(){return this._isCompound},Hr.prototype.setGraph=function(e){return this._label=e,this},Hr.prototype.graph=function(){return this._label},Hr.prototype.setDefaultNodeLabel=function(e){return kn.isFunction(e)||(e=kn.constant(e)),this._defaultNodeLabelFn=e,this},Hr.prototype.nodeCount=function(){return this._nodeCount},Hr.prototype.nodes=function(){return kn.keys(this._nodes)},Hr.prototype.sources=function(){var e=this;return kn.filter(this.nodes(),(function(t){return kn.isEmpty(e._in[t])}))},Hr.prototype.sinks=function(){var e=this;return kn.filter(this.nodes(),(function(t){return kn.isEmpty(e._out[t])}))},Hr.prototype.setNodes=function(e,t){var n=arguments,a=this;return kn.each(e,(function(r){n.length>1?a.setNode(r,t):a.setNode(r)})),this},Hr.prototype.setNode=function(e,t){return kn.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},Hr.prototype.node=function(e){return this._nodes[e]},Hr.prototype.hasNode=function(e){return kn.has(this._nodes,e)},Hr.prototype.removeNode=function(e){var t=this;if(kn.has(this._nodes,e)){var n=function(a){t.removeEdge(t._edgeObjs[a])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],kn.each(this.children(e),(function(a){t.setParent(a)})),delete this._children[e]),kn.each(kn.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],kn.each(kn.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},Hr.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(kn.isUndefined(t))t="\0";else{for(var n=t+="";!kn.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},Hr.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},Hr.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!=="\0")return t}},Hr.prototype.children=function(e){if(kn.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return kn.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}},Hr.prototype.predecessors=function(e){var t=this._preds[e];if(t)return kn.keys(t)},Hr.prototype.successors=function(e){var t=this._sucs[e];if(t)return kn.keys(t)},Hr.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return kn.union(t,this.successors(e))},Hr.prototype.isLeaf=function(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0},Hr.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;kn.each(this._nodes,(function(s,c){e(c)&&t.setNode(c,s)})),kn.each(this._edgeObjs,(function(s){t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,n.edge(s))}));var a={};function r(s){var c=n.parent(s);return c===void 0||t.hasNode(c)?(a[s]=c,c):c in a?a[c]:r(c)}return this._isCompound&&kn.each(t.nodes(),(function(s){t.setParent(s,r(s))})),t},Hr.prototype.setDefaultEdgeLabel=function(e){return kn.isFunction(e)||(e=kn.constant(e)),this._defaultEdgeLabelFn=e,this},Hr.prototype.edgeCount=function(){return this._edgeCount},Hr.prototype.edges=function(){return kn.values(this._edgeObjs)},Hr.prototype.setPath=function(e,t){var n=this,a=arguments;return kn.reduce(e,(function(r,s){return a.length>1?n.setEdge(r,s,t):n.setEdge(r,s),s})),this},Hr.prototype.setEdge=function(){var e,t,n,a,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,t=s.w,n=s.name,arguments.length===2&&(a=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(a=arguments[2],r=!0)),e=""+e,t=""+t,kn.isUndefined(n)||(n=""+n);var c=Om(this._isDirected,e,t,n);if(kn.has(this._edgeLabels,c))return r&&(this._edgeLabels[c]=a),this;if(!kn.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=r?a:this._defaultEdgeLabelFn(e,t,n);var v=Kee(this._isDirected,e,t,n);return e=v.v,t=v.w,Object.freeze(v),this._edgeObjs[c]=v,ZA(this._preds[t],e),ZA(this._sucs[e],t),this._in[t][c]=v,this._out[e][c]=v,this._edgeCount++,this},Hr.prototype.edge=function(e,t,n){var a=arguments.length===1?V1(this._isDirected,arguments[0]):Om(this._isDirected,e,t,n);return this._edgeLabels[a]},Hr.prototype.hasEdge=function(e,t,n){var a=arguments.length===1?V1(this._isDirected,arguments[0]):Om(this._isDirected,e,t,n);return kn.has(this._edgeLabels,a)},Hr.prototype.removeEdge=function(e,t,n){var a=arguments.length===1?V1(this._isDirected,arguments[0]):Om(this._isDirected,e,t,n),r=this._edgeObjs[a];return r&&(e=r.v,t=r.w,delete this._edgeLabels[a],delete this._edgeObjs[a],JA(this._preds[t],e),JA(this._sucs[e],t),delete this._in[t][a],delete this._out[e][a],this._edgeCount--),this},Hr.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var a=kn.values(n);return t?kn.filter(a,(function(r){return r.v===t})):a}},Hr.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var a=kn.values(n);return t?kn.filter(a,(function(r){return r.w===t})):a}},Hr.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))};var QA={Graph:JE,version:"2.1.8"},Zee={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Jee(e),edges:Qee(e)};return kn.isUndefined(e.graph())||(t.value=kn.clone(e.graph())),t},read:function(e){var t=new JE(e.options).setGraph(e.value);return kn.each(e.nodes,(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)})),kn.each(e.edges,(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),t}};function Jee(e){return kn.map(e.nodes(),(function(t){var n=e.node(t),a=e.parent(t),r={v:t};return kn.isUndefined(n)||(r.value=n),kn.isUndefined(a)||(r.parent=a),r}))}function Qee(e){return kn.map(e.edges(),(function(t){var n=e.edge(t),a={v:t.v,w:t.w};return kn.isUndefined(t.name)||(a.name=t.name),kn.isUndefined(n)||(a.value=n),a}))}var ete=function(e){var t,n={},a=[];function r(s){kn.has(n,s)||(n[s]=!0,t.push(s),kn.each(e.successors(s),r),kn.each(e.predecessors(s),r))}return kn.each(e.nodes(),(function(s){t=[],r(s),t.length&&a.push(t)})),a},iC=Ps;function Ps(){this._arr=[],this._keyIndices={}}Ps.prototype.size=function(){return this._arr.length},Ps.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},Ps.prototype.has=function(e){return kn.has(this._keyIndices,e)},Ps.prototype.priority=function(e){var t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority},Ps.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Ps.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!kn.has(n,e)){var a=this._arr,r=a.length;return n[e]=r,a.push({key:e,priority:t}),this._decrease(r),!0}return!1},Ps.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},Ps.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},Ps.prototype._heapify=function(e){var t=this._arr,n=2*e,a=n+1,r=e;n<t.length&&(r=t[n].priority<t[r].priority?n:r,a<t.length&&(r=t[a].priority<t[r].priority?a:r),r!==e&&(this._swap(e,r),this._heapify(r)))},Ps.prototype._decrease=function(e){for(var t,n=this._arr,a=n[e].priority;e!==0&&!(n[t=e>>1].priority<a);)this._swap(e,t),e=t},Ps.prototype._swap=function(e,t){var n=this._arr,a=this._keyIndices,r=n[e],s=n[t];n[e]=s,n[t]=r,a[s.key]=e,a[r.key]=t};var aC=function(e,t,n,a){return(function(r,s,c,v){var f,g,_={},b=new iC,x=function(S){var A=S.v!==f?S.v:S.w,E=_[A],T=c(S),I=g.distance+T;if(T<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+S+" Weight: "+T);I<E.distance&&(E.distance=I,E.predecessor=f,b.decrease(A,I))};for(r.nodes().forEach((function(S){var A=S===s?0:Number.POSITIVE_INFINITY;_[S]={distance:A},b.add(S,A)}));b.size()>0&&(f=b.removeMin(),(g=_[f]).distance!==Number.POSITIVE_INFINITY);)v(f).forEach(x);return _})(e,String(t),n||tte,a||function(r){return e.outEdges(r)})},tte=kn.constant(1),nte=function(e,t,n){return kn.transform(e.nodes(),(function(a,r){a[r]=aC(e,r,t,n)}),{})},lC=function(e){var t=0,n=[],a={},r=[];function s(c){var v=a[c]={onStack:!0,lowlink:t,index:t++};if(n.push(c),e.successors(c).forEach((function(_){kn.has(a,_)?a[_].onStack&&(v.lowlink=Math.min(v.lowlink,a[_].index)):(s(_),v.lowlink=Math.min(v.lowlink,a[_].lowlink))})),v.lowlink===v.index){var f,g=[];do f=n.pop(),a[f].onStack=!1,g.push(f);while(c!==f);r.push(g)}}return e.nodes().forEach((function(c){kn.has(a,c)||s(c)})),r},rte=function(e){return kn.filter(lC(e),(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])}))},ote=function(e,t,n){return(function(a,r,s){var c={},v=a.nodes();return v.forEach((function(f){c[f]={},c[f][f]={distance:0},v.forEach((function(g){f!==g&&(c[f][g]={distance:Number.POSITIVE_INFINITY})})),s(f).forEach((function(g){var _=g.v===f?g.w:g.v,b=r(g);c[f][_]={distance:b,predecessor:f}}))})),v.forEach((function(f){var g=c[f];v.forEach((function(_){var b=c[_];v.forEach((function(x){var S=b[f],A=g[x],E=b[x],T=S.distance+A.distance;T<E.distance&&(E.distance=T,E.predecessor=A.predecessor)}))}))})),c})(e,t||ite,n||function(a){return e.outEdges(a)})},ite=kn.constant(1),U1=sC;function sC(e){var t={},n={},a=[];if(kn.each(e.sinks(),(function r(s){if(kn.has(n,s))throw new t_;kn.has(t,s)||(n[s]=!0,t[s]=!0,kn.each(e.predecessors(s),r),delete n[s],a.push(s))})),kn.size(t)!==e.nodeCount())throw new t_;return a}function t_(){}sC.CycleException=t_,t_.prototype=new Error;var eM=function(e,t,n){kn.isArray(t)||(t=[t]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),r=[],s={};return kn.each(t,(function(c){if(!e.hasNode(c))throw new Error("Graph does not have node: "+c);uC(e,c,n==="post",s,a,r)})),r};function uC(e,t,n,a,r,s){kn.has(a,t)||(a[t]=!0,n||s.push(t),kn.each(r(t),(function(c){uC(e,c,n,a,r,s)})),n&&s.push(t))}var n_,ate={Graph:QA.Graph,json:Zee,alg:{components:ete,dijkstra:aC,dijkstraAll:nte,findCycles:rte,floydWarshall:ote,isAcyclic:function(e){try{U1(e)}catch(t){if(t instanceof U1.CycleException)return!1;throw t}return!0},postorder:function(e,t){return eM(e,t,"post")},preorder:function(e,t){return eM(e,t,"pre")},prim:function(e,t){var n,a=new JE,r={},s=new iC;function c(f){var g=f.v===n?f.w:f.v,_=s.priority(g);if(_!==void 0){var b=t(f);b<_&&(r[g]=n,s.decrease(g,b))}}if(e.nodeCount()===0)return a;kn.each(e.nodes(),(function(f){s.add(f,Number.POSITIVE_INFINITY),a.setNode(f)})),s.decrease(e.nodes()[0],0);for(var v=!1;s.size()>0;){if(n=s.removeMin(),kn.has(r,n))a.setEdge(n,r[n]);else{if(v)throw new Error("Input graph is not connected: "+e);v=!0}e.nodeEdges(n).forEach(c)}return a},tarjan:lC,topsort:U1},version:QA.version};try{n_=ate}catch{}n_||(n_=window.graphlib);var yc=n_,lte=function(e){return PP(e,5)},Wm=function(e,t,n){if(!jl(n))return!1;var a=typeof t;return!!(a=="number"?jd(n)&&C_(t,n.length):a=="string"&&t in n)&&Gv(n[t],e)},cC=Object.prototype,ste=cC.hasOwnProperty,ute=F_((function(e,t){e=Object(e);var n=-1,a=t.length,r=a>2?t[2]:void 0;for(r&&Wm(t[0],t[1],r)&&(a=1);++n<a;)for(var s=t[n],c=fh(s),v=-1,f=c.length;++v<f;){var g=c[v],_=e[g];(_===void 0||Gv(_,cC[g])&&!ste.call(e,g))&&(e[g]=s[g])}return e})),cte=function(e){return function(t,n,a){var r=Object(t);if(!jd(t)){var s=Dd(n);t=tp(t),n=function(v){return s(r[v],v,r)}}var c=e(t,n,a);return c>-1?r[s?t[c]:c]:void 0}},dte=/^\s+|\s+$/g,fte=/^[-+]0x[0-9a-f]+$/i,pte=/^0b[01]+$/i,hte=/^0o[0-7]+$/i,vte=parseInt,mte=function(e){if(typeof e=="number")return e;if(rh(e))return NaN;if(jl(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=jl(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(dte,"");var n=pte.test(e);return n||hte.test(e)?vte(e.slice(2),n?2:8):fte.test(e)?NaN:+e},xg=function(e){return e?(e=mte(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},yte=function(e){var t=xg(e),n=t%1;return t==t?n?t-n:t:0},gte=Math.max,_te=cte((function(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var r=n==null?0:yte(n);return r<0&&(r=gte(a+r,0)),nC(e,Dd(t),r)})),dC=function(e){return e!=null&&e.length?ZE(e):[]},bte=function(e,t){return e==null?e:HE(e,CP(t),fh)},wte=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0},Ete=function(e,t){var n={};return t=Dd(t),XE(e,(function(a,r,s){N_(n,r,t(a,r,s))})),n},QE=function(e,t,n){for(var a=-1,r=e.length;++a<r;){var s=e[a],c=t(s);if(c!=null&&(v===void 0?c==c&&!rh(c):n(c,v)))var v=c,f=s}return f},Ote=function(e,t){return e>t},xte=function(e){return e&&e.length?QE(e,ph,Ote):void 0},Fw=function(e,t,n){(n!==void 0&&!Gv(e[t],n)||n===void 0&&!(t in e))&&N_(e,t,n)},Ste=Function.prototype,Ate=Object.prototype,fC=Ste.toString,Mte=Ate.hasOwnProperty,kte=fC.call(Object),Tte=function(e){if(!Su(e)||ep(e)!="[object Object]")return!1;var t=D_(e);if(t===null)return!0;var n=Mte.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&fC.call(n)==kte},tM=function(e,t){if((t!=="constructor"||typeof e[t]!="function")&&t!="__proto__")return e[t]},Nte=function(e){return ny(e,fh(e))},Pte=function(e,t,n,a,r,s,c){var v=tM(e,n),f=tM(t,n),g=c.get(f);if(g)Fw(e,n,g);else{var _=void 0,b=_===void 0;if(b){var x=Ci(f),S=!x&&th(f),A=!x&&!S&&ry(f);_=f,x||S||A?Ci(v)?_=v:rC(v)?_=OP(v):S?(b=!1,_=EP(f,!0)):A?(b=!1,_=kP(f,!0)):_=[]:Tte(f)||Pv(f)?(_=v,Pv(v)?_=Nte(v):jl(v)&&!ty(v)||(_=NP(f))):b=!1}b&&(c.set(f,_),r(_,f,a,s,c),c.delete(f)),Fw(e,n,_)}},Cte=function e(t,n,a,r,s){t!==n&&HE(n,(function(c,v){if(s||(s=new Ev),jl(c))Pte(t,n,v,a,e,r,s);else{var f=void 0;f===void 0&&(f=c),Fw(t,v,f)}}),fh)},Rte=(function(e){return F_((function(t,n){var a=-1,r=n.length,s=r>1?n[r-1]:void 0,c=r>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(r--,s):void 0,c&&Wm(n[0],n[1],c)&&(s=r<3?void 0:s,r=1),t=Object(t);++a<r;){var v=n[a];v&&e(t,v,a,s)}return t}))})((function(e,t,n){Cte(e,t,n)})),pC=function(e,t){return e<t},jte=function(e){return e&&e.length?QE(e,ph,pC):void 0},Dte=function(e,t){return e&&e.length?QE(e,Dd(t),pC):void 0},Ite=function(){return Au.Date.now()},Lte=function(e,t,n,a){if(!jl(e))return e;for(var r=-1,s=(t=L_(t,e)).length,c=s-1,v=e;v!=null&&++r<s;){var f=oy(t[r]),g=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(r!=c){var _=v[f];(g=void 0)==void 0&&(g=jl(_)?_:C_(t[r+1])?[]:{})}P_(v,f,g),v=v[f]}return e},$te=function(e,t,n){for(var a=-1,r=t.length,s={};++a<r;){var c=t[a],v=$_(e,c);n(v,c)&&Lte(s,L_(c,e),v)}return s},Fte=function(e,t){return $te(e,t,(function(n,a){return WP(e,a)}))},Bte=(function(e){return tC(eC(e,void 0,dC),e+"")})((function(e,t){return e==null?{}:Fte(e,t)})),Vte=Math.ceil,Ute=Math.max,Wte=function(e,t,n,a){for(var r=-1,s=Ute(Vte((t-e)/(n||1)),0),c=Array(s);s--;)c[++r]=e,e+=n;return c},Gte=(function(e){return function(t,n,a){return a&&typeof a!="number"&&Wm(t,n,a)&&(n=a=void 0),t=xg(t),n===void 0?(n=t,t=0):n=xg(n),a=a===void 0?t<n?1:-1:xg(a),Wte(t,n,a)}})(),zte=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},Hte=function(e,t){if(e!==t){var n=e!==void 0,a=e===null,r=e==e,s=rh(e),c=t!==void 0,v=t===null,f=t==t,g=rh(t);if(!v&&!g&&!s&&e>t||s&&c&&f&&!v&&!g||a&&c&&f||!n&&f||!r)return 1;if(!a&&!s&&!g&&e<t||g&&n&&r&&!a&&!s||v&&n&&r||!c&&r||!f)return-1}return 0},Xte=function(e,t,n){for(var a=-1,r=e.criteria,s=t.criteria,c=r.length,v=n.length;++a<c;){var f=Hte(r[a],s[a]);if(f)return a>=v?f:f*(n[a]=="desc"?-1:1)}return e.index-t.index},qte=function(e,t,n){t=t.length?xv(t,(function(s){return Ci(s)?function(c){return $_(c,s.length===1?s[0]:s)}:s})):[ph];var a=-1;t=xv(t,R_(Dd));var r=qP(e,(function(s,c,v){return{criteria:xv(t,(function(f){return f(s)})),index:++a,value:s}}));return zte(r,(function(s,c){return Xte(s,c,n)}))},Yte=F_((function(e,t){if(e==null)return[];var n=t.length;return n>1&&Wm(e,t[0],t[1])?t=[]:n>2&&Wm(t[0],t[1],t[2])&&(t=[t[0]]),qte(e,ZE(t),[])})),Kte=0,Zte=function(e){var t=++Kte;return VP(e)+t},Jte=function(e,t,n){for(var a=-1,r=e.length,s=t.length,c={};++a<r;){var v=a<s?t[a]:void 0;n(c,e[a],v)}return c},r_,Qte=function(e,t){return Jte(e||[],t||[],P_)};try{r_={cloneDeep:lte,constant:zE,defaults:ute,each:jP,filter:zP,find:_te,flatten:dC,forEach:RP,forIn:bte,has:HP,isUndefined:XP,last:wte,map:YP,mapValues:Ete,max:xte,merge:Rte,min:jte,minBy:Dte,now:Ite,pick:Bte,range:Gte,reduce:KP,sortBy:Yte,uniqueId:Zte,values:oC,zipObject:Qte}}catch{}r_||(r_=window._);var ene=r_;yc.Graph;ene.constant(1);yc.Graph;yc.Graph;yc.alg.preorder;yc.alg.postorder;yc.Graph;yc.Graph;yc.Graph;yc.Graph;yc.Graph;var W1,nM;function tne(){if(nM)return W1;nM=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return W1=t,W1}var G1,rM;function nne(){if(rM)return G1;rM=1;var e=Yw(),t=tne(),n=Kw(),a="[object Arguments]",r="[object Array]",s="[object Boolean]",c="[object Date]",v="[object Error]",f="[object Function]",g="[object Map]",_="[object Number]",b="[object Object]",x="[object RegExp]",S="[object Set]",A="[object String]",E="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",R="[object Float32Array]",U="[object Float64Array]",D="[object Int8Array]",L="[object Int16Array]",W="[object Int32Array]",H="[object Uint8Array]",B="[object Uint8ClampedArray]",F="[object Uint16Array]",q="[object Uint32Array]",K={};K[R]=K[U]=K[D]=K[L]=K[W]=K[H]=K[B]=K[F]=K[q]=!0,K[a]=K[r]=K[T]=K[s]=K[I]=K[c]=K[v]=K[f]=K[g]=K[_]=K[b]=K[x]=K[S]=K[A]=K[E]=!1;function X(ee){return n(ee)&&t(ee.length)&&!!K[e(ee)]}return G1=X,G1}var z1,oM;function rne(){if(oM)return z1;oM=1;function e(t){return function(n){return t(n)}}return z1=e,z1}var xm={exports:{}};xm.exports;var iM;function one(){return iM||(iM=1,(function(e,t){var n=RD(),a=t&&!t.nodeType&&t,r=a&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===a,c=s&&n.process,v=(function(){try{var f=r&&r.require&&r.require("util").types;return f||c&&c.binding&&c.binding("util")}catch{}})();e.exports=v})(xm,xm.exports)),xm.exports}var H1,aM;function ine(){if(aM)return H1;aM=1;var e=nne(),t=rne(),n=one(),a=n&&n.isTypedArray,r=a?t(a):e;return H1=r,H1}ine();var X1,lM;function ane(){if(lM)return X1;lM=1;var e=Yw(),t=Kw(),n="[object Number]";function a(r){return typeof r=="number"||t(r)&&e(r)==n}return X1=a,X1}ane();var q1={exports:{}},Y1={exports:{}},sM;function hC(){return sM||(sM=1,(function(e){function t(n,a){this.v=n,this.k=a}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Y1)),Y1.exports}var K1={exports:{}},Z1={exports:{}},uM;function vC(){return uM||(uM=1,(function(e){function t(n,a,r,s){var c=Object.defineProperty;try{c({},"",{})}catch{c=0}e.exports=t=function(f,g,_,b){function x(S,A){t(f,S,function(E){return this._invoke(S,A,E)})}g?c?c(f,g,{value:_,enumerable:!b,configurable:!b,writable:!b}):f[g]=_:(x("next",0),x("throw",1),x("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,a,r,s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Z1)),Z1.exports}var cM;function mC(){return cM||(cM=1,(function(e){var t=vC();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var a,r,s=typeof Symbol=="function"?Symbol:{},c=s.iterator||"@@iterator",v=s.toStringTag||"@@toStringTag";function f(T,I,R,U){var D=I&&I.prototype instanceof _?I:_,L=Object.create(D.prototype);return t(L,"_invoke",(function(W,H,B){var F,q,K,X=0,ee=B||[],ue=!1,ae={p:0,n:0,v:a,a:we,f:we.bind(a,4),d:function(Te,Me){return F=Te,q=0,K=a,ae.n=Me,g}};function we(je,Te){for(q=je,K=Te,r=0;!ue&&X&&!Me&&r<ee.length;r++){var Me,Ne=ee[r],rt=ae.p,tt=Ne[2];je>3?(Me=tt===Te)&&(K=Ne[(q=Ne[4])?5:(q=3,3)],Ne[4]=Ne[5]=a):Ne[0]<=rt&&((Me=je<2&&rt<Ne[1])?(q=0,ae.v=Te,ae.n=Ne[1]):rt<tt&&(Me=je<3||Ne[0]>Te||Te>tt)&&(Ne[4]=je,Ne[5]=Te,ae.n=tt,q=0))}if(Me||je>1)return g;throw ue=!0,Te}return function(je,Te,Me){if(X>1)throw TypeError("Generator is already running");for(ue&&Te===1&&we(Te,Me),q=Te,K=Me;(r=q<2?a:K)||!ue;){F||(q?q<3?(q>1&&(ae.n=-1),we(q,K)):ae.n=K:ae.v=K);try{if(X=2,F){if(q||(je="next"),r=F[je]){if(!(r=r.call(F,K)))throw TypeError("iterator result is not an object");if(!r.done)return r;K=r.value,q<2&&(q=0)}else q===1&&(r=F.return)&&r.call(F),q<2&&(K=TypeError("The iterator does not provide a '"+je+"' method"),q=1);F=a}else if((r=(ue=ae.n<0)?K:W.call(H,ae))!==g)break}catch(Ne){F=a,q=1,K=Ne}finally{X=1}}return{value:r,done:ue}}})(T,R,U),!0),L}var g={};function _(){}function b(){}function x(){}r=Object.getPrototypeOf;var S=[][c]?r(r([][c]())):(t(r={},c,function(){return this}),r),A=x.prototype=_.prototype=Object.create(S);function E(T){return Object.setPrototypeOf?Object.setPrototypeOf(T,x):(T.__proto__=x,t(T,v,"GeneratorFunction")),T.prototype=Object.create(A),T}return b.prototype=x,t(A,"constructor",x),t(x,"constructor",b),b.displayName="GeneratorFunction",t(x,v,"GeneratorFunction"),t(A),t(A,v,"Generator"),t(A,c,function(){return this}),t(A,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:f,m:E}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(K1)),K1.exports}var J1={exports:{}},Q1={exports:{}},ew={exports:{}},dM;function yC(){return dM||(dM=1,(function(e){var t=hC(),n=vC();function a(r,s){function c(f,g,_,b){try{var x=r[f](g),S=x.value;return S instanceof t?s.resolve(S.v).then(function(A){c("next",A,_,b)},function(A){c("throw",A,_,b)}):s.resolve(S).then(function(A){x.value=A,_(x)},function(A){return c("throw",A,_,b)})}catch(A){b(A)}}var v;this.next||(n(a.prototype),n(a.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(f,g,_){function b(){return new s(function(x,S){c(f,_,x,S)})}return v=v?v.then(b,b):b()},!0)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(ew)),ew.exports}var fM;function gC(){return fM||(fM=1,(function(e){var t=mC(),n=yC();function a(r,s,c,v,f){return new n(t().w(r,s,c,v),f||Promise)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(Q1)),Q1.exports}var pM;function lne(){return pM||(pM=1,(function(e){var t=gC();function n(a,r,s,c,v){var f=t(a,r,s,c,v);return f.next().then(function(g){return g.done?g.value:f.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(J1)),J1.exports}var tw={exports:{}},hM;function sne(){return hM||(hM=1,(function(e){function t(n){var a=Object(n),r=[];for(var s in a)r.unshift(s);return function c(){for(;r.length;)if((s=r.pop())in a)return c.value=s,c.done=!1,c;return c.done=!0,c}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(tw)),tw.exports}var nw={exports:{}},rw={exports:{}},vM;function une(){return vM||(vM=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(rw)),rw.exports}var mM;function cne(){return mM||(mM=1,(function(e){var t=une().default;function n(a){if(a!=null){var r=a[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],s=0;if(r)return r.call(a);if(typeof a.next=="function")return a;if(!isNaN(a.length))return{next:function(){return a&&s>=a.length&&(a=void 0),{value:a&&a[s++],done:!a}}}}throw new TypeError(t(a)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(nw)),nw.exports}var yM;function dne(){return yM||(yM=1,(function(e){var t=hC(),n=mC(),a=lne(),r=gC(),s=yC(),c=sne(),v=cne();function f(){var g=n(),_=g.m(f),b=(Object.getPrototypeOf?Object.getPrototypeOf(_):_.__proto__).constructor;function x(E){var T=typeof E=="function"&&E.constructor;return!!T&&(T===b||(T.displayName||T.name)==="GeneratorFunction")}var S={throw:1,return:2,break:3,continue:3};function A(E){var T,I;return function(R){T||(T={stop:function(){return I(R.a,2)},catch:function(){return R.v},abrupt:function(D,L){return I(R.a,S[D],L)},delegateYield:function(D,L,W){return T.resultName=L,I(R.d,v(D),W)},finish:function(D){return I(R.f,D)}},I=function(D,L,W){R.p=T.prev,R.n=T.next;try{return D(L,W)}finally{T.next=R.n}}),T.resultName&&(T[T.resultName]=R.v,T.resultName=void 0),T.sent=R.v,T.next=R.n;try{return E.call(this,T)}finally{R.p=T.prev,R.n=T.next}}}return(e.exports=f=function(){return{wrap:function(I,R,U,D){return g.w(A(I),R,U,D&&D.reverse())},isGeneratorFunction:x,mark:g.m,awrap:function(I,R){return new t(I,R)},AsyncIterator:s,async:function(I,R,U,D,L){return(x(R)?r:a)(A(I),R,U,D,L)},keys:c,values:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports})(q1)),q1.exports}var ow,gM;function fne(){if(gM)return ow;gM=1;var e=dne()();ow=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return ow}fne();var cn;(function(e){e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.CULL_FACE=2884]="CULL_FACE",e[e.BLEND=3042]="BLEND",e[e.DITHER=3024]="DITHER",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.TEXTURE1=33985]="TEXTURE1",e[e.TEXTURE2=33986]="TEXTURE2",e[e.TEXTURE3=33987]="TEXTURE3",e[e.TEXTURE4=33988]="TEXTURE4",e[e.TEXTURE5=33989]="TEXTURE5",e[e.TEXTURE6=33990]="TEXTURE6",e[e.TEXTURE7=33991]="TEXTURE7",e[e.TEXTURE8=33992]="TEXTURE8",e[e.TEXTURE9=33993]="TEXTURE9",e[e.TEXTURE10=33994]="TEXTURE10",e[e.TEXTURE11=33995]="TEXTURE11",e[e.TEXTURE12=33996]="TEXTURE12",e[e.TEXTURE13=33997]="TEXTURE13",e[e.TEXTURE14=33998]="TEXTURE14",e[e.TEXTURE15=33999]="TEXTURE15",e[e.TEXTURE16=34e3]="TEXTURE16",e[e.TEXTURE17=34001]="TEXTURE17",e[e.TEXTURE18=34002]="TEXTURE18",e[e.TEXTURE19=34003]="TEXTURE19",e[e.TEXTURE20=34004]="TEXTURE20",e[e.TEXTURE21=34005]="TEXTURE21",e[e.TEXTURE22=34006]="TEXTURE22",e[e.TEXTURE23=34007]="TEXTURE23",e[e.TEXTURE24=34008]="TEXTURE24",e[e.TEXTURE25=34009]="TEXTURE25",e[e.TEXTURE26=34010]="TEXTURE26",e[e.TEXTURE27=34011]="TEXTURE27",e[e.TEXTURE28=34012]="TEXTURE28",e[e.TEXTURE29=34013]="TEXTURE29",e[e.TEXTURE30=34014]="TEXTURE30",e[e.TEXTURE31=34015]="TEXTURE31",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.SAMPLED=4]="SAMPLED",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(cn||(cn={}));var _M;(function(e){e.Void="Void",e.Boolean="Boolean",e.Float="Float",e.Uint32="Uint32",e.Int32="Int32",e.Vector="Vector",e.Vector2Float="vec2<f32>",e.Vector3Float="vec3<f32>",e.Vector4Float="vec4<f32>",e.Vector2Boolean="vec2<bool>",e.Vector3Boolean="vec3<bool>",e.Vector4Boolean="vec4<bool>",e.Vector2Uint="vec2<u32>",e.Vector3Uint="vec3<u32>",e.Vector4Uint="vec4<u32>",e.Vector2Int="vec2<i32>",e.Vector3Int="vec3<i32>",e.Vector4Int="vec4<i32>",e.Matrix="Matrix",e.Matrix3x3Float="mat3x3<f32>",e.Matrix4x4Float="mat4x4<i32>",e.Struct="Struct",e.FloatArray="Float[]",e.Vector4FloatArray="vec4<f32>[]"})(_M||(_M={}));var bM;(function(e){e.Program="Program",e.Identifier="Identifier",e.VariableDeclaration="VariableDeclaration",e.BlockStatement="BlockStatement",e.ReturnStatement="ReturnStatement",e.FunctionDeclaration="FunctionDeclaration",e.VariableDeclarator="VariableDeclarator",e.AssignmentExpression="AssignmentExpression",e.LogicalExpression="LogicalExpression",e.BinaryExpression="BinaryExpression",e.ArrayExpression="ArrayExpression",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.FunctionExpression="FunctionExpression",e.MemberExpression="MemberExpression",e.ConditionalExpression="ConditionalExpression",e.ExpressionStatement="ExpressionStatement",e.CallExpression="CallExpression",e.NumThreadStatement="NumThreadStatement",e.StorageStatement="StorageStatement",e.DoWhileStatement="DoWhileStatement",e.WhileStatement="WhileStatement",e.ForStatement="ForStatement",e.BreakStatement="BreakStatement",e.ContinueStatement="ContinueStatement",e.IfStatement="IfStatement",e.ImportedFunctionStatement="ImportedFunctionStatement"})(bM||(bM={}));var wM;(function(e){e.Input="Input",e.Output="Output",e.Uniform="Uniform",e.Workgroup="Workgroup",e.UniformConstant="UniformConstant",e.Image="Image",e.StorageBuffer="StorageBuffer",e.Private="Private",e.Function="Function"})(wM||(wM={}));var EM;(function(e){e.GLSL100="GLSL100",e.GLSL450="GLSL450",e.WGSL="WGSL"})(EM||(EM={}));var Sg={exports:{}},pne=Sg.exports,OM;function hne(){return OM||(OM=1,(function(e,t){(function(n,a){e.exports=a()})(pne,(function(){var n=function(G){return G instanceof Uint8Array||G instanceof Uint16Array||G instanceof Uint32Array||G instanceof Int8Array||G instanceof Int16Array||G instanceof Int32Array||G instanceof Float32Array||G instanceof Float64Array||G instanceof Uint8ClampedArray},a=function(G,se){for(var Oe=Object.keys(se),ut=0;ut<Oe.length;++ut)G[Oe[ut]]=se[Oe[ut]];return G},r=`
|
||
`;function s(G){return typeof atob<"u"?atob(G):"base64:"+G}function c(G){var se=new Error("(regl) "+G);throw console.error(se),se}function v(G,se){G||c(se)}function f(G){return G?": "+G:""}function g(G,se,Oe){G in se||c("unknown parameter ("+G+")"+f(Oe)+". possible values: "+Object.keys(se).join())}function _(G,se){n(G)||c("invalid parameter type"+f(se)+". must be a typed array")}function b(G,se){switch(se){case"number":return typeof G=="number";case"object":return typeof G=="object";case"string":return typeof G=="string";case"boolean":return typeof G=="boolean";case"function":return typeof G=="function";case"undefined":return typeof G>"u";case"symbol":return typeof G=="symbol"}}function x(G,se,Oe){b(G,se)||c("invalid parameter type"+f(Oe)+". expected "+se+", got "+typeof G)}function S(G,se){G>=0&&(G|0)===G||c("invalid parameter type, ("+G+")"+f(se)+". must be a nonnegative integer")}function A(G,se,Oe){se.indexOf(G)<0&&c("invalid value"+f(Oe)+". must be one of: "+se)}var E=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function T(G){Object.keys(G).forEach(function(se){E.indexOf(se)<0&&c('invalid regl constructor argument "'+se+'". must be one of '+E)})}function I(G,se){for(G=G+"";G.length<se;)G=" "+G;return G}function R(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function U(G,se){this.number=G,this.line=se,this.errors=[]}function D(G,se,Oe){this.file=G,this.line=se,this.message=Oe}function L(){var G=new Error,se=(G.stack||G).toString(),Oe=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(se);if(Oe)return Oe[1];var ut=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(se);return ut?ut[1]:"unknown"}function W(){var G=new Error,se=(G.stack||G).toString(),Oe=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(se);if(Oe)return Oe[1];var ut=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(se);return ut?ut[1]:"unknown"}function H(G,se){var Oe=G.split(`
|
||
`),ut=1,gt=0,ot={unknown:new R,0:new R};ot.unknown.name=ot[0].name=se||L(),ot.unknown.lines.push(new U(0,""));for(var mt=0;mt<Oe.length;++mt){var Rt=Oe[mt],Bt=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Rt);if(Bt)switch(Bt[1]){case"line":var jt=/(\d+)(\s+\d+)?/.exec(Bt[2]);jt&&(ut=jt[1]|0,jt[2]&&(gt=jt[2]|0,gt in ot||(ot[gt]=new R)));break;case"define":var ht=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Bt[2]);ht&&(ot[gt].name=ht[1]?s(ht[2]):ht[2]);break}ot[gt].lines.push(new U(ut++,Rt))}return Object.keys(ot).forEach(function(Kt){var Gt=ot[Kt];Gt.lines.forEach(function(Dt){Gt.index[Dt.number]=Dt})}),ot}function B(G){var se=[];return G.split(`
|
||
`).forEach(function(Oe){if(!(Oe.length<5)){var ut=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Oe);ut?se.push(new D(ut[1]|0,ut[2]|0,ut[3].trim())):Oe.length>0&&se.push(new D("unknown",0,Oe))}}),se}function F(G,se){se.forEach(function(Oe){var ut=G[Oe.file];if(ut){var gt=ut.index[Oe.line];if(gt){gt.errors.push(Oe),ut.hasErrors=!0;return}}G.unknown.hasErrors=!0,G.unknown.lines[0].errors.push(Oe)})}function q(G,se,Oe,ut,gt){if(!G.getShaderParameter(se,G.COMPILE_STATUS)){var ot=G.getShaderInfoLog(se),mt=ut===G.FRAGMENT_SHADER?"fragment":"vertex";je(Oe,"string",mt+" shader source must be a string",gt);var Rt=H(Oe,gt),Bt=B(ot);F(Rt,Bt),Object.keys(Rt).forEach(function(jt){var ht=Rt[jt];if(!ht.hasErrors)return;var Kt=[""],Gt=[""];function Dt(At,Ze){Kt.push(At),Gt.push(Ze||"")}Dt("file number "+jt+": "+ht.name+`
|
||
`,"color:red;text-decoration:underline;font-weight:bold"),ht.lines.forEach(function(At){if(At.errors.length>0){Dt(I(At.number,4)+"| ","background-color:yellow; font-weight:bold"),Dt(At.line+r,"color:red; background-color:yellow; font-weight:bold");var Ze=0;At.errors.forEach(function(pt){var $t=pt.message,tn=/^\s*'(.*)'\s*:\s*(.*)$/.exec($t);if(tn){var kt=tn[1];switch($t=tn[2],kt){case"assign":kt="=";break}Ze=Math.max(At.line.indexOf(kt,Ze),0)}else Ze=0;Dt(I("| ",6)),Dt(I("^^^",Ze+3)+r,"font-weight:bold"),Dt(I("| ",6)),Dt($t+r,"font-weight:bold")}),Dt(I("| ",6)+r)}else Dt(I(At.number,4)+"| "),Dt(At.line+r,"color:red")}),typeof document<"u"&&!window.chrome?(Gt[0]=Kt.join("%c"),console.log.apply(console,Gt)):console.log(Kt.join(""))}),v.raise("Error compiling "+mt+" shader, "+Rt[0].name)}}function K(G,se,Oe,ut,gt){if(!G.getProgramParameter(se,G.LINK_STATUS)){var ot=G.getProgramInfoLog(se),mt=H(Oe,gt),Rt=H(ut,gt),Bt='Error linking program with vertex shader, "'+Rt[0].name+'", and fragment shader "'+mt[0].name+'"';typeof document<"u"?console.log("%c"+Bt+r+"%c"+ot,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Bt+r+ot),v.raise(Bt)}}function X(G){G._commandRef=L()}function ee(G,se,Oe,ut){X(G);function gt(Bt){return Bt?ut.id(Bt):0}G._fragId=gt(G.static.frag),G._vertId=gt(G.static.vert);function ot(Bt,jt){Object.keys(jt).forEach(function(ht){Bt[ut.id(ht)]=!0})}var mt=G._uniformSet={};ot(mt,se.static),ot(mt,se.dynamic);var Rt=G._attributeSet={};ot(Rt,Oe.static),ot(Rt,Oe.dynamic),G._hasCount="count"in G.static||"count"in G.dynamic||"elements"in G.static||"elements"in G.dynamic}function ue(G,se){var Oe=W();c(G+" in command "+(se||L())+(Oe==="unknown"?"":" called from "+Oe))}function ae(G,se,Oe){G||ue(se,Oe||L())}function we(G,se,Oe,ut){G in se||ue("unknown parameter ("+G+")"+f(Oe)+". possible values: "+Object.keys(se).join(),ut||L())}function je(G,se,Oe,ut){b(G,se)||ue("invalid parameter type"+f(Oe)+". expected "+se+", got "+typeof G,ut||L())}function Te(G){G()}function Me(G,se,Oe){G.texture?A(G.texture._texture.internalformat,se,"unsupported texture format for attachment"):A(G.renderbuffer._renderbuffer.format,Oe,"unsupported renderbuffer format for attachment")}var Ne=33071,rt=9728,tt=9984,Be=9985,lt=9986,St=9987,He=5120,Jt=5121,Fe=5122,me=5123,Le=5124,Ye=5125,Ot=5126,bt=32819,Ft=32820,Qt=33635,on=34042,Wt=36193,nt={};nt[He]=nt[Jt]=1,nt[Fe]=nt[me]=nt[Wt]=nt[Qt]=nt[bt]=nt[Ft]=2,nt[Le]=nt[Ye]=nt[Ot]=nt[on]=4;function sn(G,se){return G===Ft||G===bt||G===Qt?2:G===on?4:nt[G]*se}function We(G){return!(G&G-1)&&!!G}function yn(G,se,Oe){var ut,gt=se.width,ot=se.height,mt=se.channels;v(gt>0&><=Oe.maxTextureSize&&ot>0&&ot<=Oe.maxTextureSize,"invalid texture shape"),(G.wrapS!==Ne||G.wrapT!==Ne)&&v(We(gt)&&We(ot),"incompatible wrap mode for texture, both width and height must be power of 2"),se.mipmask===1?gt!==1&&ot!==1&&v(G.minFilter!==tt&&G.minFilter!==lt&&G.minFilter!==Be&&G.minFilter!==St,"min filter requires mipmap"):(v(We(gt)&&We(ot),"texture must be a square power of 2 to support mipmapping"),v(se.mipmask===(gt<<1)-1,"missing or incomplete mipmap data")),se.type===Ot&&(Oe.extensions.indexOf("oes_texture_float_linear")<0&&v(G.minFilter===rt&&G.magFilter===rt,"filter not supported, must enable oes_texture_float_linear"),v(!G.genMipmaps,"mipmap generation not supported with float textures"));var Rt=se.images;for(ut=0;ut<16;++ut)if(Rt[ut]){var Bt=gt>>ut,jt=ot>>ut;v(se.mipmask&1<<ut,"missing mipmap data");var ht=Rt[ut];if(v(ht.width===Bt&&ht.height===jt,"invalid shape for mip images"),v(ht.format===se.format&&ht.internalformat===se.internalformat&&ht.type===se.type,"incompatible type for mip image"),!ht.compressed)if(ht.data){var Kt=Math.ceil(sn(ht.type,mt)*Bt/ht.unpackAlignment)*ht.unpackAlignment;v(ht.data.byteLength===Kt*jt,"invalid data for image, buffer size is inconsistent with image format")}else ht.element||ht.copy}else G.genMipmaps||v((se.mipmask&1<<ut)===0,"extra mipmap data");se.compressed&&v(!G.genMipmaps,"mipmap generation for compressed images not supported")}function Kn(G,se,Oe,ut){var gt=G.width,ot=G.height,mt=G.channels;v(gt>0&><=ut.maxTextureSize&&ot>0&&ot<=ut.maxTextureSize,"invalid texture shape"),v(gt===ot,"cube map must be square"),v(se.wrapS===Ne&&se.wrapT===Ne,"wrap mode not supported by cube map");for(var Rt=0;Rt<Oe.length;++Rt){var Bt=Oe[Rt];v(Bt.width===gt&&Bt.height===ot,"inconsistent cube map face shape"),se.genMipmaps&&(v(!Bt.compressed,"can not generate mipmap for compressed textures"),v(Bt.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var jt=Bt.images,ht=0;ht<16;++ht){var Kt=jt[ht];if(Kt){var Gt=gt>>ht,Dt=ot>>ht;v(Bt.mipmask&1<<ht,"missing mipmap data"),v(Kt.width===Gt&&Kt.height===Dt,"invalid shape for mip images"),v(Kt.format===G.format&&Kt.internalformat===G.internalformat&&Kt.type===G.type,"incompatible type for mip image"),Kt.compressed||(Kt.data?v(Kt.data.byteLength===Gt*Dt*Math.max(sn(Kt.type,mt),Kt.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Kt.element||Kt.copy)}}}}var te=a(v,{optional:Te,raise:c,commandRaise:ue,command:ae,parameter:g,commandParameter:we,constructor:T,type:x,commandType:je,isTypedArray:_,nni:S,oneOf:A,shaderError:q,linkError:K,callSite:W,saveCommandRef:X,saveDrawInfo:ee,framebufferFormat:Me,guessCommand:L,texture2D:yn,textureCube:Kn}),Gn=0,br=0,Dr=5,zr=6;function jn(G,se){this.id=Gn++,this.type=G,this.data=se}function ko(G){return G.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Se(G){if(G.length===0)return[];var se=G.charAt(0),Oe=G.charAt(G.length-1);if(G.length>1&&se===Oe&&(se==='"'||se==="'"))return['"'+ko(G.substr(1,G.length-2))+'"'];var ut=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(G);if(ut)return Se(G.substr(0,ut.index)).concat(Se(ut[1])).concat(Se(G.substr(ut.index+ut[0].length)));var gt=G.split(".");if(gt.length===1)return['"'+ko(G)+'"'];for(var ot=[],mt=0;mt<gt.length;++mt)ot=ot.concat(Se(gt[mt]));return ot}function Qe(G){return"["+Se(G).join("][")+"]"}function $e(G,se){return new jn(G,Qe(se+""))}function st(G){return typeof G=="function"&&!G._reglType||G instanceof jn}function an(G,se){if(typeof G=="function")return new jn(br,G);if(typeof G=="number"||typeof G=="boolean")return new jn(Dr,G);if(Array.isArray(G))return new jn(zr,G.map((Oe,ut)=>an(Oe,se+"["+ut+"]")));if(G instanceof jn)return G;te(!1,"invalid option type in uniform "+se)}var en={DynamicVariable:jn,define:$e,isDynamic:st,unbox:an,accessor:Qe},Tn={next:typeof requestAnimationFrame=="function"?function(G){return requestAnimationFrame(G)}:function(G){return setTimeout(G,16)},cancel:typeof cancelAnimationFrame=="function"?function(G){return cancelAnimationFrame(G)}:clearTimeout},Sr=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function li(){var G={"":0},se=[""];return{id:function(Oe){var ut=G[Oe];return ut||(ut=G[Oe]=se.length,se.push(Oe),ut)},str:function(Oe){return se[Oe]}}}function Ei(G,se,Oe){var ut=document.createElement("canvas");a(ut.style,{border:0,margin:0,padding:0,top:0,left:0}),G.appendChild(ut),G===document.body&&(ut.style.position="absolute",a(G.style,{margin:0,padding:0}));function gt(){var Rt=window.innerWidth,Bt=window.innerHeight;if(G!==document.body){var jt=G.getBoundingClientRect();Rt=jt.right-jt.left,Bt=jt.bottom-jt.top}ut.width=Oe*Rt,ut.height=Oe*Bt,a(ut.style,{width:Rt+"px",height:Bt+"px"})}var ot;G!==document.body&&typeof ResizeObserver=="function"?(ot=new ResizeObserver(function(){setTimeout(gt)}),ot.observe(G)):window.addEventListener("resize",gt,!1);function mt(){ot?ot.disconnect():window.removeEventListener("resize",gt),G.removeChild(ut)}return gt(),{canvas:ut,onDestroy:mt}}function Yo(G,se){function Oe(ut){try{return G.getContext(ut,se)}catch{return null}}return Oe("webgl")||Oe("experimental-webgl")||Oe("webgl-experimental")}function ti(G){return typeof G.nodeName=="string"&&typeof G.appendChild=="function"&&typeof G.getBoundingClientRect=="function"}function Nn(G){return typeof G.drawArrays=="function"||typeof G.drawElements=="function"}function Un(G){return typeof G=="string"?G.split():(te(Array.isArray(G),"invalid extension array"),G)}function Zn(G){return typeof G=="string"?(te(typeof document<"u","not supported outside of DOM"),document.querySelector(G)):G}function ur(G){var se=G||{},Oe,ut,gt,ot,mt={},Rt=[],Bt=[],jt=typeof window>"u"?1:window.devicePixelRatio,ht=!1,Kt=function(At){At&&te.raise(At)},Gt=function(){};if(typeof se=="string"?(te(typeof document<"u","selector queries only supported in DOM enviroments"),Oe=document.querySelector(se),te(Oe,"invalid query string for element")):typeof se=="object"?ti(se)?Oe=se:Nn(se)?(ot=se,gt=ot.canvas):(te.constructor(se),"gl"in se?ot=se.gl:"canvas"in se?gt=Zn(se.canvas):"container"in se&&(ut=Zn(se.container)),"attributes"in se&&(mt=se.attributes,te.type(mt,"object","invalid context attributes")),"extensions"in se&&(Rt=Un(se.extensions)),"optionalExtensions"in se&&(Bt=Un(se.optionalExtensions)),"onDone"in se&&(te.type(se.onDone,"function","invalid or missing onDone callback"),Kt=se.onDone),"profile"in se&&(ht=!!se.profile),"pixelRatio"in se&&(jt=+se.pixelRatio,te(jt>0,"invalid pixel ratio"))):te.raise("invalid arguments to regl"),Oe&&(Oe.nodeName.toLowerCase()==="canvas"?gt=Oe:ut=Oe),!ot){if(!gt){te(typeof document<"u","must manually specify webgl context outside of DOM environments");var Dt=Ei(ut||document.body,Kt,jt);if(!Dt)return null;gt=Dt.canvas,Gt=Dt.onDestroy}mt.premultipliedAlpha===void 0&&(mt.premultipliedAlpha=!0),ot=Yo(gt,mt)}return ot?{gl:ot,canvas:gt,container:ut,extensions:Rt,optionalExtensions:Bt,pixelRatio:jt,profile:ht,onDone:Kt,onDestroy:Gt}:(Gt(),Kt("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function to(G,se){var Oe={};function ut(mt){te.type(mt,"string","extension name must be string");var Rt=mt.toLowerCase(),Bt;try{Bt=Oe[Rt]=G.getExtension(Rt)}catch{}return!!Bt}for(var gt=0;gt<se.extensions.length;++gt){var ot=se.extensions[gt];if(!ut(ot))return se.onDestroy(),se.onDone('"'+ot+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return se.optionalExtensions.forEach(ut),{extensions:Oe,restore:function(){Object.keys(Oe).forEach(function(mt){if(Oe[mt]&&!ut(mt))throw new Error("(regl): error restoring extension "+mt)})}}}function Lr(G,se){for(var Oe=Array(G),ut=0;ut<G;++ut)Oe[ut]=se(ut);return Oe}var ml=5120,za=5121,yl=5122,as=5123,np=5124,gc=5125,va=5126;function Fs(G){for(var se=16;se<=1<<28;se*=16)if(G<=se)return se;return 0}function Rn(G){var se,Oe;return se=(G>65535)<<4,G>>>=se,Oe=(G>255)<<3,G>>>=Oe,se|=Oe,Oe=(G>15)<<2,G>>>=Oe,se|=Oe,Oe=(G>3)<<1,G>>>=Oe,se|=Oe,se|G>>1}function Id(){var G=Lr(8,function(){return[]});function se(ot){var mt=Fs(ot),Rt=G[Rn(mt)>>2];return Rt.length>0?Rt.pop():new ArrayBuffer(mt)}function Oe(ot){G[Rn(ot.byteLength)>>2].push(ot)}function ut(ot,mt){var Rt=null;switch(ot){case ml:Rt=new Int8Array(se(mt),0,mt);break;case za:Rt=new Uint8Array(se(mt),0,mt);break;case yl:Rt=new Int16Array(se(2*mt),0,mt);break;case as:Rt=new Uint16Array(se(2*mt),0,mt);break;case np:Rt=new Int32Array(se(4*mt),0,mt);break;case gc:Rt=new Uint32Array(se(4*mt),0,mt);break;case va:Rt=new Float32Array(se(4*mt),0,mt);break;default:return null}return Rt.length!==mt?Rt.subarray(0,mt):Rt}function gt(ot){Oe(ot.buffer)}return{alloc:se,free:Oe,allocType:ut,freeType:gt}}var Eo=Id();Eo.zero=Id();var _c=3408,Ki=3410,oa=3411,Mu=3412,Pa=3413,ma=3414,Ca=3415,bc=33901,wc=33902,Ld=3379,Bs=3386,$d=34921,Ec=36347,rp=36348,Il=35661,Fd=35660,gl=34930,Oc=36349,ku=34076,xc=34024,Sc=7936,op=7937,Bd=7938,Kr=35724,Xr=34047,Vd=36063,ls=34852,ya=3553,Tu=34067,Ud=34069,Uo=33984,Ll=6408,$l=5126,Nu=5121,ss=36160,Oi=36053,Ac=36064,Wd=16384,Mc=function(G,se){var Oe=1;se.ext_texture_filter_anisotropic&&(Oe=G.getParameter(Xr));var ut=1,gt=1;se.webgl_draw_buffers&&(ut=G.getParameter(ls),gt=G.getParameter(Vd));var ot=!!se.oes_texture_float;if(ot){var mt=G.createTexture();G.bindTexture(ya,mt),G.texImage2D(ya,0,Ll,1,1,0,Ll,$l,null);var Rt=G.createFramebuffer();if(G.bindFramebuffer(ss,Rt),G.framebufferTexture2D(ss,Ac,ya,mt,0),G.bindTexture(ya,null),G.checkFramebufferStatus(ss)!==Oi)ot=!1;else{G.viewport(0,0,1,1),G.clearColor(1,0,0,1),G.clear(Wd);var Bt=Eo.allocType($l,4);G.readPixels(0,0,1,1,Ll,$l,Bt),G.getError()?ot=!1:(G.deleteFramebuffer(Rt),G.deleteTexture(mt),ot=Bt[0]===1),Eo.freeType(Bt)}}var jt=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ht=!0;if(!jt){var Kt=G.createTexture(),Gt=Eo.allocType(Nu,36);G.activeTexture(Uo),G.bindTexture(Tu,Kt),G.texImage2D(Ud,0,Ll,3,3,0,Ll,Nu,Gt),Eo.freeType(Gt),G.bindTexture(Tu,null),G.deleteTexture(Kt),ht=!G.getError()}return{colorBits:[G.getParameter(Ki),G.getParameter(oa),G.getParameter(Mu),G.getParameter(Pa)],depthBits:G.getParameter(ma),stencilBits:G.getParameter(Ca),subpixelBits:G.getParameter(_c),extensions:Object.keys(se).filter(function(Dt){return!!se[Dt]}),maxAnisotropic:Oe,maxDrawbuffers:ut,maxColorAttachments:gt,pointSizeDims:G.getParameter(bc),lineWidthDims:G.getParameter(wc),maxViewportDims:G.getParameter(Bs),maxCombinedTextureUnits:G.getParameter(Il),maxCubeMapSize:G.getParameter(ku),maxRenderbufferSize:G.getParameter(xc),maxTextureUnits:G.getParameter(gl),maxTextureSize:G.getParameter(Ld),maxAttributes:G.getParameter($d),maxVertexUniforms:G.getParameter(Ec),maxVertexTextureUnits:G.getParameter(Fd),maxVaryingVectors:G.getParameter(rp),maxFragmentUniforms:G.getParameter(Oc),glsl:G.getParameter(Kr),renderer:G.getParameter(op),vendor:G.getParameter(Sc),version:G.getParameter(Bd),readFloat:ot,npotTextureCube:ht}};function $i(G){return!!G&&typeof G=="object"&&Array.isArray(G.shape)&&Array.isArray(G.stride)&&typeof G.offset=="number"&&G.shape.length===G.stride.length&&(Array.isArray(G.data)||n(G.data))}var si=function(G){return Object.keys(G).map(function(se){return G[se]})},ga={shape:Bi,flatten:zd};function lo(G,se,Oe){for(var ut=0;ut<se;++ut)Oe[ut]=G[ut]}function ip(G,se,Oe,ut){for(var gt=0,ot=0;ot<se;++ot)for(var mt=G[ot],Rt=0;Rt<Oe;++Rt)ut[gt++]=mt[Rt]}function Fi(G,se,Oe,ut,gt,ot){for(var mt=ot,Rt=0;Rt<se;++Rt)for(var Bt=G[Rt],jt=0;jt<Oe;++jt)for(var ht=Bt[jt],Kt=0;Kt<ut;++Kt)gt[mt++]=ht[Kt]}function Gd(G,se,Oe,ut,gt){for(var ot=1,mt=Oe+1;mt<se.length;++mt)ot*=se[mt];var Rt=se[Oe];if(se.length-Oe===4){var Bt=se[Oe+1],jt=se[Oe+2],ht=se[Oe+3];for(mt=0;mt<Rt;++mt)Fi(G[mt],Bt,jt,ht,ut,gt),gt+=ot}else for(mt=0;mt<Rt;++mt)Gd(G[mt],se,Oe+1,ut,gt),gt+=ot}function zd(G,se,Oe,ut){var gt=1;if(se.length)for(var ot=0;ot<se.length;++ot)gt*=se[ot];else gt=0;var mt=ut||Eo.allocType(Oe,gt);switch(se.length){case 0:break;case 1:lo(G,se[0],mt);break;case 2:ip(G,se[0],se[1],mt);break;case 3:Fi(G,se[0],se[1],se[2],mt,0);break;default:Gd(G,se,0,mt,0)}return mt}function Bi(G){for(var se=[],Oe=G;Oe.length;Oe=Oe[0])se.push(Oe.length);return se}var Zi={"[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},kc=5120,Vr=5122,ui=5124,Pu=5121,Hd=5123,Tc=5125,Cu=5126,Ha=5126,Vi={int8:kc,int16:Vr,int32:ui,uint8:Pu,uint16:Hd,uint32:Tc,float:Cu,float32:Ha},us=35048,Ji=35040,_a={dynamic:us,stream:Ji,static:35044},Cr=ga.flatten,Ui=ga.shape,Ra=35044,mi=35040,cs=5121,Fl=5126,ja=[];ja[5120]=1,ja[5122]=2,ja[5124]=4,ja[5121]=1,ja[5123]=2,ja[5125]=4,ja[5126]=4;function mo(G){return Zi[Object.prototype.toString.call(G)]|0}function Vs(G,se){for(var Oe=0;Oe<se.length;++Oe)G[Oe]=se[Oe]}function Xa(G,se,Oe,ut,gt,ot,mt){for(var Rt=0,Bt=0;Bt<Oe;++Bt)for(var jt=0;jt<ut;++jt)G[Rt++]=se[gt*Bt+ot*jt+mt]}function ba(G,se,Oe,ut){var gt=0,ot={};function mt(Ze){this.id=gt++,this.buffer=G.createBuffer(),this.type=Ze,this.usage=Ra,this.byteLength=0,this.dimension=1,this.dtype=cs,this.persistentData=null,Oe.profile&&(this.stats={size:0})}mt.prototype.bind=function(){G.bindBuffer(this.type,this.buffer)},mt.prototype.destroy=function(){Gt(this)};var Rt=[];function Bt(Ze,pt){var $t=Rt.pop();return $t||($t=new mt(Ze)),$t.bind(),Kt($t,pt,mi,0,1,!1),$t}function jt(Ze){Rt.push(Ze)}function ht(Ze,pt,$t){Ze.byteLength=pt.byteLength,G.bufferData(Ze.type,pt,$t)}function Kt(Ze,pt,$t,tn,kt,ln){var Nt;if(Ze.usage=$t,Array.isArray(pt)){if(Ze.dtype=tn||Fl,pt.length>0){var qt;if(Array.isArray(pt[0])){Nt=Ui(pt);for(var Tt=1,Zt=1;Zt<Nt.length;++Zt)Tt*=Nt[Zt];Ze.dimension=Tt,qt=Cr(pt,Nt,Ze.dtype),ht(Ze,qt,$t),ln?Ze.persistentData=qt:Eo.freeType(qt)}else if(typeof pt[0]=="number"){Ze.dimension=kt;var Cn=Eo.allocType(Ze.dtype,pt.length);Vs(Cn,pt),ht(Ze,Cn,$t),ln?Ze.persistentData=Cn:Eo.freeType(Cn)}else n(pt[0])?(Ze.dimension=pt[0].length,Ze.dtype=tn||mo(pt[0])||Fl,qt=Cr(pt,[pt.length,pt[0].length],Ze.dtype),ht(Ze,qt,$t),ln?Ze.persistentData=qt:Eo.freeType(qt)):te.raise("invalid buffer data")}}else if(n(pt))Ze.dtype=tn||mo(pt),Ze.dimension=kt,ht(Ze,pt,$t),ln&&(Ze.persistentData=new Uint8Array(new Uint8Array(pt.buffer)));else if($i(pt)){Nt=pt.shape;var Hn=pt.stride,It=pt.offset,Pt=0,Mt=0,Ln=0,or=0;Nt.length===1?(Pt=Nt[0],Mt=1,Ln=Hn[0],or=0):Nt.length===2?(Pt=Nt[0],Mt=Nt[1],Ln=Hn[0],or=Hn[1]):te.raise("invalid shape"),Ze.dtype=tn||mo(pt.data)||Fl,Ze.dimension=Mt;var mn=Eo.allocType(Ze.dtype,Pt*Mt);Xa(mn,pt.data,Pt,Mt,Ln,or,It),ht(Ze,mn,$t),ln?Ze.persistentData=mn:Eo.freeType(mn)}else pt instanceof ArrayBuffer?(Ze.dtype=cs,Ze.dimension=kt,ht(Ze,pt,$t),ln&&(Ze.persistentData=new Uint8Array(new Uint8Array(pt)))):te.raise("invalid buffer data")}function Gt(Ze){se.bufferCount--,ut(Ze);var pt=Ze.buffer;te(pt,"buffer must not be deleted already"),G.deleteBuffer(pt),Ze.buffer=null,delete ot[Ze.id]}function Dt(Ze,pt,$t,tn){se.bufferCount++;var kt=new mt(pt);ot[kt.id]=kt;function ln(Tt){var Zt=Ra,Cn=null,Hn=0,It=0,Pt=1;return Array.isArray(Tt)||n(Tt)||$i(Tt)||Tt instanceof ArrayBuffer?Cn=Tt:typeof Tt=="number"?Hn=Tt|0:Tt&&(te.type(Tt,"object","buffer arguments must be an object, a number or an array"),"data"in Tt&&(te(Cn===null||Array.isArray(Cn)||n(Cn)||$i(Cn),"invalid data for buffer"),Cn=Tt.data),"usage"in Tt&&(te.parameter(Tt.usage,_a,"invalid buffer usage"),Zt=_a[Tt.usage]),"type"in Tt&&(te.parameter(Tt.type,Vi,"invalid buffer type"),It=Vi[Tt.type]),"dimension"in Tt&&(te.type(Tt.dimension,"number","invalid dimension"),Pt=Tt.dimension|0),"length"in Tt&&(te.nni(Hn,"buffer length must be a nonnegative integer"),Hn=Tt.length|0)),kt.bind(),Cn?Kt(kt,Cn,Zt,It,Pt,tn):(Hn&&G.bufferData(kt.type,Hn,Zt),kt.dtype=It||cs,kt.usage=Zt,kt.dimension=Pt,kt.byteLength=Hn),Oe.profile&&(kt.stats.size=kt.byteLength*ja[kt.dtype]),ln}function Nt(Tt,Zt){te(Zt+Tt.byteLength<=kt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Tt.byteLength+" starting from offset "+Zt+" to a buffer of size "+kt.byteLength),G.bufferSubData(kt.type,Zt,Tt)}function qt(Tt,Zt){var Cn=(Zt||0)|0,Hn;if(kt.bind(),n(Tt)||Tt instanceof ArrayBuffer)Nt(Tt,Cn);else if(Array.isArray(Tt)){if(Tt.length>0)if(typeof Tt[0]=="number"){var It=Eo.allocType(kt.dtype,Tt.length);Vs(It,Tt),Nt(It,Cn),Eo.freeType(It)}else if(Array.isArray(Tt[0])||n(Tt[0])){Hn=Ui(Tt);var Pt=Cr(Tt,Hn,kt.dtype);Nt(Pt,Cn),Eo.freeType(Pt)}else te.raise("invalid buffer data")}else if($i(Tt)){Hn=Tt.shape;var Mt=Tt.stride,Ln=0,or=0,mn=0,cr=0;Hn.length===1?(Ln=Hn[0],or=1,mn=Mt[0],cr=0):Hn.length===2?(Ln=Hn[0],or=Hn[1],mn=Mt[0],cr=Mt[1]):te.raise("invalid shape");var Xn=Array.isArray(Tt.data)?kt.dtype:mo(Tt.data),lr=Eo.allocType(Xn,Ln*or);Xa(lr,Tt.data,Ln,or,mn,cr,Tt.offset),Nt(lr,Cn),Eo.freeType(lr)}else te.raise("invalid data for buffer subdata");return ln}return $t||ln(Ze),ln._reglType="buffer",ln._buffer=kt,ln.subdata=qt,Oe.profile&&(ln.stats=kt.stats),ln.destroy=function(){Gt(kt)},ln}function At(){si(ot).forEach(function(Ze){Ze.buffer=G.createBuffer(),G.bindBuffer(Ze.type,Ze.buffer),G.bufferData(Ze.type,Ze.persistentData||Ze.byteLength,Ze.usage)})}return Oe.profile&&(se.getTotalBufferSize=function(){var Ze=0;return Object.keys(ot).forEach(function(pt){Ze+=ot[pt].stats.size}),Ze}),{create:Dt,createStream:Bt,destroyStream:jt,clear:function(){si(ot).forEach(Gt),Rt.forEach(Gt)},getBuffer:function(Ze){return Ze&&Ze._buffer instanceof mt?Ze._buffer:null},restore:At,_initBuffer:Kt}}var Nc=0,ap=0,Pc=1,Ko=1,Us=4,qa=4,ni={points:Nc,point:ap,lines:Pc,line:Ko,triangles:Us,triangle:qa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Cc=0,ia=1,wa=4,Ru=5120,Wi=5121,Qi=5122,ci=5123,aa=5124,ji=5125,vt=34963,Vt=35040,Ut=35044;function bn(G,se,Oe,ut){var gt={},ot=0,mt={uint8:Wi,uint16:ci};se.oes_element_index_uint&&(mt.uint32=ji);function Rt(At){this.id=ot++,gt[this.id]=this,this.buffer=At,this.primType=wa,this.vertCount=0,this.type=0}Rt.prototype.bind=function(){this.buffer.bind()};var Bt=[];function jt(At){var Ze=Bt.pop();return Ze||(Ze=new Rt(Oe.create(null,vt,!0,!1)._buffer)),Kt(Ze,At,Vt,-1,-1,0,0),Ze}function ht(At){Bt.push(At)}function Kt(At,Ze,pt,$t,tn,kt,ln){At.buffer.bind();var Nt;if(Ze){var qt=ln;!ln&&(!n(Ze)||$i(Ze)&&!n(Ze.data))&&(qt=se.oes_element_index_uint?ji:ci),Oe._initBuffer(At.buffer,Ze,pt,qt,3)}else G.bufferData(vt,kt,pt),At.buffer.dtype=Nt||Wi,At.buffer.usage=pt,At.buffer.dimension=3,At.buffer.byteLength=kt;if(Nt=ln,!ln){switch(At.buffer.dtype){case Wi:case Ru:Nt=Wi;break;case ci:case Qi:Nt=ci;break;case ji:case aa:Nt=ji;break;default:te.raise("unsupported type for element array")}At.buffer.dtype=Nt}At.type=Nt,te(Nt!==ji||!!se.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Tt=tn;Tt<0&&(Tt=At.buffer.byteLength,Nt===ci?Tt>>=1:Nt===ji&&(Tt>>=2)),At.vertCount=Tt;var Zt=$t;if($t<0){Zt=wa;var Cn=At.buffer.dimension;Cn===1&&(Zt=Cc),Cn===2&&(Zt=ia),Cn===3&&(Zt=wa)}At.primType=Zt}function Gt(At){ut.elementsCount--,te(At.buffer!==null,"must not double destroy elements"),delete gt[At.id],At.buffer.destroy(),At.buffer=null}function Dt(At,Ze){var pt=Oe.create(null,vt,!0),$t=new Rt(pt._buffer);ut.elementsCount++;function tn(kt){if(!kt)pt(),$t.primType=wa,$t.vertCount=0,$t.type=Wi;else if(typeof kt=="number")pt(kt),$t.primType=wa,$t.vertCount=kt|0,$t.type=Wi;else{var ln=null,Nt=Ut,qt=-1,Tt=-1,Zt=0,Cn=0;Array.isArray(kt)||n(kt)||$i(kt)?ln=kt:(te.type(kt,"object","invalid arguments for elements"),"data"in kt&&(ln=kt.data,te(Array.isArray(ln)||n(ln)||$i(ln),"invalid data for element buffer")),"usage"in kt&&(te.parameter(kt.usage,_a,"invalid element buffer usage"),Nt=_a[kt.usage]),"primitive"in kt&&(te.parameter(kt.primitive,ni,"invalid element buffer primitive"),qt=ni[kt.primitive]),"count"in kt&&(te(typeof kt.count=="number"&&kt.count>=0,"invalid vertex count for elements"),Tt=kt.count|0),"type"in kt&&(te.parameter(kt.type,mt,"invalid buffer type"),Cn=mt[kt.type]),"length"in kt?Zt=kt.length|0:(Zt=Tt,Cn===ci||Cn===Qi?Zt*=2:(Cn===ji||Cn===aa)&&(Zt*=4))),Kt($t,ln,Nt,qt,Tt,Zt,Cn)}return tn}return tn(At),tn._reglType="elements",tn._elements=$t,tn.subdata=function(kt,ln){return pt.subdata(kt,ln),tn},tn.destroy=function(){Gt($t)},tn}return{create:Dt,createStream:jt,destroyStream:ht,getElements:function(At){return typeof At=="function"&&At._elements instanceof Rt?At._elements:null},clear:function(){si(gt).forEach(Gt)}}}var pr=new Float32Array(1),Rr=new Uint32Array(pr.buffer),yo=5123;function N(G){for(var se=Eo.allocType(yo,G.length),Oe=0;Oe<G.length;++Oe)if(isNaN(G[Oe]))se[Oe]=65535;else if(G[Oe]===1/0)se[Oe]=31744;else if(G[Oe]===-1/0)se[Oe]=64512;else{pr[0]=G[Oe];var ut=Rr[0],gt=ut>>>31<<15,ot=(ut<<1>>>24)-127,mt=ut>>13&1023;if(ot<-24)se[Oe]=gt;else if(ot<-14){var Rt=-14-ot;se[Oe]=gt+(mt+1024>>Rt)}else ot>15?se[Oe]=gt+31744:se[Oe]=gt+(ot+15<<10)+mt}return se}function C(G){return Array.isArray(G)||n(G)}var z=function(G){return!(G&G-1)&&!!G},ie=34467,Ee=3553,Ke=34067,wt=34069,Yt=6408,Sn=6406,Or=6407,vn=6409,qr=6410,gr=32854,Fr=32855,la=36194,To=32819,ea=32820,_l=33635,bl=34042,Bl=6402,ds=34041,Ya=35904,fs=35906,ri=36193,Vl=33776,wl=33777,Ka=33778,Za=33779,Ws=35986,hh=35987,vh=34798,lp=35840,Rc=35841,Gs=35842,Xd=35843,mh=36196,zs=5121,jc=5123,qd=5125,Wo=5126,Gi=10242,Yd=10243,Kd=10497,ju=33071,zv=33648,Du=10240,Iu=10241,Dc=9728,Hs=9729,ps=9984,Lu=9985,Ic=9986,hs=9987,Hv=33170,Lc=4352,Xv=4353,qv=4354,yh=34046,Zd=3317,Di=37440,gh=37441,le=37443,Xs=37444,Ul=33984,Da=[ps,Ic,Lu,hs],jr=[0,vn,qr,Or,Yt],xi={};xi[vn]=xi[Sn]=xi[Bl]=1,xi[ds]=xi[qr]=2,xi[Or]=xi[Ya]=3,xi[Yt]=xi[fs]=4;function Ur(G){return"[object "+G+"]"}var Ja=Ur("HTMLCanvasElement"),Wl=Ur("OffscreenCanvas"),Ea=Ur("CanvasRenderingContext2D"),Jd=Ur("ImageBitmap"),Qd=Ur("HTMLImageElement"),sp=Ur("HTMLVideoElement"),_h=Object.keys(Zi).concat([Ja,Wl,Ea,Jd,Qd,sp]),Gl=[];Gl[zs]=1,Gl[Wo]=4,Gl[ri]=2,Gl[jc]=2,Gl[qd]=4;var Go=[];Go[gr]=2,Go[Fr]=2,Go[la]=2,Go[ds]=4,Go[Vl]=.5,Go[wl]=.5,Go[Ka]=1,Go[Za]=1,Go[Ws]=.5,Go[hh]=1,Go[vh]=1,Go[lp]=.5,Go[Rc]=.25,Go[Gs]=.5,Go[Xd]=.25,Go[mh]=.5;function $u(G){return Array.isArray(G)&&(G.length===0||typeof G[0]=="number")}function up(G){if(!Array.isArray(G))return!1;var se=G.length;return!(se===0||!C(G[0]))}function zl(G){return Object.prototype.toString.call(G)}function Qa(G){return zl(G)===Ja}function $c(G){return zl(G)===Wl}function vs(G){return zl(G)===Ea}function Oa(G){return zl(G)===Jd}function cp(G){return zl(G)===Qd}function dp(G){return zl(G)===sp}function el(G){if(!G)return!1;var se=zl(G);return _h.indexOf(se)>=0?!0:$u(G)||up(G)||$i(G)}function Oo(G){return Zi[Object.prototype.toString.call(G)]|0}function bh(G,se){var Oe=se.length;switch(G.type){case zs:case jc:case qd:case Wo:var ut=Eo.allocType(G.type,Oe);ut.set(se),G.data=ut;break;case ri:G.data=N(se);break;default:te.raise("unsupported texture type, must specify a typed array")}}function fp(G,se){return Eo.allocType(G.type===ri?Wo:G.type,se)}function zo(G,se){G.type===ri?(G.data=N(se),Eo.freeType(se)):G.data=se}function Zr(G,se,Oe,ut,gt,ot){for(var mt=G.width,Rt=G.height,Bt=G.channels,jt=mt*Rt*Bt,ht=fp(G,jt),Kt=0,Gt=0;Gt<Rt;++Gt)for(var Dt=0;Dt<mt;++Dt)for(var At=0;At<Bt;++At)ht[Kt++]=se[Oe*Dt+ut*Gt+gt*At+ot];zo(G,ht)}function oi(G,se,Oe,ut,gt,ot){var mt;if(typeof Go[G]<"u"?mt=Go[G]:mt=xi[G]*Gl[se],ot&&(mt*=6),gt){for(var Rt=0,Bt=Oe;Bt>=1;)Rt+=mt*Bt*Bt,Bt/=2;return Rt}else return mt*Oe*ut}function Mr(G,se,Oe,ut,gt,ot,mt){var Rt={"don't care":Lc,"dont care":Lc,nice:qv,fast:Xv},Bt={repeat:Kd,clamp:ju,mirror:zv},jt={nearest:Dc,linear:Hs},ht=a({mipmap:hs,"nearest mipmap nearest":ps,"linear mipmap nearest":Lu,"nearest mipmap linear":Ic,"linear mipmap linear":hs},jt),Kt={none:0,browser:Xs},Gt={uint8:zs,rgba4:To,rgb565:_l,"rgb5 a1":ea},Dt={alpha:Sn,luminance:vn,"luminance alpha":qr,rgb:Or,rgba:Yt,rgba4:gr,"rgb5 a1":Fr,rgb565:la},At={};se.ext_srgb&&(Dt.srgb=Ya,Dt.srgba=fs),se.oes_texture_float&&(Gt.float32=Gt.float=Wo),se.oes_texture_half_float&&(Gt.float16=Gt["half float"]=ri),se.webgl_depth_texture&&(a(Dt,{depth:Bl,"depth stencil":ds}),a(Gt,{uint16:jc,uint32:qd,"depth stencil":bl})),se.webgl_compressed_texture_s3tc&&a(At,{"rgb s3tc dxt1":Vl,"rgba s3tc dxt1":wl,"rgba s3tc dxt3":Ka,"rgba s3tc dxt5":Za}),se.webgl_compressed_texture_atc&&a(At,{"rgb atc":Ws,"rgba atc explicit alpha":hh,"rgba atc interpolated alpha":vh}),se.webgl_compressed_texture_pvrtc&&a(At,{"rgb pvrtc 4bppv1":lp,"rgb pvrtc 2bppv1":Rc,"rgba pvrtc 4bppv1":Gs,"rgba pvrtc 2bppv1":Xd}),se.webgl_compressed_texture_etc1&&(At["rgb etc1"]=mh);var Ze=Array.prototype.slice.call(G.getParameter(ie));Object.keys(At).forEach(function(ye){var ct=At[ye];Ze.indexOf(ct)>=0&&(Dt[ye]=ct)});var pt=Object.keys(Dt);Oe.textureFormats=pt;var $t=[];Object.keys(Dt).forEach(function(ye){var ct=Dt[ye];$t[ct]=ye});var tn=[];Object.keys(Gt).forEach(function(ye){var ct=Gt[ye];tn[ct]=ye});var kt=[];Object.keys(jt).forEach(function(ye){var ct=jt[ye];kt[ct]=ye});var ln=[];Object.keys(ht).forEach(function(ye){var ct=ht[ye];ln[ct]=ye});var Nt=[];Object.keys(Bt).forEach(function(ye){var ct=Bt[ye];Nt[ct]=ye});var qt=pt.reduce(function(ye,ct){var it=Dt[ct];return it===vn||it===Sn||it===vn||it===qr||it===Bl||it===ds||se.ext_srgb&&(it===Ya||it===fs)?ye[it]=it:it===Fr||ct.indexOf("rgba")>=0?ye[it]=Yt:ye[it]=Or,ye},{});function Tt(){this.internalformat=Yt,this.format=Yt,this.type=zs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Xs,this.width=0,this.height=0,this.channels=0}function Zt(ye,ct){ye.internalformat=ct.internalformat,ye.format=ct.format,ye.type=ct.type,ye.compressed=ct.compressed,ye.premultiplyAlpha=ct.premultiplyAlpha,ye.flipY=ct.flipY,ye.unpackAlignment=ct.unpackAlignment,ye.colorSpace=ct.colorSpace,ye.width=ct.width,ye.height=ct.height,ye.channels=ct.channels}function Cn(ye,ct){if(!(typeof ct!="object"||!ct)){if("premultiplyAlpha"in ct&&(te.type(ct.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),ye.premultiplyAlpha=ct.premultiplyAlpha),"flipY"in ct&&(te.type(ct.flipY,"boolean","invalid texture flip"),ye.flipY=ct.flipY),"alignment"in ct&&(te.oneOf(ct.alignment,[1,2,4,8],"invalid texture unpack alignment"),ye.unpackAlignment=ct.alignment),"colorSpace"in ct&&(te.parameter(ct.colorSpace,Kt,"invalid colorSpace"),ye.colorSpace=Kt[ct.colorSpace]),"type"in ct){var it=ct.type;te(se.oes_texture_float||!(it==="float"||it==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),te(se.oes_texture_half_float||!(it==="half float"||it==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),te(se.webgl_depth_texture||!(it==="uint16"||it==="uint32"||it==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),te.parameter(it,Gt,"invalid texture type"),ye.type=Gt[it]}var dn=ye.width,hr=ye.height,he=ye.channels,oe=!1;"shape"in ct?(te(Array.isArray(ct.shape)&&ct.shape.length>=2,"shape must be an array"),dn=ct.shape[0],hr=ct.shape[1],ct.shape.length===3&&(he=ct.shape[2],te(he>0&&he<=4,"invalid number of channels"),oe=!0),te(dn>=0&&dn<=Oe.maxTextureSize,"invalid width"),te(hr>=0&&hr<=Oe.maxTextureSize,"invalid height")):("radius"in ct&&(dn=hr=ct.radius,te(dn>=0&&dn<=Oe.maxTextureSize,"invalid radius")),"width"in ct&&(dn=ct.width,te(dn>=0&&dn<=Oe.maxTextureSize,"invalid width")),"height"in ct&&(hr=ct.height,te(hr>=0&&hr<=Oe.maxTextureSize,"invalid height")),"channels"in ct&&(he=ct.channels,te(he>0&&he<=4,"invalid number of channels"),oe=!0)),ye.width=dn|0,ye.height=hr|0,ye.channels=he|0;var Pe=!1;if("format"in ct){var Ge=ct.format;te(se.webgl_depth_texture||!(Ge==="depth"||Ge==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),te.parameter(Ge,Dt,"invalid texture format");var Je=ye.internalformat=Dt[Ge];ye.format=qt[Je],Ge in Gt&&("type"in ct||(ye.type=Gt[Ge])),Ge in At&&(ye.compressed=!0),Pe=!0}!oe&&Pe?ye.channels=xi[ye.format]:oe&&!Pe?ye.channels!==jr[ye.format]&&(ye.format=ye.internalformat=jr[ye.channels]):Pe&&oe&&te(ye.channels===xi[ye.format],"number of channels inconsistent with specified format")}}function Hn(ye){G.pixelStorei(Di,ye.flipY),G.pixelStorei(gh,ye.premultiplyAlpha),G.pixelStorei(le,ye.colorSpace),G.pixelStorei(Zd,ye.unpackAlignment)}function It(){Tt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Pt(ye,ct){var it=null;if(el(ct)?it=ct:ct&&(te.type(ct,"object","invalid pixel data type"),Cn(ye,ct),"x"in ct&&(ye.xOffset=ct.x|0),"y"in ct&&(ye.yOffset=ct.y|0),el(ct.data)&&(it=ct.data)),te(!ye.compressed||it instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),ct.copy){te(!it,"can not specify copy and data field for the same texture");var dn=gt.viewportWidth,hr=gt.viewportHeight;ye.width=ye.width||dn-ye.xOffset,ye.height=ye.height||hr-ye.yOffset,ye.needsCopy=!0,te(ye.xOffset>=0&&ye.xOffset<dn&&ye.yOffset>=0&&ye.yOffset<hr&&ye.width>0&&ye.width<=dn&&ye.height>0&&ye.height<=hr,"copy texture read out of bounds")}else if(!it)ye.width=ye.width||1,ye.height=ye.height||1,ye.channels=ye.channels||4;else if(n(it))ye.channels=ye.channels||4,ye.data=it,!("type"in ct)&&ye.type===zs&&(ye.type=Oo(it));else if($u(it))ye.channels=ye.channels||4,bh(ye,it),ye.alignment=1,ye.needsFree=!0;else if($i(it)){var he=it.data;!Array.isArray(he)&&ye.type===zs&&(ye.type=Oo(he));var oe=it.shape,Pe=it.stride,Ge,Je,De,Ce,Ve,pe;oe.length===3?(De=oe[2],pe=Pe[2]):(te(oe.length===2,"invalid ndarray pixel data, must be 2 or 3D"),De=1,pe=1),Ge=oe[0],Je=oe[1],Ce=Pe[0],Ve=Pe[1],ye.alignment=1,ye.width=Ge,ye.height=Je,ye.channels=De,ye.format=ye.internalformat=jr[De],ye.needsFree=!0,Zr(ye,he,Ce,Ve,pe,it.offset)}else if(Qa(it)||$c(it)||vs(it))Qa(it)||$c(it)?ye.element=it:ye.element=it.canvas,ye.width=ye.element.width,ye.height=ye.element.height,ye.channels=4;else if(Oa(it))ye.element=it,ye.width=it.width,ye.height=it.height,ye.channels=4;else if(cp(it))ye.element=it,ye.width=it.naturalWidth,ye.height=it.naturalHeight,ye.channels=4;else if(dp(it))ye.element=it,ye.width=it.videoWidth,ye.height=it.videoHeight,ye.channels=4;else if(up(it)){var Ae=ye.width||it[0].length,fe=ye.height||it.length,ze=ye.channels;C(it[0][0])?ze=ze||it[0][0].length:ze=ze||1;for(var Xe=ga.shape(it),p=1,y=0;y<Xe.length;++y)p*=Xe[y];var O=fp(ye,p);ga.flatten(it,Xe,"",O),zo(ye,O),ye.alignment=1,ye.width=Ae,ye.height=fe,ye.channels=ze,ye.format=ye.internalformat=jr[ze],ye.needsFree=!0}ye.type===Wo?te(Oe.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):ye.type===ri&&te(Oe.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Mt(ye,ct,it){var dn=ye.element,hr=ye.data,he=ye.internalformat,oe=ye.format,Pe=ye.type,Ge=ye.width,Je=ye.height;Hn(ye),dn?G.texImage2D(ct,it,oe,oe,Pe,dn):ye.compressed?G.compressedTexImage2D(ct,it,he,Ge,Je,0,hr):ye.needsCopy?(ut(),G.copyTexImage2D(ct,it,oe,ye.xOffset,ye.yOffset,Ge,Je,0)):G.texImage2D(ct,it,oe,Ge,Je,0,oe,Pe,hr||null)}function Ln(ye,ct,it,dn,hr){var he=ye.element,oe=ye.data,Pe=ye.internalformat,Ge=ye.format,Je=ye.type,De=ye.width,Ce=ye.height;Hn(ye),he?G.texSubImage2D(ct,hr,it,dn,Ge,Je,he):ye.compressed?G.compressedTexSubImage2D(ct,hr,it,dn,Pe,De,Ce,oe):ye.needsCopy?(ut(),G.copyTexSubImage2D(ct,hr,it,dn,ye.xOffset,ye.yOffset,De,Ce)):G.texSubImage2D(ct,hr,it,dn,De,Ce,Ge,Je,oe)}var or=[];function mn(){return or.pop()||new It}function cr(ye){ye.needsFree&&Eo.freeType(ye.data),It.call(ye),or.push(ye)}function Xn(){Tt.call(this),this.genMipmaps=!1,this.mipmapHint=Lc,this.mipmask=0,this.images=Array(16)}function lr(ye,ct,it){var dn=ye.images[0]=mn();ye.mipmask=1,dn.width=ye.width=ct,dn.height=ye.height=it,dn.channels=ye.channels=4}function Er(ye,ct){var it=null;if(el(ct))it=ye.images[0]=mn(),Zt(it,ye),Pt(it,ct),ye.mipmask=1;else if(Cn(ye,ct),Array.isArray(ct.mipmap))for(var dn=ct.mipmap,hr=0;hr<dn.length;++hr)it=ye.images[hr]=mn(),Zt(it,ye),it.width>>=hr,it.height>>=hr,Pt(it,dn[hr]),ye.mipmask|=1<<hr;else it=ye.images[0]=mn(),Zt(it,ye),Pt(it,ct),ye.mipmask=1;Zt(ye,ye.images[0]),ye.compressed&&(ye.internalformat===Vl||ye.internalformat===wl||ye.internalformat===Ka||ye.internalformat===Za)&&te(ye.width%4===0&&ye.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function $o(ye,ct){for(var it=ye.images,dn=0;dn<it.length;++dn){if(!it[dn])return;Mt(it[dn],ct,dn)}}var Ro=[];function ir(){var ye=Ro.pop()||new Xn;Tt.call(ye),ye.mipmask=0;for(var ct=0;ct<16;++ct)ye.images[ct]=null;return ye}function Zo(ye){for(var ct=ye.images,it=0;it<ct.length;++it)ct[it]&&cr(ct[it]),ct[it]=null;Ro.push(ye)}function so(){this.minFilter=Dc,this.magFilter=Dc,this.wrapS=ju,this.wrapT=ju,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Lc}function Fo(ye,ct){if("min"in ct){var it=ct.min;te.parameter(it,ht),ye.minFilter=ht[it],Da.indexOf(ye.minFilter)>=0&&!("faces"in ct)&&(ye.genMipmaps=!0)}if("mag"in ct){var dn=ct.mag;te.parameter(dn,jt),ye.magFilter=jt[dn]}var hr=ye.wrapS,he=ye.wrapT;if("wrap"in ct){var oe=ct.wrap;typeof oe=="string"?(te.parameter(oe,Bt),hr=he=Bt[oe]):Array.isArray(oe)&&(te.parameter(oe[0],Bt),te.parameter(oe[1],Bt),hr=Bt[oe[0]],he=Bt[oe[1]])}else{if("wrapS"in ct){var Pe=ct.wrapS;te.parameter(Pe,Bt),hr=Bt[Pe]}if("wrapT"in ct){var Ge=ct.wrapT;te.parameter(Ge,Bt),he=Bt[Ge]}}if(ye.wrapS=hr,ye.wrapT=he,"anisotropic"in ct){var Je=ct.anisotropic;te(typeof Je=="number"&&Je>=1&&Je<=Oe.maxAnisotropic,"aniso samples must be between 1 and "),ye.anisotropic=ct.anisotropic}if("mipmap"in ct){var De=!1;switch(typeof ct.mipmap){case"string":te.parameter(ct.mipmap,Rt,"invalid mipmap hint"),ye.mipmapHint=Rt[ct.mipmap],ye.genMipmaps=!0,De=!0;break;case"boolean":De=ye.genMipmaps=ct.mipmap;break;case"object":te(Array.isArray(ct.mipmap),"invalid mipmap type"),ye.genMipmaps=!1,De=!0;break;default:te.raise("invalid mipmap type")}De&&!("min"in ct)&&(ye.minFilter=ps)}}function qo(ye,ct){G.texParameteri(ct,Iu,ye.minFilter),G.texParameteri(ct,Du,ye.magFilter),G.texParameteri(ct,Gi,ye.wrapS),G.texParameteri(ct,Yd,ye.wrapT),se.ext_texture_filter_anisotropic&&G.texParameteri(ct,yh,ye.anisotropic),ye.genMipmaps&&(G.hint(Hv,ye.mipmapHint),G.generateMipmap(ct))}var ii=0,fi={},Jo=Oe.maxTextureUnits,go=Array(Jo).map(function(){return null});function er(ye){Tt.call(this),this.mipmask=0,this.internalformat=Yt,this.id=ii++,this.refCount=1,this.target=ye,this.texture=G.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new so,mt.profile&&(this.stats={size:0})}function pi(ye){G.activeTexture(Ul),G.bindTexture(ye.target,ye.texture)}function Tr(){var ye=go[0];ye?G.bindTexture(ye.target,ye.texture):G.bindTexture(Ee,null)}function In(ye){var ct=ye.texture;te(ct,"must not double destroy texture");var it=ye.unit,dn=ye.target;it>=0&&(G.activeTexture(Ul+it),G.bindTexture(dn,null),go[it]=null),G.deleteTexture(ct),ye.texture=null,ye.params=null,ye.pixels=null,ye.refCount=0,delete fi[ye.id],ot.textureCount--}a(er.prototype,{bind:function(){var ye=this;ye.bindCount+=1;var ct=ye.unit;if(ct<0){for(var it=0;it<Jo;++it){var dn=go[it];if(dn){if(dn.bindCount>0)continue;dn.unit=-1}go[it]=ye,ct=it;break}ct>=Jo&&te.raise("insufficient number of texture units"),mt.profile&&ot.maxTextureUnits<ct+1&&(ot.maxTextureUnits=ct+1),ye.unit=ct,G.activeTexture(Ul+ct),G.bindTexture(ye.target,ye.texture)}return ct},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&In(this)}});function mr(ye,ct){var it=new er(Ee);fi[it.id]=it,ot.textureCount++;function dn(oe,Pe){var Ge=it.texInfo;so.call(Ge);var Je=ir();return typeof oe=="number"?typeof Pe=="number"?lr(Je,oe|0,Pe|0):lr(Je,oe|0,oe|0):oe?(te.type(oe,"object","invalid arguments to regl.texture"),Fo(Ge,oe),Er(Je,oe)):lr(Je,1,1),Ge.genMipmaps&&(Je.mipmask=(Je.width<<1)-1),it.mipmask=Je.mipmask,Zt(it,Je),te.texture2D(Ge,Je,Oe),it.internalformat=Je.internalformat,dn.width=Je.width,dn.height=Je.height,pi(it),$o(Je,Ee),qo(Ge,Ee),Tr(),Zo(Je),mt.profile&&(it.stats.size=oi(it.internalformat,it.type,Je.width,Je.height,Ge.genMipmaps,!1)),dn.format=$t[it.internalformat],dn.type=tn[it.type],dn.mag=kt[Ge.magFilter],dn.min=ln[Ge.minFilter],dn.wrapS=Nt[Ge.wrapS],dn.wrapT=Nt[Ge.wrapT],dn}function hr(oe,Pe,Ge,Je){te(!!oe,"must specify image data");var De=Pe|0,Ce=Ge|0,Ve=Je|0,pe=mn();return Zt(pe,it),pe.width=0,pe.height=0,Pt(pe,oe),pe.width=pe.width||(it.width>>Ve)-De,pe.height=pe.height||(it.height>>Ve)-Ce,te(it.type===pe.type&&it.format===pe.format&&it.internalformat===pe.internalformat,"incompatible format for texture.subimage"),te(De>=0&&Ce>=0&&De+pe.width<=it.width&&Ce+pe.height<=it.height,"texture.subimage write out of bounds"),te(it.mipmask&1<<Ve,"missing mipmap data"),te(pe.data||pe.element||pe.needsCopy,"missing image data"),pi(it),Ln(pe,Ee,De,Ce,Ve),Tr(),cr(pe),dn}function he(oe,Pe){var Ge=oe|0,Je=Pe|0||Ge;if(Ge===it.width&&Je===it.height)return dn;dn.width=it.width=Ge,dn.height=it.height=Je,pi(it);for(var De=0;it.mipmask>>De;++De){var Ce=Ge>>De,Ve=Je>>De;if(!Ce||!Ve)break;G.texImage2D(Ee,De,it.format,Ce,Ve,0,it.format,it.type,null)}return Tr(),mt.profile&&(it.stats.size=oi(it.internalformat,it.type,Ge,Je,!1,!1)),dn}return dn(ye,ct),dn.subimage=hr,dn.resize=he,dn._reglType="texture2d",dn._texture=it,mt.profile&&(dn.stats=it.stats),dn.destroy=function(){it.decRef()},dn}function tr(ye,ct,it,dn,hr,he){var oe=new er(Ke);fi[oe.id]=oe,ot.cubeCount++;var Pe=new Array(6);function Ge(Ce,Ve,pe,Ae,fe,ze){var Xe,p=oe.texInfo;for(so.call(p),Xe=0;Xe<6;++Xe)Pe[Xe]=ir();if(typeof Ce=="number"||!Ce){var y=Ce|0||1;for(Xe=0;Xe<6;++Xe)lr(Pe[Xe],y,y)}else if(typeof Ce=="object")if(Ve)Er(Pe[0],Ce),Er(Pe[1],Ve),Er(Pe[2],pe),Er(Pe[3],Ae),Er(Pe[4],fe),Er(Pe[5],ze);else if(Fo(p,Ce),Cn(oe,Ce),"faces"in Ce){var O=Ce.faces;for(te(Array.isArray(O)&&O.length===6,"cube faces must be a length 6 array"),Xe=0;Xe<6;++Xe)te(typeof O[Xe]=="object"&&!!O[Xe],"invalid input for cube map face"),Zt(Pe[Xe],oe),Er(Pe[Xe],O[Xe])}else for(Xe=0;Xe<6;++Xe)Er(Pe[Xe],Ce);else te.raise("invalid arguments to cube map");for(Zt(oe,Pe[0]),Oe.npotTextureCube||te(z(oe.width)&&z(oe.height),"your browser does not support non power or two texture dimensions"),p.genMipmaps?oe.mipmask=(Pe[0].width<<1)-1:oe.mipmask=Pe[0].mipmask,te.textureCube(oe,p,Pe,Oe),oe.internalformat=Pe[0].internalformat,Ge.width=Pe[0].width,Ge.height=Pe[0].height,pi(oe),Xe=0;Xe<6;++Xe)$o(Pe[Xe],wt+Xe);for(qo(p,Ke),Tr(),mt.profile&&(oe.stats.size=oi(oe.internalformat,oe.type,Ge.width,Ge.height,p.genMipmaps,!0)),Ge.format=$t[oe.internalformat],Ge.type=tn[oe.type],Ge.mag=kt[p.magFilter],Ge.min=ln[p.minFilter],Ge.wrapS=Nt[p.wrapS],Ge.wrapT=Nt[p.wrapT],Xe=0;Xe<6;++Xe)Zo(Pe[Xe]);return Ge}function Je(Ce,Ve,pe,Ae,fe){te(!!Ve,"must specify image data"),te(typeof Ce=="number"&&Ce===(Ce|0)&&Ce>=0&&Ce<6,"invalid face");var ze=pe|0,Xe=Ae|0,p=fe|0,y=mn();return Zt(y,oe),y.width=0,y.height=0,Pt(y,Ve),y.width=y.width||(oe.width>>p)-ze,y.height=y.height||(oe.height>>p)-Xe,te(oe.type===y.type&&oe.format===y.format&&oe.internalformat===y.internalformat,"incompatible format for texture.subimage"),te(ze>=0&&Xe>=0&&ze+y.width<=oe.width&&Xe+y.height<=oe.height,"texture.subimage write out of bounds"),te(oe.mipmask&1<<p,"missing mipmap data"),te(y.data||y.element||y.needsCopy,"missing image data"),pi(oe),Ln(y,wt+Ce,ze,Xe,p),Tr(),cr(y),Ge}function De(Ce){var Ve=Ce|0;if(Ve!==oe.width){Ge.width=oe.width=Ve,Ge.height=oe.height=Ve,pi(oe);for(var pe=0;pe<6;++pe)for(var Ae=0;oe.mipmask>>Ae;++Ae)G.texImage2D(wt+pe,Ae,oe.format,Ve>>Ae,Ve>>Ae,0,oe.format,oe.type,null);return Tr(),mt.profile&&(oe.stats.size=oi(oe.internalformat,oe.type,Ge.width,Ge.height,!1,!0)),Ge}}return Ge(ye,ct,it,dn,hr,he),Ge.subimage=Je,Ge.resize=De,Ge._reglType="textureCube",Ge._texture=oe,mt.profile&&(Ge.stats=oe.stats),Ge.destroy=function(){oe.decRef()},Ge}function _o(){for(var ye=0;ye<Jo;++ye)G.activeTexture(Ul+ye),G.bindTexture(Ee,null),go[ye]=null;si(fi).forEach(In),ot.cubeCount=0,ot.textureCount=0}mt.profile&&(ot.getTotalTextureSize=function(){var ye=0;return Object.keys(fi).forEach(function(ct){ye+=fi[ct].stats.size}),ye});function kl(){for(var ye=0;ye<Jo;++ye){var ct=go[ye];ct&&(ct.bindCount=0,ct.unit=-1,go[ye]=null)}si(fi).forEach(function(it){it.texture=G.createTexture(),G.bindTexture(it.target,it.texture);for(var dn=0;dn<32;++dn)if((it.mipmask&1<<dn)!==0)if(it.target===Ee)G.texImage2D(Ee,dn,it.internalformat,it.width>>dn,it.height>>dn,0,it.internalformat,it.type,null);else for(var hr=0;hr<6;++hr)G.texImage2D(wt+hr,dn,it.internalformat,it.width>>dn,it.height>>dn,0,it.internalformat,it.type,null);qo(it.texInfo,it.target)})}function So(){for(var ye=0;ye<Jo;++ye){var ct=go[ye];ct&&(ct.bindCount=0,ct.unit=-1,go[ye]=null),G.activeTexture(Ul+ye),G.bindTexture(Ee,null),G.bindTexture(Ke,null)}}return{create2D:mr,createCube:tr,clear:_o,getTexture:function(ye){return null},restore:kl,refresh:So}}var co=36161,Dn=32854,fo=32855,Fc=36194,El=33189,ef=36168,No=34041,jo=35907,pp=34836,hp=34842,Bc=34843,zi=[];zi[Dn]=2,zi[fo]=2,zi[Fc]=2,zi[El]=2,zi[ef]=1,zi[No]=4,zi[jo]=4,zi[pp]=16,zi[hp]=8,zi[Bc]=6;function tf(G,se,Oe){return zi[G]*se*Oe}var Fu=function(G,se,Oe,ut,gt){var ot={rgba4:Dn,rgb565:Fc,"rgb5 a1":fo,depth:El,stencil:ef,"depth stencil":No};se.ext_srgb&&(ot.srgba=jo),se.ext_color_buffer_half_float&&(ot.rgba16f=hp,ot.rgb16f=Bc),se.webgl_color_buffer_float&&(ot.rgba32f=pp);var mt=[];Object.keys(ot).forEach(function(Dt){var At=ot[Dt];mt[At]=Dt});var Rt=0,Bt={};function jt(Dt){this.id=Rt++,this.refCount=1,this.renderbuffer=Dt,this.format=Dn,this.width=0,this.height=0,gt.profile&&(this.stats={size:0})}jt.prototype.decRef=function(){--this.refCount<=0&&ht(this)};function ht(Dt){var At=Dt.renderbuffer;te(At,"must not double destroy renderbuffer"),G.bindRenderbuffer(co,null),G.deleteRenderbuffer(At),Dt.renderbuffer=null,Dt.refCount=0,delete Bt[Dt.id],ut.renderbufferCount--}function Kt(Dt,At){var Ze=new jt(G.createRenderbuffer());Bt[Ze.id]=Ze,ut.renderbufferCount++;function pt(tn,kt){var ln=0,Nt=0,qt=Dn;if(typeof tn=="object"&&tn){var Tt=tn;if("shape"in Tt){var Zt=Tt.shape;te(Array.isArray(Zt)&&Zt.length>=2,"invalid renderbuffer shape"),ln=Zt[0]|0,Nt=Zt[1]|0}else"radius"in Tt&&(ln=Nt=Tt.radius|0),"width"in Tt&&(ln=Tt.width|0),"height"in Tt&&(Nt=Tt.height|0);"format"in Tt&&(te.parameter(Tt.format,ot,"invalid renderbuffer format"),qt=ot[Tt.format])}else typeof tn=="number"?(ln=tn|0,typeof kt=="number"?Nt=kt|0:Nt=ln):tn?te.raise("invalid arguments to renderbuffer constructor"):ln=Nt=1;if(te(ln>0&&Nt>0&&ln<=Oe.maxRenderbufferSize&&Nt<=Oe.maxRenderbufferSize,"invalid renderbuffer size"),!(ln===Ze.width&&Nt===Ze.height&&qt===Ze.format))return pt.width=Ze.width=ln,pt.height=Ze.height=Nt,Ze.format=qt,G.bindRenderbuffer(co,Ze.renderbuffer),G.renderbufferStorage(co,qt,ln,Nt),te(G.getError()===0,"invalid render buffer format"),gt.profile&&(Ze.stats.size=tf(Ze.format,Ze.width,Ze.height)),pt.format=mt[Ze.format],pt}function $t(tn,kt){var ln=tn|0,Nt=kt|0||ln;return ln===Ze.width&&Nt===Ze.height||(te(ln>0&&Nt>0&&ln<=Oe.maxRenderbufferSize&&Nt<=Oe.maxRenderbufferSize,"invalid renderbuffer size"),pt.width=Ze.width=ln,pt.height=Ze.height=Nt,G.bindRenderbuffer(co,Ze.renderbuffer),G.renderbufferStorage(co,Ze.format,ln,Nt),te(G.getError()===0,"invalid render buffer format"),gt.profile&&(Ze.stats.size=tf(Ze.format,Ze.width,Ze.height))),pt}return pt(Dt,At),pt.resize=$t,pt._reglType="renderbuffer",pt._renderbuffer=Ze,gt.profile&&(pt.stats=Ze.stats),pt.destroy=function(){Ze.decRef()},pt}gt.profile&&(ut.getTotalRenderbufferSize=function(){var Dt=0;return Object.keys(Bt).forEach(function(At){Dt+=Bt[At].stats.size}),Dt});function Gt(){si(Bt).forEach(function(Dt){Dt.renderbuffer=G.createRenderbuffer(),G.bindRenderbuffer(co,Dt.renderbuffer),G.renderbufferStorage(co,Dt.format,Dt.width,Dt.height)}),G.bindRenderbuffer(co,null)}return{create:Kt,clear:function(){si(Bt).forEach(ht)},restore:Gt}},Ia=36160,ms=36161,Hl=3553,La=34069,wh=36064,Ol=36096,xa=36128,vp=33306,mp=36053,nf=36054,Eh=36055,Oh=36057,xh=36061,rf=36193,yp=5121,gp=5126,Vc=6407,kr=6408,Yv=6402,_p=[Vc,kr],qs=[];qs[kr]=4,qs[Vc]=3;var Uc=[];Uc[yp]=1,Uc[gp]=4,Uc[rf]=2;var Kv=32854,Sh=32855,Sa=36194,Zv=33189,Wc=36168,of=34041,bp=35907,Ah=34836,sa=34842,ys=34843,af=[Kv,Sh,Sa,bp,sa,ys,Ah],Ys={};Ys[mp]="complete",Ys[nf]="incomplete attachment",Ys[Oh]="incomplete dimensions",Ys[Eh]="incomplete, missing attachment",Ys[xh]="unsupported";function lf(G,se,Oe,ut,gt,ot){var mt={cur:null,next:null,dirty:!1,setFBO:null},Rt=["rgba"],Bt=["rgba4","rgb565","rgb5 a1"];se.ext_srgb&&Bt.push("srgba"),se.ext_color_buffer_half_float&&Bt.push("rgba16f","rgb16f"),se.webgl_color_buffer_float&&Bt.push("rgba32f");var jt=["uint8"];se.oes_texture_half_float&&jt.push("half float","float16"),se.oes_texture_float&&jt.push("float","float32");function ht(It,Pt,Mt){this.target=It,this.texture=Pt,this.renderbuffer=Mt;var Ln=0,or=0;Pt?(Ln=Pt.width,or=Pt.height):Mt&&(Ln=Mt.width,or=Mt.height),this.width=Ln,this.height=or}function Kt(It){It&&(It.texture&&It.texture._texture.decRef(),It.renderbuffer&&It.renderbuffer._renderbuffer.decRef())}function Gt(It,Pt,Mt){if(It)if(It.texture){var Ln=It.texture._texture,or=Math.max(1,Ln.width),mn=Math.max(1,Ln.height);te(or===Pt&&mn===Mt,"inconsistent width/height for supplied texture"),Ln.refCount+=1}else{var cr=It.renderbuffer._renderbuffer;te(cr.width===Pt&&cr.height===Mt,"inconsistent width/height for renderbuffer"),cr.refCount+=1}}function Dt(It,Pt){Pt&&(Pt.texture?G.framebufferTexture2D(Ia,It,Pt.target,Pt.texture._texture.texture,0):G.framebufferRenderbuffer(Ia,It,ms,Pt.renderbuffer._renderbuffer.renderbuffer))}function At(It){var Pt=Hl,Mt=null,Ln=null,or=It;typeof It=="object"&&(or=It.data,"target"in It&&(Pt=It.target|0)),te.type(or,"function","invalid attachment data");var mn=or._reglType;return mn==="texture2d"?(Mt=or,te(Pt===Hl)):mn==="textureCube"?(Mt=or,te(Pt>=La&&Pt<La+6,"invalid cube map target")):mn==="renderbuffer"?(Ln=or,Pt=ms):te.raise("invalid regl object for attachment"),new ht(Pt,Mt,Ln)}function Ze(It,Pt,Mt,Ln,or){if(Mt){var mn=ut.create2D({width:It,height:Pt,format:Ln,type:or});return mn._texture.refCount=0,new ht(Hl,mn,null)}else{var cr=gt.create({width:It,height:Pt,format:Ln});return cr._renderbuffer.refCount=0,new ht(ms,null,cr)}}function pt(It){return It&&(It.texture||It.renderbuffer)}function $t(It,Pt,Mt){It&&(It.texture?It.texture.resize(Pt,Mt):It.renderbuffer&&It.renderbuffer.resize(Pt,Mt),It.width=Pt,It.height=Mt)}var tn=0,kt={};function ln(){this.id=tn++,kt[this.id]=this,this.framebuffer=G.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Nt(It){It.colorAttachments.forEach(Kt),Kt(It.depthAttachment),Kt(It.stencilAttachment),Kt(It.depthStencilAttachment)}function qt(It){var Pt=It.framebuffer;te(Pt,"must not double destroy framebuffer"),G.deleteFramebuffer(Pt),It.framebuffer=null,ot.framebufferCount--,delete kt[It.id]}function Tt(It){var Pt;G.bindFramebuffer(Ia,It.framebuffer);var Mt=It.colorAttachments;for(Pt=0;Pt<Mt.length;++Pt)Dt(wh+Pt,Mt[Pt]);for(Pt=Mt.length;Pt<Oe.maxColorAttachments;++Pt)G.framebufferTexture2D(Ia,wh+Pt,Hl,null,0);G.framebufferTexture2D(Ia,vp,Hl,null,0),G.framebufferTexture2D(Ia,Ol,Hl,null,0),G.framebufferTexture2D(Ia,xa,Hl,null,0),Dt(Ol,It.depthAttachment),Dt(xa,It.stencilAttachment),Dt(vp,It.depthStencilAttachment);var Ln=G.checkFramebufferStatus(Ia);!G.isContextLost()&&Ln!==mp&&te.raise("framebuffer configuration not supported, status = "+Ys[Ln]),G.bindFramebuffer(Ia,mt.next?mt.next.framebuffer:null),mt.cur=mt.next,G.getError()}function Zt(It,Pt){var Mt=new ln;ot.framebufferCount++;function Ln(mn,cr){var Xn;te(mt.next!==Mt,"can not update framebuffer which is currently in use");var lr=0,Er=0,$o=!0,Ro=!0,ir=null,Zo=!0,so="rgba",Fo="uint8",qo=1,ii=null,fi=null,Jo=null,go=!1;if(typeof mn=="number")lr=mn|0,Er=cr|0||lr;else if(!mn)lr=Er=1;else{te.type(mn,"object","invalid arguments for framebuffer");var er=mn;if("shape"in er){var pi=er.shape;te(Array.isArray(pi)&&pi.length>=2,"invalid shape for framebuffer"),lr=pi[0],Er=pi[1]}else"radius"in er&&(lr=Er=er.radius),"width"in er&&(lr=er.width),"height"in er&&(Er=er.height);("color"in er||"colors"in er)&&(ir=er.color||er.colors,Array.isArray(ir)&&te(ir.length===1||se.webgl_draw_buffers,"multiple render targets not supported")),ir||("colorCount"in er&&(qo=er.colorCount|0,te(qo>0,"invalid color buffer count")),"colorTexture"in er&&(Zo=!!er.colorTexture,so="rgba4"),"colorType"in er&&(Fo=er.colorType,Zo?(te(se.oes_texture_float||!(Fo==="float"||Fo==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),te(se.oes_texture_half_float||!(Fo==="half float"||Fo==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Fo==="half float"||Fo==="float16"?(te(se.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),so="rgba16f"):(Fo==="float"||Fo==="float32")&&(te(se.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),so="rgba32f"),te.oneOf(Fo,jt,"invalid color type")),"colorFormat"in er&&(so=er.colorFormat,Rt.indexOf(so)>=0?Zo=!0:Bt.indexOf(so)>=0?Zo=!1:Zo?te.oneOf(er.colorFormat,Rt,"invalid color format for texture"):te.oneOf(er.colorFormat,Bt,"invalid color format for renderbuffer"))),("depthTexture"in er||"depthStencilTexture"in er)&&(go=!!(er.depthTexture||er.depthStencilTexture),te(!go||se.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in er&&(typeof er.depth=="boolean"?$o=er.depth:(ii=er.depth,Ro=!1)),"stencil"in er&&(typeof er.stencil=="boolean"?Ro=er.stencil:(fi=er.stencil,$o=!1)),"depthStencil"in er&&(typeof er.depthStencil=="boolean"?$o=Ro=er.depthStencil:(Jo=er.depthStencil,$o=!1,Ro=!1))}var Tr=null,In=null,mr=null,tr=null;if(Array.isArray(ir))Tr=ir.map(At);else if(ir)Tr=[At(ir)];else for(Tr=new Array(qo),Xn=0;Xn<qo;++Xn)Tr[Xn]=Ze(lr,Er,Zo,so,Fo);te(se.webgl_draw_buffers||Tr.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),te(Tr.length<=Oe.maxColorAttachments,"too many color attachments, not supported"),lr=lr||Tr[0].width,Er=Er||Tr[0].height,ii?In=At(ii):$o&&!Ro&&(In=Ze(lr,Er,go,"depth","uint32")),fi?mr=At(fi):Ro&&!$o&&(mr=Ze(lr,Er,!1,"stencil","uint8")),Jo?tr=At(Jo):!ii&&!fi&&Ro&&$o&&(tr=Ze(lr,Er,go,"depth stencil","depth stencil")),te(!!ii+!!fi+!!Jo<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var _o=null;for(Xn=0;Xn<Tr.length;++Xn)if(Gt(Tr[Xn],lr,Er),te(!Tr[Xn]||Tr[Xn].texture&&_p.indexOf(Tr[Xn].texture._texture.format)>=0||Tr[Xn].renderbuffer&&af.indexOf(Tr[Xn].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Xn+" is invalid"),Tr[Xn]&&Tr[Xn].texture){var kl=qs[Tr[Xn].texture._texture.format]*Uc[Tr[Xn].texture._texture.type];_o===null?_o=kl:te(_o===kl,"all color attachments much have the same number of bits per pixel.")}return Gt(In,lr,Er),te(!In||In.texture&&In.texture._texture.format===Yv||In.renderbuffer&&In.renderbuffer._renderbuffer.format===Zv,"invalid depth attachment for framebuffer object"),Gt(mr,lr,Er),te(!mr||mr.renderbuffer&&mr.renderbuffer._renderbuffer.format===Wc,"invalid stencil attachment for framebuffer object"),Gt(tr,lr,Er),te(!tr||tr.texture&&tr.texture._texture.format===of||tr.renderbuffer&&tr.renderbuffer._renderbuffer.format===of,"invalid depth-stencil attachment for framebuffer object"),Nt(Mt),Mt.width=lr,Mt.height=Er,Mt.colorAttachments=Tr,Mt.depthAttachment=In,Mt.stencilAttachment=mr,Mt.depthStencilAttachment=tr,Ln.color=Tr.map(pt),Ln.depth=pt(In),Ln.stencil=pt(mr),Ln.depthStencil=pt(tr),Ln.width=Mt.width,Ln.height=Mt.height,Tt(Mt),Ln}function or(mn,cr){te(mt.next!==Mt,"can not resize a framebuffer which is currently in use");var Xn=Math.max(mn|0,1),lr=Math.max(cr|0||Xn,1);if(Xn===Mt.width&&lr===Mt.height)return Ln;for(var Er=Mt.colorAttachments,$o=0;$o<Er.length;++$o)$t(Er[$o],Xn,lr);return $t(Mt.depthAttachment,Xn,lr),$t(Mt.stencilAttachment,Xn,lr),$t(Mt.depthStencilAttachment,Xn,lr),Mt.width=Ln.width=Xn,Mt.height=Ln.height=lr,Tt(Mt),Ln}return Ln(It,Pt),a(Ln,{resize:or,_reglType:"framebuffer",_framebuffer:Mt,destroy:function(){qt(Mt),Nt(Mt)},use:function(mn){mt.setFBO({framebuffer:Ln},mn)}})}function Cn(It){var Pt=Array(6);function Mt(or){var mn;te(Pt.indexOf(mt.next)<0,"can not update framebuffer which is currently in use");var cr={color:null},Xn=0,lr=null,Er="rgba",$o="uint8",Ro=1;if(typeof or=="number")Xn=or|0;else if(!or)Xn=1;else{te.type(or,"object","invalid arguments for framebuffer");var ir=or;if("shape"in ir){var Zo=ir.shape;te(Array.isArray(Zo)&&Zo.length>=2,"invalid shape for framebuffer"),te(Zo[0]===Zo[1],"cube framebuffer must be square"),Xn=Zo[0]}else"radius"in ir&&(Xn=ir.radius|0),"width"in ir?(Xn=ir.width|0,"height"in ir&&te(ir.height===Xn,"must be square")):"height"in ir&&(Xn=ir.height|0);("color"in ir||"colors"in ir)&&(lr=ir.color||ir.colors,Array.isArray(lr)&&te(lr.length===1||se.webgl_draw_buffers,"multiple render targets not supported")),lr||("colorCount"in ir&&(Ro=ir.colorCount|0,te(Ro>0,"invalid color buffer count")),"colorType"in ir&&(te.oneOf(ir.colorType,jt,"invalid color type"),$o=ir.colorType),"colorFormat"in ir&&(Er=ir.colorFormat,te.oneOf(ir.colorFormat,Rt,"invalid color format for texture"))),"depth"in ir&&(cr.depth=ir.depth),"stencil"in ir&&(cr.stencil=ir.stencil),"depthStencil"in ir&&(cr.depthStencil=ir.depthStencil)}var so;if(lr)if(Array.isArray(lr))for(so=[],mn=0;mn<lr.length;++mn)so[mn]=lr[mn];else so=[lr];else{so=Array(Ro);var Fo={radius:Xn,format:Er,type:$o};for(mn=0;mn<Ro;++mn)so[mn]=ut.createCube(Fo)}for(cr.color=Array(so.length),mn=0;mn<so.length;++mn){var qo=so[mn];te(typeof qo=="function"&&qo._reglType==="textureCube","invalid cube map"),Xn=Xn||qo.width,te(qo.width===Xn&&qo.height===Xn,"invalid cube map shape"),cr.color[mn]={target:La,data:so[mn]}}for(mn=0;mn<6;++mn){for(var ii=0;ii<so.length;++ii)cr.color[ii].target=La+mn;mn>0&&(cr.depth=Pt[0].depth,cr.stencil=Pt[0].stencil,cr.depthStencil=Pt[0].depthStencil),Pt[mn]?Pt[mn](cr):Pt[mn]=Zt(cr)}return a(Mt,{width:Xn,height:Xn,color:so})}function Ln(or){var mn,cr=or|0;if(te(cr>0&&cr<=Oe.maxCubeMapSize,"invalid radius for cube fbo"),cr===Mt.width)return Mt;var Xn=Mt.color;for(mn=0;mn<Xn.length;++mn)Xn[mn].resize(cr);for(mn=0;mn<6;++mn)Pt[mn].resize(cr);return Mt.width=Mt.height=cr,Mt}return Mt(It),a(Mt,{faces:Pt,resize:Ln,_reglType:"framebufferCube",destroy:function(){Pt.forEach(function(or){or.destroy()})}})}function Hn(){mt.cur=null,mt.next=null,mt.dirty=!0,si(kt).forEach(function(It){It.framebuffer=G.createFramebuffer(),Tt(It)})}return a(mt,{getFramebuffer:function(It){if(typeof It=="function"&&It._reglType==="framebuffer"){var Pt=It._framebuffer;if(Pt instanceof ln)return Pt}return null},create:Zt,createCube:Cn,clear:function(){si(kt).forEach(qt)},restore:Hn})}var wp=5126,sf=34962;function Gc(){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=wp,this.offset=0,this.stride=0,this.divisor=0}function uf(G,se,Oe,ut,gt){for(var ot=Oe.maxAttributes,mt=new Array(ot),Rt=0;Rt<ot;++Rt)mt[Rt]=new Gc;var Bt=0,jt={},ht={Record:Gc,scope:{},state:mt,currentVAO:null,targetVAO:null,restore:Gt()?kt:function(){},createVAO:ln,getVAO:At,destroyBuffer:Kt,setVAO:Gt()?Ze:pt,clear:Gt()?$t:function(){}};function Kt(Nt){for(var qt=0;qt<mt.length;++qt){var Tt=mt[qt];Tt.buffer===Nt&&(G.disableVertexAttribArray(qt),Tt.buffer=null)}}function Gt(){return se.oes_vertex_array_object}function Dt(){return se.angle_instanced_arrays}function At(Nt){return typeof Nt=="function"&&Nt._vao?Nt._vao:null}function Ze(Nt){if(Nt!==ht.currentVAO){var qt=Gt();Nt?qt.bindVertexArrayOES(Nt.vao):qt.bindVertexArrayOES(null),ht.currentVAO=Nt}}function pt(Nt){if(Nt!==ht.currentVAO){if(Nt)Nt.bindAttrs();else for(var qt=Dt(),Tt=0;Tt<mt.length;++Tt){var Zt=mt[Tt];Zt.buffer?(G.enableVertexAttribArray(Tt),G.vertexAttribPointer(Tt,Zt.size,Zt.type,Zt.normalized,Zt.stride,Zt.offfset),qt&&Zt.divisor&&qt.vertexAttribDivisorANGLE(Tt,Zt.divisor)):(G.disableVertexAttribArray(Tt),G.vertexAttrib4f(Tt,Zt.x,Zt.y,Zt.z,Zt.w))}ht.currentVAO=Nt}}function $t(){si(jt).forEach(function(Nt){Nt.destroy()})}function tn(){this.id=++Bt,this.attributes=[];var Nt=Gt();Nt?this.vao=Nt.createVertexArrayOES():this.vao=null,jt[this.id]=this,this.buffers=[]}tn.prototype.bindAttrs=function(){for(var Nt=Dt(),qt=this.attributes,Tt=0;Tt<qt.length;++Tt){var Zt=qt[Tt];Zt.buffer?(G.enableVertexAttribArray(Tt),G.bindBuffer(sf,Zt.buffer.buffer),G.vertexAttribPointer(Tt,Zt.size,Zt.type,Zt.normalized,Zt.stride,Zt.offset),Nt&&Zt.divisor&&Nt.vertexAttribDivisorANGLE(Tt,Zt.divisor)):(G.disableVertexAttribArray(Tt),G.vertexAttrib4f(Tt,Zt.x,Zt.y,Zt.z,Zt.w))}for(var Cn=qt.length;Cn<ot;++Cn)G.disableVertexAttribArray(Cn)},tn.prototype.refresh=function(){var Nt=Gt();Nt&&(Nt.bindVertexArrayOES(this.vao),this.bindAttrs(),ht.currentVAO=this)},tn.prototype.destroy=function(){if(this.vao){var Nt=Gt();this===ht.currentVAO&&(ht.currentVAO=null,Nt.bindVertexArrayOES(null)),Nt.deleteVertexArrayOES(this.vao),this.vao=null}jt[this.id]&&(delete jt[this.id],ut.vaoCount-=1)};function kt(){var Nt=Gt();Nt&&si(jt).forEach(function(qt){qt.refresh()})}function ln(Nt){var qt=new tn;ut.vaoCount+=1;function Tt(Zt){te(Array.isArray(Zt),"arguments to vertex array constructor must be an array"),te(Zt.length<ot,"too many attributes"),te(Zt.length>0,"must specify at least one attribute");var Cn={},Hn=qt.attributes;Hn.length=Zt.length;for(var It=0;It<Zt.length;++It){var Pt=Zt[It],Mt=Hn[It]=new Gc,Ln=Pt.data||Pt;if(Array.isArray(Ln)||n(Ln)||$i(Ln)){var or;qt.buffers[It]&&(or=qt.buffers[It],n(Ln)&&or._buffer.byteLength>=Ln.byteLength?or.subdata(Ln):(or.destroy(),qt.buffers[It]=null)),qt.buffers[It]||(or=qt.buffers[It]=gt.create(Pt,sf,!1,!0)),Mt.buffer=gt.getBuffer(or),Mt.size=Mt.buffer.dimension|0,Mt.normalized=!1,Mt.type=Mt.buffer.dtype,Mt.offset=0,Mt.stride=0,Mt.divisor=0,Mt.state=1,Cn[It]=1}else gt.getBuffer(Pt)?(Mt.buffer=gt.getBuffer(Pt),Mt.size=Mt.buffer.dimension|0,Mt.normalized=!1,Mt.type=Mt.buffer.dtype,Mt.offset=0,Mt.stride=0,Mt.divisor=0,Mt.state=1):gt.getBuffer(Pt.buffer)?(Mt.buffer=gt.getBuffer(Pt.buffer),Mt.size=(+Pt.size||Mt.buffer.dimension)|0,Mt.normalized=!!Pt.normalized||!1,"type"in Pt?(te.parameter(Pt.type,Vi,"invalid buffer type"),Mt.type=Vi[Pt.type]):Mt.type=Mt.buffer.dtype,Mt.offset=(Pt.offset||0)|0,Mt.stride=(Pt.stride||0)|0,Mt.divisor=(Pt.divisor||0)|0,Mt.state=1,te(Mt.size>=1&&Mt.size<=4,"size must be between 1 and 4"),te(Mt.offset>=0,"invalid offset"),te(Mt.stride>=0&&Mt.stride<=255,"stride must be between 0 and 255"),te(Mt.divisor>=0,"divisor must be positive"),te(!Mt.divisor||!!se.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Pt?(te(It>0,"first attribute must not be a constant"),Mt.x=+Pt.x||0,Mt.y=+Pt.y||0,Mt.z=+Pt.z||0,Mt.w=+Pt.w||0,Mt.state=2):te(!1,"invalid attribute spec for location "+It)}for(var mn=0;mn<qt.buffers.length;++mn)!Cn[mn]&&qt.buffers[mn]&&(qt.buffers[mn].destroy(),qt.buffers[mn]=null);return qt.refresh(),Tt}return Tt.destroy=function(){for(var Zt=0;Zt<qt.buffers.length;++Zt)qt.buffers[Zt]&&qt.buffers[Zt].destroy();qt.buffers.length=0,qt.destroy()},Tt._vao=qt,Tt._reglType="vao",Tt(Nt)}return ht}var cf=35632,Yr=35633,Jv=35718,no=35721;function df(G,se,Oe,ut){var gt={},ot={};function mt(Ze,pt,$t,tn){this.name=Ze,this.id=pt,this.location=$t,this.info=tn}function Rt(Ze,pt){for(var $t=0;$t<Ze.length;++$t)if(Ze[$t].id===pt.id){Ze[$t].location=pt.location;return}Ze.push(pt)}function Bt(Ze,pt,$t){var tn=Ze===cf?gt:ot,kt=tn[pt];if(!kt){var ln=se.str(pt);kt=G.createShader(Ze),G.shaderSource(kt,ln),G.compileShader(kt),te.shaderError(G,kt,ln,Ze,$t),tn[pt]=kt}return kt}var jt={},ht=[],Kt=0;function Gt(Ze,pt){this.id=Kt++,this.fragId=Ze,this.vertId=pt,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ut.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Dt(Ze,pt,$t){var tn,kt,ln=Bt(cf,Ze.fragId),Nt=Bt(Yr,Ze.vertId),qt=Ze.program=G.createProgram();if(G.attachShader(qt,ln),G.attachShader(qt,Nt),$t)for(tn=0;tn<$t.length;++tn){var Tt=$t[tn];G.bindAttribLocation(qt,Tt[0],Tt[1])}G.linkProgram(qt),te.linkError(G,qt,se.str(Ze.fragId),se.str(Ze.vertId),pt);var Zt=G.getProgramParameter(qt,Jv);ut.profile&&(Ze.stats.uniformsCount=Zt);var Cn=Ze.uniforms;for(tn=0;tn<Zt;++tn)if(kt=G.getActiveUniform(qt,tn),kt)if(kt.size>1)for(var Hn=0;Hn<kt.size;++Hn){var It=kt.name.replace("[0]","["+Hn+"]");Rt(Cn,new mt(It,se.id(It),G.getUniformLocation(qt,It),kt))}else Rt(Cn,new mt(kt.name,se.id(kt.name),G.getUniformLocation(qt,kt.name),kt));var Pt=G.getProgramParameter(qt,no);ut.profile&&(Ze.stats.attributesCount=Pt);var Mt=Ze.attributes;for(tn=0;tn<Pt;++tn)kt=G.getActiveAttrib(qt,tn),kt&&Rt(Mt,new mt(kt.name,se.id(kt.name),G.getAttribLocation(qt,kt.name),kt))}ut.profile&&(Oe.getMaxUniformsCount=function(){var Ze=0;return ht.forEach(function(pt){pt.stats.uniformsCount>Ze&&(Ze=pt.stats.uniformsCount)}),Ze},Oe.getMaxAttributesCount=function(){var Ze=0;return ht.forEach(function(pt){pt.stats.attributesCount>Ze&&(Ze=pt.stats.attributesCount)}),Ze});function At(){gt={},ot={};for(var Ze=0;Ze<ht.length;++Ze)Dt(ht[Ze],null,ht[Ze].attributes.map(function(pt){return[pt.location,pt.name]}))}return{clear:function(){var Ze=G.deleteShader.bind(G);si(gt).forEach(Ze),gt={},si(ot).forEach(Ze),ot={},ht.forEach(function(pt){G.deleteProgram(pt.program)}),ht.length=0,jt={},Oe.shaderCount=0},program:function(Ze,pt,$t,tn){te.command(Ze>=0,"missing vertex shader",$t),te.command(pt>=0,"missing fragment shader",$t);var kt=jt[pt];kt||(kt=jt[pt]={});var ln=kt[Ze];if(ln&&(ln.refCount++,!tn))return ln;var Nt=new Gt(pt,Ze);return Oe.shaderCount++,Dt(Nt,$t,tn),ln||(kt[Ze]=Nt),ht.push(Nt),a(Nt,{destroy:function(){if(Nt.refCount--,Nt.refCount<=0){G.deleteProgram(Nt.program);var qt=ht.indexOf(Nt);ht.splice(qt,1),Oe.shaderCount--}kt[Nt.vertId].refCount<=0&&(G.deleteShader(ot[Nt.vertId]),delete ot[Nt.vertId],delete jt[Nt.fragId][Nt.vertId]),Object.keys(jt[Nt.fragId]).length||(G.deleteShader(gt[Nt.fragId]),delete gt[Nt.fragId],delete jt[Nt.fragId])}})},restore:At,shader:Bt,frag:-1,vert:-1}}var Mh=6408,Ks=5121,kh=3333,Bu=5126;function Th(G,se,Oe,ut,gt,ot,mt){function Rt(ht){var Kt;se.next===null?(te(gt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Kt=Ks):(te(se.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Kt=se.next.colorAttachments[0].texture._texture.type,ot.oes_texture_float?(te(Kt===Ks||Kt===Bu,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Kt===Bu&&te(mt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):te(Kt===Ks,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Gt=0,Dt=0,At=ut.framebufferWidth,Ze=ut.framebufferHeight,pt=null;n(ht)?pt=ht:ht&&(te.type(ht,"object","invalid arguments to regl.read()"),Gt=ht.x|0,Dt=ht.y|0,te(Gt>=0&&Gt<ut.framebufferWidth,"invalid x offset for regl.read"),te(Dt>=0&&Dt<ut.framebufferHeight,"invalid y offset for regl.read"),At=(ht.width||ut.framebufferWidth-Gt)|0,Ze=(ht.height||ut.framebufferHeight-Dt)|0,pt=ht.data||null),pt&&(Kt===Ks?te(pt instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Kt===Bu&&te(pt instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),te(At>0&&At+Gt<=ut.framebufferWidth,"invalid width for read pixels"),te(Ze>0&&Ze+Dt<=ut.framebufferHeight,"invalid height for read pixels"),Oe();var $t=At*Ze*4;return pt||(Kt===Ks?pt=new Uint8Array($t):Kt===Bu&&(pt=pt||new Float32Array($t))),te.isTypedArray(pt,"data buffer for regl.read() must be a typedarray"),te(pt.byteLength>=$t,"data buffer for regl.read() too small"),G.pixelStorei(kh,4),G.readPixels(Gt,Dt,At,Ze,Mh,Kt,pt),pt}function Bt(ht){var Kt;return se.setFBO({framebuffer:ht.framebuffer},function(){Kt=Rt(ht)}),Kt}function jt(ht){return!ht||!("framebuffer"in ht)?Rt(ht):Bt(ht)}return jt}function Zs(G){return Array.prototype.slice.call(G)}function yi(G){return Zs(G).join("")}function tl(){var G=0,se=[],Oe=[];function ut(Kt){for(var Gt=0;Gt<Oe.length;++Gt)if(Oe[Gt]===Kt)return se[Gt];var Dt="g"+G++;return se.push(Dt),Oe.push(Kt),Dt}function gt(){var Kt=[];function Gt(){Kt.push.apply(Kt,Zs(arguments))}var Dt=[];function At(){var Ze="v"+G++;return Dt.push(Ze),arguments.length>0&&(Kt.push(Ze,"="),Kt.push.apply(Kt,Zs(arguments)),Kt.push(";")),Ze}return a(Gt,{def:At,toString:function(){return yi([Dt.length>0?"var "+Dt.join(",")+";":"",yi(Kt)])}})}function ot(){var Kt=gt(),Gt=gt(),Dt=Kt.toString,At=Gt.toString;function Ze(pt,$t){Gt(pt,$t,"=",Kt.def(pt,$t),";")}return a(function(){Kt.apply(Kt,Zs(arguments))},{def:Kt.def,entry:Kt,exit:Gt,save:Ze,set:function(pt,$t,tn){Ze(pt,$t),Kt(pt,$t,"=",tn,";")},toString:function(){return Dt()+At()}})}function mt(){var Kt=yi(arguments),Gt=ot(),Dt=ot(),At=Gt.toString,Ze=Dt.toString;return a(Gt,{then:function(){return Gt.apply(Gt,Zs(arguments)),this},else:function(){return Dt.apply(Dt,Zs(arguments)),this},toString:function(){var pt=Ze();return pt&&(pt="else{"+pt+"}"),yi(["if(",Kt,"){",At(),"}",pt])}})}var Rt=gt(),Bt={};function jt(Kt,Gt){var Dt=[];function At(){var kt="a"+Dt.length;return Dt.push(kt),kt}Gt=Gt||0;for(var Ze=0;Ze<Gt;++Ze)At();var pt=ot(),$t=pt.toString,tn=Bt[Kt]=a(pt,{arg:At,toString:function(){return yi(["function(",Dt.join(),"){",$t(),"}"])}});return tn}function ht(){var Kt=['"use strict";',Rt,"return {"];Object.keys(Bt).forEach(function(At){Kt.push('"',At,'":',Bt[At].toString(),",")}),Kt.push("}");var Gt=yi(Kt).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),Dt=Function.apply(null,se.concat(Gt));return Dt.apply(null,Oe)}return{global:Rt,link:ut,block:gt,proc:jt,scope:ot,cond:mt,compile:ht}}var Xl="xyzw".split(""),Js=5121,Qs=1,eu=2,ff=0,ql=1,tu=2,pf=3,nl=4,zc=5,Hc=6,Vu="dither",Uu="blend.enable",Wu="blend.color",hf="blend.equation",Gu="blend.func",Ep="depth.enable",vf="depth.func",Nh="depth.range",Op="depth.mask",rl="colorMask",xp="cull.enable",Sp="cull.face",Ap="frontFace",zu="lineWidth",xl="polygonOffset.enable",Xc="polygonOffset.offset",mf="sample.alpha",yf="sample.enable",gs="sample.coverage",_s="stencil.enable",rr="stencil.mask",Hu="stencil.func",qc="stencil.opFront",ol="stencil.opBack",di="scissor.enable",nu="scissor.box",Do="viewport",bs="profile",ta="framebuffer",Yc="vert",Ii="frag",Ho="elements",Sl="primitive",Al="count",gf="offset",Ct="instances",ru="vao",Kc="Width",Zc="Height",ws=ta+Kc,ou=ta+Zc,_f=Do+Kc,Mp=Do+Zc,iu="drawingBuffer",Jc=iu+Kc,bf=iu+Zc,kp=[Gu,hf,Hu,qc,ol,gs,Do,nu,Xc],Ml=34962,Tp=34963,il=35632,Es=35633,wf=3553,Ph=34067,Ch=2884,Rh=3042,Np=3024,Ef=2960,Qc=2929,jh=3089,al=32823,Os=32926,Qv=32928,xo=5126,ed=35664,au=35665,td=35666,Xu=5124,nd=35667,rd=35668,od=35669,lu=35670,Yl=35671,gi=35672,Of=35673,id=35674,su=35675,qu=35676,Si=35678,Po=35680,ad=4,Hi=1028,Wn=1029,xf=2304,ld=2305,Sf=32775,Pp=32776,Dh=519,xs=7680,Ih=0,uu=1,Lh=32774,Cp=513,sd=36160,$h=36064,$a={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},Kl=["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"],Ss={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},zn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Rp={frag:il,vert:Es},Yu={cw:xf,ccw:ld};function Zl(G){return Array.isArray(G)||n(G)||$i(G)}function ud(G){return G.sort(function(se,Oe){return se===Do?-1:Oe===Do?1:se<Oe?-1:1})}function Xi(G,se,Oe,ut){this.thisDep=G,this.contextDep=se,this.propDep=Oe,this.append=ut}function ll(G){return G&&!(G.thisDep||G.contextDep||G.propDep)}function Io(G){return new Xi(!1,!1,!1,G)}function ua(G,se){var Oe=G.type;if(Oe===ff){var ut=G.data.length;return new Xi(!0,ut>=1,ut>=2,se)}else if(Oe===nl){var gt=G.data;return new Xi(gt.thisDep,gt.contextDep,gt.propDep,se)}else{if(Oe===zc)return new Xi(!1,!1,!1,se);if(Oe===Hc){for(var ot=!1,mt=!1,Rt=!1,Bt=0;Bt<G.data.length;++Bt){var jt=G.data[Bt];if(jt.type===ql)Rt=!0;else if(jt.type===tu)mt=!0;else if(jt.type===pf)ot=!0;else if(jt.type===ff){ot=!0;var ht=jt.data;ht>=1&&(mt=!0),ht>=2&&(Rt=!0)}else jt.type===nl&&(ot=ot||jt.data.thisDep,mt=mt||jt.data.contextDep,Rt=Rt||jt.data.propDep)}return new Xi(ot,mt,Rt,se)}else return new Xi(Oe===pf,Oe===tu,Oe===ql,se)}}var Fa=new Xi(!1,!1,!1,function(){});function em(G,se,Oe,ut,gt,ot,mt,Rt,Bt,jt,ht,Kt,Gt,Dt,At){var Ze=jt.Record,pt={add:32774,subtract:32778,"reverse subtract":32779};Oe.ext_blend_minmax&&(pt.min=Sf,pt.max=Pp);var $t=Oe.angle_instanced_arrays,tn=Oe.webgl_draw_buffers,kt={dirty:!0,profile:At.profile},ln={},Nt=[],qt={},Tt={};function Zt(he){return he.replace(".","_")}function Cn(he,oe,Pe){var Ge=Zt(he);Nt.push(he),ln[Ge]=kt[Ge]=!!Pe,qt[Ge]=oe}function Hn(he,oe,Pe){var Ge=Zt(he);Nt.push(he),Array.isArray(Pe)?(kt[Ge]=Pe.slice(),ln[Ge]=Pe.slice()):kt[Ge]=ln[Ge]=Pe,Tt[Ge]=oe}Cn(Vu,Np),Cn(Uu,Rh),Hn(Wu,"blendColor",[0,0,0,0]),Hn(hf,"blendEquationSeparate",[Lh,Lh]),Hn(Gu,"blendFuncSeparate",[uu,Ih,uu,Ih]),Cn(Ep,Qc,!0),Hn(vf,"depthFunc",Cp),Hn(Nh,"depthRange",[0,1]),Hn(Op,"depthMask",!0),Hn(rl,rl,[!0,!0,!0,!0]),Cn(xp,Ch),Hn(Sp,"cullFace",Wn),Hn(Ap,Ap,ld),Hn(zu,zu,1),Cn(xl,al),Hn(Xc,"polygonOffset",[0,0]),Cn(mf,Os),Cn(yf,Qv),Hn(gs,"sampleCoverage",[1,!1]),Cn(_s,Ef),Hn(rr,"stencilMask",-1),Hn(Hu,"stencilFunc",[Dh,0,-1]),Hn(qc,"stencilOpSeparate",[Hi,xs,xs,xs]),Hn(ol,"stencilOpSeparate",[Wn,xs,xs,xs]),Cn(di,jh),Hn(nu,"scissor",[0,0,G.drawingBufferWidth,G.drawingBufferHeight]),Hn(Do,Do,[0,0,G.drawingBufferWidth,G.drawingBufferHeight]);var It={gl:G,context:Gt,strings:se,next:ln,current:kt,draw:Kt,elements:ot,buffer:gt,shader:ht,attributes:jt.state,vao:jt,uniforms:Bt,framebuffer:Rt,extensions:Oe,timer:Dt,isBufferArgs:Zl},Pt={primTypes:ni,compareFuncs:Ss,blendFuncs:$a,blendEquations:pt,stencilOps:zn,glTypes:Vi,orientationType:Yu};te.optional(function(){It.isArrayLike=C}),tn&&(Pt.backBuffer=[Wn],Pt.drawBuffer=Lr(ut.maxDrawbuffers,function(he){return he===0?[0]:Lr(he,function(oe){return $h+oe})}));var Mt=0;function Ln(){var he=tl(),oe=he.link,Pe=he.global;he.id=Mt++,he.batchId="0";var Ge=oe(It),Je=he.shared={props:"a0"};Object.keys(It).forEach(function(Ae){Je[Ae]=Pe.def(Ge,".",Ae)}),te.optional(function(){he.CHECK=oe(te),he.commandStr=te.guessCommand(),he.command=oe(he.commandStr),he.assert=function(Ae,fe,ze){Ae("if(!(",fe,"))",this.CHECK,".commandRaise(",oe(ze),",",this.command,");")},Pt.invalidBlendCombinations=Kl});var De=he.next={},Ce=he.current={};Object.keys(Tt).forEach(function(Ae){Array.isArray(kt[Ae])&&(De[Ae]=Pe.def(Je.next,".",Ae),Ce[Ae]=Pe.def(Je.current,".",Ae))});var Ve=he.constants={};Object.keys(Pt).forEach(function(Ae){Ve[Ae]=Pe.def(JSON.stringify(Pt[Ae]))}),he.invoke=function(Ae,fe){switch(fe.type){case ff:var ze=["this",Je.context,Je.props,he.batchId];return Ae.def(oe(fe.data),".call(",ze.slice(0,Math.max(fe.data.length+1,4)),")");case ql:return Ae.def(Je.props,fe.data);case tu:return Ae.def(Je.context,fe.data);case pf:return Ae.def("this",fe.data);case nl:return fe.data.append(he,Ae),fe.data.ref;case zc:return fe.data.toString();case Hc:return fe.data.map(function(Xe){return he.invoke(Ae,Xe)})}},he.attribCache={};var pe={};return he.scopeAttrib=function(Ae){var fe=se.id(Ae);if(fe in pe)return pe[fe];var ze=jt.scope[fe];ze||(ze=jt.scope[fe]=new Ze);var Xe=pe[fe]=oe(ze);return Xe},he}function or(he){var oe=he.static,Pe=he.dynamic,Ge;if(bs in oe){var Je=!!oe[bs];Ge=Io(function(Ce,Ve){return Je}),Ge.enable=Je}else if(bs in Pe){var De=Pe[bs];Ge=ua(De,function(Ce,Ve){return Ce.invoke(Ve,De)})}return Ge}function mn(he,oe){var Pe=he.static,Ge=he.dynamic;if(ta in Pe){var Je=Pe[ta];return Je?(Je=Rt.getFramebuffer(Je),te.command(Je,"invalid framebuffer object"),Io(function(Ce,Ve){var pe=Ce.link(Je),Ae=Ce.shared;Ve.set(Ae.framebuffer,".next",pe);var fe=Ae.context;return Ve.set(fe,"."+ws,pe+".width"),Ve.set(fe,"."+ou,pe+".height"),pe})):Io(function(Ce,Ve){var pe=Ce.shared;Ve.set(pe.framebuffer,".next","null");var Ae=pe.context;return Ve.set(Ae,"."+ws,Ae+"."+Jc),Ve.set(Ae,"."+ou,Ae+"."+bf),"null"})}else if(ta in Ge){var De=Ge[ta];return ua(De,function(Ce,Ve){var pe=Ce.invoke(Ve,De),Ae=Ce.shared,fe=Ae.framebuffer,ze=Ve.def(fe,".getFramebuffer(",pe,")");te.optional(function(){Ce.assert(Ve,"!"+pe+"||"+ze,"invalid framebuffer object")}),Ve.set(fe,".next",ze);var Xe=Ae.context;return Ve.set(Xe,"."+ws,ze+"?"+ze+".width:"+Xe+"."+Jc),Ve.set(Xe,"."+ou,ze+"?"+ze+".height:"+Xe+"."+bf),ze})}else return null}function cr(he,oe,Pe){var Ge=he.static,Je=he.dynamic;function De(pe){if(pe in Ge){var Ae=Ge[pe];te.commandType(Ae,"object","invalid "+pe,Pe.commandStr);var fe=!0,ze=Ae.x|0,Xe=Ae.y|0,p,y;return"width"in Ae?(p=Ae.width|0,te.command(p>=0,"invalid "+pe,Pe.commandStr)):fe=!1,"height"in Ae?(y=Ae.height|0,te.command(y>=0,"invalid "+pe,Pe.commandStr)):fe=!1,new Xi(!fe&&oe&&oe.thisDep,!fe&&oe&&oe.contextDep,!fe&&oe&&oe.propDep,function(Z,re){var ve=Z.shared.context,xe=p;"width"in Ae||(xe=re.def(ve,".",ws,"-",ze));var Ue=y;return"height"in Ae||(Ue=re.def(ve,".",ou,"-",Xe)),[ze,Xe,xe,Ue]})}else if(pe in Je){var O=Je[pe],$=ua(O,function(Z,re){var ve=Z.invoke(re,O);te.optional(function(){Z.assert(re,ve+"&&typeof "+ve+'==="object"',"invalid "+pe)});var xe=Z.shared.context,Ue=re.def(ve,".x|0"),_t=re.def(ve,".y|0"),xt=re.def('"width" in ',ve,"?",ve,".width|0:","(",xe,".",ws,"-",Ue,")"),Xt=re.def('"height" in ',ve,"?",ve,".height|0:","(",xe,".",ou,"-",_t,")");return te.optional(function(){Z.assert(re,xt+">=0&&"+Xt+">=0","invalid "+pe)}),[Ue,_t,xt,Xt]});return oe&&($.thisDep=$.thisDep||oe.thisDep,$.contextDep=$.contextDep||oe.contextDep,$.propDep=$.propDep||oe.propDep),$}else return oe?new Xi(oe.thisDep,oe.contextDep,oe.propDep,function(Z,re){var ve=Z.shared.context;return[0,0,re.def(ve,".",ws),re.def(ve,".",ou)]}):null}var Ce=De(Do);if(Ce){var Ve=Ce;Ce=new Xi(Ce.thisDep,Ce.contextDep,Ce.propDep,function(pe,Ae){var fe=Ve.append(pe,Ae),ze=pe.shared.context;return Ae.set(ze,"."+_f,fe[2]),Ae.set(ze,"."+Mp,fe[3]),fe})}return{viewport:Ce,scissor_box:De(nu)}}function Xn(he,oe){var Pe=he.static,Ge=typeof Pe[Ii]=="string"&&typeof Pe[Yc]=="string";if(Ge){if(Object.keys(oe.dynamic).length>0)return null;var Je=oe.static,De=Object.keys(Je);if(De.length>0&&typeof Je[De[0]]=="number"){for(var Ce=[],Ve=0;Ve<De.length;++Ve)te(typeof Je[De[Ve]]=="number","must specify all vertex attribute locations when using vaos"),Ce.push([Je[De[Ve]]|0,De[Ve]]);return Ce}}return null}function lr(he,oe,Pe){var Ge=he.static,Je=he.dynamic;function De(fe){if(fe in Ge){var ze=se.id(Ge[fe]);te.optional(function(){ht.shader(Rp[fe],ze,te.guessCommand())});var Xe=Io(function(){return ze});return Xe.id=ze,Xe}else if(fe in Je){var p=Je[fe];return ua(p,function(y,O){var $=y.invoke(O,p),Z=O.def(y.shared.strings,".id(",$,")");return te.optional(function(){O(y.shared.shader,".shader(",Rp[fe],",",Z,",",y.command,");")}),Z})}return null}var Ce=De(Ii),Ve=De(Yc),pe=null,Ae;return ll(Ce)&&ll(Ve)?(pe=ht.program(Ve.id,Ce.id,null,Pe),Ae=Io(function(fe,ze){return fe.link(pe)})):Ae=new Xi(Ce&&Ce.thisDep||Ve&&Ve.thisDep,Ce&&Ce.contextDep||Ve&&Ve.contextDep,Ce&&Ce.propDep||Ve&&Ve.propDep,function(fe,ze){var Xe=fe.shared.shader,p;Ce?p=Ce.append(fe,ze):p=ze.def(Xe,".",Ii);var y;Ve?y=Ve.append(fe,ze):y=ze.def(Xe,".",Yc);var O=Xe+".program("+y+","+p;return te.optional(function(){O+=","+fe.command}),ze.def(O+")")}),{frag:Ce,vert:Ve,progVar:Ae,program:pe}}function Er(he,oe){var Pe=he.static,Ge=he.dynamic;function Je(){if(Ho in Pe){var fe=Pe[Ho];Zl(fe)?fe=ot.getElements(ot.create(fe,!0)):fe&&(fe=ot.getElements(fe),te.command(fe,"invalid elements",oe.commandStr));var ze=Io(function(p,y){if(fe){var O=p.link(fe);return p.ELEMENTS=O,O}return p.ELEMENTS=null,null});return ze.value=fe,ze}else if(Ho in Ge){var Xe=Ge[Ho];return ua(Xe,function(p,y){var O=p.shared,$=O.isBufferArgs,Z=O.elements,re=p.invoke(y,Xe),ve=y.def("null"),xe=y.def($,"(",re,")"),Ue=p.cond(xe).then(ve,"=",Z,".createStream(",re,");").else(ve,"=",Z,".getElements(",re,");");return te.optional(function(){p.assert(Ue.else,"!"+re+"||"+ve,"invalid elements")}),y.entry(Ue),y.exit(p.cond(xe).then(Z,".destroyStream(",ve,");")),p.ELEMENTS=ve,ve})}return null}var De=Je();function Ce(){if(Sl in Pe){var fe=Pe[Sl];return te.commandParameter(fe,ni,"invalid primitve",oe.commandStr),Io(function(Xe,p){return ni[fe]})}else if(Sl in Ge){var ze=Ge[Sl];return ua(ze,function(Xe,p){var y=Xe.constants.primTypes,O=Xe.invoke(p,ze);return te.optional(function(){Xe.assert(p,O+" in "+y,"invalid primitive, must be one of "+Object.keys(ni))}),p.def(y,"[",O,"]")})}else if(De)return ll(De)?De.value?Io(function(Xe,p){return p.def(Xe.ELEMENTS,".primType")}):Io(function(){return ad}):new Xi(De.thisDep,De.contextDep,De.propDep,function(Xe,p){var y=Xe.ELEMENTS;return p.def(y,"?",y,".primType:",ad)});return null}function Ve(fe,ze){if(fe in Pe){var Xe=Pe[fe]|0;return te.command(!ze||Xe>=0,"invalid "+fe,oe.commandStr),Io(function(y,O){return ze&&(y.OFFSET=Xe),Xe})}else if(fe in Ge){var p=Ge[fe];return ua(p,function(y,O){var $=y.invoke(O,p);return ze&&(y.OFFSET=$,te.optional(function(){y.assert(O,$+">=0","invalid "+fe)})),$})}else if(ze&&De)return Io(function(y,O){return y.OFFSET="0",0});return null}var pe=Ve(gf,!0);function Ae(){if(Al in Pe){var fe=Pe[Al]|0;return te.command(typeof fe=="number"&&fe>=0,"invalid vertex count",oe.commandStr),Io(function(){return fe})}else if(Al in Ge){var ze=Ge[Al];return ua(ze,function(y,O){var $=y.invoke(O,ze);return te.optional(function(){y.assert(O,"typeof "+$+'==="number"&&'+$+">=0&&"+$+"===("+$+"|0)","invalid vertex count")}),$})}else if(De)if(ll(De)){if(De)return pe?new Xi(pe.thisDep,pe.contextDep,pe.propDep,function(y,O){var $=O.def(y.ELEMENTS,".vertCount-",y.OFFSET);return te.optional(function(){y.assert(O,$+">=0","invalid vertex offset/element buffer too small")}),$}):Io(function(y,O){return O.def(y.ELEMENTS,".vertCount")});var Xe=Io(function(){return-1});return te.optional(function(){Xe.MISSING=!0}),Xe}else{var p=new Xi(De.thisDep||pe.thisDep,De.contextDep||pe.contextDep,De.propDep||pe.propDep,function(y,O){var $=y.ELEMENTS;return y.OFFSET?O.def($,"?",$,".vertCount-",y.OFFSET,":-1"):O.def($,"?",$,".vertCount:-1")});return te.optional(function(){p.DYNAMIC=!0}),p}return null}return{elements:De,primitive:Ce(),count:Ae(),instances:Ve(Ct,!1),offset:pe}}function $o(he,oe){var Pe=he.static,Ge=he.dynamic,Je={};return Nt.forEach(function(De){var Ce=Zt(De);function Ve(pe,Ae){if(De in Pe){var fe=pe(Pe[De]);Je[Ce]=Io(function(){return fe})}else if(De in Ge){var ze=Ge[De];Je[Ce]=ua(ze,function(Xe,p){return Ae(Xe,p,Xe.invoke(p,ze))})}}switch(De){case xp:case Uu:case Vu:case _s:case Ep:case di:case xl:case mf:case yf:case Op:return Ve(function(pe){return te.commandType(pe,"boolean",De,oe.commandStr),pe},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,"typeof "+fe+'==="boolean"',"invalid flag "+De,pe.commandStr)}),fe});case vf:return Ve(function(pe){return te.commandParameter(pe,Ss,"invalid "+De,oe.commandStr),Ss[pe]},function(pe,Ae,fe){var ze=pe.constants.compareFuncs;return te.optional(function(){pe.assert(Ae,fe+" in "+ze,"invalid "+De+", must be one of "+Object.keys(Ss))}),Ae.def(ze,"[",fe,"]")});case Nh:return Ve(function(pe){return te.command(C(pe)&&pe.length===2&&typeof pe[0]=="number"&&typeof pe[1]=="number"&&pe[0]<=pe[1],"depth range is 2d array",oe.commandStr),pe},function(pe,Ae,fe){te.optional(function(){pe.assert(Ae,pe.shared.isArrayLike+"("+fe+")&&"+fe+".length===2&&typeof "+fe+'[0]==="number"&&typeof '+fe+'[1]==="number"&&'+fe+"[0]<="+fe+"[1]","depth range must be a 2d array")});var ze=Ae.def("+",fe,"[0]"),Xe=Ae.def("+",fe,"[1]");return[ze,Xe]});case Gu:return Ve(function(pe){te.commandType(pe,"object","blend.func",oe.commandStr);var Ae="srcRGB"in pe?pe.srcRGB:pe.src,fe="srcAlpha"in pe?pe.srcAlpha:pe.src,ze="dstRGB"in pe?pe.dstRGB:pe.dst,Xe="dstAlpha"in pe?pe.dstAlpha:pe.dst;return te.commandParameter(Ae,$a,Ce+".srcRGB",oe.commandStr),te.commandParameter(fe,$a,Ce+".srcAlpha",oe.commandStr),te.commandParameter(ze,$a,Ce+".dstRGB",oe.commandStr),te.commandParameter(Xe,$a,Ce+".dstAlpha",oe.commandStr),te.command(Kl.indexOf(Ae+", "+ze)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ae+", "+ze+")",oe.commandStr),[$a[Ae],$a[ze],$a[fe],$a[Xe]]},function(pe,Ae,fe){var ze=pe.constants.blendFuncs;te.optional(function(){pe.assert(Ae,fe+"&&typeof "+fe+'==="object"',"invalid blend func, must be an object")});function Xe(ve,xe){var Ue=Ae.def('"',ve,xe,'" in ',fe,"?",fe,".",ve,xe,":",fe,".",ve);return te.optional(function(){pe.assert(Ae,Ue+" in "+ze,"invalid "+De+"."+ve+xe+", must be one of "+Object.keys($a))}),Ue}var p=Xe("src","RGB"),y=Xe("dst","RGB");te.optional(function(){var ve=pe.constants.invalidBlendCombinations;pe.assert(Ae,ve+".indexOf("+p+'+", "+'+y+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var O=Ae.def(ze,"[",p,"]"),$=Ae.def(ze,"[",Xe("src","Alpha"),"]"),Z=Ae.def(ze,"[",y,"]"),re=Ae.def(ze,"[",Xe("dst","Alpha"),"]");return[O,Z,$,re]});case hf:return Ve(function(pe){if(typeof pe=="string")return te.commandParameter(pe,pt,"invalid "+De,oe.commandStr),[pt[pe],pt[pe]];if(typeof pe=="object")return te.commandParameter(pe.rgb,pt,De+".rgb",oe.commandStr),te.commandParameter(pe.alpha,pt,De+".alpha",oe.commandStr),[pt[pe.rgb],pt[pe.alpha]];te.commandRaise("invalid blend.equation",oe.commandStr)},function(pe,Ae,fe){var ze=pe.constants.blendEquations,Xe=Ae.def(),p=Ae.def(),y=pe.cond("typeof ",fe,'==="string"');return te.optional(function(){function O($,Z,re){pe.assert($,re+" in "+ze,"invalid "+Z+", must be one of "+Object.keys(pt))}O(y.then,De,fe),pe.assert(y.else,fe+"&&typeof "+fe+'==="object"',"invalid "+De),O(y.else,De+".rgb",fe+".rgb"),O(y.else,De+".alpha",fe+".alpha")}),y.then(Xe,"=",p,"=",ze,"[",fe,"];"),y.else(Xe,"=",ze,"[",fe,".rgb];",p,"=",ze,"[",fe,".alpha];"),Ae(y),[Xe,p]});case Wu:return Ve(function(pe){return te.command(C(pe)&&pe.length===4,"blend.color must be a 4d array",oe.commandStr),Lr(4,function(Ae){return+pe[Ae]})},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,pe.shared.isArrayLike+"("+fe+")&&"+fe+".length===4","blend.color must be a 4d array")}),Lr(4,function(ze){return Ae.def("+",fe,"[",ze,"]")})});case rr:return Ve(function(pe){return te.commandType(pe,"number",Ce,oe.commandStr),pe|0},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,"typeof "+fe+'==="number"',"invalid stencil.mask")}),Ae.def(fe,"|0")});case Hu:return Ve(function(pe){te.commandType(pe,"object",Ce,oe.commandStr);var Ae=pe.cmp||"keep",fe=pe.ref||0,ze="mask"in pe?pe.mask:-1;return te.commandParameter(Ae,Ss,De+".cmp",oe.commandStr),te.commandType(fe,"number",De+".ref",oe.commandStr),te.commandType(ze,"number",De+".mask",oe.commandStr),[Ss[Ae],fe,ze]},function(pe,Ae,fe){var ze=pe.constants.compareFuncs;te.optional(function(){function O(){pe.assert(Ae,Array.prototype.join.call(arguments,""),"invalid stencil.func")}O(fe+"&&typeof ",fe,'==="object"'),O('!("cmp" in ',fe,")||(",fe,".cmp in ",ze,")")});var Xe=Ae.def('"cmp" in ',fe,"?",ze,"[",fe,".cmp]",":",xs),p=Ae.def(fe,".ref|0"),y=Ae.def('"mask" in ',fe,"?",fe,".mask|0:-1");return[Xe,p,y]});case qc:case ol:return Ve(function(pe){te.commandType(pe,"object",Ce,oe.commandStr);var Ae=pe.fail||"keep",fe=pe.zfail||"keep",ze=pe.zpass||"keep";return te.commandParameter(Ae,zn,De+".fail",oe.commandStr),te.commandParameter(fe,zn,De+".zfail",oe.commandStr),te.commandParameter(ze,zn,De+".zpass",oe.commandStr),[De===ol?Wn:Hi,zn[Ae],zn[fe],zn[ze]]},function(pe,Ae,fe){var ze=pe.constants.stencilOps;te.optional(function(){pe.assert(Ae,fe+"&&typeof "+fe+'==="object"',"invalid "+De)});function Xe(p){return te.optional(function(){pe.assert(Ae,'!("'+p+'" in '+fe+")||("+fe+"."+p+" in "+ze+")","invalid "+De+"."+p+", must be one of "+Object.keys(zn))}),Ae.def('"',p,'" in ',fe,"?",ze,"[",fe,".",p,"]:",xs)}return[De===ol?Wn:Hi,Xe("fail"),Xe("zfail"),Xe("zpass")]});case Xc:return Ve(function(pe){te.commandType(pe,"object",Ce,oe.commandStr);var Ae=pe.factor|0,fe=pe.units|0;return te.commandType(Ae,"number",Ce+".factor",oe.commandStr),te.commandType(fe,"number",Ce+".units",oe.commandStr),[Ae,fe]},function(pe,Ae,fe){te.optional(function(){pe.assert(Ae,fe+"&&typeof "+fe+'==="object"',"invalid "+De)});var ze=Ae.def(fe,".factor|0"),Xe=Ae.def(fe,".units|0");return[ze,Xe]});case Sp:return Ve(function(pe){var Ae=0;return pe==="front"?Ae=Hi:pe==="back"&&(Ae=Wn),te.command(!!Ae,Ce,oe.commandStr),Ae},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,fe+'==="front"||'+fe+'==="back"',"invalid cull.face")}),Ae.def(fe,'==="front"?',Hi,":",Wn)});case zu:return Ve(function(pe){return te.command(typeof pe=="number"&&pe>=ut.lineWidthDims[0]&&pe<=ut.lineWidthDims[1],"invalid line width, must be a positive number between "+ut.lineWidthDims[0]+" and "+ut.lineWidthDims[1],oe.commandStr),pe},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,"typeof "+fe+'==="number"&&'+fe+">="+ut.lineWidthDims[0]+"&&"+fe+"<="+ut.lineWidthDims[1],"invalid line width")}),fe});case Ap:return Ve(function(pe){return te.commandParameter(pe,Yu,Ce,oe.commandStr),Yu[pe]},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,fe+'==="cw"||'+fe+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Ae.def(fe+'==="cw"?'+xf+":"+ld)});case rl:return Ve(function(pe){return te.command(C(pe)&&pe.length===4,"color.mask must be length 4 array",oe.commandStr),pe.map(function(Ae){return!!Ae})},function(pe,Ae,fe){return te.optional(function(){pe.assert(Ae,pe.shared.isArrayLike+"("+fe+")&&"+fe+".length===4","invalid color.mask")}),Lr(4,function(ze){return"!!"+fe+"["+ze+"]"})});case gs:return Ve(function(pe){te.command(typeof pe=="object"&&pe,Ce,oe.commandStr);var Ae="value"in pe?pe.value:1,fe=!!pe.invert;return te.command(typeof Ae=="number"&&Ae>=0&&Ae<=1,"sample.coverage.value must be a number between 0 and 1",oe.commandStr),[Ae,fe]},function(pe,Ae,fe){te.optional(function(){pe.assert(Ae,fe+"&&typeof "+fe+'==="object"',"invalid sample.coverage")});var ze=Ae.def('"value" in ',fe,"?+",fe,".value:1"),Xe=Ae.def("!!",fe,".invert");return[ze,Xe]})}}),Je}function Ro(he,oe){var Pe=he.static,Ge=he.dynamic,Je={};return Object.keys(Pe).forEach(function(De){var Ce=Pe[De],Ve;if(typeof Ce=="number"||typeof Ce=="boolean")Ve=Io(function(){return Ce});else if(typeof Ce=="function"){var pe=Ce._reglType;pe==="texture2d"||pe==="textureCube"?Ve=Io(function(Ae){return Ae.link(Ce)}):pe==="framebuffer"||pe==="framebufferCube"?(te.command(Ce.color.length>0,'missing color attachment for framebuffer sent to uniform "'+De+'"',oe.commandStr),Ve=Io(function(Ae){return Ae.link(Ce.color[0])})):te.commandRaise('invalid data for uniform "'+De+'"',oe.commandStr)}else C(Ce)?Ve=Io(function(Ae){var fe=Ae.global.def("[",Lr(Ce.length,function(ze){return te.command(typeof Ce[ze]=="number"||typeof Ce[ze]=="boolean","invalid uniform "+De,Ae.commandStr),Ce[ze]}),"]");return fe}):te.commandRaise('invalid or missing data for uniform "'+De+'"',oe.commandStr);Ve.value=Ce,Je[De]=Ve}),Object.keys(Ge).forEach(function(De){var Ce=Ge[De];Je[De]=ua(Ce,function(Ve,pe){return Ve.invoke(pe,Ce)})}),Je}function ir(he,oe){var Pe=he.static,Ge=he.dynamic,Je={};return Object.keys(Pe).forEach(function(De){var Ce=Pe[De],Ve=se.id(De),pe=new Ze;if(Zl(Ce))pe.state=Qs,pe.buffer=gt.getBuffer(gt.create(Ce,Ml,!1,!0)),pe.type=0;else{var Ae=gt.getBuffer(Ce);if(Ae)pe.state=Qs,pe.buffer=Ae,pe.type=0;else if(te.command(typeof Ce=="object"&&Ce,"invalid data for attribute "+De,oe.commandStr),"constant"in Ce){var fe=Ce.constant;pe.buffer="null",pe.state=eu,typeof fe=="number"?pe.x=fe:(te.command(C(fe)&&fe.length>0&&fe.length<=4,"invalid constant for attribute "+De,oe.commandStr),Xl.forEach(function(Z,re){re<fe.length&&(pe[Z]=fe[re])}))}else{Zl(Ce.buffer)?Ae=gt.getBuffer(gt.create(Ce.buffer,Ml,!1,!0)):Ae=gt.getBuffer(Ce.buffer),te.command(!!Ae,'missing buffer for attribute "'+De+'"',oe.commandStr);var ze=Ce.offset|0;te.command(ze>=0,'invalid offset for attribute "'+De+'"',oe.commandStr);var Xe=Ce.stride|0;te.command(Xe>=0&&Xe<256,'invalid stride for attribute "'+De+'", must be integer betweeen [0, 255]',oe.commandStr);var p=Ce.size|0;te.command(!("size"in Ce)||p>0&&p<=4,'invalid size for attribute "'+De+'", must be 1,2,3,4',oe.commandStr);var y=!!Ce.normalized,O=0;"type"in Ce&&(te.commandParameter(Ce.type,Vi,"invalid type for attribute "+De,oe.commandStr),O=Vi[Ce.type]);var $=Ce.divisor|0;"divisor"in Ce&&(te.command($===0||$t,'cannot specify divisor for attribute "'+De+'", instancing not supported',oe.commandStr),te.command($>=0,'invalid divisor for attribute "'+De+'"',oe.commandStr)),te.optional(function(){var Z=oe.commandStr,re=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Ce).forEach(function(ve){te.command(re.indexOf(ve)>=0,'unknown parameter "'+ve+'" for attribute pointer "'+De+'" (valid parameters are '+re+")",Z)})}),pe.buffer=Ae,pe.state=Qs,pe.size=p,pe.normalized=y,pe.type=O||Ae.dtype,pe.offset=ze,pe.stride=Xe,pe.divisor=$}}Je[De]=Io(function(Z,re){var ve=Z.attribCache;if(Ve in ve)return ve[Ve];var xe={isStream:!1};return Object.keys(pe).forEach(function(Ue){xe[Ue]=pe[Ue]}),pe.buffer&&(xe.buffer=Z.link(pe.buffer),xe.type=xe.type||xe.buffer+".dtype"),ve[Ve]=xe,xe})}),Object.keys(Ge).forEach(function(De){var Ce=Ge[De];function Ve(pe,Ae){var fe=pe.invoke(Ae,Ce),ze=pe.shared,Xe=pe.constants,p=ze.isBufferArgs,y=ze.buffer;te.optional(function(){pe.assert(Ae,fe+"&&(typeof "+fe+'==="object"||typeof '+fe+'==="function")&&('+p+"("+fe+")||"+y+".getBuffer("+fe+")||"+y+".getBuffer("+fe+".buffer)||"+p+"("+fe+'.buffer)||("constant" in '+fe+"&&(typeof "+fe+'.constant==="number"||'+ze.isArrayLike+"("+fe+".constant))))",'invalid dynamic attribute "'+De+'"')});var O={isStream:Ae.def(!1)},$=new Ze;$.state=Qs,Object.keys($).forEach(function(xe){O[xe]=Ae.def(""+$[xe])});var Z=O.buffer,re=O.type;Ae("if(",p,"(",fe,")){",O.isStream,"=true;",Z,"=",y,".createStream(",Ml,",",fe,");",re,"=",Z,".dtype;","}else{",Z,"=",y,".getBuffer(",fe,");","if(",Z,"){",re,"=",Z,".dtype;",'}else if("constant" in ',fe,"){",O.state,"=",eu,";","if(typeof "+fe+'.constant === "number"){',O[Xl[0]],"=",fe,".constant;",Xl.slice(1).map(function(xe){return O[xe]}).join("="),"=0;","}else{",Xl.map(function(xe,Ue){return O[xe]+"="+fe+".constant.length>"+Ue+"?"+fe+".constant["+Ue+"]:0;"}).join(""),"}}else{","if(",p,"(",fe,".buffer)){",Z,"=",y,".createStream(",Ml,",",fe,".buffer);","}else{",Z,"=",y,".getBuffer(",fe,".buffer);","}",re,'="type" in ',fe,"?",Xe.glTypes,"[",fe,".type]:",Z,".dtype;",O.normalized,"=!!",fe,".normalized;");function ve(xe){Ae(O[xe],"=",fe,".",xe,"|0;")}return ve("size"),ve("offset"),ve("stride"),ve("divisor"),Ae("}}"),Ae.exit("if(",O.isStream,"){",y,".destroyStream(",Z,");","}"),O}Je[De]=ua(Ce,Ve)}),Je}function Zo(he,oe){var Pe=he.static,Ge=he.dynamic;if(ru in Pe){var Je=Pe[ru];return Je!==null&&jt.getVAO(Je)===null&&(Je=jt.createVAO(Je)),Io(function(Ce){return Ce.link(jt.getVAO(Je))})}else if(ru in Ge){var De=Ge[ru];return ua(De,function(Ce,Ve){var pe=Ce.invoke(Ve,De);return Ve.def(Ce.shared.vao+".getVAO("+pe+")")})}return null}function so(he){var oe=he.static,Pe=he.dynamic,Ge={};return Object.keys(oe).forEach(function(Je){var De=oe[Je];Ge[Je]=Io(function(Ce,Ve){return typeof De=="number"||typeof De=="boolean"?""+De:Ce.link(De)})}),Object.keys(Pe).forEach(function(Je){var De=Pe[Je];Ge[Je]=ua(De,function(Ce,Ve){return Ce.invoke(Ve,De)})}),Ge}function Fo(he,oe,Pe,Ge,Je){var De=he.static,Ce=he.dynamic;te.optional(function(){var ve=[ta,Yc,Ii,Ho,Sl,gf,Al,Ct,bs,ru].concat(Nt);function xe(Ue){Object.keys(Ue).forEach(function(_t){te.command(ve.indexOf(_t)>=0,'unknown parameter "'+_t+'"',Je.commandStr)})}xe(De),xe(Ce)});var Ve=Xn(he,oe),pe=mn(he),Ae=cr(he,pe,Je),fe=Er(he,Je),ze=$o(he,Je),Xe=lr(he,Je,Ve);function p(ve){var xe=Ae[ve];xe&&(ze[ve]=xe)}p(Do),p(Zt(nu));var y=Object.keys(ze).length>0,O={framebuffer:pe,draw:fe,shader:Xe,state:ze,dirty:y,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=or(he),O.uniforms=Ro(Pe,Je),O.drawVAO=O.scopeVAO=Zo(he),!O.drawVAO&&Xe.program&&!Ve&&Oe.angle_instanced_arrays){var $=!0,Z=Xe.program.attributes.map(function(ve){var xe=oe.static[ve];return $=$&&!!xe,xe});if($&&Z.length>0){var re=jt.getVAO(jt.createVAO(Z));O.drawVAO=new Xi(null,null,null,function(ve,xe){return ve.link(re)}),O.useVAO=!0}}return Ve?O.useVAO=!0:O.attributes=ir(oe,Je),O.context=so(Ge),O}function qo(he,oe,Pe){var Ge=he.shared,Je=Ge.context,De=he.scope();Object.keys(Pe).forEach(function(Ce){oe.save(Je,"."+Ce);var Ve=Pe[Ce],pe=Ve.append(he,oe);Array.isArray(pe)?De(Je,".",Ce,"=[",pe.join(),"];"):De(Je,".",Ce,"=",pe,";")}),oe(De)}function ii(he,oe,Pe,Ge){var Je=he.shared,De=Je.gl,Ce=Je.framebuffer,Ve;tn&&(Ve=oe.def(Je.extensions,".webgl_draw_buffers"));var pe=he.constants,Ae=pe.drawBuffer,fe=pe.backBuffer,ze;Pe?ze=Pe.append(he,oe):ze=oe.def(Ce,".next"),Ge||oe("if(",ze,"!==",Ce,".cur){"),oe("if(",ze,"){",De,".bindFramebuffer(",sd,",",ze,".framebuffer);"),tn&&oe(Ve,".drawBuffersWEBGL(",Ae,"[",ze,".colorAttachments.length]);"),oe("}else{",De,".bindFramebuffer(",sd,",null);"),tn&&oe(Ve,".drawBuffersWEBGL(",fe,");"),oe("}",Ce,".cur=",ze,";"),Ge||oe("}")}function fi(he,oe,Pe){var Ge=he.shared,Je=Ge.gl,De=he.current,Ce=he.next,Ve=Ge.current,pe=Ge.next,Ae=he.cond(Ve,".dirty");Nt.forEach(function(fe){var ze=Zt(fe);if(!(ze in Pe.state)){var Xe,p;if(ze in Ce){Xe=Ce[ze],p=De[ze];var y=Lr(kt[ze].length,function($){return Ae.def(Xe,"[",$,"]")});Ae(he.cond(y.map(function($,Z){return $+"!=="+p+"["+Z+"]"}).join("||")).then(Je,".",Tt[ze],"(",y,");",y.map(function($,Z){return p+"["+Z+"]="+$}).join(";"),";"))}else{Xe=Ae.def(pe,".",ze);var O=he.cond(Xe,"!==",Ve,".",ze);Ae(O),ze in qt?O(he.cond(Xe).then(Je,".enable(",qt[ze],");").else(Je,".disable(",qt[ze],");"),Ve,".",ze,"=",Xe,";"):O(Je,".",Tt[ze],"(",Xe,");",Ve,".",ze,"=",Xe,";")}}}),Object.keys(Pe.state).length===0&&Ae(Ve,".dirty=false;"),oe(Ae)}function Jo(he,oe,Pe,Ge){var Je=he.shared,De=he.current,Ce=Je.current,Ve=Je.gl;ud(Object.keys(Pe)).forEach(function(pe){var Ae=Pe[pe];if(!(Ge&&!Ge(Ae))){var fe=Ae.append(he,oe);if(qt[pe]){var ze=qt[pe];ll(Ae)?fe?oe(Ve,".enable(",ze,");"):oe(Ve,".disable(",ze,");"):oe(he.cond(fe).then(Ve,".enable(",ze,");").else(Ve,".disable(",ze,");")),oe(Ce,".",pe,"=",fe,";")}else if(C(fe)){var Xe=De[pe];oe(Ve,".",Tt[pe],"(",fe,");",fe.map(function(p,y){return Xe+"["+y+"]="+p}).join(";"),";")}else oe(Ve,".",Tt[pe],"(",fe,");",Ce,".",pe,"=",fe,";")}})}function go(he,oe){$t&&(he.instancing=oe.def(he.shared.extensions,".angle_instanced_arrays"))}function er(he,oe,Pe,Ge,Je){var De=he.shared,Ce=he.stats,Ve=De.current,pe=De.timer,Ae=Pe.profile;function fe(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ze,Xe;function p(ve){ze=oe.def(),ve(ze,"=",fe(),";"),typeof Je=="string"?ve(Ce,".count+=",Je,";"):ve(Ce,".count++;"),Dt&&(Ge?(Xe=oe.def(),ve(Xe,"=",pe,".getNumPendingQueries();")):ve(pe,".beginQuery(",Ce,");"))}function y(ve){ve(Ce,".cpuTime+=",fe(),"-",ze,";"),Dt&&(Ge?ve(pe,".pushScopeStats(",Xe,",",pe,".getNumPendingQueries(),",Ce,");"):ve(pe,".endQuery();"))}function O(ve){var xe=oe.def(Ve,".profile");oe(Ve,".profile=",ve,";"),oe.exit(Ve,".profile=",xe,";")}var $;if(Ae){if(ll(Ae)){Ae.enable?(p(oe),y(oe.exit),O("true")):O("false");return}$=Ae.append(he,oe),O($)}else $=oe.def(Ve,".profile");var Z=he.block();p(Z),oe("if(",$,"){",Z,"}");var re=he.block();y(re),oe.exit("if(",$,"){",re,"}")}function pi(he,oe,Pe,Ge,Je){var De=he.shared;function Ce(pe){switch(pe){case ed:case nd:case Yl:return 2;case au:case rd:case gi:return 3;case td:case od:case Of:return 4;default:return 1}}function Ve(pe,Ae,fe){var ze=De.gl,Xe=oe.def(pe,".location"),p=oe.def(De.attributes,"[",Xe,"]"),y=fe.state,O=fe.buffer,$=[fe.x,fe.y,fe.z,fe.w],Z=["buffer","normalized","offset","stride"];function re(){oe("if(!",p,".buffer){",ze,".enableVertexAttribArray(",Xe,");}");var xe=fe.type,Ue;if(fe.size?Ue=oe.def(fe.size,"||",Ae):Ue=Ae,oe("if(",p,".type!==",xe,"||",p,".size!==",Ue,"||",Z.map(function(xt){return p+"."+xt+"!=="+fe[xt]}).join("||"),"){",ze,".bindBuffer(",Ml,",",O,".buffer);",ze,".vertexAttribPointer(",[Xe,Ue,xe,fe.normalized,fe.stride,fe.offset],");",p,".type=",xe,";",p,".size=",Ue,";",Z.map(function(xt){return p+"."+xt+"="+fe[xt]+";"}).join(""),"}"),$t){var _t=fe.divisor;oe("if(",p,".divisor!==",_t,"){",he.instancing,".vertexAttribDivisorANGLE(",[Xe,_t],");",p,".divisor=",_t,";}")}}function ve(){oe("if(",p,".buffer){",ze,".disableVertexAttribArray(",Xe,");",p,".buffer=null;","}if(",Xl.map(function(xe,Ue){return p+"."+xe+"!=="+$[Ue]}).join("||"),"){",ze,".vertexAttrib4f(",Xe,",",$,");",Xl.map(function(xe,Ue){return p+"."+xe+"="+$[Ue]+";"}).join(""),"}")}y===Qs?re():y===eu?ve():(oe("if(",y,"===",Qs,"){"),re(),oe("}else{"),ve(),oe("}"))}Ge.forEach(function(pe){var Ae=pe.name,fe=Pe.attributes[Ae],ze;if(fe){if(!Je(fe))return;ze=fe.append(he,oe)}else{if(!Je(Fa))return;var Xe=he.scopeAttrib(Ae);te.optional(function(){he.assert(oe,Xe+".state","missing attribute "+Ae)}),ze={},Object.keys(new Ze).forEach(function(p){ze[p]=oe.def(Xe,".",p)})}Ve(he.link(pe),Ce(pe.info.type),ze)})}function Tr(he,oe,Pe,Ge,Je){for(var De=he.shared,Ce=De.gl,Ve,pe=0;pe<Ge.length;++pe){var Ae=Ge[pe],fe=Ae.name,ze=Ae.info.type,Xe=Pe.uniforms[fe],p=he.link(Ae),y=p+".location",O;if(Xe){if(!Je(Xe))continue;if(ll(Xe)){var $=Xe.value;if(te.command($!==null&&typeof $<"u",'missing uniform "'+fe+'"',he.commandStr),ze===Si||ze===Po){te.command(typeof $=="function"&&(ze===Si&&($._reglType==="texture2d"||$._reglType==="framebuffer")||ze===Po&&($._reglType==="textureCube"||$._reglType==="framebufferCube")),"invalid texture for uniform "+fe,he.commandStr);var Z=he.link($._texture||$.color[0]._texture);oe(Ce,".uniform1i(",y,",",Z+".bind());"),oe.exit(Z,".unbind();")}else if(ze===id||ze===su||ze===qu){te.optional(function(){te.command(C($),"invalid matrix for uniform "+fe,he.commandStr),te.command(ze===id&&$.length===4||ze===su&&$.length===9||ze===qu&&$.length===16,"invalid length for matrix uniform "+fe,he.commandStr)});var re=he.global.def("new Float32Array(["+Array.prototype.slice.call($)+"])"),ve=2;ze===su?ve=3:ze===qu&&(ve=4),oe(Ce,".uniformMatrix",ve,"fv(",y,",false,",re,");")}else{switch(ze){case xo:te.commandType($,"number","uniform "+fe,he.commandStr),Ve="1f";break;case ed:te.command(C($)&&$.length===2,"uniform "+fe,he.commandStr),Ve="2f";break;case au:te.command(C($)&&$.length===3,"uniform "+fe,he.commandStr),Ve="3f";break;case td:te.command(C($)&&$.length===4,"uniform "+fe,he.commandStr),Ve="4f";break;case lu:te.commandType($,"boolean","uniform "+fe,he.commandStr),Ve="1i";break;case Xu:te.commandType($,"number","uniform "+fe,he.commandStr),Ve="1i";break;case Yl:te.command(C($)&&$.length===2,"uniform "+fe,he.commandStr),Ve="2i";break;case nd:te.command(C($)&&$.length===2,"uniform "+fe,he.commandStr),Ve="2i";break;case gi:te.command(C($)&&$.length===3,"uniform "+fe,he.commandStr),Ve="3i";break;case rd:te.command(C($)&&$.length===3,"uniform "+fe,he.commandStr),Ve="3i";break;case Of:te.command(C($)&&$.length===4,"uniform "+fe,he.commandStr),Ve="4i";break;case od:te.command(C($)&&$.length===4,"uniform "+fe,he.commandStr),Ve="4i";break}oe(Ce,".uniform",Ve,"(",y,",",C($)?Array.prototype.slice.call($):$,");")}continue}else O=Xe.append(he,oe)}else{if(!Je(Fa))continue;O=oe.def(De.uniforms,"[",se.id(fe),"]")}ze===Si?(te(!Array.isArray(O),"must specify a scalar prop for textures"),oe("if(",O,"&&",O,'._reglType==="framebuffer"){',O,"=",O,".color[0];","}")):ze===Po&&(te(!Array.isArray(O),"must specify a scalar prop for cube maps"),oe("if(",O,"&&",O,'._reglType==="framebufferCube"){',O,"=",O,".color[0];","}")),te.optional(function(){function Xt(Lt,nn){he.assert(oe,Lt,'bad data or missing for uniform "'+fe+'". '+nn)}function xn(Lt){te(!Array.isArray(O),"must not specify an array type for uniform"),Xt("typeof "+O+'==="'+Lt+'"',"invalid type, expected "+Lt)}function An(Lt,nn){Array.isArray(O)?te(O.length===Lt,"must have length "+Lt):Xt(De.isArrayLike+"("+O+")&&"+O+".length==="+Lt,"invalid vector, should have length "+Lt,he.commandStr)}function qn(Lt){te(!Array.isArray(O),"must not specify a value type"),Xt("typeof "+O+'==="function"&&'+O+'._reglType==="texture'+(Lt===wf?"2d":"Cube")+'"',"invalid texture type",he.commandStr)}switch(ze){case Xu:xn("number");break;case nd:An(2);break;case rd:An(3);break;case od:An(4);break;case xo:xn("number");break;case ed:An(2);break;case au:An(3);break;case td:An(4);break;case lu:xn("boolean");break;case Yl:An(2);break;case gi:An(3);break;case Of:An(4);break;case id:An(4);break;case su:An(9);break;case qu:An(16);break;case Si:qn(wf);break;case Po:qn(Ph);break}});var xe=1;switch(ze){case Si:case Po:var Ue=oe.def(O,"._texture");oe(Ce,".uniform1i(",y,",",Ue,".bind());"),oe.exit(Ue,".unbind();");continue;case Xu:case lu:Ve="1i";break;case nd:case Yl:Ve="2i",xe=2;break;case rd:case gi:Ve="3i",xe=3;break;case od:case Of:Ve="4i",xe=4;break;case xo:Ve="1f";break;case ed:Ve="2f",xe=2;break;case au:Ve="3f",xe=3;break;case td:Ve="4f",xe=4;break;case id:Ve="Matrix2fv";break;case su:Ve="Matrix3fv";break;case qu:Ve="Matrix4fv";break}if(oe(Ce,".uniform",Ve,"(",y,","),Ve.charAt(0)==="M"){var _t=Math.pow(ze-id+2,2),xt=he.global.def("new Float32Array(",_t,")");Array.isArray(O)?oe("false,(",Lr(_t,function(Xt){return xt+"["+Xt+"]="+O[Xt]}),",",xt,")"):oe("false,(Array.isArray(",O,")||",O," instanceof Float32Array)?",O,":(",Lr(_t,function(Xt){return xt+"["+Xt+"]="+O+"["+Xt+"]"}),",",xt,")")}else xe>1?oe(Lr(xe,function(Xt){return Array.isArray(O)?O[Xt]:O+"["+Xt+"]"})):(te(!Array.isArray(O),"uniform value must not be an array"),oe(O));oe(");")}}function In(he,oe,Pe,Ge){var Je=he.shared,De=Je.gl,Ce=Je.draw,Ve=Ge.draw;function pe(){var Ue=Ve.elements,_t,xt=oe;return Ue?((Ue.contextDep&&Ge.contextDynamic||Ue.propDep)&&(xt=Pe),_t=Ue.append(he,xt)):_t=xt.def(Ce,".",Ho),_t&&xt("if("+_t+")"+De+".bindBuffer("+Tp+","+_t+".buffer.buffer);"),_t}function Ae(){var Ue=Ve.count,_t,xt=oe;return Ue?((Ue.contextDep&&Ge.contextDynamic||Ue.propDep)&&(xt=Pe),_t=Ue.append(he,xt),te.optional(function(){Ue.MISSING&&he.assert(oe,"false","missing vertex count"),Ue.DYNAMIC&&he.assert(xt,_t+">=0","missing vertex count")})):(_t=xt.def(Ce,".",Al),te.optional(function(){he.assert(xt,_t+">=0","missing vertex count")})),_t}var fe=pe();function ze(Ue){var _t=Ve[Ue];return _t?_t.contextDep&&Ge.contextDynamic||_t.propDep?_t.append(he,Pe):_t.append(he,oe):oe.def(Ce,".",Ue)}var Xe=ze(Sl),p=ze(gf),y=Ae();if(typeof y=="number"){if(y===0)return}else Pe("if(",y,"){"),Pe.exit("}");var O,$;$t&&(O=ze(Ct),$=he.instancing);var Z=fe+".type",re=Ve.elements&&ll(Ve.elements);function ve(){function Ue(){Pe($,".drawElementsInstancedANGLE(",[Xe,y,Z,p+"<<(("+Z+"-"+Js+")>>1)",O],");")}function _t(){Pe($,".drawArraysInstancedANGLE(",[Xe,p,y,O],");")}fe?re?Ue():(Pe("if(",fe,"){"),Ue(),Pe("}else{"),_t(),Pe("}")):_t()}function xe(){function Ue(){Pe(De+".drawElements("+[Xe,y,Z,p+"<<(("+Z+"-"+Js+")>>1)"]+");")}function _t(){Pe(De+".drawArrays("+[Xe,p,y]+");")}fe?re?Ue():(Pe("if(",fe,"){"),Ue(),Pe("}else{"),_t(),Pe("}")):_t()}$t&&(typeof O!="number"||O>=0)?typeof O=="string"?(Pe("if(",O,">0){"),ve(),Pe("}else if(",O,"<0){"),xe(),Pe("}")):ve():xe()}function mr(he,oe,Pe,Ge,Je){var De=Ln(),Ce=De.proc("body",Je);return te.optional(function(){De.commandStr=oe.commandStr,De.command=De.link(oe.commandStr)}),$t&&(De.instancing=Ce.def(De.shared.extensions,".angle_instanced_arrays")),he(De,Ce,Pe,Ge),De.compile().body}function tr(he,oe,Pe,Ge){go(he,oe),Pe.useVAO?Pe.drawVAO?oe(he.shared.vao,".setVAO(",Pe.drawVAO.append(he,oe),");"):oe(he.shared.vao,".setVAO(",he.shared.vao,".targetVAO);"):(oe(he.shared.vao,".setVAO(null);"),pi(he,oe,Pe,Ge.attributes,function(){return!0})),Tr(he,oe,Pe,Ge.uniforms,function(){return!0}),In(he,oe,oe,Pe)}function _o(he,oe){var Pe=he.proc("draw",1);go(he,Pe),qo(he,Pe,oe.context),ii(he,Pe,oe.framebuffer),fi(he,Pe,oe),Jo(he,Pe,oe.state),er(he,Pe,oe,!1,!0);var Ge=oe.shader.progVar.append(he,Pe);if(Pe(he.shared.gl,".useProgram(",Ge,".program);"),oe.shader.program)tr(he,Pe,oe,oe.shader.program);else{Pe(he.shared.vao,".setVAO(null);");var Je=he.global.def("{}"),De=Pe.def(Ge,".id"),Ce=Pe.def(Je,"[",De,"]");Pe(he.cond(Ce).then(Ce,".call(this,a0);").else(Ce,"=",Je,"[",De,"]=",he.link(function(Ve){return mr(tr,he,oe,Ve,1)}),"(",Ge,");",Ce,".call(this,a0);"))}Object.keys(oe.state).length>0&&Pe(he.shared.current,".dirty=true;")}function kl(he,oe,Pe,Ge){he.batchId="a1",go(he,oe);function Je(){return!0}pi(he,oe,Pe,Ge.attributes,Je),Tr(he,oe,Pe,Ge.uniforms,Je),In(he,oe,oe,Pe)}function So(he,oe,Pe,Ge){go(he,oe);var Je=Pe.contextDep,De=oe.def(),Ce="a0",Ve="a1",pe=oe.def();he.shared.props=pe,he.batchId=De;var Ae=he.scope(),fe=he.scope();oe(Ae.entry,"for(",De,"=0;",De,"<",Ve,";++",De,"){",pe,"=",Ce,"[",De,"];",fe,"}",Ae.exit);function ze(Z){return Z.contextDep&&Je||Z.propDep}function Xe(Z){return!ze(Z)}if(Pe.needsContext&&qo(he,fe,Pe.context),Pe.needsFramebuffer&&ii(he,fe,Pe.framebuffer),Jo(he,fe,Pe.state,ze),Pe.profile&&ze(Pe.profile)&&er(he,fe,Pe,!1,!0),Ge)Pe.useVAO?Pe.drawVAO?ze(Pe.drawVAO)?fe(he.shared.vao,".setVAO(",Pe.drawVAO.append(he,fe),");"):Ae(he.shared.vao,".setVAO(",Pe.drawVAO.append(he,Ae),");"):Ae(he.shared.vao,".setVAO(",he.shared.vao,".targetVAO);"):(Ae(he.shared.vao,".setVAO(null);"),pi(he,Ae,Pe,Ge.attributes,Xe),pi(he,fe,Pe,Ge.attributes,ze)),Tr(he,Ae,Pe,Ge.uniforms,Xe),Tr(he,fe,Pe,Ge.uniforms,ze),In(he,Ae,fe,Pe);else{var p=he.global.def("{}"),y=Pe.shader.progVar.append(he,fe),O=fe.def(y,".id"),$=fe.def(p,"[",O,"]");fe(he.shared.gl,".useProgram(",y,".program);","if(!",$,"){",$,"=",p,"[",O,"]=",he.link(function(Z){return mr(kl,he,Pe,Z,2)}),"(",y,");}",$,".call(this,a0[",De,"],",De,");")}}function ye(he,oe){var Pe=he.proc("batch",2);he.batchId="0",go(he,Pe);var Ge=!1,Je=!0;Object.keys(oe.context).forEach(function(p){Ge=Ge||oe.context[p].propDep}),Ge||(qo(he,Pe,oe.context),Je=!1);var De=oe.framebuffer,Ce=!1;De?(De.propDep?Ge=Ce=!0:De.contextDep&&Ge&&(Ce=!0),Ce||ii(he,Pe,De)):ii(he,Pe,null),oe.state.viewport&&oe.state.viewport.propDep&&(Ge=!0);function Ve(p){return p.contextDep&&Ge||p.propDep}fi(he,Pe,oe),Jo(he,Pe,oe.state,function(p){return!Ve(p)}),(!oe.profile||!Ve(oe.profile))&&er(he,Pe,oe,!1,"a1"),oe.contextDep=Ge,oe.needsContext=Je,oe.needsFramebuffer=Ce;var pe=oe.shader.progVar;if(pe.contextDep&&Ge||pe.propDep)So(he,Pe,oe,null);else{var Ae=pe.append(he,Pe);if(Pe(he.shared.gl,".useProgram(",Ae,".program);"),oe.shader.program)So(he,Pe,oe,oe.shader.program);else{Pe(he.shared.vao,".setVAO(null);");var fe=he.global.def("{}"),ze=Pe.def(Ae,".id"),Xe=Pe.def(fe,"[",ze,"]");Pe(he.cond(Xe).then(Xe,".call(this,a0,a1);").else(Xe,"=",fe,"[",ze,"]=",he.link(function(p){return mr(So,he,oe,p,2)}),"(",Ae,");",Xe,".call(this,a0,a1);"))}}Object.keys(oe.state).length>0&&Pe(he.shared.current,".dirty=true;")}function ct(he,oe){var Pe=he.proc("scope",3);he.batchId="a2";var Ge=he.shared,Je=Ge.current;qo(he,Pe,oe.context),oe.framebuffer&&oe.framebuffer.append(he,Pe),ud(Object.keys(oe.state)).forEach(function(Ce){var Ve=oe.state[Ce],pe=Ve.append(he,Pe);C(pe)?pe.forEach(function(Ae,fe){Pe.set(he.next[Ce],"["+fe+"]",Ae)}):Pe.set(Ge.next,"."+Ce,pe)}),er(he,Pe,oe,!0,!0),[Ho,gf,Al,Ct,Sl].forEach(function(Ce){var Ve=oe.draw[Ce];Ve&&Pe.set(Ge.draw,"."+Ce,""+Ve.append(he,Pe))}),Object.keys(oe.uniforms).forEach(function(Ce){var Ve=oe.uniforms[Ce].append(he,Pe);Array.isArray(Ve)&&(Ve="["+Ve.join()+"]"),Pe.set(Ge.uniforms,"["+se.id(Ce)+"]",Ve)}),Object.keys(oe.attributes).forEach(function(Ce){var Ve=oe.attributes[Ce].append(he,Pe),pe=he.scopeAttrib(Ce);Object.keys(new Ze).forEach(function(Ae){Pe.set(pe,"."+Ae,Ve[Ae])})}),oe.scopeVAO&&Pe.set(Ge.vao,".targetVAO",oe.scopeVAO.append(he,Pe));function De(Ce){var Ve=oe.shader[Ce];Ve&&Pe.set(Ge.shader,"."+Ce,Ve.append(he,Pe))}De(Yc),De(Ii),Object.keys(oe.state).length>0&&(Pe(Je,".dirty=true;"),Pe.exit(Je,".dirty=true;")),Pe("a1(",he.shared.context,",a0,",he.batchId,");")}function it(he){if(!(typeof he!="object"||C(he))){for(var oe=Object.keys(he),Pe=0;Pe<oe.length;++Pe)if(en.isDynamic(he[oe[Pe]]))return!0;return!1}}function dn(he,oe,Pe){var Ge=oe.static[Pe];if(!Ge||!it(Ge))return;var Je=he.global,De=Object.keys(Ge),Ce=!1,Ve=!1,pe=!1,Ae=he.global.def("{}");De.forEach(function(ze){var Xe=Ge[ze];if(en.isDynamic(Xe)){typeof Xe=="function"&&(Xe=Ge[ze]=en.unbox(Xe));var p=ua(Xe,null);Ce=Ce||p.thisDep,pe=pe||p.propDep,Ve=Ve||p.contextDep}else{switch(Je(Ae,".",ze,"="),typeof Xe){case"number":Je(Xe);break;case"string":Je('"',Xe,'"');break;case"object":Array.isArray(Xe)&&Je("[",Xe.join(),"]");break;default:Je(he.link(Xe));break}Je(";")}});function fe(ze,Xe){De.forEach(function(p){var y=Ge[p];if(en.isDynamic(y)){var O=ze.invoke(Xe,y);Xe(Ae,".",p,"=",O,";")}})}oe.dynamic[Pe]=new en.DynamicVariable(nl,{thisDep:Ce,contextDep:Ve,propDep:pe,ref:Ae,append:fe}),delete oe.static[Pe]}function hr(he,oe,Pe,Ge,Je){var De=Ln();De.stats=De.link(Je),Object.keys(oe.static).forEach(function(Ve){dn(De,oe,Ve)}),kp.forEach(function(Ve){dn(De,he,Ve)});var Ce=Fo(he,oe,Pe,Ge,De);return _o(De,Ce),ct(De,Ce),ye(De,Ce),a(De.compile(),{destroy:function(){Ce.shader.program.destroy()}})}return{next:ln,current:kt,procs:(function(){var he=Ln(),oe=he.proc("poll"),Pe=he.proc("refresh"),Ge=he.block();oe(Ge),Pe(Ge);var Je=he.shared,De=Je.gl,Ce=Je.next,Ve=Je.current;Ge(Ve,".dirty=false;"),ii(he,oe),ii(he,Pe,null,!0);var pe;$t&&(pe=he.link($t)),Oe.oes_vertex_array_object&&Pe(he.link(Oe.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Ae=0;Ae<ut.maxAttributes;++Ae){var fe=Pe.def(Je.attributes,"[",Ae,"]"),ze=he.cond(fe,".buffer");ze.then(De,".enableVertexAttribArray(",Ae,");",De,".bindBuffer(",Ml,",",fe,".buffer.buffer);",De,".vertexAttribPointer(",Ae,",",fe,".size,",fe,".type,",fe,".normalized,",fe,".stride,",fe,".offset);").else(De,".disableVertexAttribArray(",Ae,");",De,".vertexAttrib4f(",Ae,",",fe,".x,",fe,".y,",fe,".z,",fe,".w);",fe,".buffer=null;"),Pe(ze),$t&&Pe(pe,".vertexAttribDivisorANGLE(",Ae,",",fe,".divisor);")}return Pe(he.shared.vao,".currentVAO=null;",he.shared.vao,".setVAO(",he.shared.vao,".targetVAO);"),Object.keys(qt).forEach(function(Xe){var p=qt[Xe],y=Ge.def(Ce,".",Xe),O=he.block();O("if(",y,"){",De,".enable(",p,")}else{",De,".disable(",p,")}",Ve,".",Xe,"=",y,";"),Pe(O),oe("if(",y,"!==",Ve,".",Xe,"){",O,"}")}),Object.keys(Tt).forEach(function(Xe){var p=Tt[Xe],y=kt[Xe],O,$,Z=he.block();if(Z(De,".",p,"("),C(y)){var re=y.length;O=he.global.def(Ce,".",Xe),$=he.global.def(Ve,".",Xe),Z(Lr(re,function(ve){return O+"["+ve+"]"}),");",Lr(re,function(ve){return $+"["+ve+"]="+O+"["+ve+"];"}).join("")),oe("if(",Lr(re,function(ve){return O+"["+ve+"]!=="+$+"["+ve+"]"}).join("||"),"){",Z,"}")}else O=Ge.def(Ce,".",Xe),$=Ge.def(Ve,".",Xe),Z(O,");",Ve,".",Xe,"=",O,";"),oe("if(",O,"!==",$,"){",Z,"}");Pe(Z)}),he.compile()})(),compile:hr}}function cd(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var cu=34918,wr=34919,Fh=35007,ca=function(G,se){if(!se.ext_disjoint_timer_query)return null;var Oe=[];function ut(){return Oe.pop()||se.ext_disjoint_timer_query.createQueryEXT()}function gt($t){Oe.push($t)}var ot=[];function mt($t){var tn=ut();se.ext_disjoint_timer_query.beginQueryEXT(Fh,tn),ot.push(tn),Dt(ot.length-1,ot.length,$t)}function Rt(){se.ext_disjoint_timer_query.endQueryEXT(Fh)}function Bt(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var jt=[];function ht(){return jt.pop()||new Bt}function Kt($t){jt.push($t)}var Gt=[];function Dt($t,tn,kt){var ln=ht();ln.startQueryIndex=$t,ln.endQueryIndex=tn,ln.sum=0,ln.stats=kt,Gt.push(ln)}var At=[],Ze=[];function pt(){var $t,tn,kt=ot.length;if(kt!==0){Ze.length=Math.max(Ze.length,kt+1),At.length=Math.max(At.length,kt+1),At[0]=0,Ze[0]=0;var ln=0;for($t=0,tn=0;tn<ot.length;++tn){var Nt=ot[tn];se.ext_disjoint_timer_query.getQueryObjectEXT(Nt,wr)?(ln+=se.ext_disjoint_timer_query.getQueryObjectEXT(Nt,cu),gt(Nt)):ot[$t++]=Nt,At[tn+1]=ln,Ze[tn+1]=$t}for(ot.length=$t,$t=0,tn=0;tn<Gt.length;++tn){var qt=Gt[tn],Tt=qt.startQueryIndex,Zt=qt.endQueryIndex;qt.sum+=At[Zt]-At[Tt];var Cn=Ze[Tt],Hn=Ze[Zt];Hn===Cn?(qt.stats.gpuTime+=qt.sum/1e6,Kt(qt)):(qt.startQueryIndex=Cn,qt.endQueryIndex=Hn,Gt[$t++]=qt)}Gt.length=$t}}return{beginQuery:mt,endQuery:Rt,pushScopeStats:Dt,update:pt,getNumPendingQueries:function(){return ot.length},clear:function(){Oe.push.apply(Oe,ot);for(var $t=0;$t<Oe.length;$t++)se.ext_disjoint_timer_query.deleteQueryEXT(Oe[$t]);ot.length=0,Oe.length=0},restore:function(){ot.length=0,Oe.length=0}}},Co=16384,na=256,jp=1024,Ai=34962,Aa="webglcontextlost",du="webglcontextrestored",dd=1,Lo=2,Xo=3;function Af(G,se){for(var Oe=0;Oe<G.length;++Oe)if(G[Oe]===se)return Oe;return-1}function Dp(G){var se=ur(G);if(!se)return null;var Oe=se.gl,ut=Oe.getContextAttributes(),gt=Oe.isContextLost(),ot=to(Oe,se);if(!ot)return null;var mt=li(),Rt=cd(),Bt=ot.extensions,jt=ca(Oe,Bt),ht=Sr(),Kt=Oe.drawingBufferWidth,Gt=Oe.drawingBufferHeight,Dt={tick:0,time:0,viewportWidth:Kt,viewportHeight:Gt,framebufferWidth:Kt,framebufferHeight:Gt,drawingBufferWidth:Kt,drawingBufferHeight:Gt,pixelRatio:se.pixelRatio},At={},Ze={elements:null,primitive:4,count:-1,offset:0,instances:-1},pt=Mc(Oe,Bt),$t=ba(Oe,Rt,se,kt),tn=uf(Oe,Bt,pt,Rt,$t);function kt(In){return tn.destroyBuffer(In)}var ln=bn(Oe,Bt,$t,Rt),Nt=df(Oe,mt,Rt,se),qt=Mr(Oe,Bt,pt,function(){Cn.procs.poll()},Dt,Rt,se),Tt=Fu(Oe,Bt,pt,Rt,se),Zt=lf(Oe,Bt,pt,qt,Tt,Rt),Cn=em(Oe,mt,Bt,pt,$t,ln,qt,Zt,At,tn,Nt,Ze,Dt,jt,se),Hn=Th(Oe,Zt,Cn.procs.poll,Dt,ut,Bt,pt),It=Cn.next,Pt=Oe.canvas,Mt=[],Ln=[],or=[],mn=[se.onDestroy],cr=null;function Xn(){if(Mt.length===0){jt&&jt.update(),cr=null;return}cr=Tn.next(Xn),Jo();for(var In=Mt.length-1;In>=0;--In){var mr=Mt[In];mr&&mr(Dt,null,0)}Oe.flush(),jt&&jt.update()}function lr(){!cr&&Mt.length>0&&(cr=Tn.next(Xn))}function Er(){cr&&(Tn.cancel(Xn),cr=null)}function $o(In){In.preventDefault(),gt=!0,Er(),Ln.forEach(function(mr){mr()})}function Ro(In){Oe.getError(),gt=!1,ot.restore(),Nt.restore(),$t.restore(),qt.restore(),Tt.restore(),Zt.restore(),tn.restore(),jt&&jt.restore(),Cn.procs.refresh(),lr(),or.forEach(function(mr){mr()})}Pt&&(Pt.addEventListener(Aa,$o,!1),Pt.addEventListener(du,Ro,!1));function ir(){Mt.length=0,Er(),Pt&&(Pt.removeEventListener(Aa,$o),Pt.removeEventListener(du,Ro)),Nt.clear(),Zt.clear(),Tt.clear(),qt.clear(),ln.clear(),$t.clear(),tn.clear(),jt&&jt.clear(),mn.forEach(function(In){In()})}function Zo(In){te(!!In,"invalid args to regl({...})"),te.type(In,"object","invalid args to regl({...})");function mr(Je){var De=a({},Je);delete De.uniforms,delete De.attributes,delete De.context,delete De.vao,"stencil"in De&&De.stencil.op&&(De.stencil.opBack=De.stencil.opFront=De.stencil.op,delete De.stencil.op);function Ce(Ve){if(Ve in De){var pe=De[Ve];delete De[Ve],Object.keys(pe).forEach(function(Ae){De[Ve+"."+Ae]=pe[Ae]})}}return Ce("blend"),Ce("depth"),Ce("cull"),Ce("stencil"),Ce("polygonOffset"),Ce("scissor"),Ce("sample"),"vao"in Je&&(De.vao=Je.vao),De}function tr(Je,De){var Ce={},Ve={};return Object.keys(Je).forEach(function(pe){var Ae=Je[pe];if(en.isDynamic(Ae)){Ve[pe]=en.unbox(Ae,pe);return}else if(De&&Array.isArray(Ae)){for(var fe=0;fe<Ae.length;++fe)if(en.isDynamic(Ae[fe])){Ve[pe]=en.unbox(Ae,pe);return}}Ce[pe]=Ae}),{dynamic:Ve,static:Ce}}var _o=tr(In.context||{},!0),kl=tr(In.uniforms||{},!0),So=tr(In.attributes||{},!1),ye=tr(mr(In),!1),ct={gpuTime:0,cpuTime:0,count:0},it=Cn.compile(ye,So,kl,_o,ct),dn=it.draw,hr=it.batch,he=it.scope,oe=[];function Pe(Je){for(;oe.length<Je;)oe.push(null);return oe}function Ge(Je,De){var Ce;if(gt&&te.raise("context lost"),typeof Je=="function")return he.call(this,null,Je,0);if(typeof De=="function")if(typeof Je=="number")for(Ce=0;Ce<Je;++Ce)he.call(this,null,De,Ce);else if(Array.isArray(Je))for(Ce=0;Ce<Je.length;++Ce)he.call(this,Je[Ce],De,Ce);else return he.call(this,Je,De,0);else if(typeof Je=="number"){if(Je>0)return hr.call(this,Pe(Je|0),Je|0)}else if(Array.isArray(Je)){if(Je.length)return hr.call(this,Je,Je.length)}else return dn.call(this,Je)}return a(Ge,{stats:ct,destroy:function(){it.destroy()}})}var so=Zt.setFBO=Zo({framebuffer:en.define.call(null,dd,"framebuffer")});function Fo(In,mr){var tr=0;Cn.procs.poll();var _o=mr.color;_o&&(Oe.clearColor(+_o[0]||0,+_o[1]||0,+_o[2]||0,+_o[3]||0),tr|=Co),"depth"in mr&&(Oe.clearDepth(+mr.depth),tr|=na),"stencil"in mr&&(Oe.clearStencil(mr.stencil|0),tr|=jp),te(!!tr,"called regl.clear with no buffer specified"),Oe.clear(tr)}function qo(In){if(te(typeof In=="object"&&In,"regl.clear() takes an object as input"),"framebuffer"in In)if(In.framebuffer&&In.framebuffer_reglType==="framebufferCube")for(var mr=0;mr<6;++mr)so(a({framebuffer:In.framebuffer.faces[mr]},In),Fo);else so(In,Fo);else Fo(null,In)}function ii(In){te.type(In,"function","regl.frame() callback must be a function"),Mt.push(In);function mr(){var tr=Af(Mt,In);te(tr>=0,"cannot cancel a frame twice");function _o(){var kl=Af(Mt,_o);Mt[kl]=Mt[Mt.length-1],Mt.length-=1,Mt.length<=0&&Er()}Mt[tr]=_o}return lr(),{cancel:mr}}function fi(){var In=It.viewport,mr=It.scissor_box;In[0]=In[1]=mr[0]=mr[1]=0,Dt.viewportWidth=Dt.framebufferWidth=Dt.drawingBufferWidth=In[2]=mr[2]=Oe.drawingBufferWidth,Dt.viewportHeight=Dt.framebufferHeight=Dt.drawingBufferHeight=In[3]=mr[3]=Oe.drawingBufferHeight}function Jo(){Dt.tick+=1,Dt.time=er(),fi(),Cn.procs.poll()}function go(){qt.refresh(),fi(),Cn.procs.refresh(),jt&&jt.update()}function er(){return(Sr()-ht)/1e3}go();function pi(In,mr){te.type(mr,"function","listener callback must be a function");var tr;switch(In){case"frame":return ii(mr);case"lost":tr=Ln;break;case"restore":tr=or;break;case"destroy":tr=mn;break;default:te.raise("invalid event, must be one of frame,lost,restore,destroy")}return tr.push(mr),{cancel:function(){for(var _o=0;_o<tr.length;++_o)if(tr[_o]===mr){tr[_o]=tr[tr.length-1],tr.pop();return}}}}var Tr=a(Zo,{clear:qo,prop:en.define.bind(null,dd),context:en.define.bind(null,Lo),this:en.define.bind(null,Xo),draw:Zo({}),buffer:function(In){return $t.create(In,Ai,!1,!1)},elements:function(In){return ln.create(In,!1)},texture:qt.create2D,cube:qt.createCube,renderbuffer:Tt.create,framebuffer:Zt.create,framebufferCube:Zt.createCube,vao:tn.createVAO,attributes:ut,frame:ii,on:pi,limits:pt,hasExtension:function(In){return pt.extensions.indexOf(In.toLowerCase())>=0},read:Hn,destroy:ir,_gl:Oe,_refresh:go,poll:function(){Jo(),jt&&jt.update()},now:er,stats:Rt});return se.onDone(null,Tr),Tr}return Dp}))})(Sg)),Sg.exports}hne();var xd,ym,Sd,Ns,gm,Lf,_m,dg,oc,qp,ka,ic,ac,fg;xd={},fn(xd,cn.POINTS,"points"),fn(xd,cn.LINES,"lines"),fn(xd,cn.LINE_LOOP,"line loop"),fn(xd,cn.LINE_STRIP,"line strip"),fn(xd,cn.TRIANGLES,"triangles"),fn(xd,cn.TRIANGLE_FAN,"triangle fan"),fn(xd,cn.TRIANGLE_STRIP,"triangle strip");ym={},fn(ym,cn.STATIC_DRAW,"static"),fn(ym,cn.DYNAMIC_DRAW,"dynamic"),fn(ym,cn.STREAM_DRAW,"stream");Sd={},fn(Sd,cn.BYTE,"int8"),fn(Sd,cn.UNSIGNED_INT,"int16"),fn(Sd,cn.INT,"int32"),fn(Sd,cn.UNSIGNED_BYTE,"uint8"),fn(Sd,cn.UNSIGNED_SHORT,"uint16"),fn(Sd,cn.UNSIGNED_INT,"uint32"),fn(Sd,cn.FLOAT,"float");Ns={},fn(Ns,cn.ALPHA,"alpha"),fn(Ns,cn.LUMINANCE,"luminance"),fn(Ns,cn.LUMINANCE_ALPHA,"luminance alpha"),fn(Ns,cn.RGB,"rgb"),fn(Ns,cn.RGBA,"rgba"),fn(Ns,cn.RGBA4,"rgba4"),fn(Ns,cn.RGB5_A1,"rgb5 a1"),fn(Ns,cn.RGB565,"rgb565"),fn(Ns,cn.DEPTH_COMPONENT,"depth"),fn(Ns,cn.DEPTH_STENCIL,"depth stencil");gm={},fn(gm,cn.DONT_CARE,"dont care"),fn(gm,cn.NICEST,"nice"),fn(gm,cn.FASTEST,"fast");Lf={},fn(Lf,cn.NEAREST,"nearest"),fn(Lf,cn.LINEAR,"linear"),fn(Lf,cn.LINEAR_MIPMAP_LINEAR,"mipmap"),fn(Lf,cn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),fn(Lf,cn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),fn(Lf,cn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest");_m={},fn(_m,cn.REPEAT,"repeat"),fn(_m,cn.CLAMP_TO_EDGE,"clamp"),fn(_m,cn.MIRRORED_REPEAT,"mirror");dg={},fn(dg,cn.NONE,"none"),fn(dg,cn.BROWSER_DEFAULT_WEBGL,"browser");oc={},fn(oc,cn.NEVER,"never"),fn(oc,cn.ALWAYS,"always"),fn(oc,cn.LESS,"less"),fn(oc,cn.LEQUAL,"lequal"),fn(oc,cn.GREATER,"greater"),fn(oc,cn.GEQUAL,"gequal"),fn(oc,cn.EQUAL,"equal"),fn(oc,cn.NOTEQUAL,"notequal");qp={},fn(qp,cn.FUNC_ADD,"add"),fn(qp,cn.MIN_EXT,"min"),fn(qp,cn.MAX_EXT,"max"),fn(qp,cn.FUNC_SUBTRACT,"subtract"),fn(qp,cn.FUNC_REVERSE_SUBTRACT,"reverse subtract");ka={},fn(ka,cn.ZERO,"zero"),fn(ka,cn.ONE,"one"),fn(ka,cn.SRC_COLOR,"src color"),fn(ka,cn.ONE_MINUS_SRC_COLOR,"one minus src color"),fn(ka,cn.SRC_ALPHA,"src alpha"),fn(ka,cn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),fn(ka,cn.DST_COLOR,"dst color"),fn(ka,cn.ONE_MINUS_DST_COLOR,"one minus dst color"),fn(ka,cn.DST_ALPHA,"dst alpha"),fn(ka,cn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),fn(ka,cn.CONSTANT_COLOR,"constant color"),fn(ka,cn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),fn(ka,cn.CONSTANT_ALPHA,"constant alpha"),fn(ka,cn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),fn(ka,cn.SRC_ALPHA_SATURATE,"src alpha saturate");ic={},fn(ic,cn.NEVER,"never"),fn(ic,cn.ALWAYS,"always"),fn(ic,cn.LESS,"less"),fn(ic,cn.LEQUAL,"lequal"),fn(ic,cn.GREATER,"greater"),fn(ic,cn.GEQUAL,"gequal"),fn(ic,cn.EQUAL,"equal"),fn(ic,cn.NOTEQUAL,"notequal");ac={},fn(ac,cn.ZERO,"zero"),fn(ac,cn.KEEP,"keep"),fn(ac,cn.REPLACE,"replace"),fn(ac,cn.INVERT,"invert"),fn(ac,cn.INCR,"increment"),fn(ac,cn.DECR,"decrement"),fn(ac,cn.INCR_WRAP,"increment wrap"),fn(ac,cn.DECR_WRAP,"decrement wrap");fg={},fn(fg,cn.FRONT,"front"),fn(fg,cn.BACK,"back");var iw,xM;function vne(){if(xM)return iw;xM=1;function e(t,n){return function(a){return t(n(a))}}return iw=e,iw}var aw,SM;function mne(){if(SM)return aw;SM=1;var e=vne(),t=e(Object.getPrototypeOf,Object);return aw=t,aw}var lw,AM;function yne(){if(AM)return lw;AM=1;var e=Yw(),t=mne(),n=Kw(),a="[object Object]",r=Function.prototype,s=Object.prototype,c=r.toString,v=s.hasOwnProperty,f=c.call(Object);function g(_){if(!n(_)||e(_)!=a)return!1;var b=t(_);if(b===null)return!0;var x=v.call(b,"constructor")&&b.constructor;return typeof x=="function"&&x instanceof x&&c.call(x)==f}return lw=g,lw}yne();class e2{constructor(){fa(this,"lf");fa(this,"option")}render(t){this.lf=t}layout(t={}){var g;const{nodes:n,edges:a,gridSize:r}=this.lf.graphModel;let s=40,c=40;r>20&&(s=r*2,c=r*2),this.option={type:"dagre",rankdir:"LR",align:"DR",nodesep:s,ranksep:c,begin:[120,120],...t},(g=new SJ(this.option).layout({nodes:n.map(_=>({id:_.id,size:{width:_.width,height:_.height},model:_})),edges:a.map(_=>({source:_.sourceNodeId,target:_.targetNodeId,model:_}))}).nodes)==null||g.forEach(_=>{const{model:b}=_;b.set_position({x:_.x,y:_.y})}),this.lf.fitView()}}fa(e2,"pluginName","dagre");let lc=null;function MM(e,t){return e.x+=t,e.y+=t,e.text&&(e.text.x+=t,e.text.y+=t),e}function kM(e,t){return e.startPoint&&(e.startPoint.x+=t,e.startPoint.y+=t),e.endPoint&&(e.endPoint.x+=t,e.endPoint.y+=t),e.pointsList&&e.pointsList.length>0&&e.pointsList.forEach(n=>{n.x+=t,n.y+=t}),e.text&&(e.text.x+=t,e.text.y+=t),e}const lv=40;let pg=40;function _C(e,t){const{keyboard:n}=e,{options:{keyboard:a}}=n,r=()=>{var b,x;if(pg=lv,!(a!=null&&a.enabled)||t.textEditElement)return!0;const{guards:v}=e.options,f=t.getSelectElements(!1);if(!(v&&v.beforeClone?v.beforeClone(f):!0)||f.nodes.length===0&&f.edges.length===0)return lc=null,!0;const _=f.nodes.filter(S=>S.type===nr.Start||S.type===nr.Base);if(_.length>0){ei(((x=(b=_[0])==null?void 0:b.properties)==null?void 0:x.stepName)+yt("views.applicationWorkflow.tip.cannotCopy"));return}return lc=ge.cloneDeep(f),lc.nodes.forEach(S=>MM(S,lv)),lc.edges.forEach(S=>kM(S,lv)),zf(yt("views.applicationWorkflow.tip.copyError")),!1},s=()=>{if(!(a!=null&&a.enabled)||t.textEditElement)return!0;if(lc&&(lc.nodes||lc.edges)){e.clearSelectElements();const v=e.addElements(lc,pg);if(!v)return!0;v.nodes.forEach(f=>e.selectElementById(f.id,!0)),v.edges.forEach(f=>e.selectElementById(f.id,!0)),lc.nodes.forEach(f=>MM(f,lv)),lc.edges.forEach(f=>kM(f,lv)),pg=pg+lv}return!1},c=()=>{var g;const v=t.getSelectElements(!0);if(e.clearSelectElements(),v.nodes.length==0&&v.edges.length==0)return;if(v.edges.length>0&&v.nodes.length==0){v.edges.filter(_=>!["loop-edge"].includes(_.type||"")).forEach(_=>e.deleteEdge(_.id));return}const f=v.nodes.filter(_=>["start-node","base-node","loop-body-node","loop-start-node"].includes(_.type));if(f.length>0){ei(`${(g=f[0].properties)==null?void 0:g.stepName}${yt("views.applicationWorkflow.delete.deleteMessage")}`);return}return Xw(yt("common.tip"),yt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:yt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{if(!(a!=null&&a.enabled)||t.textEditElement)return!0;v.edges.forEach(_=>e.deleteEdge(_.id)),v.nodes.forEach(_=>{_.type==="loop-node"&&e.getNodeOutgoingNode(_.id).forEach(x=>{x.type==="loop-body-node"&&e.deleteNode(x.id)}),e.deleteNode(_.id)})}),!1};t.eventCenter.on("copy_node",r),n.on(["cmd + c","ctrl + c"],r),n.on(["cmd + v","ctrl + v"],s),n.on(["cmd + z","ctrl + z"],()=>{}),n.on(["cmd + y","ctrl + y"],()=>!(a!=null&&a.enabled)||t.textEditElement?!0:(e.redo(),!1)),n.on(["backspace"],c)}const gne={class:"workflow-node-container p-16",style:{overflow:"visible"}},_ne={class:"flex-between"},bne={class:"flex align-center"},wne={class:"ellipsis-1 break-all"},Ene={class:"mt-16"},One={class:"title-decoration-1 mb-8 mt-8"},xne=["onMouseenter"],Sne={class:"break-all"},Ane={class:"dialog-footer"},Mne=Vn({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(e){$m("workflowMode",Is.ApplicationLoop);const t=Re(),n=Re(!1),a=Re({title:""}),r=$n({set:S=>{ge.set(g.nodeModel.properties,"showNode",S)},get:()=>g.nodeModel.properties.showNode!==void 0?g.nodeModel.properties.showNode:(ge.set(g.nodeModel.properties,"showNode",!0),!0)}),s=$n(()=>g.nodeModel.properties.status?g.nodeModel.properties.status:200),c=async S=>{S&&await S.validate(A=>{var E;A&&((E=g.nodeModel.graphModel.nodes)!=null&&E.some(T=>T.properties.stepName===a.value.title)?jD.error(yt("views.applicationWorkflow.tip.repeatedNodeError")):(ge.set(g.nodeModel.properties,"stepName",a.value.title),n.value=!1,S.resetFields()))})},v=Re(null),f=Re(600),g=e,_=$n(()=>{var S;return g.nodeModel.properties.config.fields?(S=g.nodeModel.properties.config.fields)==null?void 0:S.map(E=>({label:E.label,value:E.value,globeLabel:`{{${g.nodeModel.properties.stepName}.${E.value}}}`,globeValue:`{{context['${g.nodeModel.id}'].${E.value}}}`})):[]}),b=Re(!1);function x(){if(b.value=!b.value,b.value){g.nodeModel.graphModel.transformModel.focusOn(g.nodeModel.x,g.nodeModel.y,g.nodeModel.width+window.innerWidth-g.nodeModel.width,g.nodeModel.height-30),f.value=(g.nodeModel.graphModel.height-100)/g.nodeModel.graphModel.transformModel.SCALE_Y;const S=window.innerWidth/g.nodeModel.graphModel.transformModel.SCALE_X;g.nodeModel.width=S,g.nodeModel.setHeight(f.value)}else{f.value=600;const S=1920;g.nodeModel.width=S,g.nodeModel.setHeight(f.value)}}return(S,A)=>{var B;const E=J("AppIcon"),T=J("el-button"),I=J("el-alert"),R=J("el-tooltip"),U=J("el-collapse-transition"),D=J("el-input"),L=J("el-form-item"),W=J("el-form"),H=J("el-dialog");return be(),Ht("div",gne,[Y("div",{class:Cl(["step-container app-card p-16",{isSelected:g.nodeModel.isSelected,error:s.value!==200}]),style:{overflow:"visible",background:"#fff"}},[Y("div",null,[Y("div",_ne,[Y("div",bne,[(be(),at(kg(_n(Tg)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(B=e.nodeModel)==null?void 0:B.properties.node_data},null,8,["item"])),Y("h4",wne,de(e.nodeModel.properties.stepName),1)]),k(T,{link:"",onClick:x},{default:P(()=>[k(E,{iconName:b.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),k(U,null,{default:P(()=>[Ga(Y("div",Ene,[s.value!=200?(be(),at(I,{key:0,class:"mb-16",title:g.nodeModel.type==="application-node"?S.$t("views.applicationWorkflow.tip.applicationNodeError"):S.$t("views.applicationWorkflow.tip.functionNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):pn("",!0),Y("div",{style:YM(`height:${f.value}px`)},[KM(S.$slots,"default",{},void 0,!0)],4),_.value.length>0?(be(),Ht(ar,{key:1},[Y("h5",One,de(S.$t("common.param.outputParam")),1),(be(!0),Ht(ar,null,Gr(_.value,(F,q)=>(be(),Ht("div",{key:q,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:K=>v.value=q,onMouseleave:A[0]||(A[0]=K=>v.value=null)},[Y("span",Sne,de(F.label)+" "+de("{"+F.value+"}"),1),v.value===q?(be(),at(R,{key:0,effect:"dark",content:S.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(T,{link:"",onClick:K=>_n(Lm)(F.globeLabel),style:{padding:"0"}},{default:P(()=>[k(E,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],40,xne))),128))],64)):pn("",!0)],512),[[Wf,r.value]])]),_:3})])],2),k(H,{title:S.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":A[5]||(A[5]=F=>n.value=F),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:A[6]||(A[6]=rn(()=>{},["prevent"]))},{footer:P(()=>[Y("span",Ane,[k(T,{onClick:A[3]||(A[3]=rn(F=>n.value=!1,["prevent"]))},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(T,{type:"primary",onClick:A[4]||(A[4]=F=>c(t.value))},{default:P(()=>[et(de(S.$t("common.save")),1)]),_:1})])]),default:P(()=>[k(W,{"label-position":"top",ref_key:"titleFormRef",ref:t,model:a.value},{default:P(()=>[k(L,{prop:"title",rules:[{required:!0,message:S.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:P(()=>[k(D,{modelValue:a.value.title,"onUpdate:modelValue":A[1]||(A[1]=F=>a.value.title=F),onBlur:A[2]||(A[2]=F=>a.value.title=a.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])])}}}),kne=Kf(Mne,[["__scopeId","data-v-931a7769"]]),Tne=[nr.AiChat,nr.Reply,nr.ToolLib,nr.ToolLibCustom,nr.ImageUnderstandNode,nr.Application,nr.SpeechToTextNode,nr.TextToSpeechNode,nr.ImageGenerateNode,nr.ImageToVideoGenerateNode,nr.TextToVideoGenerateNode,nr.ImageGenerateNode,nr.LoopBodyNode,nr.LoopNode,nr.LoopBreakNode,nr.VideoUnderstandNode,nr.VariableAssignNode],Nne=[nr.AiChat,nr.Reply,nr.ToolLib,nr.ToolLibCustom,nr.ImageUnderstandNode,nr.VideoUnderstandNode,nr.Application,nr.SpeechToTextNode,nr.TextToSpeechNode,nr.ImageGenerateNode,nr.ImageToVideoGenerateNode,nr.TextToVideoGenerateNode,nr.ImageGenerateNode,nr.LoopBodyNode,nr.LoopNode,nr.LoopBreakNode,nr.VariableAssignNode],TM={[Is.Application]:Tne,[Is.ApplicationLoop]:Nne};class Bw{constructor(t,n){fa(this,"nodes");fa(this,"edges");fa(this,"workFlowNodes");fa(this,"workflowModel");this.nodes=t.nodes,this.edges=t.edges,this.workFlowNodes=[],this.workflowModel=n||Is.Application}is_valid_start_node(){const t=this.nodes.filter(n=>[nr.Start,nr.LoopStartNode].includes(n.id));if(t.length==0)throw yt("views.applicationWorkflow.validate.startNodeRequired");if(t.length>1)throw yt("views.applicationWorkflow.validate.startNodeOnly")}is_valid_base_node(){const t=this.nodes.filter(n=>n.id===nr.Base);if(t.length==0)throw yt("views.applicationWorkflow.validate.baseNodeRequired");if(t.length>1)throw yt("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=>[nr.Start,nr.LoopStartNode].includes(n.id))[0]}get_base_node(){return this.nodes.filter(n=>n.id===nr.Base)[0]}exist_break_node(){return this.nodes.some(t=>t.type===nr.LoopBreakNode)}_is_valid_work_flow(t){t||(t=this.get_start_node()),this.workFlowNodes.push(t),this.is_valid_node(t);const n=this.get_next_nodes(t);for(const a of n)this._is_valid_work_flow(a)}is_valid_work_flow(){this.workFlowNodes=[],this._is_valid_work_flow();const t=this.nodes.filter(n=>n.id!==nr.Start&&n.id!==nr.Base).filter(n=>!this.workFlowNodes.includes(n));if(t.length>0)throw`${yt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${t.map(n=>n.properties.stepName).join(",")}`;this.workFlowNodes=[]}get_next_nodes(t){const a=this.edges.filter(s=>s.sourceNodeId==t.id).map(s=>this.nodes.filter(c=>c.id==s.targetNodeId)).reduce((s,c)=>[...s,...c],[]),r=TM[this.workflowModel];if(a.length==0&&!r.includes(t.type))throw yt("views.applicationWorkflow.validate.noNextNode");return a}is_valid_nodes(){for(const t of this.nodes)if(t.type!==nr.Base&&t.type!==nr.Start&&t.type!==nr.LoopStartNode&&!this.edges.some(n=>n.targetNodeId===t.id))throw`${yt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${t.properties.stepName}`}is_valid_node(t){if(t.properties.status&&t.properties.status===500)throw`${t.properties.stepName} ${yt("views.applicationWorkflow.validate.nodeUnavailable")}`;if(t.type===nr.Condition){const n=t.properties.node_data.branch;for(const a of n){const r=`${t.id}_${a.id}_right`;if(this.edges.filter(c=>c.sourceAnchorId==r).length==0)throw`${t.properties.stepName} ${yt("views.applicationWorkflow.validate.needConnect1")}${a.type}${yt("views.applicationWorkflow.validate.needConnect2")}`}}else{const n=this.edges.filter(r=>r.sourceNodeId==t.id),a=TM[this.workflowModel];if(n.length==0&&!a.includes(t.type))throw`${t.properties.stepName} ${yt("views.applicationWorkflow.validate.cannotEndNode")}`}if(t.properties.status&&t.properties.status!==200)throw`${t.properties.stepName} ${yt("views.applicationWorkflow.validate.nodeUnavailable")}`}}const Pne=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":uN,"/src/workflow/nodes/application-node/index.ts":cN,"/src/workflow/nodes/base-node/index.ts":SN,"/src/workflow/nodes/condition-node/index.ts":AN,"/src/workflow/nodes/document-extract-node/index.ts":MN,"/src/workflow/nodes/form-node/index.ts":kN,"/src/workflow/nodes/image-generate/index.ts":TN,"/src/workflow/nodes/image-to-video/index.ts":NN,"/src/workflow/nodes/image-understand/index.ts":PN,"/src/workflow/nodes/intent-classify-node/index.ts":CN,"/src/workflow/nodes/loop-body-node/index.ts":sk,"/src/workflow/nodes/loop-break-node/index.ts":RN,"/src/workflow/nodes/loop-continue-node/index.ts":jN,"/src/workflow/nodes/loop-node/index.ts":DN,"/src/workflow/nodes/loop-start-node/index.ts":IN,"/src/workflow/nodes/mcp-node/index.ts":LN,"/src/workflow/nodes/parameter-extraction-node/index.ts":$N,"/src/workflow/nodes/question-node/index.ts":FN,"/src/workflow/nodes/reply-node/index.ts":BN,"/src/workflow/nodes/reranker-node/index.ts":VN,"/src/workflow/nodes/search-document-node/index.ts":UN,"/src/workflow/nodes/search-knowledge-node/index.ts":WN,"/src/workflow/nodes/speech-to-text-node/index.ts":GN,"/src/workflow/nodes/start-node/index.ts":zN,"/src/workflow/nodes/text-to-speech-node/index.ts":HN,"/src/workflow/nodes/text-to-video/index.ts":XN,"/src/workflow/nodes/tool-lib-node/index.ts":qN,"/src/workflow/nodes/tool-node/index.ts":YN,"/src/workflow/nodes/variable-aggregation-node/index.ts":KN,"/src/workflow/nodes/variable-assign-node/index.ts":ZN,"/src/workflow/nodes/variable-splitting/index.ts":JN,"/src/workflow/nodes/video-understand/index.ts":QN}),n=e,a=Re(),r=()=>{const g=new Bw(v.value.getGraphData(),Is.ApplicationLoop);return Promise.all(v.value.graphModel.nodes.map(_=>{var b;return(b=_==null?void 0:_.validate)==null?void 0:b.call(_)})).then(()=>{const _=n.nodeModel.properties.loop_node_id,b=n.nodeModel.graphModel.getNodeModelById(_);try{return g.is_loop_valid(),b.properties.node_data.loop_type=="LOOP"&&!g.exist_break_node()?Promise.reject({node:b,errMessage:yt("views.applicationWorkflow.validate.loopNodeBreakNodeRequired")}):Promise.resolve({})}catch(x){return Promise.reject({node:b,errMessage:x})}}).catch(_=>{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),_})},s=()=>{const g=n.nodeModel.properties.loop_node_id,_=n.nodeModel.graphModel.getNodeModelById(g);_.properties.node_data.loop={x:n.nodeModel.x,y:n.nodeModel.y},_.properties.node_data.loop_body=v.value.getGraphData()},c=g=>{const _=n.nodeModel.properties.loop_node_id,b=n.nodeModel.graphModel.getNodeModelById(_);b&&(b.properties.config.fields=g)},v=Re(),f=g=>{const _=a.value;if(_){let b=function(x){let S=v.value.graphModel.transformModel.SCALE_X,A=v.value.graphModel.transformModel.SCALE_Y,E=v.value.graphModel.transformModel.TRANSLATE_X,T=v.value.graphModel.transformModel.TRANSLATE_Y;const[I,R]=x;return n.nodeModel.graphModel.transformModel,S*=n.nodeModel.graphModel.transformModel.SCALE_X,A*=n.nodeModel.graphModel.transformModel.SCALE_Y,E*=n.nodeModel.graphModel.transformModel.SCALE_X,T*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(I-E)/S,(R-T)/A]};v.value=new NT({plugins:[e2],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:_}),v.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),v.value.graphModel.transformModel.HtmlPointToCanvasPoint=b.bind(v.value.graphModel.transformModel),_C(v.value,v.value.graphModel),v.value.graphModel.refresh_loop_fields=c,v.value.graphModel.get_parent_nodes=()=>n.nodeModel.graphModel.nodes,v.value.graphModel.get_up_node_field_list=n.nodeModel.get_up_node_field_list,v.value.batchRegister([...Object.keys(t).map(x=>t[x].default),eP]),v.value.setDefaultEdgeType("app-edge"),v.value.render(g||{}),v.value.graphModel.eventCenter.on("delete_edge",x=>{x.forEach(S=>{v.value.deleteEdge(S)})}),v.value.graphModel.eventCenter.on("anchor:drop",x=>{x.nodeModel.clear_next_node_field(!1)}),v.value.graphModel.eventCenter.on("anchor:drop",x=>{x.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var x;(x=v.value)==null||x.fitView()},500)}};return Ir(()=>{f(ge.cloneDeep(n.nodeModel.properties.workflow)),ge.set(n.nodeModel,"validate",r),ge.set(n.nodeModel,"set_loop_body",s)}),QM(()=>{wU(v.value.graphModel.flowId),v.value=null}),(g,_)=>(be(),at(kne,{nodeModel:e.nodeModel},{default:P(()=>[Y("div",{ref_key:"containerRef",ref:a,onWheel:_[0]||(_[0]=rn(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class Cne extends ho{constructor(t){super(t,Pne)}getNodeName(){return yt("views.applicationWorkflow.nodes.loopBodyNode.label")}get_up_node_field_list(t,n){const a=this.props.model.properties.loop_node_id;if(typeof a=="string"){const r=this.props.graphModel.getNodeModelById(a);if(r&&typeof r.get_up_node_field_list=="function")return r.get_up_node_field_list(t,n)}return[]}}class Rne extends vo{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:a,width:r,height:s}=this;this.properties.showNode===void 0||this.properties.showNode;const c=[];return c.push({edgeAddable:!1,x:n,y:a-s/2+10,id:`${t}_children`,type:"children"}),c}setHeight(t){this.properties.height=t,this.outgoing.edges.forEach(n=>{n.updatePathByAnchor()}),this.incoming.edges.forEach(n=>{n.updatePathByAnchor()})}}const jne={type:"loop-body-node",model:Rne,view:Cne};class Dne extends hn.BezierEdgeModel{getArrowStyle(){const t=super.getArrowStyle();return t.offset=0,t.verticalLength=0,t}getEdgeStyle(){const t=super.getEdgeStyle();return t.strokeWidth=2,t.stroke="#BBBFC4",t.offset=0,t}getData(){const t=super.getData();return t&&(t.sourceAnchorId=this.sourceAnchorId,t.targetAnchorId=this.targetAnchorId),t}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(s=>s.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(s=>s.id===this.targetAnchorId);if(n&&r){const s={x:n.x,y:n.y-10};this.updateStartPoint(s);const c={x:r.x,y:r.y+3};this.updateEndPoint(c)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}}const Ine={type:"loop-edge",view:hn.BezierEdge,model:Dne},Lne=Vn({__name:"NodeControl",props:{lf:Object||String||null},setup(e){const t=e,n=Re(!1);function a(){var _;(_=t.lf)==null||_.zoom(!0,[0,0])}function r(){var _;(_=t.lf)==null||_.zoom(!1,[0,0])}function s(){var _,b,x;(_=t.lf)==null||_.resetZoom(),(b=t.lf)==null||b.resetTranslate(),(x=t.lf)==null||x.fitView()}const c=()=>{var _;(_=t.lf)==null||_.extension.dagre.layout()},v=()=>{var _;(_=t.lf)==null||_.graphModel.nodes.forEach(b=>{b.properties.showNode=!1})},f=()=>{var _;(_=t.lf)==null||_.graphModel.nodes.forEach(b=>{b.properties.showNode=!0})},g=_=>{var x,S,A;const b=document.querySelector(".lf-drag-able");n.value=_,_?(b.style.cursor="default",(x=t.lf)==null||x.openSelectionSelect(),(S=t.lf)==null||S.extension.selectionSelect.setSelectionSense(!0,!1)):(b.style.cursor="pointer",(A=t.lf)==null||A.closeSelectionSelect())};return(_,b)=>{const x=J("Position"),S=J("el-icon"),A=J("el-button"),E=J("AppIcon"),T=J("el-divider"),I=J("ZoomOut"),R=J("el-tooltip"),U=J("ZoomIn"),D=J("el-card");return be(),at(D,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:P(()=>[k(A,{onClick:b[0]||(b[0]=L=>g(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Cl({"is-drag-active":n.value})},{default:P(()=>[k(S,{size:16},{default:P(()=>[k(x)]),_:1})]),_:1},8,["class"]),k(A,{onClick:b[1]||(b[1]=L=>g(!1)),style:{border:"none",padding:"4px",height:"24px","margin-left":"8px"},class:Cl({"is-drag-active":!n.value})},{default:P(()=>[k(E,{iconName:"app-raisehand",size:16})]),_:1},8,["class"]),k(T,{direction:"vertical"}),k(A,{link:"",onClick:r,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:P(()=>[k(S,{size:16,title:_.$t("views.applicationWorkflow.control.zoomOut")},{default:P(()=>[k(I)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(A,{link:"",onClick:a,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:P(()=>[k(S,{size:16,title:_.$t("views.applicationWorkflow.control.zoomIn")},{default:P(()=>[k(U)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(A,{link:"",onClick:s,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:P(()=>[k(E,{iconName:"app-fitview",title:_.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(T,{direction:"vertical"}),k(A,{link:"",onClick:v,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-retract",title:_.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(A,{link:"",onClick:f,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-extend",title:_.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(A,{link:"",onClick:c,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:_.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-beautify",title:_.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),$ne=Kf(Lne,[["__scopeId","data-v-510558f4"]]),Fne=Vn({name:"WorkFlow"}),Bne=Vn({...Fne,props:{data:Object||null},setup(e,{expose:t}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":uN,"./nodes/application-node/index.ts":cN,"./nodes/base-node/index.ts":SN,"./nodes/condition-node/index.ts":AN,"./nodes/document-extract-node/index.ts":MN,"./nodes/form-node/index.ts":kN,"./nodes/image-generate/index.ts":TN,"./nodes/image-to-video/index.ts":NN,"./nodes/image-understand/index.ts":PN,"./nodes/intent-classify-node/index.ts":CN,"./nodes/loop-body-node/index.ts":sk,"./nodes/loop-break-node/index.ts":RN,"./nodes/loop-continue-node/index.ts":jN,"./nodes/loop-node/index.ts":DN,"./nodes/loop-start-node/index.ts":IN,"./nodes/mcp-node/index.ts":LN,"./nodes/parameter-extraction-node/index.ts":$N,"./nodes/question-node/index.ts":FN,"./nodes/reply-node/index.ts":BN,"./nodes/reranker-node/index.ts":VN,"./nodes/search-document-node/index.ts":UN,"./nodes/search-knowledge-node/index.ts":WN,"./nodes/speech-to-text-node/index.ts":GN,"./nodes/start-node/index.ts":zN,"./nodes/text-to-speech-node/index.ts":HN,"./nodes/text-to-video/index.ts":XN,"./nodes/tool-lib-node/index.ts":qN,"./nodes/tool-node/index.ts":YN,"./nodes/variable-aggregation-node/index.ts":KN,"./nodes/variable-assign-node/index.ts":ZN,"./nodes/variable-splitting/index.ts":JN,"./nodes/video-understand/index.ts":QN}),a=ha("workflowMode")||Is.Application,r=ha("loopWorkflowMode")||Is.ApplicationLoop,s=OU(),c=Re(""),v=Re();Ir(()=>{g()}),QM(()=>{EU()});const f=E=>{v.value.render(E)},g=E=>{const T=document.querySelector("#container");T&&(v.value=new NT({plugins:[e2,vU],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:T,stopMoveGraph:!1,stopZoomGraph:!1}),v.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),v.value.on("graph:rendered",()=>{c.value=v.value.graphModel.flowId}),_C(v.value,v.value.graphModel),v.value.batchRegister([...Object.keys(n).map(I=>n[I].default),eP,Ine]),v.value.setDefaultEdgeType("app-edge"),v.value.render(E||{}),v.value.graphModel.get_provide=(I,R)=>({getNode:()=>I,getGraph:()=>R,workflowMode:a,loopWorkflowMode:r}),v.value.graphModel.eventCenter.on("delete_edge",I=>{I.forEach(R=>{v.value.deleteEdge(R)})}),v.value.graphModel.eventCenter.on("anchor:drop",I=>{I.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var I,R,U;((I=v.value.graphModel)==null?void 0:I.nodes.length)>1?(R=v.value)==null||R.fitView():(U=v.value)==null||U.translateCenter()},500))};return t({onmousedown:(E,T)=>{E.type&&v.value.dnd.startDrag({type:E.type,properties:{...E.properties}},T),E.callback&&E.callback(v.value)},validate:()=>Promise.all(v.value.graphModel.nodes.map(E=>{var T;return(T=E==null?void 0:E.validate)==null?void 0:T.call(E)})),getGraphData:()=>{const E=v.value.getGraphData();E.nodes.forEach(I=>{I.type==="loop-body-node"&&v.value.getNodeModelById(I.id).set_loop_body()});const T=v.value.getGraphData();return T.nodes=T.nodes.filter(I=>I.type!=="loop-body-node"),T.edges=E.edges.filter(I=>I.type!=="loop-edge"),T},addNode:E=>{v.value.clearSelectElements();const{virtualRectCenterPositionX:T,virtualRectCenterPositionY:I}=v.value.graphModel.getVirtualRectSize(),R=v.value.graphModel.addNode({type:E.type,properties:E.properties,x:T,y:I-v.value.graphModel.height/2});R.isSelected=!0,R.isHovered=!0,v.value.toFront(R.id)},clearGraphData:()=>v.value.clearData(),renderGraphData:g,render:f}),(E,T)=>(be(),Ht(ar,null,[T[0]||(T[0]=Y("div",{className:"workflow-app",id:"container"},null,-1)),v.value?(be(),at($ne,{key:0,class:"workflow-control",lf:v.value},null,8,["lf"])):pn("",!0),k(_n(s),{"flow-id":c.value},null,8,["flow-id"])],64))}}),Vne={class:"workflow-publish-history border-l white-bg"},Une={class:"border-b p-16-24"},Wne={class:"list-height pt-0"},Gne={class:"p-8 pt-0"},zne={class:"flex-between"},Hne={style:{"max-width":"80%"}},Xne={class:"text-center"},qne=Vn({__name:"PublishHistory",emits:["click","refreshVersion"],setup(e,{emit:t}){const n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=t,c=Re(!1),v=Re([]),f=Re("");function g(T){f.value=T.id}function _(T){s("click",T)}function b(T){s("refreshVersion",T)}function x(T){T.writeStatus=!0}function S(T){T.writeStatus=!1}function A(T,I){if(T){const R={name:T};po({type:"workflowVersion",systemType:r.value}).putWorkFlowVersion(a,I.id,R,c).then(()=>{zf(yt("common.modifySuccess")),I.writeStatus=!1,E()})}else ei(yt("views.applicationWorkflow.tip.nameMessage"))}function E(){po({type:"workflowVersion",systemType:r.value}).getWorkFlowVersion(a,c).then(T=>{v.value=T.data})}return Ir(()=>{E()}),(T,I)=>{const R=J("ReadWrite"),U=J("el-tag"),D=J("UserFilled"),L=J("el-icon"),W=J("el-avatar"),H=J("el-text"),B=J("AppIcon"),F=J("el-button"),q=J("el-dropdown-item"),K=J("RefreshLeft"),X=J("el-dropdown-menu"),ee=J("el-dropdown"),ue=J("common-list"),ae=J("el-scrollbar"),we=Mv("loading");return be(),Ht("div",Vne,[Y("h4",Une,de(T.$t("views.applicationWorkflow.setting.releaseHistory")),1),Y("div",Wne,[k(ae,null,{default:P(()=>[Y("div",Gne,[Ga((be(),at(ue,{data:v.value,class:"mt-8",onClick:_,onMouseenter:g,onMouseleave:I[1]||(I[1]=je=>f.value="")},{default:P(({row:je,index:Te})=>[Y("div",zne,[Y("div",Hne,[Y("h5",{class:Cl([Te===0?"primary":"","flex align-center"])},[k(R,{onChange:Me=>A(Me,je),data:je.name||_n(uw)(je.update_time),trigger:"manual",write:je.writeStatus,onClose:Me=>S(je)},null,8,["onChange","data","write","onClose"]),Te===0?(be(),at(U,{key:0,class:"default-tag ml-4"},{default:P(()=>[et(de(T.$t("views.applicationWorkflow.setting.latestRelease")),1)]),_:1})):pn("",!0)],2),k(H,{type:"info",class:"color-secondary flex align-center mt-8"},{default:P(()=>[k(W,{size:20,class:"avatar-grey mr-4"},{default:P(()=>[k(L,null,{default:P(()=>[k(D)]),_:1})]),_:1}),et(" "+de(je.publish_user_name),1)]),_:2},1024)]),Ga(Y("div",{onClick:I[0]||(I[0]=rn(()=>{},["stop"]))},[k(ee,{trigger:"click",teleported:!1},{dropdown:P(()=>[k(X,null,{default:P(()=>[k(q,{onClick:rn(Me=>x(je),["stop"])},{default:P(()=>[k(B,{iconName:"app-edit",class:"color-secondary"}),et(" "+de(T.$t("common.edit")),1)]),_:1},8,["onClick"]),k(q,{onClick:Me=>b(je)},{default:P(()=>[k(L,{class:"color-secondary"},{default:P(()=>[k(K)]),_:1}),et(" "+de(T.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:P(()=>[k(F,{text:""},{default:P(()=>[k(B,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Wf,f.value===je.id]])])]),empty:P(()=>[Y("div",Xne,[k(H,{type:"info"},{default:P(()=>[et(de(T.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[we,c.value]])])]),_:1})])])}}}),Yne=Kf(qne,[["__scopeId","data-v-85be1165"]]),Kne={class:"application-workflow"},Zne={class:"header border-b flex-between p-12-24 white-bg"},Jne={class:"flex align-center"},Qne=["title"],ere={key:0},tre={key:0},nre={key:1},rre=["href"],ore={class:"ml-4"},ire={class:"flex-between"},are={class:"flex align-center"},lre={class:"mr-12 ml-24 flex"},sre=["src"],ure=["title"],cre={class:"mr-16"},dre={class:"scrollbar-height"},Pre=Vn({__name:"index",setup(e){$m("getApplicationDetail",()=>S),$m("workflowMode",Is.Application);const{theme:t}=XM(),n=DD(),a=Li(),{params:{id:r,from:s}}=a,c=$n(()=>a.path.includes("resource-management")?"systemManage":"workspace"),v=$n(()=>qM.application[c.value]),f=$n(()=>t.isDefaultTheme());let g;const _=Re(),b=Re(),x=Re(!1),S=Re(null),A=Re(!1),E=Re(!1),T=Re(!1),I=Re(""),R=Re(!1),U=Re(!1),D=Re(!1),L=Re({}),W=Re(null),H=Re([]),B=$n(()=>Lx(H.value)?"?"+Lx(H.value):""),F=$n(()=>{var Ye;return`${window.location.origin}/chat/`+((Ye=S.value)==null?void 0:Ye.access_token)+B.value});function q(){JSON.stringify(W.value)!==JSON.stringify(Be())?Xw(yt("common.tip"),yt("views.applicationWorkflow.tip.saveMessage"),{confirmButtonText:yt("views.applicationWorkflow.setting.exitSave"),cancelButtonText:yt("views.applicationWorkflow.setting.exit"),distinguishCancelAndClose:!0}).then(()=>{St(!0,!0)}).catch(Ye=>{Ye==="cancel"&&He()}):He()}function K(){D.value||(U.value=!1,D.value=!1)}function X(Ye){Ye&&ue(Ye),U.value=!1,D.value=!1}function ee(Ye){D.value=!0,L.value=Ye,ue(Ye),Le()}function ue(Ye){var Ot;Ye.work_flow.nodes.map(bt=>{bt.properties.noRender=!0}),S.value.work_flow=Ye.work_flow,I.value=Ye==null?void 0:Ye.update_time,(Ot=_.value)==null||Ot.clearGraphData(),Gf(()=>{var bt;(bt=_.value)==null||bt.render(Ye.work_flow)})}function ae(){lt(),R.value&&me(),U.value=!1,D.value=!1}function we(){U.value=!0}function je(Ye){Ye?me():Le(),localStorage.setItem("workflowAutoSave",Ye.toString())}function Te(Ye){A.value=!1}function Me(Ye){A.value=!1}function Ne(){A.value=!1}const rt=()=>{var Ye;(Ye=_.value)==null||Ye.validate().then(()=>{const Ot=Be(),bt=new Bw(Ot);try{bt.is_valid()}catch(Ft){ei(Ft.toString());return}po({type:"application",systemType:c.value}).putApplication(r,{work_flow:Ot},x).then(()=>po({type:"application",systemType:c.value}).publish(r,{},x)).then(Ft=>{var Qt,on;S.value.name=Ft.data.name,(on=(Qt=Ft.data.work_flow)==null?void 0:Qt.nodes)==null||on.filter(Wt=>Wt.id==="base-node").map(Wt=>{H.value=Wt.properties.api_input_field_list?Wt.properties.api_input_field_list.map(nt=>({name:nt.variable,value:nt.default_value})):Wt.properties.input_field_list?Wt.properties.input_field_list.filter(nt=>nt.assignment_method==="api_input").map(nt=>({name:nt.variable,value:nt.default_value})):[]}),zf(yt("views.application.tip.publishSuccess"))}).catch(Ft=>{var Wt,nt,sn,We;const Qt=Ft.node,on=Ft.errMessage;if(typeof on=="string")ei(((Wt=Ft.node.properties)==null?void 0:Wt.stepName)+` ${yt("views.applicationWorkflow.node").toLowerCase()} `+on.toLowerCase());else{const yn=Object.keys(on);ei(((nt=Qt.properties)==null?void 0:nt.stepName)+` ${yt("views.applicationWorkflow.node").toLowerCase()} `+((We=(sn=on[yn[0]])==null?void 0:sn[0])==null?void 0:We.message.toLowerCase()))}})}).catch(Ot=>{var Qt,on,Wt,nt;const bt=Ot.node,Ft=Ot.errMessage;if(typeof Ft=="string")ei(((Qt=Ot.node.properties)==null?void 0:Qt.stepName)+` ${yt("views.applicationWorkflow.node")},`+Ft);else{const sn=Object.keys(Ft);ei(((on=bt.properties)==null?void 0:on.stepName)+` ${yt("views.applicationWorkflow.node")},`+((nt=(Wt=Ft[sn[0]])==null?void 0:Wt[0])==null?void 0:nt.message))}})},tt=()=>{var Ye;(Ye=_.value)==null||Ye.validate().then(()=>{var Ft;const Ot=Be(),bt=new Bw(Ot);try{bt.is_valid(),S.value={...S.value,type:"WORK_FLOW",...(Ft=bt.get_base_node())==null?void 0:Ft.properties.node_data,work_flow:Be()},E.value=!0}catch(Qt){ei(Qt.toString())}}).catch(Ot=>{var Qt,on,Wt,nt;const bt=Ot.node,Ft=Ot.errMessage;if(typeof Ft=="string")ei(((Qt=Ot.node.properties)==null?void 0:Qt.stepName)+` ${yt("views.applicationWorkflow.node")},`+Ft);else{const sn=Object.keys(Ft);ei(((on=bt.properties)==null?void 0:on.stepName)+` ${yt("views.applicationWorkflow.node")},`+((nt=(Wt=Ft[sn[0]])==null?void 0:Wt[0])==null?void 0:nt.message))}})};function Be(){var Ye;return(Ye=_.value)==null?void 0:Ye.getGraphData()}function lt(){po({type:"application",systemType:c.value}).getApplicationDetail(r).then(Ye=>{var Ot,bt,Ft,Qt,on;(Ot=Ye.data)==null||Ot.work_flow.nodes.map(Wt=>{Wt.properties.noRender=!0}),S.value=Ye.data,S.value.stt_model_id=Ye.data.stt_model,S.value.tts_model_id=Ye.data.tts_model,S.value.tts_type=Ye.data.tts_type,I.value=(bt=Ye.data)==null?void 0:bt.update_time,(Qt=(Ft=S.value.work_flow)==null?void 0:Ft.nodes)==null||Qt.filter(Wt=>Wt.id==="base-node").map(Wt=>{H.value=Wt.properties.api_input_field_list?Wt.properties.api_input_field_list.map(nt=>({name:nt.variable,value:nt.default_value})):Wt.properties.input_field_list?Wt.properties.input_field_list.filter(nt=>nt.assignment_method==="api_input").map(nt=>({name:nt.variable,value:nt.default_value})):[]}),po({type:"application",systemType:c.value}).getAccessToken(r,x).then(Wt=>{S.value={...S.value,...Wt.data}}),(on=_.value)==null||on.clearGraphData(),Gf(()=>{var Wt;(Wt=_.value)==null||Wt.render(S.value.work_flow),W.value=Be()}),Od([Nl.IS_EE,Nl.IS_PE],"OR")&&po({type:"application",systemType:c.value}).getApplicationSetting(r).then(Wt=>{S.value={...S.value,...Wt.data}})})}function St(Ye,Ot){const bt={work_flow:Be()};x.value=Ot||!1,po({type:"application",systemType:c.value}).putApplication(r,bt).then(()=>{I.value=new Date,Ye&&(W.value=Be(),zf(yt("common.saveSuccess")),Ot&&He())}).catch(()=>{x.value=!1})}const He=()=>a.path.includes("workspace")?n.push({path:Fe()}):n.push({path:Jt()}),Jt=()=>Od([_u.ADMIN,Ua.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/overview`:Od([_u.ADMIN,Ua.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/access`:Od([_u.ADMIN,Ua.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-user`:Od([_u.ADMIN,Ua.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",Fe=()=>Od([new If([_u.USER],[Ua.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),_u.WORKSPACE_MANAGE.getWorkspaceRole,Ua.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Ua.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${s}/${r}/WORK_FLOW/overview`:Od([new If([_u.USER],[Ua.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"AND"),new If([_u.WORKSPACE_MANAGE.getWorkspaceRole],[Ua.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Nl.IS_EE,Nl.IS_PE],"OR"),new If([],[Ua.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"OR")],"OR")?`/application/${s}/${r}/WORK_FLOW/access`:Od([new If([_u.USER],[Ua.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"AND"),new If([_u.WORKSPACE_MANAGE.getWorkspaceRole],[Ua.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Nl.IS_EE,Nl.IS_PE],"OR"),new If([],[Ua.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"OR")],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-user`:Od([new If([_u.USER],[Ua.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Ua.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Ua.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-log`:"/application",me=()=>{g=setInterval(()=>{St()},6e4)},Le=()=>{g&&clearInterval(g)};return Ir(()=>{lt();const Ye=localStorage.getItem("workflowAutoSave");R.value=Ye==="true",R.value&&me()}),ID(()=>{var Ye;Le(),(Ye=_.value)==null||Ye.clearGraphData()}),(Ye,Ot)=>{var Se,Qe,$e;const bt=J("back-button"),Ft=J("el-text"),Qt=J("el-button"),on=J("el-divider"),Wt=J("Close"),nt=J("el-icon"),sn=J("AppIcon"),We=J("el-dropdown-item"),yn=J("el-switch"),Kn=J("el-dropdown-menu"),te=J("el-dropdown"),Gn=J("el-collapse-transition"),br=J("el-avatar"),Dr=J("LogoIcon"),zr=J("AiChat"),jn=Mv("click-outside"),ko=Mv("loading");return Ga((be(),Ht("div",Kne,[Y("div",Zne,[Y("div",Jne,[k(bt,{onClick:q}),Y("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(Se=S.value)==null?void 0:Se.name},de((Qe=S.value)==null?void 0:Qe.name),9,Qne),U.value&&D.value?(be(),Ht("div",ere,[k(Ft,{type:"info",class:"ml-16 color-secondary"},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.info.previewVersion"))+" "+de(L.value.name||_n(uw)(L.value.update_time)),1)]),_:1})])):I.value?(be(),at(Ft,{key:1,type:"info",class:"ml-16 color-secondary"},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.info.saveTime"))+de(_n(uw)(I.value)),1)]),_:1})):pn("",!0)]),U.value&&D.value?(be(),Ht("div",tre,[k(Qt,{type:"primary",class:"mr-8",onClick:Ot[0]||(Ot[0]=st=>X())},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.setting.restoreVersion")),1)]),_:1}),k(on,{direction:"vertical"}),k(Qt,{text:"",onClick:ae},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1})])):(be(),Ht("div",nre,[k(Qt,{onClick:Ot[1]||(Ot[1]=st=>A.value=!A.value)},{default:P(()=>[k(sn,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(Ye.$t("views.applicationWorkflow.setting.addComponent")),1)]),_:1}),v.value.debug(_n(r))?(be(),at(Qt,{key:0,onClick:tt,disabled:E.value},{default:P(()=>[k(sn,{iconName:"app-debug-outlined",class:"mr-4"}),et(" "+de(Ye.$t("views.applicationWorkflow.setting.debug")),1)]),_:1},8,["disabled"])):pn("",!0),v.value.edit(_n(r))?(be(),at(Qt,{key:1,onClick:Ot[2]||(Ot[2]=st=>St(!0))},{default:P(()=>[k(sn,{iconName:"app-save-outlined",class:"mr-4"}),et(" "+de(Ye.$t("common.save")),1)]),_:1})):pn("",!0),v.value.edit(_n(r))?(be(),at(Qt,{key:2,type:"primary",onClick:rt},{default:P(()=>[et(de(Ye.$t("views.application.operation.publish")),1)]),_:1})):pn("",!0),k(te,{trigger:"click"},{dropdown:P(()=>[k(Kn,null,{default:P(()=>[Y("a",{href:F.value,target:"_blank"},[k(We,null,{default:P(()=>[k(sn,{iconName:"app-create-chat",class:"color-secondary"}),et(" "+de(Ye.$t("views.application.operation.toChat")),1)]),_:1})],8,rre),k(We,{onClick:we},{default:P(()=>[k(sn,{iconName:"app-history-outlined",class:"color-secondary"}),et(" "+de(Ye.$t("views.applicationWorkflow.setting.releaseHistory")),1)]),_:1}),k(We,null,{default:P(()=>[k(sn,{iconName:"app-save-outlined",class:"color-secondary"}),et(" "+de(Ye.$t("views.applicationWorkflow.setting.autoSave"))+" ",1),Y("div",ore,[k(yn,{size:"small",modelValue:R.value,"onUpdate:modelValue":Ot[4]||(Ot[4]=st=>R.value=st),onChange:je},null,8,["modelValue"])])]),_:1})]),_:1})]),default:P(()=>[k(Qt,{text:"",onClick:Ot[3]||(Ot[3]=rn(()=>{},["stop"])),class:"ml-8 mt-4"},{default:P(()=>[k(sn,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),k(Gn,null,{default:P(()=>[Ga(k(TT,{show:A.value,id:_n(r),onClickNodes:Te,onOnmousedown:Me,workflowRef:_.value},null,8,["show","id","workflowRef"]),[[jn,Ne]])]),_:1}),Y("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:b},[S.value?(be(),at(Bne,{key:0,ref_key:"workflowRef",ref:_,data:($e=S.value)==null?void 0:$e.work_flow},null,8,["data"])):pn("",!0)],512),k(Gn,null,{default:P(()=>{var st,an,en;return[E.value?(be(),Ht("div",{key:0,class:Cl(["workflow-debug-container",T.value?"enlarge":""])},[Y("div",{class:Cl(["workflow-debug-header",f.value?"":"custom-header"])},[Y("div",ire,[Y("div",are,[Y("div",lre,[_n(sw)((st=S.value)==null?void 0:st.icon)?(be(),at(br,{key:0,shape:"square",size:32,style:{background:"none"}},{default:P(()=>{var Tn;return[Y("img",{src:_n(Bf)((Tn=S.value)==null?void 0:Tn.icon),alt:""},null,8,sre)]}),_:1})):(be(),at(Dr,{key:1,height:"32px"}))]),Y("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(an=S.value)==null?void 0:an.name},de(((en=S.value)==null?void 0:en.name)||Ye.$t("views.application.form.appName.label")),9,ure)]),Y("div",cre,[k(Qt,{link:"",onClick:Ot[5]||(Ot[5]=Tn=>T.value=!T.value)},{default:P(()=>[k(sn,{iconName:T.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1}),k(Qt,{link:"",onClick:Ot[6]||(Ot[6]=Tn=>E.value=!1)},{default:P(()=>[k(nt,{size:20,class:"color-secondary"},{default:P(()=>[k(Wt)]),_:1})]),_:1})])])],2),Y("div",dre,[k(zr,{"application-details":S.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):pn("",!0)]}),_:1}),U.value?Ga((be(),at(Yne,{key:0,onClick:ee,onRefreshVersion:X},null,512)),[[jn,K]]):pn("",!0)])),[[ko,x.value]])}}});export{Pre as default};
|