UnisKB/static/admin/assets/index-DikDLlMq.js

203 lines
1.3 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var P8=Object.defineProperty;var C8=(e,t,n)=>t in e?P8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fa=(e,t,n)=>C8(e,typeof t!="symbol"?t+"":t,n);import{dr as Sv,eN as wu,dn as io,eO as Fx,db as oh,eP as Hm,eQ as Uf,eR as ih,eS as LM,eT as js,ep as dc,de as pa,eU as R8,dc as fc,ek as $M,eV as j8,eW as Xm,eX as Ds,eg as i_,ei as Hw,dk as ah,au as pc,eY as FM,eZ as lh,eq as Rv,e_ as Xw,di as ao,e$ as a_,dM as l_,eo as kd,dS as Bo,f0 as Av,dj as Yf,f1 as jv,f2 as qm,dR as hc,dh as dl,dg as Ao,f3 as D8,f4 as BM,eE as Eu,en as Ta,f5 as I8,f6 as L8,f7 as Dv,f8 as s_,f9 as VM,dL as sh,fa as UM,bL as qw,df as Ym,at as Iv,dQ as Im,dO as eh,ej as $8,em as Bx,el as F8,as as WM,fb as GM,fc as B8,dm as u_,dd as V8,es as kg,fd as U8,fe as zM,ff as HM,fg as XM,fh as W8,fi as G8,dp as z8,fj as H8,fk as X8,fl as q8,fm as Y8,fn as Tg,ev as K8,fo as qM,dN as YM,er as Yw,fp as KM,fq as Kw,fr as Z8,dl as Km,fs as ZM,ft as J8,fu as JM,fv as QM,fw as Q8,fx as eD,fy as tD,ew as Lm,eC as nD,fz as rD,fA as oD,aw as iD,fB as aD,fC as lD,fD as sD,fE as uD,fF as cD,fG as dD,fH as fD,ai as pD,eF as hD,fI as vD,ax as mD,fJ as yD,fK as gD,fL as _D,fM as bD,fN as wD,fO as ED,av as OD,fP as xD,eG as SD,fQ as AD,eD as MD,fR as kD,fS as TD,fT as ND,fU as PD,ay as Vn,aB as je,aV as Zm,aD as J,aW as Ht,aF as _e,aX as ar,aH as k,aI as K,aE as at,aY as Gr,aG as P,b1 as pn,b2 as _n,c_ as uw,bX as Bf,dw as Vx,aJ as de,bY as Zw,aK as et,aS as Xt,cf as Kf,fV as Ga,aP as Li,aA as ek,aN as sc,aO as $n,aQ as tk,b6 as Ir,b8 as Wa,bd as nk,cg as Wf,cp as Ng,fW as Pg,bW as ng,aT as po,aZ as me,b7 as Mv,ce as Cl,cE as rk,ci as $m,c1 as ei,aC as yt,c0 as Jw,aM as nr,ch as cl,d4 as CD,aU as Zf,bB as kv,fX as RD,fY as jD,fZ as ok,f_ as ik,f$ as DD,g0 as ID,g1 as LD,g2 as $D,g3 as FD,g4 as oo,du as Qw,dv as BD,ct as VD,bD as Gf,dF as UD,b3 as zf,g5 as is,cI as WD,g6 as eE,g7 as Ux,g8 as Zp,g9 as GD,ga as tE,gb as nE,gc as zD,gd as HD,b4 as ak,bZ as cw,az as XD,eB as Wx,cX as qD,bG as Od,bH as Nl,bI as gu,bK as Va,bJ as If}from"./admin-BkqzSx7d.js";import{g as YD,t as Gx,a as zx,i as vc,n as KD,c as rE,l as rg,d as ZD}from"./data-De9gjkyk.js";import{_ as Pd}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-BXGe6m62.js";import{G as oE,d as JD,e as QD,f as eI,_ as lk,c as sk,b as tI,a as nI}from"./ToolDialog.vue_vue_type_style_index_0_lang-w5fl2QJu.js";import{d as uk,c as uh,v as Jm,e as rI,g as ck,f as oI,a as iI,r as aI}from"./reduce-Yvm7YAXp.js";import{c as iE,b as c_,i as aE,p as dk,n as lE,a as lI,d as sE,e as sI,f as uI,g as cI,h as dI,u as fI,j as pI,k as hI,l as vI,m as mI,r as yI,o as gI,q as _I,s as bI,t as wI}from"./uniqBy-CmWHIAxs.js";import{c as EI,a as OI,b as xI,e as SI,f as AI,m as MI,d as kI,h as TI}from"./min-Dif6Cg4O.js";import{d as fk,e as NI,g as PI,h as CI,i as RI,z as jI,s as DI,m as II,a as LI,b as $I,f as FI,c as BI,r as VI,u as UI}from"./zipObject-Ceyl1BP7.js";import{l as pk,_ as hk}from"./vue-draggable-plus-BjfV0UzS.js";import{_ as WI}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-BvyW1EJ6.js";import{_ as fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const vk=Object.freeze(Object.defineProperty({__proto__:null,get default(){return cre}},Symbol.toStringTag,{value:"Module"}));var GI=NaN;function Hx(e){return typeof e=="number"?e:Sv(e)?GI:+e}function d_(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=wu(n),a=wu(a)):(n=Hx(n),a=Hx(a)),r=e(n,a)}return r}}var zI=d_(function(e,t){return e+t},0),HI="Expected a function";function XI(e,t){if(typeof t!="function")throw new TypeError(HI);return e=io(e),function(){if(--e<1)return t.apply(this,arguments)}}var Cg=Fx&&new Fx,mk=Cg?function(e,t){return Cg.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=Hm(e.prototype),a=e.apply(n,t);return Uf(a)?a:n}}var qI=1;function YI(e,t,n){var a=t&qI,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 KI=Math.max;function yk(e,t,n,a){for(var r=-1,s=e.length,c=n.length,v=-1,f=t.length,_=KI(s-c,0),g=Array(f+_),b=!a;++v<f;)g[v]=t[v];for(;++r<c;)(b||r<s)&&(g[n[r]]=e[r]);for(;_--;)g[v++]=e[r++];return g}var ZI=Math.max;function gk(e,t,n,a){for(var r=-1,s=e.length,c=-1,v=n.length,f=-1,_=t.length,g=ZI(s-v,0),b=Array(g+_),x=!a;++r<g;)b[r]=e[r];for(var A=r;++f<_;)b[A+f]=t[f];for(;++c<v;)(x||r<s)&&(b[A+n[c]]=e[r++]);return b}function JI(e,t){for(var n=e.length,a=0;n--;)e[n]===t&&++a;return a}function f_(){}var QI=4294967295;function eo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=QI,this.__views__=[]}eo.prototype=Hm(f_.prototype);eo.prototype.constructor=eo;var uE=Cg?function(e){return Cg.get(e)}:LM,yv={},e4=Object.prototype,t4=e4.hasOwnProperty;function vg(e){for(var t=e.name+"",n=yv[t],a=t4.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 Is(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Is.prototype=Hm(f_.prototype);Is.prototype.constructor=Is;function _k(e){if(e instanceof eo)return e.clone();var t=new Is(e.__wrapped__,e.__chain__);return t.__actions__=js(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var n4=Object.prototype,r4=n4.hasOwnProperty;function ce(e){if(dc(e)&&!pa(e)&&!(e instanceof eo)){if(e instanceof Is)return e;if(r4.call(e,"__wrapped__"))return _k(e)}return new Is(e)}ce.prototype=f_.prototype;ce.prototype.constructor=ce;function dw(e){var t=vg(e),n=ce[t];if(typeof n!="function"||!(t in eo.prototype))return!1;if(e===n)return!0;var a=uE(n);return!!a&&e===a[0]}var bk=R8(mk),o4=/\{\n\/\* \[wrapped with (.+)\] \*/,i4=/,? & /;function a4(e){var t=e.match(o4);return t?t[1].split(i4):[]}var l4=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function s4(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(l4,`{
/* [wrapped with `+t+`] */
`)}var u4=1,c4=2,d4=8,f4=16,p4=32,h4=64,v4=128,m4=256,y4=512,g4=[["ary",v4],["bind",u4],["bindKey",c4],["curry",d4],["curryRight",f4],["flip",y4],["partial",p4],["partialRight",h4],["rearg",m4]];function _4(e,t){return fc(g4,function(n){var a="_."+n[0];t&n[1]&&!$M(e,a)&&e.push(a)}),e.sort()}function wk(e,t,n){var a=t+"";return j8(e,s4(a,_4(a4(a),n)))}var b4=4,w4=8,Xx=32,qx=64;function Ek(e,t,n,a,r,s,c,v,f,_){var g=t&w4,b=g?c:void 0,x=g?void 0:c,A=g?s:void 0,S=g?void 0:s;t|=g?Xx:qx,t&=~(g?qx:Xx),t&b4||(t&=-4);var E=[e,t,r,A,b,S,x,v,f,_],T=n.apply(void 0,E);return dw(e)&&bk(T,E),T.placeholder=a,wk(T,e,t)}function Lv(e){var t=e;return t.placeholder}var E4=Math.min;function O4(e,t){for(var n=e.length,a=E4(t.length,n),r=js(e);a--;){var s=t[a];e[a]=Xm(s,n)?r[s]:void 0}return e}var Yx="__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===Yx)&&(e[n]=Yx,s[r++]=n)}return s}var x4=1,S4=2,A4=8,M4=16,k4=128,T4=512;function p_(e,t,n,a,r,s,c,v,f,_){var g=t&k4,b=t&x4,x=t&S4,A=t&(A4|M4),S=t&T4,E=x?void 0:Fm(e);function T(){for(var I=arguments.length,R=Array(I),U=I;U--;)R[U]=arguments[U];if(A)var L=Lv(T),D=JI(R,L);if(a&&(R=yk(R,a,r,A)),s&&(R=gk(R,s,c,A)),I-=D,A&&I<_){var W=Hf(R,L);return Ek(e,t,p_,T.placeholder,n,R,W,v,f,_-I)}var Y=b?n:this,B=x?Y[e]:e;return I=R.length,v?R=O4(R,v):S&&I>1&&R.reverse(),g&&f<I&&(R.length=f),this&&this!==ih&&this instanceof T&&(B=E||Fm(B)),B.apply(Y,R)}return T}function N4(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 _=s<3&&c[0]!==f&&c[s-1]!==f?[]:Hf(c,f);if(s-=_.length,s<n)return Ek(e,t,p_,r.placeholder,void 0,c,_,void 0,void 0,n-s);var g=this&&this!==ih&&this instanceof r?a:e;return Ds(g,this,c)}return r}var P4=1;function C4(e,t,n,a){var r=t&P4,s=Fm(e);function c(){for(var v=-1,f=arguments.length,_=-1,g=a.length,b=Array(g+f),x=this&&this!==ih&&this instanceof c?s:e;++_<g;)b[_]=a[_];for(;f--;)b[_++]=arguments[++v];return Ds(x,r?n:this,b)}return c}var Kx="__lodash_placeholder__",_1=1,R4=2,j4=4,Zx=8,mm=128,Jx=256,D4=Math.min;function I4(e,t){var n=e[1],a=t[1],r=n|a,s=r<(_1|R4|mm),c=a==mm&&n==Zx||a==mm&&n==Jx&&e[7].length<=t[8]||a==(mm|Jx)&&t[7].length<=t[8]&&n==Zx;if(!(s||c))return e;a&_1&&(e[2]=t[2],r|=n&_1?0:j4);var v=t[3];if(v){var f=e[3];e[3]=f?yk(f,v,t[4]):v,e[4]=f?Hf(e[3],Kx):t[4]}return v=t[5],v&&(f=e[5],e[5]=f?gk(f,v,t[6]):v,e[6]=f?Hf(e[5],Kx):t[6]),v=t[7],v&&(e[7]=v),a&mm&&(e[8]=e[8]==null?t[8]:D4(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e}var L4="Expected a function",Qx=1,$4=2,eS=8,tS=16,nS=32,F4=64,rS=Math.max;function Cd(e,t,n,a,r,s,c,v){var f=t&$4;if(!f&&typeof e!="function")throw new TypeError(L4);var _=a?a.length:0;if(_||(t&=-97,a=r=void 0),c=c===void 0?c:rS(io(c),0),v=v===void 0?v:io(v),_-=r?r.length:0,t&F4){var g=a,b=r;a=r=void 0}var x=f?void 0:uE(e),A=[e,t,n,a,r,g,b,s,c,v];if(x&&I4(A,x),e=A[0],t=A[1],n=A[2],a=A[3],r=A[4],v=A[9]=A[9]===void 0?f?0:e.length:rS(A[9]-_,0),!v&&t&(eS|tS)&&(t&=-25),!t||t==Qx)var S=YI(e,t,n);else t==eS||t==tS?S=N4(e,t,v):(t==nS||t==(Qx|nS))&&!r.length?S=C4(e,t,n,a):S=p_.apply(void 0,A);var E=x?mk:bk;return wk(E(S,A),e,t)}var B4=128;function Ok(e,t,n){return t=n?void 0:t,t=e&&t==null?e.length:t,Cd(e,B4,void 0,void 0,void 0,void 0,t)}var V4=i_(function(e,t){Hw(t,ah(t),e)}),fw=i_(function(e,t,n,a){Hw(t,ah(t),e,a)}),U4=i_(function(e,t,n,a){Hw(t,pc(t),e,a)});function cE(e,t){for(var n=-1,a=t.length,r=Array(a),s=e==null;++n<a;)r[n]=s?void 0:FM(e,t[n]);return r}var W4=lh(cE),G4="[object DOMException]",z4="[object Error]";function dE(e){if(!dc(e))return!1;var t=Rv(e);return t==z4||t==G4||typeof e.message=="string"&&typeof e.name=="string"&&!Xw(e)}var xk=ao(function(e,t){try{return Ds(e,void 0,t)}catch(n){return dE(n)?n:new Error(n)}}),H4="Expected a function";function Sk(e,t){var n;if(typeof t!="function")throw new TypeError(H4);return e=io(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var X4=1,q4=32,h_=ao(function(e,t,n){var a=X4;if(n.length){var r=Hf(n,Lv(h_));a|=q4}return Cd(e,a,t,n,r)});h_.placeholder={};var Y4=lh(function(e,t){return fc(t,function(n){n=a_(n),l_(e,n,h_(e[n],e))}),e}),K4=1,Z4=2,J4=32,fE=ao(function(e,t,n){var a=K4|Z4;if(n.length){var r=Hf(n,Lv(fE));a|=J4}return Cd(t,a,e,n,r)});fE.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 Q4="\\ud800-\\udfff",eL="\\u0300-\\u036f",tL="\\ufe20-\\ufe2f",nL="\\u20d0-\\u20ff",rL=eL+tL+nL,oL="\\ufe0e\\ufe0f",iL="\\u200d",aL=RegExp("["+iL+Q4+rL+oL+"]");function $v(e){return aL.test(e)}function lL(e){return e.split("")}var Ak="\\ud800-\\udfff",sL="\\u0300-\\u036f",uL="\\ufe20-\\ufe2f",cL="\\u20d0-\\u20ff",dL=sL+uL+cL,fL="\\ufe0e\\ufe0f",pL="["+Ak+"]",pw="["+dL+"]",hw="\\ud83c[\\udffb-\\udfff]",hL="(?:"+pw+"|"+hw+")",Mk="[^"+Ak+"]",kk="(?:\\ud83c[\\udde6-\\uddff]){2}",Tk="[\\ud800-\\udbff][\\udc00-\\udfff]",vL="\\u200d",Nk=hL+"?",Pk="["+fL+"]?",mL="(?:"+vL+"(?:"+[Mk,kk,Tk].join("|")+")"+Pk+Nk+")*",yL=Pk+Nk+mL,gL="(?:"+[Mk+pw+"?",pw,kk,Tk,pL].join("|")+")",_L=RegExp(hw+"(?="+hw+")|"+gL+yL,"g");function bL(e){return e.match(_L)||[]}function Ou(e){return $v(e)?bL(e):lL(e)}function Ck(e){return function(t){t=Bo(t);var n=$v(t)?Ou(t):void 0,a=n?n[0]:t.charAt(0),r=n?Jf(n,1).join(""):t.slice(1);return a[e]()+r}}var pE=Ck("toUpperCase");function Rk(e){return pE(Bo(e).toLowerCase())}function hE(e){return function(t){return e==null?void 0:e[t]}}var wL={À:"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"},EL=hE(wL),OL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xL="\\u0300-\\u036f",SL="\\ufe20-\\ufe2f",AL="\\u20d0-\\u20ff",ML=xL+SL+AL,kL="["+ML+"]",TL=RegExp(kL,"g");function jk(e){return e=Bo(e),e&&e.replace(OL,EL).replace(TL,"")}var NL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function PL(e){return e.match(NL)||[]}var CL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function RL(e){return CL.test(e)}var Dk="\\ud800-\\udfff",jL="\\u0300-\\u036f",DL="\\ufe20-\\ufe2f",IL="\\u20d0-\\u20ff",LL=jL+DL+IL,Ik="\\u2700-\\u27bf",Lk="a-z\\xdf-\\xf6\\xf8-\\xff",$L="\\xac\\xb1\\xd7\\xf7",FL="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BL="\\u2000-\\u206f",VL=" \\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",$k="A-Z\\xc0-\\xd6\\xd8-\\xde",UL="\\ufe0e\\ufe0f",Fk=$L+FL+BL+VL,Bk="[']",oS="["+Fk+"]",WL="["+LL+"]",Vk="\\d+",GL="["+Ik+"]",Uk="["+Lk+"]",Wk="[^"+Dk+Fk+Vk+Ik+Lk+$k+"]",zL="\\ud83c[\\udffb-\\udfff]",HL="(?:"+WL+"|"+zL+")",XL="[^"+Dk+"]",Gk="(?:\\ud83c[\\udde6-\\uddff]){2}",zk="[\\ud800-\\udbff][\\udc00-\\udfff]",sv="["+$k+"]",qL="\\u200d",iS="(?:"+Uk+"|"+Wk+")",YL="(?:"+sv+"|"+Wk+")",aS="(?:"+Bk+"(?:d|ll|m|re|s|t|ve))?",lS="(?:"+Bk+"(?:D|LL|M|RE|S|T|VE))?",Hk=HL+"?",Xk="["+UL+"]?",KL="(?:"+qL+"(?:"+[XL,Gk,zk].join("|")+")"+Xk+Hk+")*",ZL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",JL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",QL=Xk+Hk+KL,e6="(?:"+[GL,Gk,zk].join("|")+")"+QL,t6=RegExp([sv+"?"+Uk+"+"+aS+"(?="+[oS,sv,"$"].join("|")+")",YL+"+"+lS+"(?="+[oS,sv+iS,"$"].join("|")+")",sv+"?"+iS+"+"+aS,sv+"+"+lS,JL,ZL,Vk,e6].join("|"),"g");function n6(e){return e.match(t6)||[]}function qk(e,t,n){return e=Bo(e),t=n?void 0:t,t===void 0?RL(e)?n6(e):PL(e):e.match(t)||[]}var r6="[']",o6=RegExp(r6,"g");function Fv(e){return function(t){return uk(qk(jk(t).replace(o6,"")),e,"")}}var i6=Fv(function(e,t,n){return t=t.toLowerCase(),e+(n?Rk(t):t)}),a6=ih.isFinite,l6=Math.min;function vE(e){var t=Math[e];return function(n,a){if(n=Av(n),a=a==null?0:l6(io(a),292),a&&a6(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 s6=vE("ceil");function Yk(e){var t=ce(e);return t.__chain__=!0,t}var u6=Math.ceil,c6=Math.max;function d6(e,t,n){(n?Yf(e,t,n):t===void 0)?t=1:t=c6(io(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var r=0,s=0,c=Array(u6(a/t));r<a;)c[s++]=kd(e,r,r+=t);return c}var f6=1,p6=4;function h6(e,t){return t=typeof t=="function"?t:void 0,jv(e,f6|p6,t)}var v6=4;function m6(e,t){return t=typeof t=="function"?t:void 0,jv(e,v6,t)}function y6(){return new Is(this.value(),this.__chain__)}function g6(){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 qm(pa(n)?js(n):[n],hc(t,1))}var _6="Expected a function";function b6(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(_6);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 Kk(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 w6(e){var t=pc(e);return function(n){return Kk(n,e,t)}}var E6=1;function O6(e){return w6(jv(e,E6))}function x6(e,t){return t==null||Kk(e,t,pc(t))}var S6=Object.prototype,A6=S6.hasOwnProperty,M6=iE(function(e,t,n){A6.call(e,n)?++e[n]:l_(e,n,1)});function k6(e,t){var n=Hm(e);return t==null?n:D8(n,t)}var T6=8;function mE(e,t,n){t=n?void 0:t;var a=Cd(e,T6,void 0,void 0,void 0,void 0,void 0,t);return a.placeholder=mE.placeholder,a}mE.placeholder={};var N6=16;function yE(e,t,n){t=n?void 0:t;var a=Cd(e,N6,void 0,void 0,void 0,void 0,void 0,t);return a.placeholder=yE.placeholder,a}yE.placeholder={};function P6(e,t){return e==null||e!==e?t:e}function Zk(e,t,n,a,r,s){return Uf(e)&&Uf(t)&&(s.set(t,e),BM(e,t,void 0,Zk,s),s.delete(t)),e}var Jk=i_(function(e,t,n,a){BM(e,t,n,a)}),C6=ao(function(e){return e.push(void 0,Zk),Ds(Jk,void 0,e)}),R6="Expected a function";function Qk(e,t,n){if(typeof e!="function")throw new TypeError(R6);return setTimeout(function(){e.apply(void 0,n)},t)}var j6=ao(function(e,t){return Qk(e,1,t)}),D6=ao(function(e,t,n){return Qk(e,Av(t)||0,n)}),I6=ao(function(e,t){var n=Eu(t);return Ta(n)&&(n=void 0),Ta(e)?c_(e,hc(t,1,Ta,!0),Ao(n)):[]}),L6=ao(function(e,t){var n=Eu(t);return Ta(n)&&(n=void 0),Ta(e)?c_(e,hc(t,1,Ta,!0),void 0,n):[]}),$6=d_(function(e,t){return e/t},1);function v_(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 F6(e,t){return e&&e.length?v_(e,Ao(t),!0,!0):[]}function B6(e,t){return e&&e.length?v_(e,Ao(t),!0):[]}function V6(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}var eT=I8(!0);function gE(e,t){return e&&eT(e,t,pc)}var tT=L8(gE,!0);function U6(e,t){var n=pa(e)?V6:tT;return n(e,uh(t))}function W6(e,t,n){e=Bo(e),t=wu(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 G6(e,t){return dl(t,function(n){return[n,e[n]]})}function z6(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=[a,a]}),n}var H6="[object Map]",X6="[object Set]";function nT(e){return function(t){var n=s_(t);return n==H6?VM(t):n==X6?z6(t):G6(t,e(t))}}var q6=nT(pc),Y6=nT(ah),K6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Z6=hE(K6),rT=/[&<>"']/g,J6=RegExp(rT.source);function oT(e){return e=Bo(e),e&&J6.test(e)?e.replace(rT,Z6):e}var iT=/[\\^$.*+?()[\]{}|]/g,Q6=RegExp(iT.source);function e5(e){return e=Bo(e),e&&Q6.test(e)?e.replace(iT,"\\$&"):e}var t5=4294967295;function aT(e){return e?Dv(io(e),0,t5):0}function n5(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:aT(a);n<a;)e[n++]=t;return e}function r5(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),n5(e,t,n,a)):[]}function lT(e,t,n){var a;return n(e,function(r,s,c){if(t(r,s,c))return a=s,!1}),a}function o5(e,t){return lT(e,Ao(t),sh)}var i5=EI(UM);function a5(e,t){return lT(e,Ao(t),gE)}var l5=1/0;function s5(e,t){return hc(qw(e,t),l5)}function u5(e,t,n){return n=n===void 0?1:io(n),hc(qw(e,t),n)}function c5(e,t){var n=e==null?0:e.length;return n?(t=t===void 0?1:io(t),hc(e,t)):[]}var d5=512;function f5(e){return Cd(e,d5)}var p5=vE("floor"),h5="Expected a function",v5=8,m5=32,y5=128,g5=256;function sT(e){return lh(function(t){var n=t.length,a=n,r=Is.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!="function")throw new TypeError(h5);if(r&&!c&&vg(s)=="wrapper")var c=new Is([],!0)}for(a=c?a:n;++a<n;){s=t[a];var v=vg(s),f=v=="wrapper"?uE(s):void 0;f&&dw(f[0])&&f[1]==(y5|v5|m5|g5)&&!f[4].length&&f[9]==1?c=c[vg(f[0])].apply(c,f[3]):c=s.length==1&&dw(s)?c[v]():c.thru(s)}return function(){var _=arguments,g=_[0];if(c&&_.length==1&&pa(g))return c.plant(g).value();for(var b=0,x=n?t[b].apply(this,_):g;++b<n;)x=t[b].call(this,x);return x}})}var _5=sT(),b5=sT(!0);function w5(e,t){return e==null?e:eT(e,uh(t),ah)}function E5(e,t){return e&&gE(e,uh(t))}function m_(e,t){return Ym(t,function(n){return Iv(e[n])})}function O5(e){return e==null?[]:m_(e,pc(e))}function x5(e){return e==null?[]:m_(e,ah(e))}function y_(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Av(t),n=Av(n)),e(t,n)}}var S5=y_(fk),A5=y_(function(e,t){return e>=t}),M5=Math.max,k5=Math.min;function T5(e,t,n){return e>=k5(t,n)&&e<M5(t,n)}function N5(e,t,n){return t=Im(t),n===void 0?(n=t,t=0):n=Im(n),e=Av(e),T5(e,t,n)}function P5(e){var t=e==null?0:e.length;return t?kd(e,0,-1):[]}var C5=Math.min;function _E(e,t,n){for(var a=n?F8:$M,r=e[0].length,s=e.length,c=s,v=Array(s),f=1/0,_=[];c--;){var g=e[c];c&&t&&(g=dl(g,eh(t))),f=C5(g.length,f),v[c]=!n&&(t||r>=120&&g.length>=120)?new $8(c&&g):void 0}g=e[0];var b=-1,x=v[0];e:for(;++b<r&&_.length<f;){var A=g[b],S=t?t(A):A;if(A=n||A!==0?A:0,!(x?Bx(x,S):a(_,S,n))){for(c=s;--c;){var E=v[c];if(!(E?Bx(E,S):a(e[c],S,n)))continue e}x&&x.push(S),_.push(A)}}return _}function bE(e){return Ta(e)?e:[]}var R5=ao(function(e){var t=dl(e,bE);return t.length&&t[0]===e[0]?_E(t):[]}),j5=ao(function(e){var t=Eu(e),n=dl(e,bE);return t===Eu(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?_E(n,Ao(t)):[]}),D5=ao(function(e){var t=Eu(e),n=dl(e,bE);return t=typeof t=="function"?t:void 0,t&&n.pop(),n.length&&n[0]===e[0]?_E(n,void 0,t):[]});function I5(e,t,n,a){return sh(e,function(r,s,c){t(a,n(r),s,c)}),a}function uT(e,t){return function(n,a){return I5(n,e,t(a),{})}}var L5=Object.prototype,$5=L5.toString,F5=uT(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=$5.call(t)),e[t]=n},WM(oh)),cT=Object.prototype,B5=cT.hasOwnProperty,V5=cT.toString,U5=uT(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=V5.call(t)),B5.call(e,t)?e[t].push(n):e[t]=[n]},Ao);function Qm(e,t,n){t=GM(t,e),e=B8(e,t);var a=e==null?e:e[a_(Eu(t))];return a==null?void 0:Ds(a,e,n)}var W5=ao(Qm),G5=ao(function(e,t,n){var a=-1,r=typeof t=="function",s=u_(e)?Array(e.length):[];return V8(e,function(c){s[++a]=r?Ds(t,c,n):Qm(c,t,n)}),s}),z5="[object ArrayBuffer]";function H5(e){return dc(e)&&Rv(e)==z5}var sS=kg&&kg.isArrayBuffer,X5=sS?eh(sS):H5,q5="[object Boolean]";function Y5(e){return e===!0||e===!1||dc(e)&&Rv(e)==q5}var K5="[object Date]";function Z5(e){return dc(e)&&Rv(e)==K5}var uS=kg&&kg.isDate,J5=uS?eh(uS):Z5;function Q5(e){return dc(e)&&e.nodeType===1&&!Xw(e)}function e$(e,t,n){n=typeof n=="function"?n:void 0;var a=n?n(e,t):void 0;return a===void 0?U8(e,t,void 0,n):!!a}var t$=ih.isFinite;function n$(e){return typeof e=="number"&&t$(e)}function dT(e){return typeof e=="number"&&e==io(e)}function r$(e,t){return e===t||zM(e,t,HM(t))}function o$(e,t,n){return n=typeof n=="function"?n:void 0,zM(e,t,HM(t),n)}var i$="[object Number]";function fT(e){return typeof e=="number"||dc(e)&&Rv(e)==i$}function a$(e){return fT(e)&&e!=+e}var l$=W8?Iv:XM,s$="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function u$(e){if(l$(e))throw new Error(s$);return G8(e)}var cS=9007199254740991;function c$(e){return dT(e)&&e>=-cS&&e<=cS}var d$="[object WeakMap]";function f$(e){return dc(e)&&s_(e)==d$}var p$="[object WeakSet]";function h$(e){return dc(e)&&Rv(e)==p$}var v$=1;function m$(e){return Ao(typeof e=="function"?e:jv(e,v$))}var y$=Array.prototype,g$=y$.join;function _$(e,t){return e==null?"":g$.call(e,t)}var b$=Fv(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),w$=iE(function(e,t,n){l_(e,n,t)});function E$(e,t,n){for(var a=n+1;a--;)if(e[a]===t)return a;return a}var O$=Math.max,x$=Math.min;function S$(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?O$(a+r,0):x$(r,a-1)),t===t?E$(e,t,r):z8(e,H8,r,!0)}var A$=Fv(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),M$=Ck("toLowerCase"),k$=y_(OI),T$=y_(function(e,t){return e<=t});function N$(e,t){var n={};return t=Ao(t),sh(e,function(a,r,s){l_(n,t(a,r,s),a)}),n}var P$=1;function C$(e){return X8(jv(e,P$))}var R$=1;function j$(e,t){return q8(e,jv(t,R$))}function D$(e,t){return e&&e.length?xI(e,Ao(t),fk):void 0}function wE(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 I$=NaN;function pT(e,t){var n=e==null?0:e.length;return n?wE(e,t)/n:I$}function L$(e){return pT(e,oh)}function $$(e,t){return pT(e,Ao(t))}var F$=ao(function(e,t){return function(n){return Qm(n,e,t)}}),B$=ao(function(e,t){return function(n){return Qm(e,n,t)}});function V$(e,t,n){var a=pc(t),r=m_(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 _=this.__chain__;if(s||_){var g=e(this.__wrapped__),b=g.__actions__=js(this.__actions__);return b.push({func:f,args:arguments,thisArg:e}),g.__chain__=_,g}return f.apply(e,qm([this.value()],arguments))})}),e}var U$=d_(function(e,t){return e*t},1);function W$(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}var G$="[object Map]",z$="[object Set]",b1=Tg?Tg.iterator:void 0;function hT(e){if(!e)return[];if(u_(e))return aE(e)?Ou(e):js(e);if(b1&&e[b1])return W$(e[b1]());var t=s_(e),n=t==G$?VM:t==z$?Y8:Jm;return n(e)}function H$(){this.__values__===void 0&&(this.__values__=hT(this.value()));var e=this.__index__>=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}}function vT(e,t){var n=e.length;if(n)return t+=t<0?n:0,Xm(t,n)?e[t]:void 0}function X$(e,t){return e&&e.length?vT(e,io(t)):void 0}function q$(e){return e=io(e),ao(function(t){return vT(t,e)})}function Y$(e,t){return dk(e,lE(Ao(t)))}function K$(e){return Sk(2,e)}function Z$(e,t,n,a){return e==null?[]:(pa(t)||(t=t==null?[]:[t]),n=a?void 0:n,pa(n)||(n=n==null?[]:[n]),NI(e,t,n))}function EE(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 J$=EE(dl),Q$=ao,eF=Math.min,tF=Q$(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=eF(a.length,n);++r<s;)a[r]=t[r].call(this,a[r]);return Ds(e,this,a)})}),nF=EE(lI),rF=EE(K8),oF=9007199254740991,iF=Math.floor;function vw(e,t){var n="";if(!e||t<1||t>oF)return n;do t%2&&(n+=e),t=iF(t/2),t&&(e+=e);while(t);return n}var aF=qM("length"),mT="\\ud800-\\udfff",lF="\\u0300-\\u036f",sF="\\ufe20-\\ufe2f",uF="\\u20d0-\\u20ff",cF=lF+sF+uF,dF="\\ufe0e\\ufe0f",fF="["+mT+"]",mw="["+cF+"]",yw="\\ud83c[\\udffb-\\udfff]",pF="(?:"+mw+"|"+yw+")",yT="[^"+mT+"]",gT="(?:\\ud83c[\\udde6-\\uddff]){2}",_T="[\\ud800-\\udbff][\\udc00-\\udfff]",hF="\\u200d",bT=pF+"?",wT="["+dF+"]?",vF="(?:"+hF+"(?:"+[yT,gT,_T].join("|")+")"+wT+bT+")*",mF=wT+bT+vF,yF="(?:"+[yT+mw+"?",mw,gT,_T,fF].join("|")+")",dS=RegExp(yw+"(?="+yw+")|"+yF+mF,"g");function gF(e){for(var t=dS.lastIndex=0;dS.test(e);)++t;return t}function Bv(e){return $v(e)?gF(e):aF(e)}var _F=Math.ceil;function Rg(e,t){t=t===void 0?" ":wu(t);var n=t.length;if(n<2)return n?vw(t,e):t;var a=vw(t,_F(e/Bv(t)));return $v(t)?Jf(Ou(a),0,e).join(""):a.slice(0,e)}var bF=Math.ceil,wF=Math.floor;function EF(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 Rg(wF(r),n)+e+Rg(bF(r),n)}function OF(e,t,n){e=Bo(e),t=io(t);var a=t?Bv(e):0;return t&&a<t?e+Rg(t-a,n):e}function xF(e,t,n){e=Bo(e),t=io(t);var a=t?Bv(e):0;return t&&a<t?Rg(t-a,n)+e:e}var SF=/^\s+/,AF=ih.parseInt;function MF(e,t,n){return n||t==null?t=0:t&&(t=+t),AF(Bo(e).replace(SF,""),t||0)}var kF=32,g_=ao(function(e,t){var n=Hf(t,Lv(g_));return Cd(e,kF,void 0,t,n)});g_.placeholder={};var TF=64,OE=ao(function(e,t){var n=Hf(t,Lv(OE));return Cd(e,TF,void 0,t,n)});OE.placeholder={};var NF=iE(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function PF(e){for(var t,n=this;n instanceof f_;){var a=_k(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 CF(e){return function(t){return e==null?void 0:YM(e,t)}}function RF(e,t,n,a){for(var r=n-1,s=e.length;++r<s;)if(a(e[r],t))return r;return-1}var jF=Array.prototype,fS=jF.splice;function xE(e,t,n,a){var r=a?RF:Yw,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,_=t[s],g=n?n(_):_;(f=r(v,g,f,a))>-1;)v!==e&&fS.call(v,f,1),fS.call(e,f,1);return e}function ET(e,t){return e&&e.length&&t&&t.length?xE(e,t):e}var DF=ao(ET);function IF(e,t,n){return e&&e.length&&t&&t.length?xE(e,t,Ao(n)):e}function LF(e,t,n){return e&&e.length&&t&&t.length?xE(e,t,void 0,n):e}var $F=Array.prototype,FF=$F.splice;function OT(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;Xm(r)?FF.call(e,r,1):KM(e,r)}}return e}var BF=lh(function(e,t){var n=e==null?0:e.length,a=cE(e,t);return OT(e,dl(t,function(r){return Xm(r,n)?+r:r}).sort(PI)),a}),VF=Math.floor,UF=Math.random;function SE(e,t){return e+VF(UF()*(t-e+1))}var WF=parseFloat,GF=Math.min,zF=Math.random;function HF(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=Im(e),t===void 0?(t=e,e=0):t=Im(t)),e>t){var a=e;e=t,t=a}if(n||e%1||t%1){var r=zF();return GF(e+r*(t-e+WF("1e-"+((r+"").length-1))),t)}return SE(e,t)}var XF=CI(!0),qF=256,YF=lh(function(e,t){return Cd(e,qF,void 0,void 0,void 0,t)});function KF(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 ZF(e,t,n){var a=pa(e)?KF:rI,r=arguments.length<3;return a(e,Ao(t),n,r,tT)}function JF(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 OT(e,r),n}function QF(e,t,n){return(n?Yf(e,t,n):t===void 0)?t=1:t=io(t),vw(Bo(e),t)}function e9(){var e=arguments,t=Bo(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var t9="Expected a function";function n9(e,t){if(typeof e!="function")throw new TypeError(t9);return t=t===void 0?t:io(t),ao(e,t)}function r9(e,t,n){t=GM(t,e);var a=-1,r=t.length;for(r||(r=1,e=void 0);++a<r;){var s=e==null?void 0:e[a_(t[a])];s===void 0&&(a=r,s=n),e=Iv(s)?s.call(e):s}return e}var o9=Array.prototype,i9=o9.reverse;function gw(e){return e==null?e:i9.call(e)}var a9=vE("round");function xT(e){var t=e.length;return t?e[SE(0,t-1)]:void 0}function l9(e){return xT(Jm(e))}function s9(e){var t=pa(e)?xT:l9;return t(e)}function __(e,t){var n=-1,a=e.length,r=a-1;for(t=t===void 0?a:t;++n<t;){var s=SE(n,r),c=e[s];e[s]=e[n],e[n]=c}return e.length=t,e}function u9(e,t){return __(js(e),Dv(t,0,e.length))}function c9(e,t){var n=Jm(e);return __(n,Dv(t,0,n.length))}function d9(e,t,n){(n?Yf(e,t,n):t===void 0)?t=1:t=io(t);var a=pa(e)?u9:c9;return a(e,t)}function f9(e,t,n,a){return a=typeof a=="function"?a:void 0,e==null?e:Kw(e,t,n,a)}function p9(e){return __(js(e))}function h9(e){return __(Jm(e))}function v9(e){var t=pa(e)?p9:h9;return t(e)}var m9="[object Map]",y9="[object Set]";function g9(e){if(e==null)return 0;if(u_(e))return aE(e)?Bv(e):e.length;var t=s_(e);return t==m9||t==y9?e.size:Z8(e).length}function _9(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 b9=Fv(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),w9=4294967295,E9=w9-1,O9=Math.floor,x9=Math.min;function AE(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),_=t===void 0;r<s;){var g=O9((r+s)/2),b=n(e[g]),x=b!==void 0,A=b===null,S=b===b,E=Sv(b);if(c)var T=a||S;else _?T=S&&(a||x):v?T=S&&x&&(a||!A):f?T=S&&x&&!A&&(a||!E):A||E?T=!1:T=a?b<=t:b<t;T?r=g+1:s=g}return x9(s,E9)}var S9=4294967295,A9=S9>>>1;function b_(e,t,n){var a=0,r=e==null?a:e.length;if(typeof t=="number"&&t===t&&r<=A9){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 AE(e,t,oh,n)}function M9(e,t){return b_(e,t)}function k9(e,t,n){return AE(e,t,Ao(n))}function T9(e,t){var n=e==null?0:e.length;if(n){var a=b_(e,t);if(a<n&&Km(e[a],t))return a}return-1}function N9(e,t){return b_(e,t,!0)}function P9(e,t,n){return AE(e,t,Ao(n),!0)}function C9(e,t){var n=e==null?0:e.length;if(n){var a=b_(e,t,!0)-1;if(Km(e[a],t))return a}return-1}function ST(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||!Km(v,f)){var f=v;s[r++]=c===0?0:c}}return s}function R9(e){return e&&e.length?ST(e):[]}function j9(e,t){return e&&e.length?ST(e,Ao(t)):[]}var D9=4294967295;function I9(e,t,n){return n&&typeof n!="number"&&Yf(e,t,n)&&(t=n=void 0),n=n===void 0?D9:n>>>0,n?(e=Bo(e),e&&(typeof t=="string"||t!=null&&!sE(t))&&(t=wu(t),!t&&$v(e))?Jf(Ou(e),0,n):e.split(t,n)):[]}var L9="Expected a function",$9=Math.max;function F9(e,t){if(typeof e!="function")throw new TypeError(L9);return t=t==null?0:$9(io(t),0),ao(function(n){var a=n[t],r=Jf(n,0,t);return a&&qm(r,a),Ds(e,this,r)})}var B9=Fv(function(e,t,n){return e+(n?" ":"")+pE(t)});function V9(e,t,n){return e=Bo(e),n=n==null?0:Dv(io(n),0,e.length),t=wu(t),e.slice(n,n+t.length)==t}function U9(){return{}}function W9(){return""}function G9(){return!0}var z9=d_(function(e,t){return e-t},0);function H9(e){return e&&e.length?wE(e,oh):0}function X9(e,t){return e&&e.length?wE(e,Ao(t)):0}function q9(e){var t=e==null?0:e.length;return t?kd(e,1,t):[]}function Y9(e,t,n){return e&&e.length?(t=n||t===void 0?1:io(t),kd(e,0,t<0?0:t)):[]}function K9(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 Z9(e,t){return e&&e.length?v_(e,Ao(t),!1,!0):[]}function J9(e,t){return e&&e.length?v_(e,Ao(t)):[]}function Q9(e,t){return t(e),e}var AT=Object.prototype,e7=AT.hasOwnProperty;function pS(e,t,n,a){return e===void 0||Km(e,AT[n])&&!e7.call(a,n)?t:e}var t7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function n7(e){return"\\"+t7[e]}var MT=/<%=([\s\S]+?)%>/g,r7=/<%-([\s\S]+?)%>/g,o7=/<%([\s\S]+?)%>/g,_w={escape:r7,evaluate:o7,interpolate:MT,variable:"",imports:{_:{escape:oT}}},i7="Invalid `variable` option passed into `_.template`",a7=/\b__p \+= '';/g,l7=/\b(__p \+=) '' \+/g,s7=/(__e\(.*?\)|\b__t\)) \+\n'';/g,u7=/[()=,{}\[\]\/\s]/,c7=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,og=/($^)/,d7=/['\n\r\u2028\u2029\\]/g,f7=Object.prototype,hS=f7.hasOwnProperty;function p7(e,t,n){var a=_w.imports._.templateSettings||_w;n&&Yf(e,t,n)&&(t=void 0),e=Bo(e),t=fw({},t,a,pS);var r=fw({},t.imports,a.imports,pS),s=pc(r),c=ck(r,s),v,f,_=0,g=t.interpolate||og,b="__p += '",x=RegExp((t.escape||og).source+"|"+g.source+"|"+(g===MT?c7:og).source+"|"+(t.evaluate||og).source+"|$","g"),A=hS.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+`
`:"";e.replace(x,function(T,I,R,U,L,D){return R||(R=U),b+=e.slice(_,D).replace(d7,n7),I&&(v=!0,b+=`' +
__e(`+I+`) +
'`),L&&(f=!0,b+=`';
`+L+`;
__p += '`),R&&(b+=`' +
((__t = (`+R+`)) == null ? '' : __t) +
'`),_=D+T.length,T}),b+=`';
`;var S=hS.call(t,"variable")&&t.variable;if(!S)b=`with (obj) {
`+b+`
}
`;else if(u7.test(S))throw new Error(i7);b=(f?b.replace(a7,""):b).replace(l7,"$1").replace(s7,"$1;"),b="function("+(S||"obj")+`) {
`+(S?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(v?", __e = _.escape":"")+(f?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+b+`return __p
}`;var E=xk(function(){return Function(s,A+"return "+b).apply(void 0,c)});if(E.source=b,dE(E))throw E;return E}function w_(e,t){return t(e)}var h7=9007199254740991,w1=4294967295,v7=Math.min;function m7(e,t){if(e=io(e),e<1||e>h7)return[];var n=w1,a=v7(e,w1);t=uh(t),e-=w1;for(var r=ZM(a,t);++n<e;)t(n);return r}function y7(){return this}function kT(e,t){var n=e;return n instanceof eo&&(n=n.value()),uk(t,function(a,r){return r.func.apply(r.thisArg,qm([a],r.args))},n)}function g7(){return kT(this.__wrapped__,this.__actions__)}function _7(e){return Bo(e).toLowerCase()}function b7(e){return pa(e)?dl(e,a_):Sv(e)?[e]:js(J8(Bo(e)))}var vS=9007199254740991;function w7(e){return e?Dv(io(e),-vS,vS):e===0?e:0}function E7(e){return Bo(e).toUpperCase()}function O7(e,t,n){var a=pa(e),r=a||JM(e)||QM(e);if(t=Ao(t),n==null){var s=e&&e.constructor;r?n=a?new s:[]:Uf(e)?n=Iv(s)?Hm(Q8(e)):{}:n={}}return(r?fc:sh)(e,function(c,v,f){return t(n,c,v,f)}),n}function TT(e,t){for(var n=e.length;n--&&Yw(t,e[n],0)>-1;);return n}function NT(e,t){for(var n=-1,a=e.length;++n<a&&Yw(t,e[n],0)>-1;);return n}function x7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return eD(e);if(!e||!(t=wu(t)))return e;var a=Ou(e),r=Ou(t),s=NT(a,r),c=TT(a,r)+1;return Jf(a,s,c).join("")}function S7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return e.slice(0,tD(e)+1);if(!e||!(t=wu(t)))return e;var a=Ou(e),r=TT(a,Ou(t))+1;return Jf(a,0,r).join("")}var A7=/^\s+/;function M7(e,t,n){if(e=Bo(e),e&&(n||t===void 0))return e.replace(A7,"");if(!e||!(t=wu(t)))return e;var a=Ou(e),r=NT(a,Ou(t));return Jf(a,r).join("")}var k7=30,T7="...",N7=/\w*$/;function P7(e,t){var n=k7,a=T7;if(Uf(t)){var r="separator"in t?t.separator:r;n="length"in t?io(t.length):n,a="omission"in t?wu(t.omission):a}e=Bo(e);var s=e.length;if($v(e)){var c=Ou(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),sE(r)){if(e.slice(v).search(r)){var _,g=f;for(r.global||(r=RegExp(r.source,Bo(N7.exec(r))+"g")),r.lastIndex=0;_=r.exec(g);)var b=_.index;f=f.slice(0,b===void 0?v:b)}}else if(e.indexOf(wu(r),v)!=v){var x=f.lastIndexOf(r);x>-1&&(f=f.slice(0,x))}return f+a}function C7(e){return Ok(e,1)}var R7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},j7=hE(R7),PT=/&(?:amp|lt|gt|quot|#39);/g,D7=RegExp(PT.source);function I7(e){return e=Bo(e),e&&D7.test(e)?e.replace(PT,j7):e}var L7=ao(function(e){var t=Eu(e);return Ta(t)&&(t=void 0),Lm(hc(e,1,Ta,!0),Ao(t))}),$7=ao(function(e){var t=Eu(e);return t=typeof t=="function"?t:void 0,Lm(hc(e,1,Ta,!0),void 0,t)});function F7(e,t){return t=typeof t=="function"?t:void 0,e&&e.length?Lm(e,void 0,t):[]}function B7(e,t){return e==null?!0:KM(e,t)}var V7=Math.max;function ME(e){if(!(e&&e.length))return[];var t=0;return e=Ym(e,function(n){if(Ta(n))return t=V7(n.length,t),!0}),ZM(t,function(n){return dl(e,qM(n))})}function CT(e,t){if(!(e&&e.length))return[];var n=ME(e);return t==null?n:dl(n,function(a){return Ds(t,void 0,a)})}function RT(e,t,n,a){return Kw(e,t,n(YM(e,t)),a)}function U7(e,t,n){return e==null?e:RT(e,t,uh(n))}function W7(e,t,n,a){return a=typeof a=="function"?a:void 0,e==null?e:RT(e,t,uh(n),a)}var G7=Fv(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()});function z7(e){return e==null?[]:ck(e,ah(e))}var H7=ao(function(e,t){return Ta(e)?c_(e,t):[]});function X7(e,t){return g_(uh(t),e)}var q7=lh(function(e){var t=e.length,n=t?e[0]:0,a=this.__wrapped__,r=function(s){return cE(s,e)};return t>1||this.__actions__.length||!(a instanceof eo)||!Xm(n)?this.thru(r):(a=a.slice(n,+n+(t?1:0)),a.__actions__.push({func:w_,args:[r],thisArg:void 0}),new Is(a,this.__chain__).thru(function(s){return t&&!s.length&&s.push(void 0),s}))});function Y7(){return Yk(this)}function K7(){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:w_,args:[gw],thisArg:void 0}),new Is(t,this.__chain__)}return this.thru(gw)}function kE(e,t,n){var a=e.length;if(a<2)return a?Lm(e[0]):[];for(var r=-1,s=Array(a);++r<a;)for(var c=e[r],v=-1;++v<a;)v!=r&&(s[r]=c_(s[r]||c,e[v],t,n));return Lm(hc(s,1),t,n)}var Z7=ao(function(e){return kE(Ym(e,Ta))}),J7=ao(function(e){var t=Eu(e);return Ta(t)&&(t=void 0),kE(Ym(e,Ta),Ao(t))}),Q7=ao(function(e){var t=Eu(e);return t=typeof t=="function"?t:void 0,kE(Ym(e,Ta),void 0,t)}),eB=ao(ME);function tB(e,t){return RI(e||[],t||[],Kw)}var nB=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,CT(e,n)});const Bn={chunk:d6,compact:sI,concat:g6,difference:uI,differenceBy:I6,differenceWith:L6,drop:cI,dropRight:dI,dropRightWhile:F6,dropWhile:B6,fill:r5,findIndex:SI,findLastIndex:UM,flatten:nD,flattenDeep:rD,flattenDepth:c5,fromPairs:oD,head:hI,indexOf:vI,initial:P5,intersection:R5,intersectionBy:j5,intersectionWith:D5,join:_$,lastIndexOf:S$,nth:X$,pull:DF,pullAll:ET,pullAllBy:IF,pullAllWith:LF,pullAt:BF,remove:JF,reverse:gw,slice:_9,sortedIndex:M9,sortedIndexBy:k9,sortedIndexOf:T9,sortedLastIndex:N9,sortedLastIndexBy:P9,sortedLastIndexOf:C9,sortedUniq:R9,sortedUniqBy:j9,tail:q9,take:Y9,takeRight:K9,takeRightWhile:Z9,takeWhile:J9,union:iD,unionBy:L7,unionWith:$7,uniq:fI,uniqBy:pI,uniqWith:F7,unzip:ME,unzipWith:CT,without:H7,xor:Z7,xorBy:J7,xorWith:Q7,zip:eB,zipObject:jI,zipObjectDeep:tB,zipWith:nB},Vo={countBy:M6,every:gI,filter:oI,find:AI,findLast:i5,flatMap:aD,flatMapDeep:s5,flatMapDepth:u5,forEach:iI,forEachRight:U6,groupBy:mI,includes:_I,invokeMap:G5,keyBy:w$,map:qw,orderBy:Z$,partition:NF,reduce:aI,reduceRight:ZF,reject:yI,sample:s9,sampleSize:d9,shuffle:v9,size:g9,some:bI,sortBy:DI},rB={now:lD},Ri={after:XI,ary:Ok,before:Sk,bind:h_,bindKey:fE,curry:mE,curryRight:yE,debounce:sD,defer:j6,delay:D6,flip:f5,memoize:uD,once:K$,overArgs:tF,partial:g_,partialRight:OE,rearg:YF,rest:n9,spread:F9,throttle:cD,unary:C7,wrap:X7},fr={castArray:dD,clone:pD,cloneDeep:hD,cloneDeepWith:h6,cloneWith:m6,conformsTo:x6,eq:Km,gt:S5,gte:A5,isArguments:vD,isArrayBuffer:X5,isArrayLike:u_,isArrayLikeObject:Ta,isBoolean:Y5,isBuffer:JM,isDate:J5,isElement:Q5,isEmpty:mD,isEqual:yD,isEqualWith:e$,isError:dE,isFinite:n$,isFunction:Iv,isInteger:dT,isLength:gD,isMap:_D,isMatch:r$,isMatchWith:o$,isNaN:a$,isNative:u$,isNil:bD,isNull:wD,isNumber:fT,isObjectLike:dc,isPlainObject:Xw,isRegExp:sE,isSafeInteger:c$,isSet:ED,isString:aE,isSymbol:Sv,isTypedArray:QM,isUndefined:OD,isWeakMap:f$,isWeakSet:h$,lt:k$,lte:T$,toArray:hT,toFinite:Im,toLength:aT,toNumber:Av,toPlainObject:fD,toSafeInteger:w7,toString:Bo},pl={add:zI,ceil:s6,divide:$6,floor:p5,max:II,maxBy:D$,mean:L$,meanBy:$$,min:MI,minBy:LI,multiply:U$,round:a9,subtract:z9,sum:H9,sumBy:X9},TE={clamp:xD,inRange:N5,random:HF},Ar={assign:wI,assignIn:V4,assignInWith:fw,assignWith:U4,at:W4,create:k6,defaults:kI,defaultsDeep:C6,findKey:o5,findLastKey:a5,forIn:FI,forInRight:w5,forOwn:BI,forOwnRight:E5,functions:O5,functionsIn:x5,get:FM,has:TI,hasIn:TD,invert:F5,invertBy:U5,invoke:W5,keysIn:ah,mapKeys:N$,mapValues:$I,merge:SD,mergeWith:Jk,omit:AD,omitBy:Y$,pick:MD,pickBy:dk,result:r9,set:kD,setWith:f9,toPairs:q6,toPairsIn:Y6,transform:O7,unset:B7,update:U7,updateWith:W7,values:Jm,valuesIn:z7},mc={at:q7,chain:Yk,commit:y6,next:H$,plant:PF,reverse:K7,tap:Q9,toIterator:y7,value:g7,wrapperChain:Y7},bo={camelCase:i6,capitalize:Rk,deburr:jk,endsWith:W6,escape:oT,escapeRegExp:e5,kebabCase:b$,lowerCase:A$,lowerFirst:M$,pad:EF,padEnd:OF,padStart:xF,parseInt:MF,repeat:QF,replace:e9,snakeCase:b9,split:I9,startCase:B9,startsWith:V9,template:p7,templateSettings:_w,toLower:_7,toUpper:E7,trim:x7,trimEnd:S7,trimStart:M7,truncate:P7,unescape:I7,upperCase:G7,upperFirst:pE,words:qk},Mo={attempt:xk,bindAll:Y4,cond:b6,conforms:O6,constant:WM,defaultTo:P6,flow:_5,flowRight:b5,iteratee:m$,matches:C$,matchesProperty:j$,method:F$,methodOf:B$,noop:LM,nthArg:q$,over:J$,overEvery:nF,overSome:rF,property:ND,propertyOf:CF,range:VI,rangeRight:XF,stubArray:PD,stubFalse:XM,stubObject:U9,stubString:W9,stubTrue:G9,times:m7,toPath:b7,uniqueId:UI};function oB(){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 iB(){if(this.__filtered__){var e=new eo(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}var aB=Math.max,lB=Math.min;function sB(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=lB(t,e+c);break;case"takeRight":e=aB(e,t-c);break}}return{start:e,end:t}}var uB=1,cB=2,dB=Math.min;function fB(){var e=this.__wrapped__.value(),t=this.__dir__,n=pa(e),a=t<0,r=n?e.length:0,s=sB(0,r,this.__views__),c=s.start,v=s.end,f=v-c,_=a?v:c-1,g=this.__iteratees__,b=g.length,x=0,A=dB(f,this.__takeCount__);if(!n||!a&&r==f&&A==f)return kT(e,this.__actions__);var S=[];e:for(;f--&&x<A;){_+=t;for(var E=-1,T=e[_];++E<b;){var I=g[E],R=I.iteratee,U=I.type,L=R(T);if(U==cB)T=L;else if(!L){if(U==uB)continue e;break e}}S[x++]=T}return S}/**
* @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 pB="4.17.21",hB=2,vB=1,mB=3,jT=4294967295,yB=Array.prototype,gB=Object.prototype,DT=gB.hasOwnProperty,mS=Tg?Tg.iterator:void 0,_B=Math.max,yS=Math.min,NE=(function(e){return function(t,n,a){if(a==null){var r=Uf(n),s=r&&pc(n),c=s&&s.length&&m_(n,s);(c?c.length:r)||(a=n,n=t,t=this)}return e(t,n,a)}})(V$);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=NE;ce.negate=lE;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=w_;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;NE(ce,ce);ce.add=pl.add;ce.attempt=Mo.attempt;ce.camelCase=bo.camelCase;ce.capitalize=bo.capitalize;ce.ceil=pl.ceil;ce.clamp=TE.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=TE.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=Eu;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=rB.now;ce.pad=bo.pad;ce.padEnd=bo.padEnd;ce.padStart=bo.padStart;ce.parseInt=bo.parseInt;ce.random=TE.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;NE(ce,(function(){var e={};return sh(ce,function(t,n){DT.call(ce.prototype,n)||(e[n]=t)}),e})(),{chain:!1});ce.VERSION=pB;(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:_B(io(n),0);var a=this.__filtered__&&!t?new eo(this):this.clone();return a.__filtered__?a.__takeCount__=yS(n,a.__takeCount__):a.__views__.push({size:yS(n,jT),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==vB||n==mB;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 Qm(n,e,t)})});eo.prototype.reject=function(e){return this.filter(lE(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(jT)};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,_=v[0],g=f||pa(c),b=function(I){var R=r.apply(ce,qm([I],v));return a&&x?R[0]:R};g&&n&&typeof _=="function"&&_.length!=1&&(f=g=!1);var x=this.__chain__,A=!!this.__actions__.length,S=s&&!x,E=f&&!A;if(!s&&g){c=E?c:new eo(this);var T=e.apply(c,v);return T.__actions__.push({func:w_,args:[b],thisArg:void 0}),new Is(T,x)}return S&&E?e.apply(this,v):(T=this.thru(b),S?a?T.value()[0]:T.value():T)})});fc(["pop","push","shift","sort","splice","unshift"],function(e){var t=yB[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+"";DT.call(yv,a)||(yv[a]=[]),yv[a].push({name:t,func:n})}});yv[p_(void 0,hB).name]=[{name:"wrapper",func:void 0}];eo.prototype.clone=oB;eo.prototype.reverse=iB;eo.prototype.value=fB;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;mS&&(ce.prototype[mS]=mc.toIterator);const bB="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",wB="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",EB={class:"list flex-wrap"},OB=["onClick","onMousedown"],xB=["src"],SB=["title"],AB={class:"flex-between"},MB={class:"flex align-center"},kB=["src"],TB=["title"],NB={key:0,class:"status-tag",style:{"margin-left":"auto"}},PB=Vn({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(e,{emit:t}){const n=e,a=t,r=je(""),s=je([]);function c(v,f){return f.length?v.filter(_=>_.name.toLowerCase().includes(f.toLowerCase())):v}return Zm([()=>r.value,()=>n.list],()=>{s.value=c(n.list,r.value)}),(v,f)=>{const _=J("el-input"),g=J("el-avatar"),b=J("el-tag"),x=J("el-text"),A=J("el-popover"),S=J("el-empty");return _e(),Ht(ar,null,[k(_,{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"]),K("div",EB,[s.value.length?(_e(!0),Ht(ar,{key:0},Gr(s.value,E=>(_e(),at(A,{key:E.id,placement:"right",width:280,"show-after":500},{reference:P(()=>[K("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:Xt(T=>a("clickNodes",E),["stop"]),onMousedown:Xt(T=>a("onmousedown",E),["stop"])},[_n(uw)(E==null?void 0:E.icon)?(_e(),at(g,{key:0,shape:"square",size:20,style:{background:"none"}},{default:P(()=>[K("img",{src:_n(Bf)(E==null?void 0:E.icon,_n(Bf)("./favicon.ico")),alt:""},null,8,xB)]),_:2},1024)):(_e(),at(g,{key:1,class:"avatar-green",shape:"square",size:20},{default:P(()=>[...f[1]||(f[1]=[K("img",{src:Vx,style:{width:"58%"},alt:""},null,-1)])]),_:1})),K("span",{class:"ml-8 ellipsis",title:E.name},de(E.name),9,SB)],40,OB)]),default:P(()=>[K("div",AB,[K("div",MB,[_n(uw)(E==null?void 0:E.icon)?(_e(),at(g,{key:0,shape:"square",size:20,style:{background:"none"}},{default:P(()=>[K("img",{src:_n(Bf)(E==null?void 0:E.icon,_n(Bf)("./favicon.ico")),alt:""},null,8,kB)]),_:2},1024)):(_e(),at(g,{key:1,class:"avatar-green",shape:"square",size:20},{default:P(()=>[...f[2]||(f[2]=[K("img",{src:Vx,style:{width:"58%"},alt:""},null,-1)])]),_:1})),K("span",{class:"font-medium ml-8 break-all",title:E.name},de(E.name),9,TB)]),E.type?(_e(),Ht("div",NB,[_n(Zw)(E.type)?(_e(),at(b,{key:0,class:"warning-tag"},{default:P(()=>[et(de(v.$t("views.application.workflow")),1)]),_:1})):(_e(),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)):(_e(),at(S,{key:1,description:v.$t("common.noData")},null,8,["description"]))])],64)}}}),gS=Kf(PB,[["__scopeId","data-v-deb1c287"]]),CB={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},RB={key:0},jB={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},DB=["onClick","onMousedown"],IB={class:"lighter"},LB={class:"flex align-center mb-8"},$B={class:"lighter color-text-primary"},FB={key:1,class:"ml-16 mt-8"},BB=Vn({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(e,{emit:t}){const n=Ga("workflowMode"),a=Li(),{user:r,folder:s}=ek(),c=YD(n||sc.Application),v=je(""),f=e,_=t,g=$n(()=>a.path.includes("resource-management")?"systemManage":"workspace"),b=$n(()=>tk.tool[g.value]),x=je(!1),A=je("base"),S=$n(()=>{if(!v.value)return c||[];const H=v.value.toLowerCase();return(c||[]).reduce((q,ee)=>{const ue=ee.list.filter(ie=>ie.label.toLowerCase().includes(H));return ue.length&&q.push({...ee,list:ue}),q},[])});function E(H,q,ee){var ue;q&&(H.properties.stepName=q.name,ee=="tool"&&(H.properties.node_data={...q,tool_lib_id:q.id,input_field_list:q.input_field_list.map(ie=>({...ie,value:ie.source=="reference"?[]:""}))}),ee=="application"&&(H.properties.node_data={name:q.name,icon:q.icon,application_id:q.id})),(ue=f.workflowRef)==null||ue.addNode(H),_("clickNodes",H)}function T(H,q,ee){var ue;q&&(H.properties.stepName=q.name,ee=="tool"&&(H.properties.node_data={...q,tool_lib_id:q.id,input_field_list:q.input_field_list.map(ie=>({...ie,value:ie.source=="reference"?[]:""}))}),ee=="application"&&(Zw(q.type)?(q.work_flow.nodes[0].properties.node_data.file_upload_setting,H.properties.node_data={name:q.name,icon:q.icon,application_id:q.id}):H.properties.node_data={name:q.name,icon:q.icon,application_id:q.id})),(ue=f.workflowRef)==null||ue.onmousedown(H),_("onmousedown",H)}const I=je([]),R=je([]);async function U(){var q;const H=await s.asyncGetFolder(ng.TOOL,{},x);I.value=H.data,s.setCurrentFolder(((q=H.data)==null?void 0:q[0])||{})}async function L(){var q,ee,ue,ie;const H=await po({type:"tool",isShared:((q=s.currentFolder)==null?void 0:q.id)==="share",systemType:"workspace"}).getToolList({folder_id:((ee=s.currentFolder)==null?void 0:ee.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});R.value=((ue=H.data)==null?void 0:ue.tools)||H.data||[],R.value=(ie=R.value)==null?void 0:ie.filter(be=>be.is_active)}const D=je([]),W=je([]);function Y(){s.asyncGetFolder(ng.APPLICATION,{},x).then(H=>{var q;D.value=H.data,s.setCurrentFolder(((q=H.data)==null?void 0:q[0])||{})})}async function B(){var q;const H=await po({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((q=s.currentFolder)==null?void 0:q.id)||r.getWorkspaceId()});W.value=H.data.filter(ee=>ee.resource_type==="application"&&ee.id!==f.id&&ee.is_publish)}function V(H){s.setCurrentFolder(H),A.value==="tool"?L():B()}async function z(H){console.log(H),H==="tool"?(await U(),L()):H==="application"&&(Y(),B())}return Ir(()=>{}),(H,q)=>{const ee=J("search"),ue=J("el-icon"),ie=J("el-input"),be=J("el-text"),De=J("el-popover"),Ne=J("el-scrollbar"),Ae=J("el-tab-pane"),Te=J("folder-tree"),rt=J("LayoutContainer"),tt=J("el-tabs");return Wa((_e(),Ht("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:nk({width:A.value==="base"?"400px":"640px"})},[k(tt,{modelValue:A.value,"onUpdate:modelValue":q[5]||(q[5]=Be=>A.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:P(()=>[Wa(K("div",CB,[k(ie,{modelValue:v.value,"onUpdate:modelValue":q[0]||(q[0]=Be=>v.value=Be),class:"mr-12 ml-12",placeholder:H.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:P(()=>[k(ue,{class:"el-input__icon"},{default:P(()=>[k(ee)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Wf,A.value==="base"]]),k(Ae,{label:H.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:P(()=>[k(Ne,{height:"400"},{default:P(()=>[S.value.length>0?(_e(),Ht("div",RB,[(_e(!0),Ht(ar,null,Gr(S.value,(Be,dt)=>(_e(),Ht(ar,{key:dt},[k(be,{type:"info",size:"small",class:"color-secondary ml-12"},{default:P(()=>[et(de(Be.label),1)]),_:2},1024),K("div",jB,[(_e(!0),Ht(ar,null,Gr(Be.list,(St,He)=>(_e(),at(De,{key:He,placement:"right",width:280,"show-after":500},{reference:P(()=>[K("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:Xt(Qt=>E(St),["stop"]),onMousedown:Xt(Qt=>T(St),["stop"])},[(_e(),at(Ng(_n(Pg)(`${St.type}-icon`)),{class:"mr-8",size:20})),K("div",IB,de(St.label),1)],40,DB)]),default:P(()=>[K("div",LB,[(_e(),at(Ng(_n(Pg)(`${St.type}-icon`)),{class:"mr-8",size:32})),K("div",$B,de(St.label),1)]),k(be,{type:"info",size:"small",class:"color-secondary lighter"},{default:P(()=>[et(de(St.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(_e(),Ht("div",FB,[k(be,{type:"info"},{default:P(()=>[et(de(H.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Ae,{label:H.$t("views.tool.title"),name:"tool"},{default:P(()=>[k(rt,null,{left:P(()=>{var Be;return[k(Te,{source:_n(ng).TOOL,data:I.value,currentNodeKey:(Be=_n(s).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,shareTitle:H.$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(Ne,{height:"450"},{default:P(()=>[k(gS,{list:R.value,onClickNodes:q[1]||(q[1]=Be=>E(_n(Gx),Be,"tool")),onOnmousedown:q[2]||(q[2]=Be=>T(_n(Gx),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Ae,{label:H.$t("views.application.title"),name:"application"},{default:P(()=>[k(rt,null,{left:P(()=>{var Be;return[k(Te,{source:_n(ng).APPLICATION,data:D.value,currentNodeKey:(Be=_n(s).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:P(()=>[k(Ne,{height:"450"},{default:P(()=>[k(gS,{list:W.value,onClickNodes:q[3]||(q[3]=Be=>E(_n(zx),Be,"application")),onOnmousedown:q[4]||(q[4]=Be=>T(_n(zx),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Wf,e.show]])}}}),IT=Kf(BB,[["__scopeId","data-v-a8dfaa84"]]),VB={class:"flex-between"},UB={class:"ellipsis-1 break-all"},WB={key:0,src:bB,alt:""},GB={key:1,src:wB,alt:""},zB={style:{width:"280px"},class:"p-12-16"},HB={class:"mt-8 lighter"},XB={class:"title-decoration-1 mb-8 mt-8"},qB=["onMouseenter"],YB={class:"break-all"},KB={class:"dialog-footer"},ZB=Vn({__name:"NodeContainer",props:{nodeModel:{}},setup(e){const t=Li(),{params:{id:n}}=t,a=je({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=je(!1),s=je(),c=je(),v=je(!1),f=je({title:""}),_=$n({set:z=>{me.set(D.nodeModel.properties,"condition",z)},get:()=>D.nodeModel.properties.condition?D.nodeModel.properties.condition:(me.set(D.nodeModel.properties,"condition","AND"),!0)}),g=$n({set:z=>{me.set(D.nodeModel.properties,"showNode",z)},get:()=>D.nodeModel.properties.showNode!==void 0?D.nodeModel.properties.showNode:(me.set(D.nodeModel.properties,"showNode",!0),!0)}),b=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},x=$n(()=>D.nodeModel.properties.status?D.nodeModel.properties.status:200);function A(){f.value.title=D.nodeModel.properties.stepName,v.value=!0}const S=async z=>{z&&await z.validate(H=>{var q;H&&((q=D.nodeModel.graphModel.nodes.filter(ee=>ee.id!==D.nodeModel.id))!=null&&q.some(ee=>ee.properties.stepName===f.value.title)?ei(yt("views.applicationWorkflow.tip.repeatedNodeError")):(me.set(D.nodeModel.properties,"stepName",f.value.title),v.value=!1,z.resetFields()))})},E=z=>{z!=null&&z.shiftKey||D.nodeModel.graphModel.clearSelectElements(),me.set(D.nodeModel,"isSelected",!D.nodeModel.isSelected),me.set(D.nodeModel,"isHovered",!D.nodeModel.isSelected),D.nodeModel.graphModel.toFront(D.nodeModel.id)},T=je(null),I=()=>{D.nodeModel.graphModel.clearSelectElements();const z=D.nodeModel.graphModel.cloneNode(D.nodeModel.id);me.set(z,"isSelected",!0),me.set(z,"isHovered",!0),D.nodeModel.graphModel.toFront(z.id)},R=()=>{Jw(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(H=>{H.type==="loop-body-node"&&D.nodeModel.graphModel.deleteNode(H.id)}),D.nodeModel.graphModel.deleteNode(D.nodeModel.id)}),D.nodeModel.graphModel.eventCenter.emit("delete_node")},U=z=>{z.height&&(D.nodeModel.virtual||(a.value.stepContainerHeight=z.height,D.nodeModel.setHeight(a.value.stepContainerHeight)))};function L(z){var ee,ue,ie;const H=z.properties.width?z.properties.width:214,q=D.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((ee=s.value)==null?void 0:ee.x)+H/2+200,y:((ue=s.value)==null?void 0:ue.y)-z.height});D.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:D.nodeModel.id,sourceAnchorId:(ie=s.value)==null?void 0:ie.id,targetNodeId:q.id,targetAnchorId:q.id+"_left"}),V()}const D=e,W=$n(()=>{var z;return D.nodeModel.properties.config.fields?(z=D.nodeModel.properties.config.fields)==null?void 0:z.map(q=>({label:q.label,value:q.value,globeLabel:`{{${D.nodeModel.properties.stepName}.${q.value}}}`,globeValue:`{{context['${D.nodeModel.id}'].${q.value}}}`})):[]});function Y(z){return![nr.Start,nr.Base,nr.LoopStartNode.toString()].includes(z)}const B=z=>{r.value=!0,s.value=z},V=()=>{r.value=!1,s.value=void 0};return Ir(()=>{me.set(D.nodeModel,"openNodeMenu",z=>{r.value?V():B(z)})}),(z,H)=>{var we;const q=J("ArrowDownBold"),ee=J("el-icon"),ue=J("el-button"),ie=J("el-option"),be=J("el-select"),De=J("el-dropdown"),Ne=J("AppIcon"),Ae=J("el-dropdown-item"),Te=J("el-dropdown-menu"),rt=J("el-alert"),tt=J("el-tooltip"),Be=J("el-collapse-transition"),dt=J("el-input"),St=J("el-form-item"),He=J("el-form"),Qt=J("el-dialog"),Fe=Mv("resize");return _e(),Ht("div",{onMousedown:E,class:"workflow-node-container p-16",style:{overflow:"visible"}},[K("div",{class:Cl(["step-container app-card p-16",{isSelected:D.nodeModel.isSelected,error:x.value!==200}]),style:{overflow:"visible"}},[Wa((_e(),Ht("div",null,[K("div",VB,[K("div",{class:"flex align-center",onDragstart:H[0]||(H[0]=Xt(()=>{},["prevent"])),onDrag:H[1]||(H[1]=Xt(()=>{},["prevent"])),onDragover:H[2]||(H[2]=Xt(()=>{},["prevent"])),onDragend:H[3]||(H[3]=Xt(()=>{},["prevent"])),style:{width:"69%"}},[(_e(),at(Ng(_n(Pg)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(we=e.nodeModel)==null?void 0:we.properties.node_data},null,8,["item"])),K("h4",UB,de(e.nodeModel.properties.stepName),1)],32),K("div",{onMousemove:H[6]||(H[6]=Xt(()=>{},["stop"])),onMousedown:H[7]||(H[7]=Xt(()=>{},["stop"])),onKeydown:H[8]||(H[8]=Xt(()=>{},["stop"])),onClick:H[9]||(H[9]=Xt(()=>{},["stop"]))},[k(ue,{text:"",onClick:H[4]||(H[4]=Re=>g.value=!g.value)},{default:P(()=>[k(ee,{class:Cl(["arrow-icon color-secondary",g.value?"rotate-180":""])},{default:P(()=>[k(q)]),_:1},8,["class"])]),_:1}),Y(e.nodeModel.type)?(_e(),at(De,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:P(()=>[K("div",zB,[K("h5",null,de(z.$t("views.applicationWorkflow.condition.title")),1),K("p",HB,[K("span",null,de(z.$t("views.applicationWorkflow.condition.front")),1),k(be,{modelValue:_.value,"onUpdate:modelValue":H[5]||(H[5]=Re=>_.value=Re),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(ie,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(ie,{label:z.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),K("span",null,de(z.$t("views.applicationWorkflow.condition.text")),1)])])]),default:P(()=>[k(ue,{text:""},{default:P(()=>[_.value==="OR"?(_e(),Ht("img",WB)):pn("",!0),_.value==="AND"?(_e(),Ht("img",GB)):pn("",!0)]),_:1})]),_:1})):pn("",!0),Y(e.nodeModel.type)?(_e(),at(De,{key:1,teleported:!1,trigger:"click"},{dropdown:P(()=>[k(Te,{style:{"min-width":"80px"}},{default:P(()=>[k(Ae,{onClick:A,class:"p-8"},{default:P(()=>[et(de(z.$t("common.rename")),1)]),_:1}),k(Ae,{onClick:I,class:"p-8"},{default:P(()=>[et(de(z.$t("common.copy")),1)]),_:1}),k(Ae,{onClick:R,class:"border-t p-8"},{default:P(()=>[et(de(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:P(()=>[k(ue,{text:""},{default:P(()=>[k(Ne,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):pn("",!0)],32)]),k(Be,null,{default:P(()=>[Wa(K("div",{onMousedown:H[11]||(H[11]=Xt(()=>{},["stop"])),onKeydown:H[12]||(H[12]=Xt(()=>{},["stop"])),onClick:H[13]||(H[13]=Xt(()=>{},["stop"])),class:"mt-16"},[x.value!=200?(_e(),at(rt,{key:0,class:"mb-16",title:D.nodeModel.type==="application-node"?z.$t("views.applicationWorkflow.tip.applicationNodeError"):z.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):pn("",!0),rk(z.$slots,"default",{},void 0,!0),W.value.length>0?(_e(),Ht(ar,{key:1},[K("h5",XB,de(z.$t("common.param.outputParam")),1),(_e(!0),Ht(ar,null,Gr(W.value,(Re,Ye)=>(_e(),Ht("div",{key:Ye,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:Ot=>T.value=Ye,onMouseleave:H[10]||(H[10]=Ot=>T.value=null)},[K("span",YB,de(Re.label)+" "+de("{"+Re.value+"}"),1),T.value===Ye?(_e(),at(tt,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(ue,{link:"",onClick:Ot=>_n($m)(Re.globeLabel),style:{padding:"0"}},{default:P(()=>[k(Ne,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],40,qB))),128))],64)):pn("",!0)],544),[[Wf,g.value]])]),_:3})])),[[Fe,U]])],2),k(Be,null,{default:P(()=>[r.value?(_e(),at(IT,{key:0,onMousemove:H[14]||(H[14]=Xt(()=>{},["stop"])),onMousedown:H[15]||(H[15]=Xt(()=>{},["stop"])),onClick:H[16]||(H[16]=Xt(()=>{},["stop"])),onWheel:b,show:r.value,id:_n(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:L},null,8,["show","id"])):pn("",!0)]),_:1}),k(Qt,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:v.value,"onUpdate:modelValue":H[21]||(H[21]=Re=>v.value=Re),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:H[22]||(H[22]=Xt(()=>{},["prevent"]))},{footer:P(()=>[K("span",KB,[k(ue,{onClick:H[19]||(H[19]=Xt(Re=>v.value=!1,["prevent"]))},{default:P(()=>[et(de(z.$t("common.cancel")),1)]),_:1}),k(ue,{type:"primary",onClick:H[20]||(H[20]=Re=>S(c.value))},{default:P(()=>[et(de(z.$t("common.save")),1)]),_:1})])]),default:P(()=>[k(He,{"label-position":"top",ref_key:"titleFormRef",ref:c,model:f.value},{default:P(()=>[k(St,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:P(()=>[k(dt,{modelValue:f.value.title,"onUpdate:modelValue":H[17]||(H[17]=Re=>f.value.title=Re),onBlur:H[18]||(H[18]=Re=>f.value.title=f.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),wo=Kf(ZB,[["__scopeId","data-v-c3f1746d"]]),JB={class:"title-decoration-1 mb-8"},QB={class:"flex-between w-full"},eV={class:"flex-between"},tV={class:"flex align-center"},nV={class:"flex align-center"},rV={class:"mr-4"},oV={class:"flex-between"},iV={class:"flex-between mb-16"},aV={key:0,class:"w-full mb-16"},lV={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},sV={class:"flex align-center",style:{"line-height":"20px"}},uV=["src"],cV=["title"],dV={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},fV={class:"flex align-center",style:{"line-height":"20px"}},pV={class:"ellipsis"},hV={class:"flex-between mb-16"},vV={class:"lighter"},mV={key:2,class:"w-full mb-16"},yV={class:"flex align-center",style:{"line-height":"20px"}},gV=["src"],_V=["title"],bV={class:"flex-between"},wV={class:"mr-4"},EV={class:"flex"},OV={class:"flex-between w-full"},xV={class:"flex align-center"},SV={class:"mr-4"},AV=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("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){me.set(x.nodeModel.properties.node_data,"system",Be)}function v(Be){me.set(x.nodeModel.properties.node_data,"prompt",Be)}const f=Be=>{var dt;Be?(dt=E.value)==null||dt.reset_default(Be,a):V({})},g={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||me.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):(me.set(x.nodeModel.properties,"node_data",g),x.nodeModel.properties.node_data),set:Be=>{me.set(x.nodeModel.properties,"node_data",Be)}}),x=e,A=je(),S=je(null),E=je(),T=je(),I=()=>{var Be;return(Be=A.value)==null?void 0:Be.validate().catch(dt=>Promise.reject({node:x.nodeModel,errMessage:dt}))},R=t();function U(){var dt;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(dt=R.value)==null?void 0:dt.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:r.value}).getSelectModelList(Be).then(St=>{S.value=me.groupBy(St==null?void 0:St.data,"provider")})}const L=Be=>{var dt;Be&&((dt=E.value)==null||dt.open(Be,a,b.value.model_params_setting))},D=je(),W=Be=>{var dt;Be&&((dt=D.value)==null||dt.open(Be,a))},Y=Be=>{me.set(x.nodeModel.properties.node_data,"system",Be)},B=()=>{var Be;(Be=T.value)==null||Be.open(b.value.model_setting)};function V(Be){me.set(x.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let dt=me.cloneDeep(x.nodeModel.properties.node_data.model_setting);dt={...dt,...Be},me.set(x.nodeModel.properties.node_data,"model_setting",dt)}const H=je();function q(){const Be={mcp_servers:b.value.mcp_servers,mcp_tool_ids:b.value.mcp_tool_ids,mcp_source:b.value.mcp_source};H.value.open(Be,rt.value)}function ee(Be){me.set(x.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),me.set(x.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),me.set(x.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const ue=je();function ie(){ue.value.open(b.value.tool_ids)}function be(Be){me.set(x.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function De(Be){const dt=x.nodeModel.properties.node_data.tool_ids.filter(St=>St!==Be);me.set(x.nodeModel.properties.node_data,"tool_ids",dt)}function Ne(Be){const dt=x.nodeModel.properties.node_data.mcp_tool_ids.filter(St=>St!==Be);me.set(x.nodeModel.properties.node_data,"mcp_tool_ids",dt)}const Ae=je([]);function Te(){var dt;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(dt=R.value)==null?void 0:dt.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};po({type:"tool",systemType:r.value}).getAllToolList(Be).then(St=>{Ae.value=[...St.data.shared_tools,...St.data.tools].filter(He=>He.is_active)})}const rt=je([]);function tt(){var dt;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(dt=R.value)==null?void 0:dt.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,dt,St,He;U(),typeof((Be=x.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&vc(x.nodeModel)&&me.set(x.nodeModel.properties.node_data,"is_result",!0),me.set(x.nodeModel,"validate",I),b.value.dialogue_type||(b.value.dialogue_type="WORKFLOW"),(dt=x.nodeModel.properties.node_data)!=null&&dt.mcp_tool_id&&(me.set(x.nodeModel.properties.node_data,"mcp_tool_ids",[(St=x.nodeModel.properties.node_data)==null?void 0:St.mcp_tool_id]),me.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&&me.set(x.nodeModel.properties.node_data,"mcp_output_enable",!0),Te(),tt()}),(Be,dt)=>{const St=J("AppIcon"),He=J("el-button"),Qt=J("ModelSelect"),Fe=J("el-form-item"),we=J("el-tooltip"),Re=J("MdEditorMagnify"),Ye=J("el-option"),Ot=J("el-select"),bt=J("el-input-number"),Ft=J("el-switch"),en=J("el-avatar"),on=J("ToolIcon"),Wt=J("Close"),nt=J("el-icon"),sn=J("el-form"),We=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",JB,de(Be.$t("views.applicationWorkflow.nodeSetting")),1),k(We,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(sn,{onSubmit:dt[16]||(dt[16]=Xt(()=>{},["prevent"])),model:b.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:A,"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(()=>[K("div",QB,[K("div",null,[K("span",null,[et(de(Be.$t("views.application.form.aiModel.label")),1),dt[17]||(dt[17]=K("span",{class:"color-danger"},"*",-1))])]),k(He,{disabled:!b.value.model_id,type:"primary",link:"",onClick:dt[0]||(dt[0]=te=>L(b.value.model_id)),onRefreshForm:V},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(Qt,{onChange:f,onWheel:s,teleported:!1,modelValue:b.value.model_id,"onUpdate:modelValue":dt[1]||(dt[1]=te=>b.value.model_id=te),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:S.value,onSubmitModel:U,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(Fe,null,{label:P(()=>[K("div",eV,[K("div",tV,[K("span",null,de(Be.$t("views.application.form.roleSettings.label")),1),k(we,{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:dt[2]||(dt[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(Re,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:b.value.system,"onUpdate:modelValue":dt[3]||(dt[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(()=>[K("div",nV,[K("div",rV,[K("span",null,[et(de(Be.$t("views.application.form.prompt.label")),1),dt[18]||(dt[18]=K("span",{class:"color-danger"},"*",-1))])]),k(we,{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(Re,{onWheel:s,title:Be.$t("views.application.form.prompt.label"),modelValue:b.value.prompt,"onUpdate:modelValue":dt[4]||(dt[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(()=>[K("div",oV,[K("div",null,de(Be.$t("views.application.form.historyRecord.label")),1),k(Ot,{modelValue:b.value.dialogue_type,"onUpdate:modelValue":dt[5]||(dt[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":dt[6]||(dt[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"]),K("div",iV,[dt[19]||(dt[19]=K("div",{class:"lighter"},"MCP",-1)),K("div",null,[b.value.mcp_enable?(_e(),at(He,{key:0,type:"primary",class:"mr-4",link:"",onClick:q,onRefreshForm:V},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1})):pn("",!0),k(Ft,{size:"small",modelValue:b.value.mcp_enable,"onUpdate:modelValue":dt[7]||(dt[7]=te=>b.value.mcp_enable=te)},null,8,["modelValue"])])]),((yn=b.value.mcp_tool_ids)==null?void 0:yn.length)>0?(_e(),Ht("div",aV,[(_e(!0),Ht(ar,null,Gr(b.value.mcp_tool_ids,(te,Gn)=>{var br,Dr,zr;return _e(),Ht(ar,{key:Gn},[_n(cl)(rt.value,te,"id")?(_e(),Ht("div",lV,[K("div",sV,[(br=_n(cl)(rt.value,te,"id"))!=null&&br.icon?(_e(),at(en,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>{var jn;return[K("img",{src:_n(Bf)((jn=_n(cl)(rt.value,te,"id"))==null?void 0:jn.icon),alt:""},null,8,uV)]}),_:2},1024)):(_e(),at(on,{key:1,type:"MCP",class:"mr-8",size:20})),K("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,cV)]),k(He,{text:"",onClick:jn=>Ne(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?(_e(),Ht("div",dV,[K("div",fV,[k(on,{type:"MCP",class:"mr-8",size:20}),K("div",pV,de(Be.$t("common.custom")+" MCP"),1)]),k(He,{text:"",onClick:dt[8]||(dt[8]=te=>b.value.mcp_servers="")},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1})])):pn("",!0),K("div",hV,[K("div",vV,de(Be.$t("views.tool.title")),1),K("div",null,[b.value.tool_enable?(_e(),at(He,{key:0,type:"primary",class:"mr-4",link:"",onClick:ie,onRefreshForm:V},{default:P(()=>[k(St,{iconName:"app-setting"})]),_:1})):pn("",!0),k(Ft,{size:"small",modelValue:b.value.tool_enable,"onUpdate:modelValue":dt[9]||(dt[9]=te=>b.value.tool_enable=te)},null,8,["modelValue"])])]),((Kn=b.value.tool_ids)==null?void 0:Kn.length)>0?(_e(),Ht("div",mV,[(_e(!0),Ht(ar,null,Gr(b.value.tool_ids,(te,Gn)=>{var br,Dr,zr;return _e(),Ht("div",{key:Gn,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[K("div",yV,[(br=_n(cl)(Ae.value,te,"id"))!=null&&br.icon?(_e(),at(en,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>{var jn;return[K("img",{src:_n(Bf)((jn=_n(cl)(Ae.value,te,"id"))==null?void 0:jn.icon),alt:""},null,8,gV)]}),_:2},1024)):(_e(),at(on,{key:1,class:"mr-8",size:20})),K("div",{class:"ellipsis",title:(Dr=_n(cl)(Ae.value,te,"id"))==null?void 0:Dr.name},de((zr=_n(cl)(Ae.value,te,"id"))==null?void 0:zr.name),9,_V)]),k(He,{text:"",onClick:jn=>De(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?(_e(),at(Fe,{key:3,onClick:dt[11]||(dt[11]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",bV,[K("span",wV,de(Be.$t("views.application.form.mcp_output_enable")),1),K("div",EV,[k(Ft,{class:"ml-8",size:"small",modelValue:b.value.mcp_output_enable,"onUpdate:modelValue":dt[10]||(dt[10]=te=>b.value.mcp_output_enable=te)},null,8,["modelValue"])])])]),_:1})):pn("",!0),k(Fe,{onClick:dt[13]||(dt[13]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",OV,[K("div",null,[K("span",null,de(Be.$t("views.application.form.reasoningContent.label")),1)]),K("div",null,[b.value.model_setting.reasoning_content_enable?(_e(),at(He,{key:0,type:"primary",link:"",onClick:B,onRefreshForm:V,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":dt[12]||(dt[12]=te=>b.value.model_setting.reasoning_content_enable=te)},null,8,["modelValue"])])])]),_:1}),k(Fe,{onClick:dt[15]||(dt[15]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",xV,[K("div",SV,[K("span",null,de(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(we,{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":dt[14]||(dt[14]=te=>b.value.is_result=te)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:E,onRefresh:V},null,512),k(oE,{onReplace:Y,ref_key:"GeneratePromptDialogRef",ref:D},null,512),k(JD,{ref_key:"ReasoningParamSettingDialogRef",ref:T,onRefresh:z},null,512),k(QD,{ref_key:"mcpServersDialogRef",ref:H,onRefresh:ee},null,512),k(eI,{ref_key:"toolDialogRef",ref:ue,onRefresh:be},null,512)]),_:1},8,["nodeModel"])}}});var ig={exports:{}},_S;function MV(){return _S||(_S=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(_){return s[_]}).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 D})),r.d(a,"b",(function(){return L})),r.d(a,"c",(function(){return He})),r.d(a,"d",(function(){return Qt})),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 dt})),r.d(a,"k",(function(){return q}));var s,c,v,f,_,g,b,x={},A=[],S=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function E(Fe,we){for(var Re in we)Fe[Re]=we[Re];return Fe}function T(Fe){var we=Fe.parentNode;we&&we.removeChild(Fe)}function I(Fe,we,Re){var Ye,Ot,bt,Ft={};for(bt in we)bt=="key"?Ye=we[bt]:bt=="ref"?Ot=we[bt]:Ft[bt]=we[bt];if(arguments.length>2&&(Ft.children=arguments.length>3?s.call(arguments,2):Re),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,we,Re,Ye,Ot){var bt={type:Fe,props:we,key:Re,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 L(Fe){return Fe.children}function D(Fe,we){this.props=Fe,this.context=we}function W(Fe,we){if(we==null)return Fe.__?W(Fe.__,Fe.__.__k.indexOf(Fe)+1):null;for(var Re;we<Fe.__k.length;we++)if((Re=Fe.__k[we])!=null&&Re.__e!=null)return Re.__e;return typeof Fe.type=="function"?W(Fe):null}function Y(Fe){var we,Re;if((Fe=Fe.__)!=null&&Fe.__c!=null){for(Fe.__e=Fe.__c.base=null,we=0;we<Fe.__k.length;we++)if((Re=Fe.__k[we])!=null&&Re.__e!=null){Fe.__e=Fe.__c.base=Re.__e;break}return Y(Fe)}}function B(Fe){(!Fe.__d&&(Fe.__d=!0)&&f.push(Fe)&&!V.__r++||g!==c.debounceRendering)&&((g=c.debounceRendering)||_)(V)}function V(){for(var Fe;V.__r=f.length;)Fe=f.sort((function(we,Re){return we.__v.__b-Re.__v.__b})),f=[],Fe.some((function(we){var Re,Ye,Ot,bt,Ft,en;we.__d&&(Ft=(bt=(Re=we).__v).__e,(en=Re.__P)&&(Ye=[],(Ot=E({},bt)).__v=bt.__v+1,Ne(en,bt,Ot,Re.__n,en.ownerSVGElement!==void 0,bt.__h!=null?[Ft]:null,Ye,Ft??W(bt),bt.__h),Ae(Ye,bt),bt.__e!=Ft&&Y(bt)))}))}function z(Fe,we,Re,Ye,Ot,bt,Ft,en,on,Wt){var nt,sn,We,yn,Kn,te,Gn,br=Ye&&Ye.__k||A,Dr=br.length;for(Re.__k=[],nt=0;nt<we.length;nt++)if((yn=Re.__k[nt]=(yn=we[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(L,{children:yn},null,null,null):yn.__b>0?R(yn.type,yn.props,yn.key,null,yn.__v):yn)!=null){if(yn.__=Re,yn.__b=Re.__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}Ne(Fe,yn,We=We||x,Ot,bt,Ft,en,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=H(yn,on,Fe):on=ee(Fe,yn,We,br,Kn,on),typeof Re.type=="function"&&(Re.__d=on)):on&&We.__e==on&&on.parentNode!=Fe&&(on=W(We))}for(Re.__e=te,nt=Dr;nt--;)br[nt]!=null&&(typeof Re.type=="function"&&br[nt].__e!=null&&br[nt].__e==Re.__d&&(Re.__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 H(Fe,we,Re){for(var Ye,Ot=Fe.__k,bt=0;Ot&&bt<Ot.length;bt++)(Ye=Ot[bt])&&(Ye.__=Fe,we=typeof Ye.type=="function"?H(Ye,we,Re):ee(Re,Ye,Ye,Ot,Ye.__e,we));return we}function q(Fe,we){return we=we||[],Fe==null||typeof Fe=="boolean"||(Array.isArray(Fe)?Fe.some((function(Re){q(Re,we)})):we.push(Fe)),we}function ee(Fe,we,Re,Ye,Ot,bt){var Ft,en,on;if(we.__d!==void 0)Ft=we.__d,we.__d=void 0;else if(Re==null||Ot!=bt||Ot.parentNode==null)e:if(bt==null||bt.parentNode!==Fe)Fe.appendChild(Ot),Ft=null;else{for(en=bt,on=0;(en=en.nextSibling)&&on<Ye.length;on+=2)if(en==Ot)break e;Fe.insertBefore(Ot,bt),Ft=bt}return Ft!==void 0?Ft:Ot.nextSibling}function ue(Fe,we,Re){we[0]==="-"?Fe.setProperty(we,Re):Fe[we]=Re==null?"":typeof Re!="number"||S.test(we)?Re:Re+"px"}function ie(Fe,we,Re,Ye,Ot){var bt;e:if(we==="style")if(typeof Re=="string")Fe.style.cssText=Re;else{if(typeof Ye=="string"&&(Fe.style.cssText=Ye=""),Ye)for(we in Ye)Re&&we in Re||ue(Fe.style,we,"");if(Re)for(we in Re)Ye&&Re[we]===Ye[we]||ue(Fe.style,we,Re[we])}else if(we[0]==="o"&&we[1]==="n")bt=we!==(we=we.replace(/Capture$/,"")),we=we.toLowerCase()in Fe?we.toLowerCase().slice(2):we.slice(2),Fe.l||(Fe.l={}),Fe.l[we+bt]=Re,Re?Ye||Fe.addEventListener(we,bt?De:be,bt):Fe.removeEventListener(we,bt?De:be,bt);else if(we!=="dangerouslySetInnerHTML"){if(Ot)we=we.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(we!=="href"&&we!=="list"&&we!=="form"&&we!=="tabIndex"&&we!=="download"&&we in Fe)try{Fe[we]=Re??"";break e}catch{}typeof Re=="function"||(Re!=null&&(Re!==!1||we[0]==="a"&&we[1]==="r")?Fe.setAttribute(we,Re):Fe.removeAttribute(we))}}function be(Fe){this.l[Fe.type+!1](c.event?c.event(Fe):Fe)}function De(Fe){this.l[Fe.type+!0](c.event?c.event(Fe):Fe)}function Ne(Fe,we,Re,Ye,Ot,bt,Ft,en,on){var Wt,nt,sn,We,yn,Kn,te,Gn,br,Dr,zr,jn=we.type;if(we.constructor!==void 0)return null;Re.__h!=null&&(on=Re.__h,en=we.__e=Re.__e,we.__h=null,bt=[en]),(Wt=c.__b)&&Wt(we);try{e:if(typeof jn=="function"){if(Gn=we.props,br=(Wt=jn.contextType)&&Ye[Wt.__c],Dr=Wt?br?br.props.value:Wt.__:Ye,Re.__c?te=(nt=we.__c=Re.__c).__=nt.__E:("prototype"in jn&&jn.prototype.render?we.__c=nt=new jn(Gn,Dr):(we.__c=nt=new D(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||we.__v===Re.__v){nt.props=Gn,nt.state=nt.__s,we.__v!==Re.__v&&(nt.__d=!1),nt.__v=we,we.__e=Re.__e,we.__k=Re.__k,we.__k.forEach((function(ko){ko&&(ko.__=we)})),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(we),nt.__d=!1,nt.__v=we,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===L&&Wt.key==null?Wt.props.children:Wt,z(Fe,Array.isArray(zr)?zr:[zr],we,Re,Ye,Ot,bt,Ft,en,on),nt.base=we.__e,we.__h=null,nt.__h.length&&Ft.push(nt),te&&(nt.__E=nt.__=null),nt.__e=!1}else bt==null&&we.__v===Re.__v?(we.__k=Re.__k,we.__e=Re.__e):we.__e=Te(Re.__e,we,Re,Ye,Ot,bt,Ft,on);(Wt=c.diffed)&&Wt(we)}catch(ko){we.__v=null,(on||bt!=null)&&(we.__e=en,we.__h=!!on,bt[bt.indexOf(en)]=null),c.__e(ko,we,Re)}}function Ae(Fe,we){c.__c&&c.__c(we,Fe),Fe.some((function(Re){try{Fe=Re.__h,Re.__h=[],Fe.some((function(Ye){Ye.call(Re)}))}catch(Ye){c.__e(Ye,Re.__v)}}))}function Te(Fe,we,Re,Ye,Ot,bt,Ft,en){var on,Wt,nt,sn=Re.props,We=we.props,yn=we.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,en=!1}if(yn===null)sn===We||en&&Fe.data===We||(Fe.data=We);else{if(bt=bt&&s.call(Fe.childNodes),Wt=(sn=Re.props||x).dangerouslySetInnerHTML,nt=We.dangerouslySetInnerHTML,!en){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||ie(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]||ie(te,jn,Gn[jn],br[jn],Dr)})(Fe,We,sn,Ot,en),nt)we.__k=[];else if(Kn=we.props.children,z(Fe,Array.isArray(Kn)?Kn:[Kn],we,Re,Ye,Ot&&yn!=="foreignObject",bt,Ft,bt?bt[0]:Re.__k&&W(Re,0),en),bt!=null)for(Kn=bt.length;Kn--;)bt[Kn]!=null&&T(bt[Kn]);en||("value"in We&&(Kn=We.value)!==void 0&&(Kn!==sn.value||Kn!==Fe.value||yn==="progress"&&!Kn)&&ie(Fe,"value",Kn,sn.value,!1),"checked"in We&&(Kn=We.checked)!==void 0&&Kn!==Fe.checked&&ie(Fe,"checked",Kn,sn.checked,!1))}return Fe}function rt(Fe,we,Re){try{typeof Fe=="function"?Fe(we):Fe.current=we}catch(Ye){c.__e(Ye,Re)}}function tt(Fe,we,Re){var Ye,Ot;if(c.unmount&&c.unmount(Fe),(Ye=Fe.ref)&&(Ye.current&&Ye.current!==Fe.__e||rt(Ye,null,we)),(Ye=Fe.__c)!=null){if(Ye.componentWillUnmount)try{Ye.componentWillUnmount()}catch(bt){c.__e(bt,we)}Ye.base=Ye.__P=null}if(Ye=Fe.__k)for(Ot=0;Ot<Ye.length;Ot++)Ye[Ot]&&tt(Ye[Ot],we,typeof Fe.type!="function");Re||Fe.__e==null||T(Fe.__e),Fe.__e=Fe.__d=void 0}function Be(Fe,we,Re){return this.constructor(Fe,Re)}function dt(Fe,we,Re){var Ye,Ot,bt;c.__&&c.__(Fe,we),Ot=(Ye=typeof Re=="function")?null:Re&&Re.__k||we.__k,bt=[],Ne(we,Fe=(!Ye&&Re||we).__k=I(L,null,[Fe]),Ot||x,x,we.ownerSVGElement!==void 0,!Ye&&Re?[Re]:Ot?null:we.firstChild?s.call(we.childNodes):null,bt,!Ye&&Re?Re:Ot?Ot.__e:we.firstChild,Ye),Ae(bt,Fe)}function St(Fe,we){dt(Fe,we,St)}function He(Fe,we,Re){var Ye,Ot,bt,Ft=E({},Fe.props);for(bt in we)bt=="key"?Ye=we[bt]:bt=="ref"?Ot=we[bt]:Ft[bt]=we[bt];return arguments.length>2&&(Ft.children=arguments.length>3?s.call(arguments,2):Re),R(Fe.type,Ft,Ye||Fe.key,Ot||Fe.ref,null)}function Qt(Fe,we){var Re={__c:we="__cC"+b++,__:Fe,Consumer:function(Ye,Ot){return Ye.children(Ot)},Provider:function(Ye){var Ot,bt;return this.getChildContext||(Ot=[],(bt={})[we]=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 en=Ft.componentWillUnmount;Ft.componentWillUnmount=function(){Ot.splice(Ot.indexOf(Ft),1),en&&en.call(Ft)}}),Ye.children}};return Re.Provider.__=Re.Consumer.contextType=Re}s=A.slice,c={__e:function(Fe,we){for(var Re,Ye,Ot;we=we.__;)if((Re=we.__c)&&!Re.__)try{if((Ye=Re.constructor)&&Ye.getDerivedStateFromError!=null&&(Re.setState(Ye.getDerivedStateFromError(Fe)),Ot=Re.__d),Re.componentDidCatch!=null&&(Re.componentDidCatch(Fe),Ot=Re.__d),Ot)return Re.__E=Re}catch(bt){Fe=bt}throw Fe}},v=0,D.prototype.setState=function(Fe,we){var Re;Re=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof Fe=="function"&&(Fe=Fe(E({},Re),this.props)),Fe&&E(Re,Fe),Fe!=null&&this.__v&&(we&&this.__h.push(we),B(this))},D.prototype.forceUpdate=function(Fe){this.__v&&(this.__e=!0,Fe&&this.__h.push(Fe),B(this))},D.prototype.render=L,f=[],_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V.__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 Pa})),r.d(a,"d",(function(){return Zn})),r.d(a,"e",(function(){return tn})),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 H})),r.d(a,"p",(function(){return ip})),r.d(a,"q",(function(){return ma})),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 Mu})),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 _a})),r.d(a,"z",(function(){return Ko})),r.d(a,"A",(function(){return ci})),r.d(a,"B",(function(){return ya})),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 Nu}));var v=[];Object.freeze(v);var f={};function _(){return++Rn.mobxGuid}function g(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 A=function(){};function S(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,X){Object.defineProperty(N,C,{enumerable:!1,writable:!0,configurable:!0,value:X})}function I(N,C){var X="isMobX"+N;return C.prototype[X]=!0,function(ae){return S(ae)&&ae[X]===!0}}function R(N){return N instanceof Map}function U(N){return N instanceof Set}function L(N){var C=new Set;for(var X in N)C.add(X);return Object.getOwnPropertySymbols(N).forEach((function(ae){Object.getOwnPropertyDescriptor(N,ae).enumerable&&C.add(ae)})),Array.from(C)}function D(N){return N&&N.toString?N.toString():new String(N).toString()}function W(N){return N===null?null:typeof N=="object"?""+N:N}var Y=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"),V=(function(){function N(C){C===void 0&&(C="Atom@"+_()),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 Au(this)},N.prototype.reportChanged=function(){Ki(),(function(C){C.lowestObserverState!==sn.STALE&&(C.lowestObserverState=sn.STALE,C.observers.forEach((function(X){X.dependenciesState===sn.UP_TO_DATE&&(X.isTracing!==We.NONE&&Na(X,C),X.onBecomeStale()),X.dependenciesState=sn.STALE})))})(this),oa()},N.prototype.toString=function(){return this.name},N})(),z=I("Atom",V);function H(N,C,X){C===void 0&&(C=A),X===void 0&&(X=A);var ae,Ee=new V(N);return C!==A&&Vd("onBecomeObserved",Ee,C,ae),X!==A&&Xr(Ee,X),Ee}var q={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(X,ae){X.__proto__=ae}||function(X,ae){for(var Ee in ae)ae.hasOwnProperty(Ee)&&(X[Ee]=ae[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,X=1,ae=arguments.length;X<ae;X++)for(var Ee in C=arguments[X])Object.prototype.hasOwnProperty.call(C,Ee)&&(N[Ee]=C[Ee]);return N},ue.apply(this,arguments)};function ie(N){var C=typeof Symbol=="function"&&N[Symbol.iterator],X=0;return C?C.call(N):{next:function(){return N&&X>=N.length&&(N=void 0),{value:N&&N[X++],done:!N}}}}function be(N,C){var X=typeof Symbol=="function"&&N[Symbol.iterator];if(!X)return N;var ae,Ee,Ke=X.call(N),wt=[];try{for(;(C===void 0||C-- >0)&&!(ae=Ke.next()).done;)wt.push(ae.value)}catch(Kt){Ee={error:Kt}}finally{try{ae&&!ae.done&&(X=Ke.return)&&X.call(Ke)}finally{if(Ee)throw Ee.error}}return wt}function De(){for(var N=[],C=0;C<arguments.length;C++)N=N.concat(be(arguments[C]));return N}var Ne=Symbol("mobx did run lazy initializers"),Ae=Symbol("mobx pending decorators"),Te={},rt={};function tt(N,C){var X=C?Te:rt;return X[N]||(X[N]={configurable:!0,enumerable:C,get:function(){return Be(this),this[N]},set:function(ae){Be(this),this[N]=ae}})}function Be(N){var C,X;if(N[Ne]!==!0){var ae=N[Ae];if(ae){T(N,Ne,!0);var Ee=De(Object.getOwnPropertySymbols(ae),Object.keys(ae));try{for(var Ke=ie(Ee),wt=Ke.next();!wt.done;wt=Ke.next()){var Kt=ae[wt.value];Kt.propertyCreator(N,Kt.prop,Kt.descriptor,Kt.decoratorTarget,Kt.decoratorArguments)}}catch(Sn){C={error:Sn}}finally{try{wt&&!wt.done&&(X=Ke.return)&&X.call(Ke)}finally{if(C)throw C.error}}}}}function dt(N,C){return function(){var X,ae=function(Ee,Ke,wt,Kt){if(Kt===!0)return C(Ee,Ke,wt,Ee,X),null;if(!Object.prototype.hasOwnProperty.call(Ee,Ae)){var Sn=Ee[Ae];T(Ee,Ae,ue({},Sn))}return Ee[Ae][Ke]={prop:Ke,propertyCreator:C,descriptor:wt,decoratorTarget:Ee,decoratorArguments:X},tt(Ke,N)};return St(arguments)?(X=v,ae.apply(null,arguments)):(X=Array.prototype.slice.call(arguments),ae)}}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,X){return si(N)?N:Array.isArray(N)?Wt.array(N,{name:X}):E(N)?Wt.object(N,void 0,{name:X}):R(N)?Wt.map(N,{name:X}):U(N)?Wt.set(N,{name:X}):N}function Qt(N){return N}function Fe(N){b(N);var C=dt(!0,(function(ae,Ee,Ke,wt,Kt){var Sn=Ke?Ke.initializer?Ke.initializer.call(ae):Ke.value:void 0;ia(ae).addObservableProp(Ee,Sn,N)})),X=(s!==void 0&&s.env,C);return X.enhancer=N,X}var we={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function Re(N){return N==null?we:typeof N=="string"?{name:N,deep:!0,proxy:!0}:N}Object.freeze(we);var Ye=Fe(He),Ot=Fe((function(N,C,X){return N==null||ci(N)||_a(N)||Ko(N)||ni(N)?N:Array.isArray(N)?Wt.array(N,{name:X,deep:!1}):E(N)?Wt.object(N,void 0,{name:X,deep:!1}):R(N)?Wt.map(N,{name:X,deep:!1}):U(N)?Wt.set(N,{name:X,deep:!1}):g(!1)})),bt=Fe(Qt),Ft=Fe((function(N,C,X){return Vt(N,C)?C:N}));function en(N){return N.defaultDecorator?N.defaultDecorator.enhancer:N.deep===!1?Qt:He}var on={box:function(N,C){arguments.length>2&&nt("box");var X=Re(C);return new Lr(N,en(X),X.name,!0,X.equals)},array:function(N,C){arguments.length>2&&nt("array");var X=Re(C);return Fl(N,en(X),X.name)},map:function(N,C){arguments.length>2&&nt("map");var X=Re(C);return new Pc(N,en(X),X.name)},set:function(N,C){arguments.length>2&&nt("set");var X=Re(C);return new qa(N,en(X),X.name)},object:function(N,C,X){typeof arguments[1]=="string"&&nt("object");var ae=Re(X);if(ae.proxy===!1)return ma({},N,C,ae);var Ee=ku(ae),Ke=ma({},void 0,void 0,ae),wt=us(Ke);return Ud(wt,N,C,Ee),wt},ref:bt,shallow:Ot,deep:Ye,struct:Ft},Wt=function(N,C,X){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return Ye.apply(null,arguments);if(si(N))return N;var ae=E(N)?Wt.object(N,C,X):Array.isArray(N)?Wt.array(N,C):R(N)?Wt.map(N,C):U(N)?Wt.set(N,C):N;if(ae!==N)return ae;g(!1)};function nt(N){g("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=dt(!1,(function(N,C,X,ae,Ee){var Ke=X.get,wt=X.set,Kt=Ee[0]||{};ia(N).addComputedProp(N,C,ue({get:Ke,set:wt,context:N},Kt))})),Kn=yn({equals:q.structural}),te=function(N,C,X){if(typeof C=="string"||N!==null&&typeof N=="object"&&arguments.length===1)return yn.apply(null,arguments);var ae=typeof C=="object"?C:{};return ae.get=N,ae.set=typeof C=="function"?C:ae.set,ae.name=ae.name||N.name||"",new za(ae)};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),X=$e(),ae=N.observing,Ee=ae.length,Ke=0;Ke<Ee;Ke++){var wt=ae[Ke];if(yl(wt)){if(Rn.disableErrorBoundaries)wt.get();else try{wt.get()}catch{return lt(X),tn(C),!0}if(N.dependenciesState===sn.STALE)return lt(X),tn(C),!0}}return Tn(N),lt(X),tn(C),!1}}function zr(){return Rn.trackingDerivation!==null}function jn(N){var C=N.observers.size>0;Rn.computationDepth>0&&C&&g(!1),Rn.allowStateChanges||!C&&Rn.enforceActions!=="strict"||g(!1)}function ko(N,C,X){var ae=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(X);else try{Ee=C.call(X)}catch(wt){Ee=new Gn(wt)}return Rn.trackingDerivation=Ke,(function(wt){for(var Kt=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=Kt.length;qr--;)(Fr=Kt[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),tn(ae),Ee}function Se(N){var C=N.observing;N.observing=[];for(var X=C.length;X--;)Eo(C[X],N);N.dependenciesState=sn.NOT_TRACKING}function Qe(N){var C=$e();try{return N()}finally{lt(C)}}function $e(){var N=Rn.trackingDerivation;return Rn.trackingDerivation=null,N}function lt(N){Rn.trackingDerivation=N}function an(N){var C=Rn.allowStateReads;return Rn.allowStateReads=N,C}function tn(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,X=C.length;X--;)C[X].lowestObserverState=sn.UP_TO_DATE}}var Sr=0,li=1,Ei=Object.getOwnPropertyDescriptor((function(){}),"name");Ei&&Ei.configurable;function Yo(N,C,X){var ae=function(){return ti(N,C,X||this,arguments)};return ae.isMobxAction=!0,ae}function ti(N,C,X,ae){var Ee=Nn();try{return C.apply(X,ae)}catch(Ke){throw Ee.error=Ke,Ke}finally{Un(Ee)}}function Nn(N,C,X){var ae=0,Ee=$e();Ki();var Ke={prevDerivation:Ee,prevAllowStateChanges:ur(!0),prevAllowStateReads:an(!0),notifySpy:!1,startTime:ae,actionId:li++,parentActionId:Sr};return Sr=Ke.actionId,Ke}function Un(N){Sr!==N.actionId&&g("invalid action stack. did you forget to finish an action?"),Sr=N.parentActionId,N.error!==void 0&&(Rn.suppressReactionErrors=!0),to(N.prevAllowStateChanges),tn(N.prevAllowStateReads),oa(),lt(N.prevDerivation),N.notifySpy,Rn.suppressReactionErrors=!1}function Zn(N,C){var X,ae=ur(N);try{X=C()}finally{to(ae)}return X}function ur(N){var C=Rn.allowStateChanges;return Rn.allowStateChanges=N,C}function to(N){Rn.allowStateChanges=N}var Lr=(function(N){function C(X,ae,Ee,Ke,wt){Ee===void 0&&(Ee="ObservableValue@"+_()),wt===void 0&&(wt=q.default);var Kt=N.call(this,Ee)||this;return Kt.enhancer=ae,Kt.name=Ee,Kt.equals=wt,Kt.hasUnreportedChange=!1,Kt.value=ae(X,void 0,Ee),Kt}return(function(X,ae){function Ee(){this.constructor=X}ee(X,ae),X.prototype=ae===null?Object.create(ae):(Ee.prototype=ae.prototype,new Ee)})(C,N),C.prototype.dehanceValue=function(X){return this.dehancer!==void 0?this.dehancer(X):X},C.prototype.set=function(X){this.value,(X=this.prepareNewValue(X))!==Rn.UNCHANGED&&this.setNewValue(X)},C.prototype.prepareNewValue=function(X){if(jn(this),Ji(this)){var ae=Cr(this,{object:this,type:"update",newValue:X});if(!ae)return Rn.UNCHANGED;X=ae.newValue}return X=this.enhancer(X,this.value,this.name),this.equals(this.value,X)?Rn.UNCHANGED:X},C.prototype.setNewValue=function(X){var ae=this.value;this.value=X,this.reportChanged(),Ui(this)&&mi(this,{type:"update",object:this,newValue:X,oldValue:ae})},C.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},C.prototype.intercept=function(X){return ga(this,X)},C.prototype.observe=function(X,ae){return ae&&X({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ca(this,X)},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})(V),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="#"+_(),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@"+_(),C.set&&(this.setter=Yo(this.name+"-setter",C.set)),this.equals=C.equals||(C.compareStructural||C.struct?q.structural:q.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(X){X.dependenciesState===sn.UP_TO_DATE&&(X.dependenciesState=sn.POSSIBLY_STALE,X.isTracing!==We.NONE&&Na(X,C),X.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&&g("Cycle detected in computation "+this.name+": "+this.derivation),Rn.inBatch!==0||this.observers.size!==0||this.keepAlive?(Au(this),Dr(this)&&this.trackAndCompute()&&(function(X){X.lowestObserverState!==sn.STALE&&(X.lowestObserverState=sn.STALE,X.observers.forEach((function(ae){ae.dependenciesState===sn.POSSIBLY_STALE?ae.dependenciesState=sn.STALE:ae.dependenciesState===sn.UP_TO_DATE&&(X.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,X=this.dependenciesState===sn.NOT_TRACKING,ae=this.computeValue(!0),Ee=X||br(C)||br(ae)||!this.equals(C,ae);return Ee&&(this.value=ae),Ee},N.prototype.computeValue=function(C){var X;if(this.isComputing=!0,Rn.computationDepth++,C)X=ko(this,this.derivation,this.scope);else if(Rn.disableErrorBoundaries===!0)X=this.derivation.call(this.scope);else try{X=this.derivation.call(this.scope)}catch(ae){X=new Gn(ae)}return Rn.computationDepth--,this.isComputing=!1,X},N.prototype.suspend=function(){this.keepAlive||(Se(this),this.value=void 0)},N.prototype.observe=function(C,X){var ae=this,Ee=!0,Ke=void 0;return Sc((function(){var wt=ae.get();if(!Ee||X){var Kt=$e();C({type:"update",object:ae,newValue:wt,oldValue:Ke}),lt(Kt)}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 ha=!0,$s=!1,Rn=(function(){var N=gc();return N.__mobxInstanceCount>0&&!N.__mobxGlobals&&(ha=!1),N.__mobxGlobals&&N.__mobxGlobals.version!==new as().version&&(ha=!1),ha?N.__mobxGlobals?(N.__mobxInstanceCount+=1,N.__mobxGlobals.UNCHANGED||(N.__mobxGlobals.UNCHANGED={}),N.__mobxGlobals):(N.__mobxInstanceCount=1,N.__mobxGlobals=new as):(setTimeout((function(){$s||g("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 X=N[C];X.isPendingUnobservation=!1,X.observers.size===0&&(X.isBeingObserved&&(X.isBeingObserved=!1,X.onBecomeUnobserved()),X instanceof za&&X.suspend())}Rn.pendingUnobservations=[]}}function Au(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 Na(N,C){if(N.isTracing===We.BREAK){var X=[];va(Uo(N),X,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:
`+X.join(`
`)+`
*/
`)()}}function va(N,C,X){C.length>=1e3?C.push("(and many more)"):(C.push(""+new Array(X).join(" ")+N.name),N.dependencies&&N.dependencies.forEach((function(ae){return va(ae,C,X+1)})))}var Pa=(function(){function N(C,X,ae,Ee){C===void 0&&(C="Reaction@"+_()),Ee===void 0&&(Ee=!1),this.name=C,this.onInvalidate=X,this.errorHandler=ae,this.requiresObservable=Ee,this.observing=[],this.newObserving=[],this.dependenciesState=sn.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+_(),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 X=ko(this,C,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Se(this),br(X)&&this.reportExceptionInDerivation(X.cause),oa()}},N.prototype.reportExceptionInDerivation=function(C){var X=this;if(this.errorHandler)this.errorHandler(C,this);else{if(Rn.disableErrorBoundaries)throw C;Rn.suppressReactionErrors,Rn.globalReactionErrorHandlers.forEach((function(ae){return ae(C,X)}))}},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 X=[],ae=0;ae<arguments.length;ae++)X[ae]=arguments[ae];var Ee=!1;typeof X[X.length-1]=="boolean"&&(Ee=X.pop());var Ke=Vr(X);if(!Ke)return g(!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 X=N.splice(0),ae=0,Ee=X.length;ae<Ee;ae++)X[ae].runReaction()}Rn.isRunningReactions=!1}var Fs=I("Reaction",Pa);function $d(N){var C=bc;bc=function(X){return N((function(){return C(X)}))}}function Ec(N){return function(){}}function rp(){g(!1)}function Il(N){return function(C,X,ae){if(ae){if(ae.value)return{value:Yo(N,ae.value),enumerable:!1,configurable:!0,writable:!0};var Ee=ae.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,X,ae){Object.defineProperty(C,X,{configurable:!0,enumerable:!1,get:function(){},set:function(Ee){T(this,X,gl(N,Ee))}})}}var gl=function(N,C,X,ae){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):ae!==!0?Il(C).apply(null,arguments):void T(N,C,Yo(N.name||C,X.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 Mu(N){return typeof N=="function"&&N.isMobxAction===!0}function xc(N,C,X){T(N,C,Yo(C,X.bind(N)))}function Sc(N,C){C===void 0&&(C=f);var X,ae=C&&C.name||N.name||"Autorun@"+_();if(!C.scheduler&&!C.delay)X=new Pa(ae,(function(){this.track(wt)}),C.onError,C.requiresObservable);else{var Ee=Bd(C),Ke=!1;X=new Pa(ae,(function(){Ke||(Ke=!0,Ee((function(){Ke=!1,X.isDisposed||X.track(wt)})))}),C.onError,C.requiresObservable)}function wt(){N(X)}return X.schedule(),X.getDisposer()}gl.bound=function(N,C,X,ae){return ae===!0?(xc(N,C,X.value),null):X?{configurable:!0,enumerable:!1,get:function(){return xc(this,C,X.value||X.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,X){X===void 0&&(X=f);var ae,Ee,Ke,wt=X.name||"Reaction@"+_(),Kt=gl(wt,X.onError?(ae=X.onError,Ee=C,function(){try{return Ee.apply(this,arguments)}catch(To){ae.call(this,To)}}):C),Sn=!X.scheduler&&!X.delay,Or=Bd(X),vn=!0,qr=!1,gr=X.compareStructural?q.structural:X.equals||q.default,Fr=new Pa(wt,(function(){vn||Sn?la():qr||(qr=!0,Or(la))}),X.onError,X.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&&X.fireImmediately&&Kt(Ke,Fr),vn||To!==!0||Kt(Ke,Fr),vn&&(vn=!1)}}return Fr.schedule(),Fr.getDisposer()}function Xr(N,C,X){return Vd("onBecomeUnobserved",N,C,X)}function Vd(N,C,X,ae){var Ee=typeof ae=="function"?aa(C,X):aa(C),Ke=typeof ae=="function"?ae:X,wt=N+"Listeners";return Ee[wt]?Ee[wt].add(Ke):Ee[wt]=new Set([Ke]),typeof Ee[N]!="function"?g(!1):function(){var Kt=Ee[wt];Kt&&(Kt.delete(Ke),Kt.size===0&&delete Ee[wt])}}function ls(N){var C=N.enforceActions,X=N.computedRequiresReaction,ae=N.computedConfigurable,Ee=N.disableErrorBoundaries,Ke=N.reactionScheduler,wt=N.reactionRequiresObservable,Kt=N.observableRequiresReaction;if(N.isolateGlobalState===!0&&((Rn.pendingReactions.length||Rn.inBatch||Rn.isRunningReactions)&&g("isolateGlobalState should be called before MobX is running any reactions"),$s=!0,ha&&(--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:g("Invalid value for 'enforceActions': '"+C+"', expected 'never', 'always' or 'observed'")}Rn.enforceActions=Sn,Rn.allowStateChanges=Sn!==!0&&Sn!=="strict"}X!==void 0&&(Rn.computedRequiresReaction=!!X),wt!==void 0&&(Rn.reactionRequiresObservable=!!wt),Kt!==void 0&&(Rn.observableRequiresReaction=!!Kt,Rn.allowStateReads=!Rn.observableRequiresReaction),ae!==void 0&&(Rn.computedConfigurable=!!ae),Ee!==void 0&&(Rn.disableErrorBoundaries=!!Ee),Ke&&$d(Ke)}function ma(N,C,X,ae){var Ee=ku(ae=Re(ae));return Be(N),ia(N,ae.name,Ee.enhancer),C&&Ud(N,C,X,Ee),N}function ku(N){return N.defaultDecorator||(N.deep===!1?bt:Ye)}function Ud(N,C,X,ae){var Ee,Ke;Ki();try{var wt=Y(C);try{for(var Kt=ie(wt),Sn=Kt.next();!Sn.done;Sn=Kt.next()){var Or=Sn.value,vn=Object.getOwnPropertyDescriptor(C,Or),qr=(X&&Or in X?X[Or]:vn.get?yn:ae)(N,Or,vn,!0);qr&&Object.defineProperty(N,Or,qr)}}catch(gr){Ee={error:gr}}finally{try{Sn&&!Sn.done&&(Ke=Kt.return)&&Ke.call(Kt)}finally{if(Ee)throw Ee.error}}}finally{oa()}}function Uo(N,C){return Ll(aa(N,C))}function Ll(N){var C,X,ae={name:N.name};return N.observing&&N.observing.length>0&&(ae.dependencies=(C=N.observing,X=[],C.forEach((function(Ee){X.indexOf(Ee)===-1&&X.push(Ee)})),X).map(Ll)),ae}var $l=0;function Tu(){this.message="FLOW_CANCELLED"}function ss(N){arguments.length!==1&&g("Flow expects 1 argument and cannot be used as decorator");var C=N.name||"<unnamed flow>";return function(){var X,ae=this,Ee=arguments,Ke=++$l,wt=gl(C+" - runid: "+Ke+" - init",N).apply(ae,Ee),Kt=void 0,Sn=new Promise((function(Or,vn){var qr=0;function gr(To){var ea;Kt=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;Kt=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):(Kt=Promise.resolve(To.value)).then(gr,Fr);To.then(la,vn)}X=vn,gr(void 0)}));return Sn.cancel=gl(C+" - runid: "+Ke+" - cancel",(function(){try{Kt&&Oi(Kt);var Or=wt.return(void 0),vn=Promise.resolve(Or.value);vn.then(A,A),Oi(vn),X(new Tu)}catch(qr){X(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 X=aa(N,C);return yl(X)}return yl(N)}function Wd(N){return arguments.length>1?g(!1):Ac(N)}function Mc(N,C){return typeof C!="string"?g(!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]||z(N)||Fs(N)||yl(N))}function si(N){return arguments.length!==1&&g(!1),$i(N)}function ya(N){return ci(N)?N[B].getKeys():Ko(N)||ni(N)?Array.from(N.keys()):_a(N)?N.map((function(C,X){return X})):g(!1)}function lo(N){return ci(N)?ya(N).map((function(C){return N[C]})):Ko(N)?ya(N).map((function(C){return N.get(C)})):ni(N)?Array.from(N.values()):_a(N)?N.slice():g(!1)}function ip(N){return ci(N)?ya(N).map((function(C){return[C,N[C]]})):Ko(N)?ya(N).map((function(C){return[C,N.get(C)]})):ni(N)?Array.from(N.entries()):_a(N)?N.map((function(C,X){return[X,C]})):g(!1)}function Fi(N,C,X){if(arguments.length!==2||ni(N))if(ci(N)){var ae=N[B],Ee=ae.values.get(C);Ee?ae.write(C,X):ae.addObservableProp(C,X,ae.defaultEnhancer)}else if(Ko(N))N.set(C,X);else if(ni(N))N.add(C);else{if(!_a(N))return g(!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]=X,oa()}else{Ki();var Ke=C;try{for(var wt in Ke)Fi(N,wt,Ke[wt])}finally{oa()}}}function Gd(N,C,X,ae){return typeof X=="function"?(function(Ee,Ke,wt,Kt){return ji(Ee,Ke).observe(wt,Kt)})(N,C,X,ae):(function(Ee,Ke,wt){return ji(Ee).observe(Ke,wt)})(N,C,X)}Tu.prototype=Object.create(Error.prototype);var zd={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Bi(N,C,X,ae){return ae.detectCycles&&N.set(C,X),X}function Zi(N,C,X){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,X);if(si(N)&&ya(N),C.detectCycles===!0&&N!==null&&X.has(N))return X.get(N);if(_a(N)||Array.isArray(N)){var ae=Bi(X,N,[],C),Ee=N.map((function(gr){return Zi(gr,C,X)}));ae.length=Ee.length;for(var Ke=0,wt=Ee.length;Ke<wt;Ke++)ae[Ke]=Ee[Ke];return ae}if(ni(N)||Object.getPrototypeOf(N)===Set.prototype){if(C.exportMapsAsObjects===!1){var Kt=Bi(X,N,new Set,C);return N.forEach((function(gr){Kt.add(Zi(gr,C,X))})),Kt}var Sn=Bi(X,N,[],C);return N.forEach((function(gr){Sn.push(Zi(gr,C,X))})),Sn}if(Ko(N)||Object.getPrototypeOf(N)===Map.prototype){if(C.exportMapsAsObjects===!1){var Or=Bi(X,N,new Map,C);return N.forEach((function(gr,Fr){Or.set(Fr,Zi(gr,C,X))})),Or}var vn=Bi(X,N,{},C);return N.forEach((function(gr,Fr){vn[Fr]=Zi(gr,C,X)})),vn}var qr=Bi(X,N,{},C);return L(N).forEach((function(gr){qr[gr]=Zi(N[gr],C,X)})),qr}function kc(N,C){var X;return typeof C=="boolean"&&(C={detectCycles:C}),C||(C=zd),C.detectCycles=C.detectCycles===void 0?C.recurseEverything===!0:C.detectCycles===!0,C.detectCycles&&(X=new Map),Zi(N,C,X)}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 Nu(N,C,X){return arguments.length===1||C&&typeof C=="object"?Tc(N,C):Hd(N,C,X||{})}function Hd(N,C,X){var ae;typeof X.timeout=="number"&&(ae=setTimeout((function(){if(!Ke[B].isDisposed){Ke();var wt=new Error("WHEN_TIMEOUT");if(!X.onError)throw wt;X.onError(wt)}}),X.timeout)),X.name=X.name||"When@"+_();var Ee=Yo(X.name+"-effect",C),Ke=Sc((function(wt){N()&&(wt.dispose(),ae&&clearTimeout(ae),Ee())}),X);return Ke}function Tc(N,C){var X,ae=new Promise((function(Ee,Ke){var wt=Hd(N,Ee,ue(ue({},C),{onError:Ke}));X=function(){wt(),Ke("WHEN_CANCELLED")}}));return ae.cancel=X,ae}function Pu(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===Ne)return!0;var X=Pu(N);return Ha(C)?X.has(C):C in N},get:function(N,C){if(C===B||C==="constructor"||C===Ne)return N[C];var X=Pu(N),ae=X.values.get(C);if(ae instanceof V){var Ee=ae.get();return Ee===void 0&&X.has(C),Ee}return Ha(C)&&X.has(C),N[C]},set:function(N,C,X){return!!Ha(C)&&(Fi(N,C,X),!0)},deleteProperty:function(N,C){return!!Ha(C)&&(Pu(N).remove(C),!0)},ownKeys:function(N){return Pu(N).keysAtom.reportObserved(),Reflect.ownKeys(N)},preventExtensions:function(N){return g("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 ga(N,C){var X=N.interceptors||(N.interceptors=[]);return X.push(C),x((function(){var ae=X.indexOf(C);ae!==-1&&X.splice(ae,1)}))}function Cr(N,C){var X=$e();try{for(var ae=De(N.interceptors||[]),Ee=0,Ke=ae.length;Ee<Ke&&(b(!(C=ae[Ee](C))||C.type,"Intercept handlers should return nothing or a change object"),C);Ee++);return C}finally{lt(X)}}function Ui(N){return N.changeListeners!==void 0&&N.changeListeners.length>0}function Ca(N,C){var X=N.changeListeners||(N.changeListeners=[]);return X.push(C),x((function(){var ae=X.indexOf(C);ae!==-1&&X.splice(ae,1)}))}function mi(N,C){var X=$e(),ae=N.changeListeners;if(ae){for(var Ee=0,Ke=(ae=ae.slice()).length;Ee<Ke;Ee++)ae[Ee](C);lt(X)}}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,X){return C==="length"&&N[B].setArrayLength(X),typeof C=="number"&&mo.set.call(N,C,X),typeof C=="symbol"||isNaN(C)?N[C]=X:mo.set.call(N,parseInt(C),X),!0},preventExtensions:function(N){return g("Observable arrays cannot be frozen"),!1}};function Fl(N,C,X,ae){X===void 0&&(X="ObservableArray@"+_()),ae===void 0&&(ae=!1);var Ee,Ke,wt,Kt=new Ra(X,C,ae);Ee=Kt.values,Ke=B,wt=Kt,Object.defineProperty(Ee,Ke,{enumerable:!1,writable:!1,configurable:!0,value:wt});var Sn=new Proxy(Kt.values,cs);if(Kt.proxy=Sn,N&&N.length){var Or=ur(!0);Kt.spliceWithArray(0,0,N),to(Or)}return Sn}var Ra=(function(){function N(C,X,ae){this.owned=ae,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new V(C||"ObservableArray@"+_()),this.enhancer=function(Ee,Ke){return X(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 ga(this,C)},N.prototype.observe=function(C,X){return X===void 0&&(X=!1),X&&C({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ca(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 X=this.values.length;if(C!==X)if(C>X){for(var ae=new Array(C-X),Ee=0;Ee<C-X;Ee++)ae[Ee]=void 0;this.spliceWithArray(X,0,ae)}else this.spliceWithArray(C,X-C)},N.prototype.updateArrayLength=function(C,X){if(C!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=X},N.prototype.spliceWithArray=function(C,X,ae){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)),X=arguments.length===1?Ke-C:X==null?0:Math.max(0,Math.min(X,Ke-C)),ae===void 0&&(ae=v),Ji(this)){var wt=Cr(this,{object:this.proxy,type:"splice",index:C,removedCount:X,added:ae});if(!wt)return v;X=wt.removedCount,ae=wt.added}ae=ae.length===0?ae:ae.map((function(Sn){return Ee.enhancer(Sn,void 0)}));var Kt=this.spliceItemsIntoValues(C,X,ae);return X===0&&ae.length===0||this.notifyArraySplice(C,ae,Kt),this.dehanceValues(Kt)},N.prototype.spliceItemsIntoValues=function(C,X,ae){var Ee;if(ae.length<1e4)return(Ee=this.values).splice.apply(Ee,De([C,X],ae));var Ke=this.values.slice(C,C+X);return this.values=this.values.slice(0,C).concat(ae,this.values.slice(C+X)),Ke},N.prototype.notifyArrayChildUpdate=function(C,X,ae){var Ee=!this.owned&&!1,Ke=Ui(this),wt=Ke||Ee?{object:this.proxy,type:"update",index:C,newValue:X,oldValue:ae}:null;this.atom.reportChanged(),Ke&&mi(this,wt)},N.prototype.notifyArraySplice=function(C,X,ae){var Ee=!this.owned&&!1,Ke=Ui(this),wt=Ke||Ee?{object:this.proxy,type:"splice",index:C,removed:ae,added:X,removedCount:ae.length,addedCount:X.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 X=[],ae=2;ae<arguments.length;ae++)X[ae-2]=arguments[ae];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,X)},spliceWithArray:function(N,C,X){return this[B].spliceWithArray(N,C,X)},push:function(){for(var N=[],C=0;C<arguments.length;C++)N[C]=arguments[C];var X=this[B];return X.spliceWithArray(X.values.length,0,N),X.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 X=this[B];return X.spliceWithArray(0,0,N),X.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],X=C.dehanceValues(C.values).indexOf(N);return X>-1&&(this.splice(X,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 X=this[B],ae=X.values;if(N<ae.length){jn(X.atom);var Ee=ae[N];if(Ji(X)){var Ke=Cr(X,{type:"update",object:X.proxy,index:N,newValue:C});if(!Ke)return;C=Ke.newValue}(C=X.enhancer(C,Ee))!==Ee&&(ae[N]=C,X.notifyArrayChildUpdate(N,C,Ee))}else{if(N!==ae.length)throw new Error("[mobx.array] Index out of bounds, "+N+" is larger than "+ae.length);X.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 X=C.dehanceValues(C.values);return X[N].apply(X,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(N){typeof Array.prototype[N]=="function"&&(mo[N]=function(C,X){var ae=this,Ee=this[B];return Ee.atom.reportObserved(),Ee.dehanceValues(Ee.values)[N]((function(Ke,wt){return C.call(X,Ke,wt,ae)}),X)})})),["reduce","reduceRight"].forEach((function(N){mo[N]=function(){var C=this,X=this[B];X.atom.reportObserved();var ae=arguments[0];return arguments[0]=function(Ee,Ke,wt){return Ke=X.dehanceValue(Ke),ae(Ee,Ke,wt,C)},X.values[N].apply(X.values,arguments)}}));var Bs,Xa=I("ObservableArrayAdministration",Ra);function _a(N){return S(N)&&Xa(N[B])}var Nc,ap={},Pc=(function(){function N(C,X,ae){if(X===void 0&&(X=He),ae===void 0&&(ae="ObservableMap@"+_()),this.enhancer=X,this.name=ae,this[Bs]=ap,this._keysAtom=H(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 X=this;if(!Rn.trackingDerivation)return this._has(C);var ae=this._hasMap.get(C);if(!ae){var Ee=ae=new Lr(this._has(C),Qt,this.name+"."+D(C)+"?",!1);this._hasMap.set(C,Ee),Xr(Ee,(function(){return X._hasMap.delete(C)}))}return ae.get()},N.prototype.set=function(C,X){var ae=this._has(C);if(Ji(this)){var Ee=Cr(this,{type:ae?"update":"add",object:this,newValue:X,name:C});if(!Ee)return this;X=Ee.newValue}return ae?this._updateValue(C,X):this._addValue(C,X),this},N.prototype.delete=function(C){var X=this;if(jn(this._keysAtom),Ji(this)&&!(Ee=Cr(this,{type:"delete",object:this,name:C})))return!1;if(this._has(C)){var ae=Ui(this),Ee=ae?{type:"delete",object:this,oldValue:this._data.get(C).value,name:C}:null;return ui((function(){X._keysAtom.reportChanged(),X._updateHasMapEntry(C,!1),X._data.get(C).setNewValue(void 0),X._data.delete(C)})),ae&&mi(this,Ee),!0}return!1},N.prototype._updateHasMapEntry=function(C,X){var ae=this._hasMap.get(C);ae&&ae.setNewValue(X)},N.prototype._updateValue=function(C,X){var ae=this._data.get(C);if((X=ae.prepareNewValue(X))!==Rn.UNCHANGED){var Ee=Ui(this),Ke=Ee?{type:"update",object:this,oldValue:ae.value,name:C,newValue:X}:null;ae.setNewValue(X),Ee&&mi(this,Ke)}},N.prototype._addValue=function(C,X){var ae=this;jn(this._keysAtom),ui((function(){var wt=new Lr(X,ae.enhancer,ae.name+"."+D(C),!1);ae._data.set(C,wt),X=wt.value,ae._updateHasMapEntry(C,!0),ae._keysAtom.reportChanged()}));var Ee=Ui(this),Ke=Ee?{type:"add",object:this,name:C,newValue:X}: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,X=this.keys();return Rr({next:function(){var ae=X.next(),Ee=ae.done,Ke=ae.value;return{done:Ee,value:Ee?void 0:C.get(Ke)}}})},N.prototype.entries=function(){var C=this,X=this.keys();return Rr({next:function(){var ae=X.next(),Ee=ae.done,Ke=ae.value;return{done:Ee,value:Ee?void 0:[Ke,C.get(Ke)]}}})},N.prototype[Bs=B,Symbol.iterator]=function(){return this.entries()},N.prototype.forEach=function(C,X){var ae,Ee;try{for(var Ke=ie(this),wt=Ke.next();!wt.done;wt=Ke.next()){var Kt=be(wt.value,2),Sn=Kt[0],Or=Kt[1];C.call(X,Or,Sn,this)}}catch(vn){ae={error:vn}}finally{try{wt&&!wt.done&&(Ee=Ke.return)&&Ee.call(Ke)}finally{if(ae)throw ae.error}}},N.prototype.merge=function(C){var X=this;return Ko(C)&&(C=C.toJS()),ui((function(){var ae=ur(!0);try{E(C)?L(C).forEach((function(Ee){return X.set(Ee,C[Ee])})):Array.isArray(C)?C.forEach((function(Ee){var Ke=be(Ee,2),wt=Ke[0],Kt=Ke[1];return X.set(wt,Kt)})):R(C)?(C.constructor!==Map&&g("Cannot initialize from classes that inherit from Map: "+C.constructor.name),C.forEach((function(Ee,Ke){return X.set(Ke,Ee)}))):C!=null&&g("Cannot initialize map from "+C)}finally{to(ae)}})),this},N.prototype.clear=function(){var C=this;ui((function(){Qe((function(){var X,ae;try{for(var Ee=ie(C.keys()),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=Ke.value;C.delete(wt)}}catch(Kt){X={error:Kt}}finally{try{Ke&&!Ke.done&&(ae=Ee.return)&&ae.call(Ee)}finally{if(X)throw X.error}}}))}))},N.prototype.replace=function(C){var X=this;return ui((function(){var ae,Ee,Ke,wt,Kt=(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 g("Cannot convert to map from '"+ri+"'")})(C),Sn=new Map,Or=!1;try{for(var vn=ie(X._data.keys()),qr=vn.next();!qr.done;qr=vn.next()){var gr=qr.value;if(!Kt.has(gr))if(X.delete(gr))Or=!0;else{var Fr=X._data.get(gr);Sn.set(gr,Fr)}}}catch(ri){ae={error:ri}}finally{try{qr&&!qr.done&&(Ee=vn.return)&&Ee.call(vn)}finally{if(ae)throw ae.error}}try{for(var la=ie(Kt.entries()),To=la.next();!To.done;To=la.next()){var ea=be(To.value,2),_l=(gr=ea[0],Fr=ea[1],X._data.has(gr));if(X.set(gr,Fr),X._data.has(gr)){var bl=X._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(X._data.size!==Sn.size)X._keysAtom.reportChanged();else for(var Bl=X._data.keys(),ds=Sn.keys(),Ya=Bl.next(),fs=ds.next();!Ya.done;){if(Ya.value!==fs.value){X._keysAtom.reportChanged();break}Ya=Bl.next(),fs=ds.next()}X._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,X,ae={};try{for(var Ee=ie(this),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=be(Ke.value,2),Kt=wt[0],Sn=wt[1];ae[typeof Kt=="symbol"?Kt:D(Kt)]=Sn}}catch(Or){C={error:Or}}finally{try{Ke&&!Ke.done&&(X=Ee.return)&&X.call(Ee)}finally{if(C)throw C.error}}return ae},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(X){return D(X)+": "+C.get(X)})).join(", ")+" }]"},N.prototype.observe=function(C,X){return Ca(this,C)},N.prototype.intercept=function(C){return ga(this,C)},N})(),Ko=I("ObservableMap",Pc),Vs={},qa=(function(){function N(C,X,ae){if(X===void 0&&(X=He),ae===void 0&&(ae="ObservableSet@"+_()),this.name=ae,this[Nc]=Vs,this._data=new Set,this._atom=H(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 X(Ee,Ke,ae)},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 X,ae;try{for(var Ee=ie(C._data.values()),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=Ke.value;C.delete(wt)}}catch(Kt){X={error:Kt}}finally{try{Ke&&!Ke.done&&(ae=Ee.return)&&ae.call(Ee)}finally{if(X)throw X.error}}}))}))},N.prototype.forEach=function(C,X){var ae,Ee;try{for(var Ke=ie(this),wt=Ke.next();!wt.done;wt=Ke.next()){var Kt=wt.value;C.call(X,Kt,Kt,this)}}catch(Sn){ae={error:Sn}}finally{try{wt&&!wt.done&&(Ee=Ke.return)&&Ee.call(Ke)}finally{if(ae)throw ae.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 X=this;if(jn(this._atom),Ji(this)&&!(Ee=Cr(this,{type:"add",object:this,newValue:C})))return this;if(!this.has(C)){ui((function(){X._data.add(X.enhancer(C,void 0)),X._atom.reportChanged()}));var ae=Ui(this),Ee=ae?{type:"add",object:this,newValue:C}:null;ae&&mi(this,Ee)}return this},N.prototype.delete=function(C){var X=this;if(Ji(this)&&!(Ee=Cr(this,{type:"delete",object:this,oldValue:C})))return!1;if(this.has(C)){var ae=Ui(this),Ee=ae?{type:"delete",object:this,oldValue:C}:null;return ui((function(){X._atom.reportChanged(),X._data.delete(C)})),ae&&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,X=Array.from(this.keys()),ae=Array.from(this.values());return Rr({next:function(){var Ee=C;return C+=1,Ee<ae.length?{value:[X[Ee],ae[Ee]],done:!1}:{done:!0}}})},N.prototype.keys=function(){return this.values()},N.prototype.values=function(){this._atom.reportObserved();var C=this,X=0,ae=Array.from(this._data.values());return Rr({next:function(){return X<ae.length?{value:C.dehanceValue(ae[X++]),done:!1}:{done:!0}}})},N.prototype.replace=function(C){var X=this;return ni(C)&&(C=C.toJS()),ui((function(){var ae=ur(!0);try{Array.isArray(C)||U(C)?(X.clear(),C.forEach((function(Ee){return X.add(Ee)}))):C!=null&&g("Cannot initialize set from "+C)}finally{to(ae)}})),this},N.prototype.observe=function(C,X){return Ca(this,C)},N.prototype.intercept=function(C){return ga(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,X,ae,Ee){X===void 0&&(X=new Map),this.target=C,this.values=X,this.name=ae,this.defaultEnhancer=Ee,this.keysAtom=new V(ae+".keys")}return N.prototype.read=function(C){return this.values.get(C).get()},N.prototype.write=function(C,X){var ae=this.target,Ee=this.values.get(C);if(Ee instanceof za)Ee.set(X);else{if(Ji(this)){if(!(wt=Cr(this,{type:"update",object:this.proxy||ae,name:C,newValue:X})))return;X=wt.newValue}if((X=Ee.prepareNewValue(X))!==Rn.UNCHANGED){var Ke=Ui(this),wt=Ke?{type:"update",object:this.proxy||ae,oldValue:Ee.value,name:C,newValue:X}:null;Ee.setNewValue(X),Ke&&mi(this,wt)}}},N.prototype.has=function(C){var X=this.pendingKeys||(this.pendingKeys=new Map),ae=X.get(C);if(ae)return ae.get();var Ee=!!this.values.get(C);return ae=new Lr(Ee,Qt,this.name+"."+D(C)+"?",!1),X.set(C,ae),ae.get()},N.prototype.addObservableProp=function(C,X,ae){ae===void 0&&(ae=this.defaultEnhancer);var Ee=this.target;if(Ji(this)){var Ke=Cr(this,{object:this.proxy||Ee,name:C,type:"add",newValue:X});if(!Ke)return;X=Ke.newValue}var wt=new Lr(X,ae,this.name+"."+D(C),!1);this.values.set(C,wt),X=wt.value,Object.defineProperty(Ee,C,(function(Kt){return ba[Kt]||(ba[Kt]={configurable:!0,enumerable:!0,get:function(){return this[B].read(Kt)},set:function(Sn){this[B].write(Kt,Sn)}})})(C)),this.notifyPropertyAddition(C,X)},N.prototype.addComputedProp=function(C,X,ae){var Ee,Ke,wt,Kt=this.target;ae.name=ae.name||this.name+"."+D(X),this.values.set(X,new za(ae)),(C===Kt||(Ee=C,Ke=X,!(wt=Object.getOwnPropertyDescriptor(Ee,Ke))||wt.configurable!==!1&&wt.writable!==!1))&&Object.defineProperty(C,X,(function(Sn){return Cu[Sn]||(Cu[Sn]={configurable:Rn.computedConfigurable,enumerable:!1,get:function(){return Wi(this).read(Sn)},set:function(Or){Wi(this).write(Sn,Or)}})})(X))},N.prototype.remove=function(C){if(this.values.has(C)){var X=this.target;if(Ji(this)&&!(Sn=Cr(this,{object:this.proxy||X,name:C,type:"remove"})))return;try{Ki();var ae=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 Kt=this.pendingKeys.get(C);Kt&&Kt.set(!1)}delete this.target[C];var Sn=ae?{type:"remove",object:this.proxy||X,oldValue:wt,name:C}:null;ae&&mi(this,Sn)}finally{oa()}}},N.prototype.illegalAccess=function(C,X){},N.prototype.observe=function(C,X){return Ca(this,C)},N.prototype.intercept=function(C){return ga(this,C)},N.prototype.notifyPropertyAddition=function(C,X){var ae=Ui(this),Ee=ae?{type:"add",object:this.proxy||this.target,name:C,newValue:X}:null;if(ae&&mi(this,Ee),this.pendingKeys){var Ke=this.pendingKeys.get(C);Ke&&Ke.set(!0)}this.keysAtom.reportChanged()},N.prototype.getKeys=function(){var C,X;this.keysAtom.reportObserved();var ae=[];try{for(var Ee=ie(this.values),Ke=Ee.next();!Ke.done;Ke=Ee.next()){var wt=be(Ke.value,2),Kt=wt[0];wt[1]instanceof Lr&&ae.push(Kt)}}catch(Sn){C={error:Sn}}finally{try{Ke&&!Ke.done&&(X=Ee.return)&&X.call(Ee)}finally{if(C)throw C.error}}return ae},N})();function ia(N,C,X){if(C===void 0&&(C=""),X===void 0&&(X=He),Object.prototype.hasOwnProperty.call(N,B))return N[B];E(N)||(C=(N.constructor.name||"ObservableObject")+"@"+_()),C||(C="ObservableObject@"+_());var ae=new Cc(N,new Map,D(C),X);return T(N,B,ae),ae}var ba=Object.create(null),Cu=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!!S(N)&&(Be(N),Qi(N[B]))}function aa(N,C){if(typeof N=="object"&&N!==null){if(_a(N))return C!==void 0&&g(!1),N[B].atom;if(ni(N))return N[B];if(Ko(N)){var X=N;return C===void 0?X._keysAtom:((ae=X._data.get(C)||X._hasMap.get(C))||g(!1),ae)}var ae;if(Be(N),C&&!N[B]&&N[C],ci(N))return C?((ae=N[B].values.get(C))||g(!1),ae):g(!1);if(z(N)||yl(N)||Fs(N))return N}else if(typeof N=="function"&&Fs(N[B]))return N[B];return g(!1)}function ji(N,C){return N||g("Expecting some object"),C!==void 0?ji(aa(N,C)):z(N)||yl(N)||Fs(N)||Ko(N)||ni(N)?N:(Be(N),N[B]?N[B]:void g(!1))}var vt=Object.prototype.toString;function Vt(N,C,X){return X===void 0&&(X=-1),Ut(N,C,X)}function Ut(N,C,X,ae,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]":X>=0&&X++}N=bn(N),C=bn(C);var Kt=wt==="[object Array]";if(!Kt){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(X===0)return!1;X<0&&(X=-1),Ee=Ee||[];for(var vn=(ae=ae||[]).length;vn--;)if(ae[vn]===N)return Ee[vn]===C;if(ae.push(N),Ee.push(C),Kt){if((vn=N.length)!==C.length)return!1;for(;vn--;)if(!Ut(N[vn],C[vn],X-1,ae,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],X-1,ae,Ee))return!1}return ae.pop(),Ee.pop(),!0}function bn(N){return _a(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),_=r(116),g="Array Iterator",b=f.set,x=f.getterFor(g);n.exports=_(Array,"Array",(function(A,S){b(this,{type:g,target:s(A),index:0,kind:S})}),(function(){var A=x(this),S=A.target,E=A.kind,T=A.index++;return!S||T>=S.length?(A.target=void 0,{value:void 0,done:!0}):E=="keys"?{value:T,done:!1}:E=="values"?{value:S[T],done:!1}:{value:[T,S[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),_=r(34),g=r(15),b=r(71),x=r(36),A=r(108),S=r(18),E=r(35),T=r(96),I=r(30),R=r(33),U=r(54),L=r(87),D=r(32),W=r(40),Y=r(41),B=r(86),V=r(39),z=r(69),H=r(60),q=r(77),ee=r(74),ue=r(139),ie=r(112),be=r(50),De=r(38),Ne=r(84),Ae=r(98),Te=r(42),rt=r(89),tt=r(93),Be=r(72),dt=r(90),St=r(28),He=r(140),Qt=r(141),Fe=r(78),we=r(58),Re=r(79).forEach,Ye=tt("hidden"),Ot="Symbol",bt=St("toPrimitive"),Ft=we.set,en=we.getterFor(Ot),on=Object.prototype,Wt=c.Symbol,nt=Wt&&Wt.prototype,sn=c.TypeError,We=c.QObject,yn=v("JSON","stringify"),Kn=be.f,te=De.f,Gn=ue.f,br=Ne.f,Dr=g([].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,lt=x&&S((function(){return H(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]=H(nt);return Ft(Zn,{type:Ot,tag:Nn,description:Un}),x||(Zn.description=Un),Zn},tn=function(Nn,Un,Zn){Nn===on&&tn(jn,Un,Zn),D(Nn);var ur=B(Un);return D(Zn),E(zr,ur)?(Zn.enumerable?(E(Nn,Ye)&&Nn[Ye][ur]&&(Nn[Ye][ur]=!1),Zn=H(Zn,{enumerable:z(0,!1)})):(E(Nn,Ye)||te(Nn,Ye,z(1,{})),Nn[Ye][ur]=!0),lt(Nn,ur,Zn)):te(Nn,ur,Zn)},Tn=function(Nn,Un){D(Nn);var Zn=Y(Un),ur=q(Zn).concat(Yo(Zn));return Re(ur,(function(to){x&&!_(Sr,Zn,to)||tn(Nn,to,Zn[to])})),Nn},Sr=function(Nn){var Un=B(Nn),Zn=_(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=Y(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(Y(Nn)),Zn=[];return Re(Un,(function(ur){E(zr,ur)||E(Be,ur)||Dr(Zn,ur)})),Zn},Yo=function(Nn){var Un=Nn===on,Zn=Gn(Un?jn:Y(Nn)),ur=[];return Re(Zn,(function(to){!E(zr,to)||Un&&!E(on,to)||Dr(ur,zr[to])})),ur};if(A||(Wt=function(){if(U(nt,this))throw sn("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?V(arguments[0]):void 0,Un=dt(Nn),Zn=function(ur){this===on&&_(Zn,jn,ur),E(this,Ye)&&E(this[Ye],Un)&&(this[Ye][Un]=!1),lt(this,Un,z(1,ur))};return x&&$e&&lt(on,Un,{configurable:!0,set:Zn}),an(Un,Nn)},Te(nt=Wt.prototype,"toString",(function(){return en(this).tag})),Te(Wt,"withoutSetter",(function(Nn){return an(dt(Nn),Nn)})),Ne.f=Sr,De.f=tn,be.f=li,ee.f=ue.f=Ei,ie.f=Yo,He.f=function(Nn){return an(St(Nn),Nn)},x&&(te(nt,"description",{configurable:!0,get:function(){return en(this).description}}),b||Te(on,"propertyIsEnumerable",Sr,{unsafe:!0}))),s({global:!0,wrap:!0,forced:!A,sham:!A},{Symbol:Wt}),Re(q(Qe),(function(Nn){Qt(Nn)})),s({target:Ot,stat:!0,forced:!A},{for:function(Nn){var Un=V(Nn);if(E(ko,Un))return ko[Un];var Zn=Wt(Un);return ko[Un]=Zn,Se[Zn]=Un,Zn},keyFor:function(Nn){if(!L(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:!A,sham:!x},{create:function(Nn,Un){return Un===void 0?H(Nn):Tn(H(Nn),Un)},defineProperty:tn,defineProperties:Tn,getOwnPropertyDescriptor:li}),s({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:Ei,getOwnPropertySymbols:Yo}),s({target:"Object",stat:!0,forced:S((function(){ie.f(1)}))},{getOwnPropertySymbols:function(Nn){return ie.f(W(Nn))}}),yn&&s({target:"JSON",stat:!0,forced:!A||S((function(){var Nn=Wt();return yn([Nn])!="[null]"||yn({a:Nn})!="{}"||yn(Object(Nn))!="{}"}))},{stringify:function(Nn,Un,Zn){var ur=Ae(arguments),to=Un;if((R(Un)||Nn!==void 0)&&!L(Nn))return T(Un)||(Un=function(Lr,ml){if(I(to)&&(ml=_(to,this,Lr,ml)),!L(ml))return ml}),ur[1]=Un,f(yn,null,ur)}}),!nt[bt]){var ti=nt.valueOf;Te(nt,bt,(function(Nn){return _(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),_=r(57),g=r(28),b=g("iterator"),x=g("toStringTag"),A=f.values,S=function(T,I){if(T){if(T[b]!==A)try{_(T,b,A)}catch{T[b]=A}if(T[x]||_(T,x,I),c[I]){for(var R in f)if(T[R]!==f[R])try{_(T,R,f[R])}catch{T[R]=f[R]}}}};for(var E in c)S(s[E]&&s[E].prototype,E);S(v,"DOMTokenList")},function(n,a,r){var s=r(151).charAt,c=r(39),v=r(58),f=r(116),_="String Iterator",g=v.set,b=v.getterFor(_);f(String,"String",(function(x){g(this,{type:_,string:c(x),index:0})}),(function(){var x,A=b(this),S=A.string,E=A.index;return E>=S.length?{value:void 0,done:!0}:(x=s(S,E),A.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),_=r(35),g=r(30),b=r(54),x=r(39),A=r(38).f,S=r(134),E=v.Symbol,T=E&&E.prototype;if(c&&g(E)&&(!("description"in T)||E().description!==void 0)){var I={},R=function(){var V=arguments.length<1||arguments[0]===void 0?void 0:x(arguments[0]),z=b(T,this)?new E(V):V===void 0?E():E(V);return V===""&&(I[z]=!0),z};S(R,E),R.prototype=T,T.constructor=R;var U=String(E("test"))=="Symbol(test)",L=f(T.toString),D=f(T.valueOf),W=/^Symbol\((.*)\)[^)]+$/,Y=f("".replace),B=f("".slice);A(T,"description",{configurable:!0,get:function(){var V=D(this),z=L(V);if(_(I,V))return"";var H=U?B(z,7,-1):Y(z,W,"$1");return H===""?void 0:H}}),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 be})),r.d(a,"e",(function(){return Te})),r.d(a,"f",(function(){return De})),r.d(a,"g",(function(){return zr}));var s,c,v,f=r(0),_=0,g=[],b=f.i.__b,x=f.i.__r,A=f.i.diffed,S=f.i.__c,E=f.i.unmount;function T(Se,Qe){f.i.__h&&f.i.__h(c,Se,_||Qe),_=0;var $e=c.__H||(c.__H={__:[],__h:[]});return Se>=$e.__.length&&$e.__.push({}),$e.__[Se]}function I(Se){return _=1,R(ee,Se)}function R(Se,Qe,$e){var lt=T(s++,2);return lt.t=Se,lt.__c||(lt.__=[$e?$e(Qe):ee(void 0,Qe),function(an){var tn=lt.t(lt.__[0],an);lt.__[0]!==tn&&(lt.__=[tn,lt.__[1]],lt.__c.setState({}))}],lt.__c=c),lt.__}function U(Se,Qe){var $e=T(s++,3);!f.i.__s&&q($e.__H,Qe)&&($e.__=Se,$e.__H=Qe,c.__H.__h.push($e))}function L(Se,Qe){var $e=T(s++,4);!f.i.__s&&q($e.__H,Qe)&&($e.__=Se,$e.__H=Qe,c.__h.push($e))}function D(Se,Qe){var $e=T(s++,7);return q($e.__H,Qe)&&($e.__=Se(),$e.__H=Qe,$e.__h=Se),$e.__}function W(Se,Qe){return _=8,D((function(){return Se}),Qe)}function Y(){var Se;for(g.sort((function(Qe,$e){return Qe.__v.__b-$e.__v.__b}));Se=g.pop();)if(Se.__P)try{Se.__H.__h.forEach(z),Se.__H.__h.forEach(H),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(z),Qe.__h.forEach(H),Qe.__h=[])},f.i.diffed=function(Se){A&&A(Se);var Qe=Se.__c;Qe&&Qe.__H&&Qe.__H.__h.length&&(g.push(Qe)!==1&&v===f.i.requestAnimationFrame||((v=f.i.requestAnimationFrame)||V)(Y)),c=null},f.i.__c=function(Se,Qe){Qe.some((function($e){try{$e.__h.forEach(z),$e.__h=$e.__h.filter((function(lt){return!lt.__||H(lt)}))}catch(lt){Qe.some((function(an){an.__h&&(an.__h=[])})),Qe=[],f.i.__e(lt,$e.__v)}})),S&&S(Se,Qe)},f.i.unmount=function(Se){E&&E(Se);var Qe,$e=Se.__c;$e&&$e.__H&&($e.__H.__.forEach((function(lt){try{z(lt)}catch(an){Qe=an}})),Qe&&f.i.__e(Qe,$e.__v))};var B=typeof requestAnimationFrame=="function";function V(Se){var Qe,$e=function(){clearTimeout(lt),B&&cancelAnimationFrame(Qe),setTimeout(Se)},lt=setTimeout($e,100);B&&(Qe=requestAnimationFrame($e))}function z(Se){var Qe=c,$e=Se.__c;typeof $e=="function"&&(Se.__c=void 0,$e()),c=Qe}function H(Se){var Qe=c;Se.__c=Se.__(),c=Qe}function q(Se,Qe){return!Se||Se.length!==Qe.length||Qe.some((function($e,lt){return $e!==Se[lt]}))}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 ie(Se,Qe){for(var $e in Se)if($e!=="__source"&&!($e in Qe))return!0;for(var lt in Qe)if(lt!=="__source"&&Se[lt]!==Qe[lt])return!0;return!1}function be(Se){this.props=Se}function De(Se,Qe){function $e(an){var tn=this.props.ref,Tn=tn==an.ref;return!Tn&&tn&&(tn.call?tn(null):tn.current=null),Qe?!Qe(this.props,an)||!Tn:ie(this.props,an)}function lt(an){return this.shouldComponentUpdate=$e,Object(f.e)(Se,an)}return lt.displayName="Memo("+(Se.displayName||Se.name)+")",lt.prototype.isReactComponent=!0,lt.__f=!0,lt}(be.prototype=new f.a).isPureReactComponent=!0,be.prototype.shouldComponentUpdate=function(Se,Qe){return ie(this.props,Se)||ie(this.state,Qe)};var Ne=f.i.__b;f.i.__b=function(Se){Se.type&&Se.type.__f&&Se.ref&&(Se.props.ref=Se.ref,Se.ref=null),Ne&&Ne(Se)};var Ae=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Te(Se){function Qe($e,lt){var an=ue({},$e);return delete an.ref,Se(an,!(lt=$e.ref||lt)||typeof lt=="object"&&!("current"in lt)?null:lt)}return Qe.$$typeof=Ae,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 lt,an=Qe;an=an.__;)if((lt=an.__c)&&lt.__c)return Qe.__e==null&&(Qe.__e=$e.__e,Qe.__k=$e.__k),lt.__c(Se,Qe)}Be(Se,Qe,$e)};var dt=f.i.unmount;function St(Se,Qe,$e){return Se&&(Se.__c&&Se.__c.__H&&(Se.__c.__H.__.forEach((function(lt){typeof lt.__c=="function"&&lt.__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(lt){return St(lt,Qe,$e)}))),Se}function He(Se,Qe,$e){return Se&&(Se.__v=null,Se.__k=Se.__k&&Se.__k.map((function(lt){return He(lt,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 Qt(){this.__u=0,this.t=null,this.__b=null}function Fe(Se){var Qe=Se.__.__c;return Qe&&Qe.__e&&Qe.__e(Se)}function we(){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),dt&&dt(Se)},(Qt.prototype=new f.a).__c=function(Se,Qe){var $e=Qe.__c,lt=this;lt.t==null&&(lt.t=[]),lt.t.push($e);var an=Fe(lt.__v),tn=!1,Tn=function(){tn||(tn=!0,$e.__R=null,an?an(Sr):Sr())};$e.__R=Tn;var Sr=function(){if(!--lt.__u){if(lt.state.__e){var Ei=lt.state.__e;lt.__v.__k[0]=He(Ei,Ei.__c.__P,Ei.__c.__O)}var Yo;for(lt.setState({__e:lt.__b=null});Yo=lt.t.pop();)Yo.forceUpdate()}},li=Qe.__h===!0;lt.__u++||li||lt.setState({__e:lt.__b=lt.__v.__k[0]}),Se.then(Tn,Tn)},Qt.prototype.componentWillUnmount=function(){this.t=[]},Qt.prototype.render=function(Se,Qe){if(this.__b){if(this.__v.__k){var $e=document.createElement("div"),lt=this.__v.__k[0].__c;this.__v.__k[0]=St(this.__b,$e,lt.__O=lt.__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 Re=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(lt){this.childNodes.push(lt),Qe.i.appendChild(lt)},insertBefore:function(lt,an){this.childNodes.push(lt),Qe.i.appendChild(lt)},removeChild:function(lt){this.childNodes.splice(this.childNodes.indexOf(lt)>>>1,1),Qe.i.removeChild(lt)}}),Object(f.j)(Object(f.e)(Ye,{context:Qe.context},Se.__v),Qe.l)):Qe.l&&Qe.componentWillUnmount()}(we.prototype=new f.a).__e=function(Se){var Qe=this,$e=Fe(Qe.__v),lt=Qe.o.get(Se);return lt[0]++,function(an){var tn=function(){Qe.props.revealOrder?(lt.push(an),Re(Qe,Se,lt)):an()};$e?$e(tn):tn()}},we.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},we.prototype.componentDidUpdate=we.prototype.componentDidMount=function(){var Se=this;this.o.forEach((function(Qe,$e){Re(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]/,en=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,lt=$e;if(typeof Qe=="string"){var an=Qe.indexOf("-")===-1;for(var tn in lt={},$e){var Tn=$e[tn];en&&tn==="children"&&Qe==="noscript"||tn==="value"&&"defaultValue"in $e&&Tn==null||(tn==="defaultValue"&&"value"in $e&&$e.value==null?tn="value":tn==="download"&&Tn===!0?Tn="":/ondoubleclick/i.test(tn)?tn="ondblclick":/^onchange(textarea|input)/i.test(tn+Qe)&&!on($e.type)?tn="oninput":/^onfocus$/i.test(tn)?tn="onfocusin":/^onblur$/i.test(tn)?tn="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(tn)?tn=tn.toLowerCase():an&&Ft.test(tn)?tn=tn.replace(/[A-Z0-9]/,"-$&").toLowerCase():Tn===null&&(Tn=void 0),lt[tn]=Tn)}Qe=="select"&&lt.multiple&&Array.isArray(lt.value)&&(lt.value=Object(f.k)($e.children).forEach((function(Sr){Sr.props.selected=lt.value.indexOf(Sr.props.value)!=-1}))),Qe=="select"&&lt.defaultValue!=null&&(lt.value=Object(f.k)($e.children).forEach((function(Sr){Sr.props.selected=lt.multiple?lt.defaultValue.indexOf(Sr.props.value)!=-1:lt.defaultValue==Sr.props.value}))),Se.props=lt,$e.class!=$e.className&&(Kn.enumerable="className"in $e,$e.className!=null&&(lt.class=$e.className),Object.defineProperty(lt,"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:L,useRef:function(Se){return _=5,D((function(){return{current:Se}}),[])},useImperativeHandle:function(Se,Qe,$e){_=6,L((function(){typeof Se=="function"?Se(Qe()):Se&&(Se.current=Qe())}),$e==null?$e:$e.concat(Se))},useMemo:D,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:be,memo:De,forwardRef:Te,flushSync:function(Se,Qe){return Se(Qe)},unstable_batchedUpdates:zr,StrictMode:jn,Suspense:Qt,SuspenseList:we,lazy:function(Se){var Qe,$e,lt;function an(tn){if(Qe||(Qe=Se()).then((function(Tn){$e=Tn.default||Tn}),(function(Tn){lt=Tn})),lt)throw lt;if(!$e)throw Qe;return Object(f.e)($e,tn)}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),_=r(57),g=function(x){if(x&&x.forEach!==f)try{_(x,"forEach",f)}catch{x.forEach=f}};for(var b in c)c[b]&&g(s[b]&&s[b].prototype);g(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),_=r(143);s({target:"Object",stat:!0,forced:c((function(){f(1)})),sham:!_},{getPrototypeOf:function(g){return f(v(g))}})},function(n,a,r){var s=r(16),c=r(46),v=r(76),f=r(203),_=r(165),g=r(32),b=r(33),x=r(60),A=r(18),S=c("Reflect","construct"),E=Object.prototype,T=[].push,I=A((function(){function L(){}return!(S((function(){}),[],L)instanceof L)})),R=!A((function(){S((function(){}))})),U=I||R;s({target:"Reflect",stat:!0,forced:U,sham:U},{construct:function(L,D){_(L),g(D);var W=arguments.length<3?L:_(arguments[2]);if(R&&!I)return S(L,D,W);if(L==W){switch(D.length){case 0:return new L;case 1:return new L(D[0]);case 2:return new L(D[0],D[1]);case 3:return new L(D[0],D[1],D[2]);case 4:return new L(D[0],D[1],D[2],D[3])}var Y=[null];return v(T,Y,D),new(v(f,L,Y))}var B=W.prototype,V=x(b(B)?B:E),z=v(L,V,D);return b(z)?z:V}})},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),_=r(110),g=r(134),b=r(95);n.exports=function(x,A){var S,E,T,I,R,U=x.target,L=x.global,D=x.stat;if(S=L?s:D?s[U]||_(U,{}):(s[U]||{}).prototype)for(E in A){if(I=A[E],T=x.noTargetGet?(R=c(S,E))&&R.value:S[E],!b(L?E:U+(D?".":"#")+E,x.forced)&&T!==void 0){if(typeof I==typeof T)continue;g(I,T)}(x.sham||T&&T.sham)&&v(I,"sham",!0),f(S,E,I,x)}}},function(n,a,r){var s=r(16),c=r(7),v=r(96),f=r(99),_=r(33),g=r(75),b=r(45),x=r(41),A=r(63),S=r(28),E=r(81),T=r(98),I=E("slice"),R=S("species"),U=c.Array,L=Math.max;s({target:"Array",proto:!0,forced:!I},{slice:function(D,W){var Y,B,V,z=x(this),H=b(z),q=g(D,H),ee=g(W===void 0?H:W,H);if(v(z)&&(Y=z.constructor,(f(Y)&&(Y===U||v(Y.prototype))||_(Y)&&(Y=Y[R])===null)&&(Y=void 0),Y===U||Y===void 0))return T(z,q,ee);for(B=new(Y===void 0?U:Y)(L(ee-q,0)),V=0;q<ee;q++,V++)q in z&&A(B,V,z[q]);return B.length=V,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,_=Function.prototype,g=v(_.toString),b=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,x=v(b.exec);s&&!c&&f(_,"name",{configurable:!0,get:function(){try{return x(b,g(this))[1]}catch{return""}}})},function(n,a,r){var s=r(16),c=r(18),v=r(41),f=r(50).f,_=r(36),g=c((function(){f(1)}));s({target:"Object",stat:!0,forced:!_||g,sham:!_},{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),_=r(50),g=r(63);s({target:"Object",stat:!0,sham:!c},{getOwnPropertyDescriptors:function(b){for(var x,A,S=f(b),E=_.f,T=v(S),I={},R=0;T.length>R;)(A=E(S,x=T[R++]))!==void 0&&g(I,x,A);return I}})},,function(n,a,r){var s=r(16),c=r(7),v=r(18),f=r(96),_=r(33),g=r(40),b=r(45),x=r(63),A=r(115),S=r(81),E=r(28),T=r(70),I=E("isConcatSpreadable"),R=9007199254740991,U="Maximum allowed index exceeded",L=c.TypeError,D=T>=51||!v((function(){var B=[];return B[I]=!1,B.concat()[0]!==B})),W=S("concat"),Y=function(B){if(!_(B))return!1;var V=B[I];return V!==void 0?!!V:f(B)};s({target:"Array",proto:!0,forced:!D||!W},{concat:function(B){var V,z,H,q,ee,ue=g(this),ie=A(ue,0),be=0;for(V=-1,H=arguments.length;V<H;V++)if(Y(ee=V===-1?ue:arguments[V])){if(be+(q=b(ee))>R)throw L(U);for(z=0;z<q;z++,be++)z in ee&&x(ie,be,ee[z])}else{if(be>=R)throw L(U);x(ie,be++,ee)}return ie.length=be,ie}})},function(n,a,r){var s=r(7),c=r(89),v=r(35),f=r(90),_=r(108),g=r(132),b=c("wks"),x=s.Symbol,A=x&&x.for,S=g?x:x&&x.withoutSetter||f;n.exports=function(E){if(!v(b,E)||!_&&typeof b[E]!="string"){var T="Symbol."+E;_&&v(x,E)?b[E]=x[E]:b[E]=g&&A?A(T):S(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(_){if(c(_))return _;throw f(v(_)+" 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,_){return v(c(f),_)}},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),_=r(86),g=s.TypeError,b=Object.defineProperty;a.f=c?b:function(x,A,S){if(f(x),A=_(A),f(S),v)try{return b(x,A,S)}catch{}if("get"in S||"set"in S)throw g("Accessors not supported");return"value"in S&&(x[A]=S.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),_=r(110),g=r(92),b=r(58),x=r(73).CONFIGURABLE,A=b.get,S=b.enforce,E=String(String).split("String");(n.exports=function(T,I,R,U){var L,D=!!U&&!!U.unsafe,W=!!U&&!!U.enumerable,Y=!!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),(L=S(R)).source||(L.source=E.join(typeof B=="string"?B:""))),T!==s?(D?!Y&&T[I]&&(W=!0):delete T[I],W?T[I]=R:f(T,I,R)):W?T[I]=R:_(I,R)})(Function.prototype,"toString",(function(){return c(this)&&A(this).source||g(this)}))},function(n,a,r){(function(s){r.d(a,"d",(function(){return f})),r.d(a,"c",(function(){return _})),r.d(a,"b",(function(){return g})),r.d(a,"a",(function(){return x}));var c=r(10),v=function(A,S){var E=typeof Symbol=="function"&&A[Symbol.iterator];if(!E)return A;var T,I,R=E.call(A),U=[];try{for(;(S===void 0||S-- >0)&&!(T=R.next()).done;)U.push(T.value)}catch(L){I={error:L}}finally{try{T&&!T.done&&(E=R.return)&&E.call(R)}finally{if(I)throw I.error}}return U};function f(){var A=v(Object(c.j)(0),2)[1];return Object(c.h)((function(){A((function(S){return S+1}))}),[])}function _(A){if(!A||typeof A!="object")return!1;var S=Object.getPrototypeOf(A);return!S||S===Object.prototype}function g(A){return typeof Symbol=="function"?Symbol.for(A):"__$mobx-react "+A+"__"}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,_){return arguments.length<2?v(s[f]):s[f]&&s[f][_]}},function(n,a,r){var s=r(16),c=r(34),v=r(33),f=r(32),_=r(204),g=r(50),b=r(101);s({target:"Reflect",stat:!0},{get:function x(A,S){var E,T,I=arguments.length<3?A:arguments[2];return f(A)===I?A[S]:(E=g.f(A,S))?_(E)?E.value:E.get===void 0?void 0:c(E.get,I):v(T=b(A))?x(T,S,I):void 0}})},function(n,a,r){(function(s){var c=r(31),v=r(171),f=t&&!t.nodeType&&t,_=f&&typeof s=="object"&&s&&!s.nodeType&&s,g=_&&_.exports===f?c.a.Buffer:void 0,b=(g?g.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,_=f&&f.exports===v&&c.a.process,g=(function(){try{var b=f&&f.require&&f.require("util").types;return b||_&&_.binding&&_.binding("util")}catch{}})();a.a=g}).call(this,r(122)(n))},function(n,a,r){var s=r(36),c=r(34),v=r(84),f=r(69),_=r(41),g=r(86),b=r(35),x=r(133),A=Object.getOwnPropertyDescriptor;a.f=s?A:function(S,E){if(S=_(S),E=g(E),x)try{return A(S,E)}catch{}if(b(S,E))return f(!c(v.f,S,E),S[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(_){if(c(_))return _;throw f(v(_)+" 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,_,v(1,g))}:function(f,_,g){return f[_]=g,f}},function(n,a,r){var s,c,v,f=r(175),_=r(7),g=r(15),b=r(33),x=r(57),A=r(35),S=r(109),E=r(93),T=r(72),I="Object already initialized",R=_.TypeError,U=_.WeakMap;if(f||S.state){var L=S.state||(S.state=new U),D=g(L.get),W=g(L.has),Y=g(L.set);s=function(V,z){if(W(L,V))throw new R(I);return z.facade=V,Y(L,V,z),z},c=function(V){return D(L,V)||{}},v=function(V){return W(L,V)}}else{var B=E("state");T[B]=!0,s=function(V,z){if(A(V,B))throw new R(I);return z.facade=V,x(V,B,z),z},c=function(V){return A(V,B)?V[B]:{}},v=function(V){return A(V,B)}}n.exports={set:s,get:c,has:v,enforce:function(V){return v(V)?c(V):s(V,{})},getterFor:function(V){return function(z){var H;if(!b(z)||(H=c(z)).type!==V)throw R("Incompatible receiver, "+V+" required");return H}}}},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),_=r(72),g=r(138),b=r(91),x=r(93),A=x("IE_PROTO"),S=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",g.appendChild(U),U.src="javascript:",(R=U.contentWindow.document).open(),R.write(E("document.F=Object")),R.close(),R.F):T(s);for(var L=f.length;L--;)delete I.prototype[f[L]];return I()};_[A]=!0,n.exports=Object.create||function(R,U){var L;return R!==null?(S.prototype=c(R),L=new S,S.prototype=null,L[A]=R):L=I(),U===void 0?L:v(L,U)}},function(n,a,r){var s=r(36),c=r(7),v=r(15),f=r(95),_=r(42),g=r(35),b=r(148),x=r(54),A=r(87),S=r(131),E=r(18),T=r(74).f,I=r(50).f,R=r(38).f,U=r(160),L=r(161).trim,D="Number",W=c.Number,Y=W.prototype,B=c.TypeError,V=v("".slice),z=v("".charCodeAt),H=function(De){var Ne=S(De,"number");return typeof Ne=="bigint"?Ne:q(Ne)},q=function(De){var Ne,Ae,Te,rt,tt,Be,dt,St,He=S(De,"number");if(A(He))throw B("Cannot convert a Symbol value to a number");if(typeof He=="string"&&He.length>2){if(He=L(He),(Ne=z(He,0))===43||Ne===45){if((Ae=z(He,2))===88||Ae===120)return NaN}else if(Ne===48){switch(z(He,1)){case 66:case 98:Te=2,rt=49;break;case 79:case 111:Te=8,rt=55;break;default:return+He}for(Be=(tt=V(He,2)).length,dt=0;dt<Be;dt++)if((St=z(tt,dt))<48||St>rt)return NaN;return parseInt(tt,Te)}}return+He};if(f(D,!W(" 0o1")||!W("0b1")||W("+0x1"))){for(var ee,ue=function(De){var Ne=arguments.length<1?0:W(H(De)),Ae=this;return x(Y,Ae)&&E((function(){U(Ae)}))?b(Object(Ne),Ae,ue):Ne},ie=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(","),be=0;ie.length>be;be++)g(W,ee=ie[be])&&!g(ue,ee)&&R(ue,ee,I(W,ee));ue.prototype=Y,Y.constructor=ue,_(c,D,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(_);b in f?c.f(f,b,v(0,g)):f[b]=g}},function(n,a,r){var s=r(15),c=r(56),v=s(s.bind);n.exports=function(f,_){return c(f),_===void 0?f:v?v(f,_):function(){return f.apply(_,arguments)}}},function(n,a,r){var s=r(16),c=r(15),v=r(85),f=r(41),_=r(121),g=c([].join),b=v!=Object,x=_("join",",");s({target:"Array",proto:!0,forced:b||!x},{join:function(A){return g(f(this),A===void 0?",":A)}})},function(n,a,r){var s=r(15),c=r(73).PROPER,v=r(42),f=r(32),_=r(54),g=r(39),b=r(18),x=r(154),A="toString",S=RegExp.prototype,E=S.toString,T=s(x),I=b((function(){return E.call({source:"a",flags:"b"})!="/a/b"})),R=c&&E.name!=A;(I||R)&&v(RegExp.prototype,A,(function(){var U=f(this),L=g(U.source),D=U.flags;return"/"+L+"/"+g(D===void 0&&_(S,U)&&!("flags"in S)?T(U):D)}),{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),_=v.process,g=v.Deno,b=_&&_.versions||g&&g.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,_=c(v,"name"),g=_&&(function(){}).name==="something",b=_&&(!s||s&&f(v,"name").configurable);n.exports={EXISTS:_,PROPER:g,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,_){var g=s(f);return g<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=g?f:f.prototype,v)&&s(f,v,{configurable:!0,value:_})}},function(n,a,r){var s=r(64),c=r(15),v=r(85),f=r(40),_=r(45),g=r(115),b=c([].push),x=function(A){var S=A==1,E=A==2,T=A==3,I=A==4,R=A==6,U=A==7,L=A==5||R;return function(D,W,Y,B){for(var V,z,H=f(D),q=v(H),ee=s(W,Y),ue=_(q),ie=0,be=B||g,De=S?be(D,ue):E||U?be(D,0):void 0;ue>ie;ie++)if((L||ie in q)&&(z=ee(V=q[ie],ie,H),A))if(S)De[ie]=z;else if(z)switch(A){case 3:return!0;case 5:return V;case 6:return ie;case 2:b(De,V)}else switch(A){case 4:return!1;case 7:b(De,V)}return R?-1:T||I?I:De}};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(_){return v>=51||!s((function(){var g=[];return(g.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),_=r(159),g=r(32),b=r(44),x=r(164),A=r(124),S=r(94),E=r(39),T=r(62),I=r(114),R=r(125),U=r(103),L=r(155),D=r(18),W=L.UNSUPPORTED_Y,Y=4294967295,B=Math.min,V=[].push,z=v(/./.exec),H=v(V),q=v("".slice),ee=!D((function(){var ue=/(?:)/,ie=ue.exec;ue.exec=function(){return ie.apply(this,arguments)};var be="ab".split(ue);return be.length!==2||be[0]!=="a"||be[1]!=="b"}));f("split",(function(ue,ie,be){var De;return De="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(Ne,Ae){var Te=E(b(this)),rt=Ae===void 0?Y:Ae>>>0;if(rt===0)return[];if(Ne===void 0)return[Te];if(!_(Ne))return c(ie,Te,Ne,rt);for(var tt,Be,dt,St=[],He=(Ne.ignoreCase?"i":"")+(Ne.multiline?"m":"")+(Ne.unicode?"u":"")+(Ne.sticky?"y":""),Qt=0,Fe=new RegExp(Ne.source,He+"g");(tt=c(U,Fe,Te))&&!((Be=Fe.lastIndex)>Qt&&(H(St,q(Te,Qt,tt.index)),tt.length>1&&tt.index<Te.length&&s(V,St,I(tt,1)),dt=tt[0].length,Qt=Be,St.length>=rt));)Fe.lastIndex===tt.index&&Fe.lastIndex++;return Qt===Te.length?!dt&&z(Fe,"")||H(St,""):H(St,q(Te,Qt)),St.length>rt?I(St,0,rt):St}:"0".split(void 0,0).length?function(Ne,Ae){return Ne===void 0&&Ae===0?[]:c(ie,this,Ne,Ae)}:ie,[function(Ne,Ae){var Te=b(this),rt=Ne==null?void 0:T(Ne,ue);return rt?c(rt,Ne,Te,Ae):c(De,E(Te),Ne,Ae)},function(Ne,Ae){var Te=g(this),rt=E(Ne),tt=be(De,Te,rt,Ae,De!==ie);if(tt.done)return tt.value;var Be=x(Te,RegExp),dt=Te.unicode,St=(Te.ignoreCase?"i":"")+(Te.multiline?"m":"")+(Te.unicode?"u":"")+(W?"g":"y"),He=new Be(W?"^(?:"+Te.source+")":Te,St),Qt=Ae===void 0?Y:Ae>>>0;if(Qt===0)return[];if(rt.length===0)return R(He,rt)===null?[rt]:[];for(var Fe=0,we=0,Re=[];we<rt.length;){He.lastIndex=W?0:we;var Ye,Ot=R(He,W?q(rt,we):rt);if(Ot===null||(Ye=B(S(He.lastIndex+(W?we:0)),rt.length))===Fe)we=A(rt,we,dt);else{if(H(Re,q(rt,Fe,we)),Re.length===Qt)return Re;for(var bt=1;bt<=Ot.length-1;bt++)if(H(Re,Ot[bt]),Re.length===Qt)return Re;we=Fe=Ye}}return H(Re,q(rt,Fe)),Re}]}),!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 _=c(this,f);return!!_&&_.enumerable}:s},function(n,a,r){var s=r(7),c=r(15),v=r(18),f=r(51),_=s.Object,g=c("".split);n.exports=v((function(){return!_("z").propertyIsEnumerable(0)}))?function(b){return f(b)=="String"?g(b,""):_(b)}:_},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),_=r(132),g=s.Object;n.exports=_?function(b){return typeof b=="symbol"}:function(b){var x=c("Symbol");return v(x)&&f(x.prototype,g(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(_){return"Symbol("+(_===void 0?"":_)+")_"+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(_){return f?v.createElement(_):{}}},function(n,a,r){var s=r(15),c=r(30),v=r(109),f=s(Function.toString);c(v.inspectSource)||(v.inspectSource=function(_){return f(_)}),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(A,S){var E=g[_(A)];return E==x||E!=b&&(c(S)?s(S):!!S)},_=f.normalize=function(A){return String(A).replace(v,".").toLowerCase()},g=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),_=r(28)("toStringTag"),g=s.Object,b=f((function(){return arguments})())=="Arguments";n.exports=c?f:function(x){var A,S,E;return x===void 0?"Undefined":x===null?"Null":typeof(S=(function(T,I){try{return T[I]}catch{}})(A=g(x),_))=="string"?S:b?f(A):(E=f(A))=="Object"&&v(A.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),_=r(46),g=r(92),b=function(){},x=[],A=_("Reflect","construct"),S=/^\s*(?:class|function)\b/,E=s(S.exec),T=!S.exec(b),I=function(R){if(!v(R))return!1;try{return A(b,x,R),!0}catch{return!1}};n.exports=!A||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(S,g(R))}:I},function(n,a,r){var s=r(28),c=r(60),v=r(38),f=s("unscopables"),_=Array.prototype;_[f]==null&&v.f(_,f,{configurable:!0,value:c(null)}),n.exports=function(g){_[f][g]=!0}},function(n,a,r){var s=r(7),c=r(35),v=r(30),f=r(40),_=r(93),g=r(143),b=_("IE_PROTO"),x=s.Object,A=x.prototype;n.exports=g?x.getPrototypeOf:function(S){var E=f(S);if(c(E,b))return E[b];var T=E.constructor;return v(T)&&E instanceof T?T.prototype:E instanceof x?A:null}},function(n,a,r){var s=r(15),c=r(32),v=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var f,_=!1,g={};try{(f=s(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(g,[]),_=g instanceof Array}catch{}return function(b,x){return c(b),v(x),_?f(b,x):b.__proto__=x,b}})():void 0)},function(n,a,r){var s,c,v=r(34),f=r(15),_=r(39),g=r(154),b=r(155),x=r(89),A=r(60),S=r(58).get,E=r(190),T=r(191),I=x("native-string-replace",String.prototype.replace),R=RegExp.prototype.exec,U=R,L=f("".charAt),D=f("".indexOf),W=f("".replace),Y=f("".slice),B=(c=/b*/g,v(R,s=/a/,"a"),v(R,c,"a"),s.lastIndex!==0||c.lastIndex!==0),V=b.BROKEN_CARET,z=/()??/.exec("")[1]!==void 0;(B||z||V||E||T)&&(U=function(H){var q,ee,ue,ie,be,De,Ne,Ae=this,Te=S(Ae),rt=_(H),tt=Te.raw;if(tt)return tt.lastIndex=Ae.lastIndex,q=v(U,tt,rt),Ae.lastIndex=tt.lastIndex,q;var Be=Te.groups,dt=V&&Ae.sticky,St=v(g,Ae),He=Ae.source,Qt=0,Fe=rt;if(dt&&(St=W(St,"y",""),D(St,"g")===-1&&(St+="g"),Fe=Y(rt,Ae.lastIndex),Ae.lastIndex>0&&(!Ae.multiline||Ae.multiline&&L(rt,Ae.lastIndex-1)!==`
`)&&(He="(?: "+He+")",Fe=" "+Fe,Qt++),ee=new RegExp("^(?:"+He+")",St)),z&&(ee=new RegExp("^"+He+"$(?!\\s)",St)),B&&(ue=Ae.lastIndex),ie=v(R,dt?ee:Ae,Fe),dt?ie?(ie.input=Y(ie.input,Qt),ie[0]=Y(ie[0],Qt),ie.index=Ae.lastIndex,Ae.lastIndex+=ie[0].length):Ae.lastIndex=0:B&&ie&&(Ae.lastIndex=Ae.global?ie.index+ie[0].length:ue),z&&ie&&ie.length>1&&v(I,ie[0],ee,(function(){for(be=1;be<arguments.length-2;be++)arguments[be]===void 0&&(ie[be]=void 0)})),ie&&Be)for(ie.groups=De=A(null),be=0;be<Be.length;be++)De[(Ne=Be[be])[0]]=ie[Ne[1]];return ie}),n.exports=U},function(n,a,r){var s=r(16),c=r(7),v=r(75),f=r(59),_=r(45),g=r(40),b=r(115),x=r(63),A=r(81)("splice"),S=c.TypeError,E=Math.max,T=Math.min,I=9007199254740991,R="Maximum allowed length exceeded";s({target:"Array",proto:!0,forced:!A},{splice:function(U,L){var D,W,Y,B,V,z,H=g(this),q=_(H),ee=v(U,q),ue=arguments.length;if(ue===0?D=W=0:ue===1?(D=0,W=q-ee):(D=ue-2,W=T(E(f(L),0),q-ee)),q+D-W>I)throw S(R);for(Y=b(H,W),B=0;B<W;B++)(V=ee+B)in H&&x(Y,B,H[V]);if(Y.length=W,D<W){for(B=ee;B<q-W;B++)z=B+D,(V=B+W)in H?H[z]=H[V]:delete H[z];for(B=q;B>q-W+D;B--)delete H[B-1]}else if(D>W)for(B=q-W;B>ee;B--)z=B+D-1,(V=B+W-1)in H?H[z]=H[V]:delete H[z];for(B=0;B<D;B++)H[B+ee]=arguments[B+2];return H.length=q-W+D,Y}})},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,_=f&&f.exports===v?c.a.Buffer:void 0,g=_?_.allocUnsafe:void 0;a.a=function(b,x){if(x)return b.slice();var A=b.length,S=g?g(A):new b.constructor(A);return b.copy(S),S}}).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),_=s.Array,g=Math.max;n.exports=function(b,x,A){for(var S=v(b),E=c(x,S),T=c(A===void 0?S:A,S),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),_=r(30),g=r(180),b=r(101),x=r(102),A=r(78),S=r(57),E=r(42),T=r(28),I=r(80),R=r(142),U=f.PROPER,L=f.CONFIGURABLE,D=R.IteratorPrototype,W=R.BUGGY_SAFARI_ITERATORS,Y=T("iterator"),B="keys",V="values",z="entries",H=function(){return this};n.exports=function(q,ee,ue,ie,be,De,Ne){g(ue,ee,ie);var Ae,Te,rt,tt=function(we){if(we===be&&Qt)return Qt;if(!W&&we in St)return St[we];switch(we){case B:case V:case z:return function(){return new ue(this,we)}}return function(){return new ue(this)}},Be=ee+" Iterator",dt=!1,St=q.prototype,He=St[Y]||St["@@iterator"]||be&&St[be],Qt=!W&&He||tt(be),Fe=ee=="Array"&&St.entries||He;if(Fe&&(Ae=b(Fe.call(new q)))!==Object.prototype&&Ae.next&&(v||b(Ae)===D||(x?x(Ae,D):_(Ae[Y])||E(Ae,Y,H)),A(Ae,Be,!0,!0),v&&(I[Be]=H)),U&&be==V&&He&&He.name!==V&&(!v&&L?S(St,"name",V):(dt=!0,Qt=function(){return c(He,this)})),be)if(Te={values:tt(V),keys:De?Qt:tt(B),entries:tt(z)},Ne)for(rt in Te)(W||dt||!(rt in St))&&E(St,rt,Te[rt]);else s({target:ee,proto:!0,forced:W||dt},Te);return v&&!Ne||St[Y]===Qt||E(St,Y,Qt,{name:be}),I[ee]=Qt,Te}},function(n,a,r){var s=r(7),c=r(64),v=r(34),f=r(32),_=r(88),g=r(145),b=r(45),x=r(54),A=r(146),S=r(118),E=r(147),T=s.TypeError,I=function(U,L){this.stopped=U,this.result=L},R=I.prototype;n.exports=function(U,L,D){var W,Y,B,V,z,H,q,ee=D&&D.that,ue=!(!D||!D.AS_ENTRIES),ie=!(!D||!D.IS_ITERATOR),be=!(!D||!D.INTERRUPTED),De=c(L,ee),Ne=function(Te){return W&&E(W,"normal",Te),new I(!0,Te)},Ae=function(Te){return ue?(f(Te),be?De(Te[0],Te[1],Ne):De(Te[0],Te[1])):be?De(Te,Ne):De(Te)};if(ie)W=U;else{if(!(Y=S(U)))throw T(_(U)+" is not iterable");if(g(Y)){for(B=0,V=b(U);V>B;B++)if((z=Ae(U[B]))&&x(R,z))return z;return new I(!1)}W=A(U,Y)}for(H=W.next;!(q=v(H,W)).done;){try{z=Ae(q.value)}catch(Te){E(W,"throw",Te)}if(typeof z=="object"&&z&&x(R,z))return z}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(_){if(_!=null)return c(_,f)||c(_,"@@iterator")||v[s(_)]}},function(n,a,r){var s=r(7),c=r(54),v=s.TypeError;n.exports=function(f,_){if(c(_,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(!g&&!c)return!1;var b=!1;try{var x={};x[s]=function(){return{next:function(){return{done:b=!0}}}},_(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),_=r(28),g=r(57),b=_("species"),x=RegExp.prototype;n.exports=function(A,S,E,T){var I=_(A),R=!f((function(){var W={};return W[I]=function(){return 7},""[A](W)!=7})),U=R&&!f((function(){var W=!1,Y=/a/;return A==="split"&&((Y={}).constructor={},Y.constructor[b]=function(){return Y},Y.flags="",Y[I]=/./[I]),Y.exec=function(){return W=!0,null},Y[I](""),!W}));if(!R||!U||E){var L=s(/./[I]),D=S(I,""[A],(function(W,Y,B,V,z){var H=s(W),q=Y.exec;return q===v||q===x.exec?R&&!z?{done:!0,value:L(Y,B,V)}:{done:!0,value:H(B,Y,V)}:{done:!1}}));c(String.prototype,A,D[0]),c(x,I,D[1])}T&&g(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),_=r(51),g=r(103),b=s.TypeError;n.exports=function(x,A){var S=x.exec;if(f(S)){var E=c(S,x,A);return E!==null&&v(E),E}if(_(x)==="RegExp")return c(g,x,A);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),_=r(18),g=r(32),b=r(30),x=r(59),A=r(94),S=r(39),E=r(44),T=r(124),I=r(62),R=r(201),U=r(125),L=r(28)("replace"),D=Math.max,W=Math.min,Y=v([].concat),B=v([].push),V=v("".indexOf),z=v("".slice),H="a".replace(/./,"$0")==="$0",q=!!/./[L]&&/./[L]("a","$0")==="";f("replace",(function(ee,ue,ie){var be=q?"$":"$0";return[function(De,Ne){var Ae=E(this),Te=De==null?void 0:I(De,L);return Te?c(Te,De,Ae,Ne):c(ue,S(Ae),De,Ne)},function(De,Ne){var Ae=g(this),Te=S(De);if(typeof Ne=="string"&&V(Ne,be)===-1&&V(Ne,"$<")===-1){var rt=ie(ue,Ae,Te,Ne);if(rt.done)return rt.value}var tt=b(Ne);tt||(Ne=S(Ne));var Be=Ae.global;if(Be){var dt=Ae.unicode;Ae.lastIndex=0}for(var St=[];;){var He=U(Ae,Te);if(He===null||(B(St,He),!Be))break;S(He[0])===""&&(Ae.lastIndex=T(Te,A(Ae.lastIndex),dt))}for(var Qt,Fe="",we=0,Re=0;Re<St.length;Re++){for(var Ye=S((He=St[Re])[0]),Ot=D(W(x(He.index),Te.length),0),bt=[],Ft=1;Ft<He.length;Ft++)B(bt,(Qt=He[Ft])===void 0?Qt:String(Qt));var en=He.groups;if(tt){var on=Y([Ye],bt,Ot,Te);en!==void 0&&B(on,en);var Wt=S(s(Ne,void 0,on))}else Wt=R(Ye,Te,Ot,bt,en,Ne);Ot>=we&&(Fe+=z(Te,we,Ot)+Wt,we=Ot+Ye.length)}return Fe+z(Te,we)}]}),!!_((function(){var ee=/./;return ee.exec=function(){var ue=[];return ue.groups={a:"7"},ue},"".replace(ee,"$<a>")!=="7"}))||!H||q)},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,A=0,S=0,E=arguments.length,T=0;S<E;)T<(b=v(arguments[S++]))?(A=A*(x=T/b)*x+1,T=b):A+=b>0?(x=b/T)*x:b;return T===1/0?1/0:T*f(A)}})},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,_="Expected a function",g="__lodash_hash_undefined__",b="__lodash_placeholder__",x=16,A=32,S=64,E=128,T=256,I=1/0,R=9007199254740991,U=NaN,L=4294967295,D=[["ary",E],["bind",1],["bindKey",2],["curry",8],["curryRight",x],["flip",512],["partial",A],["partialRight",S],["rearg",T]],W="[object Arguments]",Y="[object Array]",B="[object Boolean]",V="[object Date]",z="[object Error]",H="[object Function]",q="[object GeneratorFunction]",ee="[object Map]",ue="[object Number]",ie="[object Object]",be="[object Promise]",De="[object RegExp]",Ne="[object Set]",Ae="[object String]",Te="[object Symbol]",rt="[object WeakMap]",tt="[object ArrayBuffer]",Be="[object DataView]",dt="[object Float32Array]",St="[object Float64Array]",He="[object Int8Array]",Qt="[object Int16Array]",Fe="[object Int32Array]",we="[object Uint8Array]",Re="[object Uint8ClampedArray]",Ye="[object Uint16Array]",Ot="[object Uint32Array]",bt=/\b__p \+= '';/g,Ft=/\b(__p \+=) '' \+/g,en=/(__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=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,tn=/\\(\\)?/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]",ha="["+as+"]",$s="["+to+"]",Rn="\\d+",Id="[\\u2700-\\u27bf]",Eo="["+ml+"]",_c="[^\\ud800-\\udfff"+as+Rn+Lr+ml+za+"]",Ki="\\ud83c[\\udffb-\\udfff]",oa="[^\\ud800-\\udfff]",Au="(?:\\ud83c[\\udde6-\\uddff]){2}",Na="[\\ud800-\\udbff][\\udc00-\\udfff]",va="["+za+"]",Pa="(?:"+Eo+"|"+_c+")",bc="(?:"+va+"|"+_c+")",wc="(?:['](?:d|ll|m|re|s|t|ve))?",Ld="(?:['](?:D|LL|M|RE|S|T|VE))?",Fs="(?:"+$s+"|"+Ki+")?",$d="[\\ufe0e\\ufe0f]?",Ec=$d+Fs+("(?:\\u200d(?:"+[oa,Au,Na].join("|")+")"+$d+Fs+")*"),rp="(?:"+[Id,Au,Na].join("|")+")"+Ec,Il="(?:"+[oa+$s+"?",$s,Au,Na,gc].join("|")+")",Fd=RegExp(np,"g"),gl=RegExp($s,"g"),Oc=RegExp(Ki+"(?="+Ki+")|"+Il+Ec,"g"),Mu=RegExp([va+"?"+Eo+"+"+wc+"(?="+[ha,va,"$"].join("|")+")",bc+"+"+Ld+"(?="+[ha,va+Pa,"$"].join("|")+")",va+"?"+Pa+"+"+wc,va+"+"+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[dt]=Kr[St]=Kr[He]=Kr[Qt]=Kr[Fe]=Kr[we]=Kr[Re]=Kr[Ye]=Kr[Ot]=!0,Kr[W]=Kr[Y]=Kr[tt]=Kr[B]=Kr[Be]=Kr[V]=Kr[z]=Kr[H]=Kr[ee]=Kr[ue]=Kr[ie]=Kr[De]=Kr[Ne]=Kr[Ae]=Kr[rt]=!1;var Xr={};Xr[W]=Xr[Y]=Xr[tt]=Xr[Be]=Xr[B]=Xr[V]=Xr[dt]=Xr[St]=Xr[He]=Xr[Qt]=Xr[Fe]=Xr[ee]=Xr[ue]=Xr[ie]=Xr[De]=Xr[Ne]=Xr[Ae]=Xr[Te]=Xr[we]=Xr[Re]=Xr[Ye]=Xr[Ot]=!0,Xr[z]=Xr[H]=Xr[rt]=!1;var Vd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ls=parseFloat,ma=parseInt,ku=typeof s=="object"&&s&&s.Object===Object&&s,Ud=typeof self=="object"&&self&&self.Object===Object&&self,Uo=ku||Ud||Function("return this")(),Ll=a&&!a.nodeType&&a,$l=Ll&&typeof c=="object"&&c&&!c.nodeType&&c,Tu=$l&&$l.exports===Ll,ss=Tu&&ku.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,ya=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 Nu(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 Pu=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,ga,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 ga(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 Ca(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 Ra(vt){return vt&&vt.slice(0,ci(vt)+1).replace(jn,"")}function mo(vt){return function(Vt){return vt(Vt)}}function Bs(vt,Vt){return Vr(Vt,(function(Ut){return vt[Ut]}))}function Xa(vt,Vt){return vt.has(Vt)}function _a(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=Ca({À:"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=Ca({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Vs(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 ba(vt){var Vt=-1,Ut=Array(vt.size);return vt.forEach((function(bn){Ut[++Vt]=bn})),Ut}function Cu(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):Pu(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=Ca({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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,X=Vt.RegExp,ae=Vt.String,Ee=Vt.TypeError,Ke=bn.prototype,wt=yo.prototype,Kt=C.prototype,Sn=Vt["__core-js_shared__"],Or=wt.toString,vn=Kt.hasOwnProperty,qr=0,gr=(Ut=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||""))?"Symbol(src)_1."+Ut:"",Fr=Kt.toString,la=Or.call(C),To=Uo._,ea=X("^"+Or.call(vn).replace(Dr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_l=Tu?Vt.Buffer:f,bl=Vt.Symbol,Bl=Vt.Uint8Array,ds=_l?_l.allocUnsafe:f,Ya=Cc(C.getPrototypeOf,C),fs=C.create,ri=Kt.propertyIsEnumerable,Vl=Ke.splice,wl=bl?bl.isConcatSpreadable:f,Ka=bl?bl.iterator:f,Za=bl?bl.toStringTag:f,Us=(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,Ws=N.floor,Xd=C.getOwnPropertySymbols,mh=_l?_l.isBuffer:f,Gs=Vt.isFinite,jc=Ke.join,qd=Cc(C.keys,C),Wo=N.max,Gi=N.min,Yd=pr.now,Kd=Vt.parseInt,Ru=N.random,Hv=Ke.reverse,ju=ol(Vt,"DataView"),Du=ol(Vt,"Map"),Dc=ol(Vt,"Promise"),zs=ol(Vt,"Set"),ps=ol(Vt,"WeakMap"),Iu=ol(C,"create"),Ic=ps&&new ps,hs={},Xv=Es(ju),Lc=Es(Du),qv=Es(Dc),Yv=Es(zs),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 ja)return p;if(vn.call(p,"__wrapped__"))return wf(p)}return new ja(p)}var Hs=(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 ja(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__=L,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 wa(p){var y=this.__data__=new Ur(p);this.size=y.size}function Jd(p,y){var O=wr(p),$=!O&&uu(p),Z=!O&&!$&&na(p),re=!O&&!$&&!Z&&ot(p),ve=O||$||Z||re,xe=ve?Fl(p.length,ae):[],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&&!$a(p[y],O)||O===f&&!(y in p))&&Qa(p,y,O)}function Go(p,y,O){var $=p[y];vn.call(p,y)&&$a($,O)&&(O!==f||y in p)||Qa(p,y,O)}function Lu(p,y){for(var O=p.length;O--;)if($a(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__"&&Us?Us(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:Yt(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 Ea(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 rn=Lt.length,sr=new Lt.constructor(rn);return rn&&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 qt=Do(p),xn=qt==H||qt==q;if(na(p))return Mh(p,xe);if(qt==ie||qt==W||xn&&!Z){if(ve=Ue||xn?{}:ta(p),!xe)return Ue?(function(Lt,rn){return tl(Lt,tu(Lt),rn)})(p,(function(Lt,rn){return Lt&&tl(rn,Pt(rn),Lt)})(ve,p)):(function(Lt,rn){return tl(Lt,di(Lt),rn)})(p,zl(ve,p))}else{if(!Xr[qt])return Z?p:{};ve=(function(Lt,rn,sr){var Pn=Lt.constructor;switch(rn){case tt:return Ys(Lt);case B:case V:return new Pn(+Lt);case Be:return(function(yr,Br){var Jn=Br?Ys(yr.buffer):yr.buffer;return new yr.constructor(Jn,yr.byteOffset,yr.byteLength)})(Lt,sr);case dt:case St:case He:case Qt:case Fe:case we:case Re:case Ye:case Ot:return kh(Lt,sr);case ee:return new Pn;case ue:case Ae:return new Pn(Lt);case De:return(function(yr){var Br=new yr.constructor(yr.source,Sr.exec(yr));return Br.lastIndex=yr.lastIndex,Br})(Lt);case Ne:return new Pn;case Te:return qe=Lt,Di?C(Di.call(qe)):{}}var qe})(p,qt,xe)}}re||(re=new wa);var An=re.get(p);if(An)return An;re.set(p,ve),Oe(p)?p.forEach((function(Lt){ve.add(Ea(Lt,y,O,Lt,p,re))})):Af(p)&&p.forEach((function(Lt,rn){ve.set(rn,Ea(Lt,y,O,rn,p,re))}));var qn=xt?f:(_t?Ue?mf:Xc:Ue?Pt:It)(p);return Fi(qn||p,(function(Lt,rn){qn&&(Lt=p[rn=Lt]),Go(ve,rn,Ea(Lt,y,O,rn,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(_);return ou((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],qt=O==null?xt:O(xt);if(xt=$||xt!==0?xt:0,ve&&qt==qt){for(var xn=_t;xn--;)if(y[xn]===qt)continue e;Ue.push(xt)}else re(y,qt,$)||Ue.push(xt)}return Ue}le.templateSettings={escape:We,evaluate:yn,interpolate:Kn,variable:"",imports:{_:le}},le.prototype=Ul.prototype,le.prototype.constructor=le,ja.prototype=Hs(Ul.prototype),ja.prototype.constructor=ja,jr.prototype=Hs(Ul.prototype),jr.prototype.constructor=jr,xi.prototype.clear=function(){this.__data__=Iu?Iu(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(Iu){var O=y[p];return O===g?f:O}return vn.call(y,p)?y[p]:f},xi.prototype.has=function(p){var y=this.__data__;return Iu?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]=Iu&&y===f?g:y,this},Ur.prototype.clear=function(){this.__data__=[],this.size=0},Ur.prototype.delete=function(p){var y=this.__data__,O=Lu(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=Lu(y,p);return O<0?f:y[O][1]},Ur.prototype.has=function(p){return Lu(this.__data__,p)>-1},Ur.prototype.set=function(p,y){var O=this.__data__,$=Lu(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(Du||Ur),string:new xi}},Ja.prototype.delete=function(p){var y=zu(this,p).delete(p);return this.size-=y?1:0,y},Ja.prototype.get=function(p){return zu(this,p).get(p)},Ja.prototype.has=function(p){return zu(this,p).has(p)},Ja.prototype.set=function(p,y){var O=zu(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,g),this},Wl.prototype.has=function(p){return this.__data__.has(p)},wa.prototype.clear=function(){this.__data__=new Ur,this.size=0},wa.prototype.delete=function(p){var y=this.__data__,O=y.delete(p);return this.size=y.size,O},wa.prototype.get=function(p){return this.__data__.get(p)},wa.prototype.has=function(p){return this.__data__.has(p)},wa.prototype.set=function(p,y){var O=this.__data__;if(O instanceof Ur){var $=O.__data__;if(!Du||$.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=Js(Dn),bh=Js(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=Qs(),co=Qs(!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 Sa(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 qt=-1,xn=xe[0];e:for(;++qt<Z&&_t.length<Ue;){var An=xt[qt],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 $u(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 qt=wr(re),xn=wr(ve),An=qt?Y:Do(re),qn=xn?Y:Do(ve),Lt=(An=An==W?ie:An)==ie,rn=(qn=qn==W?ie:qn)==ie,sr=An==qn;if(sr&&na(re)){if(!na(ve))return!1;qt=!0,Lt=!1}if(sr&&!Lt)return xt||(xt=new wa),qt||ot(re)?Gu(re,ve,xe,Ue,_t,xt):(function(Jn,dr,Mi,Fa,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 V:case ue:return $a(+Jn,+dr);case z:return Jn.name==dr.name&&Jn.message==dr.message;case De:case Ae:return Jn==dr+"";case ee:var du=ni;case Ne:var Mf=1&Fa;if(du||(du=ba),Jn.size!=dr.size&&!Mf)return!1;var Ip=As.get(Jn);if(Ip)return Ip==dr;Fa|=2,As.set(Jn,dr);var Ms=Gu(du(Jn),du(dr),Fa,Jl,ki,As);return As.delete(Jn),Ms;case Te: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=rn&&vn.call(ve,"__wrapped__");if(Pn||qe){var yr=Pn?re.value():re,Br=qe?ve.value():ve;return xt||(xt=new wa),_t(yr,Br,xe,Ue,xt)}}return sr?(xt||(xt=new wa),(function(Jn,dr,Mi,Fa,Jl,ki){var As=1&Mi,du=Xc(Jn),Mf=du.length,Ip=Xc(dr).length;if(Mf!=Ip&&!As)return!1;for(var Ms=Mf;Ms--;){var Yu=du[Ms];if(!(As?Yu in dr:vn.call(dr,Yu)))return!1}var nm=ki.get(Jn),kf=ki.get(dr);if(nm&&kf)return nm==dr&&kf==Jn;var Lp=!0;ki.set(Jn,dr),ki.set(dr,Jn);for(var rm=As;++Ms<Mf;){var $p=Jn[Yu=du[Ms]],fd=dr[Yu];if(Fa)var pd=As?Fa(fd,$p,Yu,dr,Jn,ki):Fa($p,fd,Yu,Jn,dr,ki);if(!(pd===f?$p===fd||Jl($p,fd,Mi,Fa,ki):pd)){Lp=!1;break}rm||(rm=Yu=="constructor")}if(Lp&&!rm){var fu=Jn.constructor,Fp=dr.constructor;fu==Fp||!("constructor"in Jn)||!("constructor"in dr)||typeof fu=="function"&&fu instanceof fu&&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,$,$u,Z))}function Da(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 qt=new wa;if($)var xn=$(_t,xt,Ue,p,y,qt);if(!(xn===f?$u(xt,_t,3,$,qt):xn))return!1}}return!0}function ms(p){return!(!Lo(p)||(y=p,gr&&gr in y))&&(Sa(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 Ia(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 Oa(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||Da(O,p,y)}}function mp(p,y){return Sl(p)&&nu(y)?Kc(il(p),y):function(O){var $=Yt(O,p);return $===f&&$===y?Tt(O,p):$u(y,$,3)}}function nf(p,y,O,$,Z){p!==y&&Mr(y,(function(re,ve){if(Z||(Z=new wa),Lo(re))(function(Ue,_t,xt,qt,xn,An,qn){var Lt=_f(Ue,xt),rn=_f(_t,xt),sr=qn.get(rn);if(sr)return void Gl(Ue,xt,sr);var Pn=An?An(Lt,rn,xt+"",Ue,_t,qn):f,qe=Pn===f;if(qe){var yr=wr(rn),Br=!yr&&na(rn),Jn=!yr&&!Br&&ot(rn);Pn=rn,yr||Br||Jn?wr(Lt)?Pn=Lt:Co(Lt)?Pn=yi(Lt):Br?(qe=!1,Pn=Mh(rn,!0)):Jn?(qe=!1,Pn=kh(rn,!0)):Pn=[]:G(rn)||uu(rn)?(Pn=Lt,uu(Lt)?Pn=Dt(Lt):Lo(Lt)&&!Sa(Lt)||(Pn=ta(rn))):qe=!1}qe&&(qn.set(rn,Pn),xn(Pn,rn,qt,An,qn),qn.delete(rn)),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=Oa(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,qt=xe.criteria,xn=Ue.criteria,An=qt.length,qn=_t.length;++xt<An;){var Lt=Fu(qt[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)&&Xs(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+Ws(Ru()*(y-p+1))}function Vc(p,y){var O="";if(!p||y<1||y>R)return O;do y%2&&(O+=p),(y=Ws(y/2))&&(p+=p);while(y);return O}function kr(p,y){return Jc(Zc(p,y,tr),p+"")}function Kv(p){return Qd(Er(p))}function _p(p,y){var O=Er(p);return Ml(O,vs(y,0,O.length))}function Xs(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,Zv=Us?function(p,y){return Us(p,"toString",{configurable:!0,enumerable:!1,value:Tr(y),writable:!0})}:tr;function Sh(p){return Ml(Er(p))}function xa(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 Jv(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=Ws((Z+re)/2),qt=O(p[xt]),xn=qt!==f,An=qt===null,qn=qt==qt,Lt=gt(qt);if(ve)var rn=$||qn;else rn=_t?qn&&($||xn):xe?qn&&xn&&($||!An):Ue?qn&&xn&&!An&&($||!Lt):!An&&!Lt&&($?qt<=y:qt<y);rn?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||!$a(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 ba(_t);ve=!1,Z=Xa,Ue=new Wl}else Ue=y?[]:xe;e:for(;++$<re;){var xt=p[$],qt=y?y(xt):xt;if(xt=O||xt!==0?xt:0,ve&&qt==qt){for(var xn=Ue.length;xn--;)if(Ue[xn]===qt)continue e;y&&Ue.push(qt),xe.push(xt)}else Z(Ue,qt,O)||(Ue!==xe&&Ue.push(qt),xe.push(xt))}return xe}function af(p,y){return(p=ws(p,y=Yr(y,p)))==null||delete p[il(xo(y))]}function qs(p,y,O,$){return Xs(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?xa(p,$?0:re,$?re+1:Z):xa(p,$?re+1:0,$?Z:re)}function wp(p,y){var O=p;return O instanceof jr&&(O=O.value()),Nu(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 Qv=kr;function no(p,y,O){var $=p.length;return O=O===f?$:O,!y&&O>=$?p:xa(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 Ys(p){var y=new p.constructor(p.byteLength);return new Bl(y).set(new Bl(p)),y}function kh(p,y){var O=y?Ys(p.buffer):p.buffer;return new p.constructor(O,p.byteOffset,p.length)}function Fu(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),qt=!$;++xe<Ue;)xt[xe]=y[xe];for(;++Z<ve;)(qt||Z<re)&&(xt[O[Z]]=p[Z]);for(;_t--;)xt[xe++]=p[Z++];return xt}function Ks(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),qt=bn(xt+_t),xn=!$;++Z<xt;)qt[Z]=p[Z];for(var An=Z;++Ue<_t;)qt[An+Ue]=y[Ue];for(;++ve<xe;)(xn||Z<re)&&(qt[An+O[ve]]=p[Z++]);return qt}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 Zs(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 Js(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 Qs(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 Nu(go(ir(y).replace(Fd,"")),p,"")}}function eu(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=Hs(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=ja.prototype.thru;for(p&&y.reverse();$--;){var re=y[$];if(typeof re!="function")throw new Ee(_);if(Z&&!ve&&gs(re)=="wrapper")var ve=new ja([],!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 qt=0,xn=O?y[qt].apply(this,_t):xt;++qt<O;)xn=y[qt].call(this,xn);return xn}}))}function zc(p,y,O,$,Z,re,ve,xe,Ue,_t){var xt=y&E,qt=1&y,xn=2&y,An=24&y,qn=512&y,Lt=xn?f:eu(p);return function rn(){for(var sr=arguments.length,Pn=bn(sr),qe=sr;qe--;)Pn[qe]=arguments[qe];if(An)var yr=_s(rn),Br=ap(Pn,yr);if($&&(Pn=Th(Pn,$,Z,An)),re&&(Pn=Ks(Pn,re,ve,An)),sr-=Br,An&&sr<_t){var Jn=ia(Pn,yr);return Ep(p,y,zc,rn.placeholder,O,Pn,Jn,xe,Ue,_t-sr)}var dr=qt?O:this,Mi=xn?dr[p]:p;return sr=Pn.length,xe?Pn=ru(Pn,xe):qn&&sr>1&&Pn.reverse(),xt&&Ue<sr&&(Pn.length=Ue),this&&this!==Uo&&this instanceof rn&&(Mi=Lt||eu(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 Bu(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 Vu(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 Uu(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 Wu(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?A:S,4&(y&=~(xt?S:A))||(y&=-4);var qt=[p,y,Z,xt?re:f,xt?ve:f,xt?f:re,xt?f:ve,xe,Ue,_t],xn=O.apply(f,qt);return Al(p)&&Mp(xn,qt),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))&&Gs(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=zs&&1/ba(new zs([,-0]))[1]==I?function(p){return new zs(p)}:ut;function Op(p){return function(y){var O=Do(y);return O==ee?ni(y):O==Ne?Cu(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(_);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&S){var xt=$,qt=Z;$=Z=f}var xn=Ue?f:yf(p),An=[p,y,O,$,Z,xt,qt,re,ve,xe];if(xn&&(function(Lt,rn){var sr=Lt[1],Pn=rn[1],qe=sr|Pn,yr=qe<131,Br=Pn==E&&sr==8||Pn==E&&sr==T&&Lt[7].length<=rn[8]||Pn==384&&rn[7].length<=rn[8]&&sr==8;if(!yr&&!Br)return Lt;1&Pn&&(Lt[2]=rn[2],qe|=1&sr?0:4);var Jn=rn[3];if(Jn){var dr=Lt[3];Lt[3]=dr?Th(dr,Jn,rn[4]):Jn,Lt[4]=dr?ia(Lt[3],b):rn[4]}(Jn=rn[5])&&(dr=Lt[5],Lt[5]=dr?Ks(dr,Jn,rn[6]):Jn,Lt[6]=dr?ia(Lt[5],b):rn[6]),(Jn=rn[7])&&(Lt[7]=Jn),Pn&E&&(Lt[8]=Lt[8]==null?rn[8]:Gi(Lt[8],rn[8])),Lt[9]==null&&(Lt[9]=rn[9]),Lt[0]=rn[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,rn,sr){var Pn=eu(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,rn,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!=A&&y!=33||Z.length?zc.apply(f,An):(function(Lt,rn,sr,Pn){var qe=1&rn,yr=eu(Lt);return function Br(){for(var Jn=-1,dr=arguments.length,Mi=-1,Fa=Pn.length,Jl=bn(Fa+dr),ki=this&&this!==Uo&&this instanceof Br?yr:Lt;++Mi<Fa;)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,rn,sr){var Pn=1&rn,qe=eu(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||$a(p,Kt[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 Gu(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 qt=-1,xn=!0,An=2&O?new Wl:f;for(re.set(p,y),re.set(y,p);++qt<xe;){var qn=p[qt],Lt=y[qt];if($)var rn=ve?$(Lt,qn,qt,y,p,re):$(qn,Lt,qt,p,y,re);if(rn!==f){if(rn)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,tu)}var yf=Ic?function(p){return Ic.get(p)}:ut;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 zu(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,nu(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,tu=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)||uu(p))}function ta(p){return typeof p.constructor!="function"||Ct(p)?{}:Hs(Ya(p))}function Yc(p){return wr(p)||uu(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)&&$a(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]}(ju&&Do(new ju(new ArrayBuffer(1)))!=Be||Du&&Do(new Du)!=ee||Dc&&Do(Dc.resolve())!=be||zs&&Do(new zs)!=Ne||ps&&Do(new ps)!=rt)&&(Do=function(p){var y=No(p),O=y==ie?p.constructor:f,$=O?Es(O):"";if($)switch($){case Xv:return Be;case Lc:return ee;case qv:return be;case Yv:return Ne;case yh:return rt}return y});var gf=Sn?Sa:Je;function Ct(p){var y=p&&p.constructor;return p===(typeof y=="function"&&y.prototype||Kt)}function nu(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,xa(y,0,-1))}function ru(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),ou=lp||function(p,y){return Uo.setTimeout(p,y)},Jc=kp(Zv);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(D,(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(tn,"$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 ja(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)):[]})),em=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(iu);function iu(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(Fu)),$}));function Hu(p){return p==null?p:Hv.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 au(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=au(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))})),lu=kr((function(p){var y=xo(p);return y=typeof y=="function"?y:f,sf(Bi(p,Co),f,y)})),Xu=kr(au),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 ja($,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 su(p,y){return(wr(p)?Vr:Oa)(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 La(p,y){var O;if(typeof y!="function")throw new Ee(_);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));$|=A}return rl(p,$,y,O,Z)})),Ss=kr((function(p,y,O){var $=3;if(O.length){var Z=ia(O,_s(Ss));$|=A}return rl(y,$,p,O,Z)}));function zn(p,y,O){var $,Z,re,ve,xe,Ue,_t=0,xt=!1,qt=!1,xn=!0;if(typeof p!="function")throw new Ee(_);function An(qe){var yr=$,Br=Z;return $=Z=f,_t=qe,ve=p.apply(Br,yr)}function qn(qe){return _t=qe,xe=ou(rn,y),xt?An(qe):ve}function Lt(qe){var yr=qe-Ue;return Ue===f||yr>=y||yr<0||qt&&qe-_t>=re}function rn(){var qe=sd();if(Lt(qe))return sr(qe);xe=ou(rn,(function(yr){var Br=y-(yr-Ue);return qt?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(qt)return df(xe),xe=ou(rn,y),An(Ue)}return xe===f&&(xe=ou(rn,y)),ve}return y=Gt(y)||0,Lo(O)&&(xt=!!O.leading,re=(qt="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)})),qu=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(_);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(_);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=Qv((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,A,f,y,O)})),Io=kr((function(p,y){var O=ia(y,_s(Io));return rl(p,S,f,y,O)})),ua=xl((function(p,y){return rl(p,T,f,f,f,y)}));function $a(p,y){return p===y||p!=p&&y!=y}var tm=Wu(jo),cd=Wu((function(p,y){return p>=y})),uu=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)&&!Sa(p)}function Co(p){return Xo(p)&&ca(p)}var na=mh||Je,jp=Wd?mo(Wd):function(p){return Xo(p)&&No(p)==V};function Ai(p){if(!Xo(p))return!1;var y=No(p);return y==z||y=="[object DOMException]"||typeof p.message=="string"&&typeof p.name=="string"&&!G(p)}function Sa(p){if(!Lo(p))return!1;var y=No(p);return y==H||y==q||y=="[object AsyncFunction]"||y=="[object Proxy]"}function cu(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)!=ie)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)==De},Oe=si?mo(si):function(p){return Xo(p)&&Do(p)==Ne};function st(p){return typeof p=="string"||!wr(p)&&Xo(p)&&No(p)==Ae}function gt(p){return typeof p=="symbol"||Xo(p)&&No(p)==Te}var ot=ya?mo(ya):function(p){return Xo(p)&&dd(p.length)&&!!Kr[No(p)]},mt=Wu(Ol),Rt=Wu((function(p,y){return p<=y}));function Bt(p){if(!p)return[];if(ca(p))return st(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==Ne?ba: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 Zt(p){return p?vs(ht(p),0,L):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=Ra(p);var O=Ei.test(p);return O||ti.test(p)?ma(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=Zs((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=Zs((function(p,y){tl(y,Pt(y),p)})),$t=Zs((function(p,y,O,$){tl(y,Pt(y),p,$)})),nn=Zs((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||$a(xt,Kt[_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 Yt(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 Jt=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):Ia(p)}function Pt(p){return ca(p)?Jd(p,!0):wh(p)}var Mt=Zs((function(p,y,O){nf(p,y,O)})),Ln=Zs((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=Ea(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?[]:Bs(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(Mu)||[]})(p):(function($){return $.match(lt)||[]})(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:Ea(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=Sa(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__),qt=xt.__actions__=yi(this.__actions__);return qt.push({func:Ue,args:arguments,thisArg:p}),xt.__chain__=_t,xt}return Ue.apply(p,ui([this.value()],arguments))})})),p}function ut(){}var it=Vu(Vr),dn=Vu(zd),hr=Vu(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 Ie=Bu((function(p,y){return p+y}),0),Ce=vf("ceil"),Ve=Bu((function(p,y){return p/y}),1),pe=vf("floor"),Me,fe=Bu((function(p,y){return p*y}),1),ze=vf("round"),Xe=Bu((function(p,y){return p-y}),0);return le.after=function(p,y){if(typeof y!="function")throw new Ee(_);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=nn,le.at=kt,le.before=La,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++]=xa(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(_);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)}})(Ea(p,1))},le.constant=Tr,le.countBy=Wn,le.create=function(p,y){var O=Hs(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=qu,le.difference=Ph,le.differenceBy=Ch,le.differenceWith=Rh,le.drop=function(p,y,O){var $=p==null?0:p.length;return $?xa(p,(y=O||y===f?1:ht(y))<0?0:y,$):[]},le.dropRight=function(p,y,O){var $=p==null?0:p.length;return $?xa(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:Zt(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(su(p,y),1)},le.flatMapDeep=function(p,y){return oi(su(p,y),I)},le.flatMapDepth=function(p,y,O){return O=O===f?1:ht(O),oi(su(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?xa(p,0,-1):[]},le.intersection=al,le.intersectionBy=Os,le.intersectionWith=em,le.invert=Jt,le.invertBy=Cn,le.invokeMap=xs,le.iteratee=_o,le.keyBy=Ih,le.keys=It,le.keysIn=Pt,le.map=su,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(Ea(p,1))},le.matchesProperty=function(p,y){return mp(p,Ea(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 La(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=iu,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(_);return kr(p,y=y===f?y:ht(y))},le.reverse=Hu,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:Xs(p,y,O)},le.setWith=function(p,y,O,$){return $=typeof $=="function"?$:f,p==null?p:Xs(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)),xa(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?L: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(_);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?xa(p,1,y):[]},le.take=function(p,y,O){return p&&p.length?xa(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 $?xa(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(_);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)&&Sa(re)?Hs(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=au,le.unzipWith=Yl,le.update=function(p,y,O){return p==null?p:qs(p,y,cf(O))},le.updateWith=function(p,y,O,$){return $=typeof $=="function"?$:f,p==null?p:qs(p,y,cf(O),$)},le.values=Er,le.valuesIn=function(p){return p==null?[]:Bs(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=lu,le.zip=Xu,le.zipObject=function(p,y){return Gc(p||[],y||[],Go)},le.zipObjectDeep=function(p,y){return Gc(p||[],y||[],Xs)},le.zipWith=Si,le.entries=Xn,le.entriesIn=lr,le.extend=pt,le.extendWith=$t,ye(le,le),le.add=Ie,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 Ea(p,4)},le.cloneDeep=function(p){return Ea(p,5)},le.cloneDeepWith=function(p,y){return Ea(p,5,y=typeof y=="function"?y:f)},le.cloneWith=function(p,y){return Ea(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=$a,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=Yt,le.gt=tm,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)),st(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=uu,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)||uu(p)))return!p.length;var y=Do(p);if(y==ee||y==Ne)return!p.size;if(Ct(p))return!Ia(p).length;for(var O in p)if(vn.call(p,O))return!1;return!0},le.isEqual=function(p,y){return $u(p,y)},le.isEqualWith=function(p,y,O){var $=(O=typeof O=="function"?O:f)?O(p,y):f;return $===f?$u(p,y,f,O):!!$},le.isError=Ai,le.isFinite=function(p){return typeof p=="number"&&Gs(p)},le.isFunction=Sa,le.isInteger=cu,le.isLength=dd,le.isMap=Af,le.isMatch=function(p,y){return p===y||Da(p,y,qc(y))},le.isMatchWith=function(p,y,O){return O=typeof O=="function"?O:f,Da(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 cu(p)&&p>=-9007199254740991&&p<=R},le.isSet=Oe,le.isString=st,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,ga,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=ut,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 Uu(Ws(Z),O)+p+Uu(Rc(Z),O)},le.padEnd=function(p,y,O){p=At(p);var $=(y=ht(y))?Wi(p):0;return y&&$<y?p+Uu(y-$,O):p},le.padStart=function(p,y,O){p=At(p);var $=(y=ht(y))?Wi(p):0;return y&&$<y?Uu(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=Ru();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)?Nu: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=Sa(re)?re.call(p):re}return p},le.round=ze,le.runInContext=vt,le.sample=function(p){return(wr(p)?Qd:Kv)(p)},le.size=function(p){if(p==null)return 0;if(ca(p))return st(p)?Wi(p):p.length;var y=Do(p);return y==ee||y==Ne?p.size:Ia(p).length},le.snakeCase=qo,le.some=function(p,y,O){var $=wr(p)?Tc:Jv;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&&$a(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($a(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=Bs(ve,xe),_t=0,xt=y.interpolate||Zn,qt="__p += '",xn=X((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(rn,sr,Pn,qe,yr,Br){return Pn||(Pn=qe),qt+=p.slice(_t,Br).replace(ur,Vs),sr&&(Z=!0,qt+=`' +
__e(`+sr+`) +
'`),yr&&(re=!0,qt+=`';
`+yr+`;
__p += '`),Pn&&(qt+=`' +
((__t = (`+Pn+`)) == null ? '' : __t) +
'`),_t=Br+rn.length,rn})),qt+=`';
`;var qn=vn.call(y,"variable")&&y.variable;if(qn){if(an.test(qn))throw new Rr("Invalid `variable` option passed into `_.template`")}else qt=`with (obj) {
`+qt+`
}
`;qt=(re?qt.replace(bt,""):qt).replace(Ft,"$1").replace(en,"$1;"),qt="function("+(qn||"obj")+`) {
`+(qn?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(re?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+qt+`return __p
}`;var Lt=er((function(){return yo(xe,An+"return "+qt).apply(f,Ue)}));if(Lt.source=qt,Ai(Lt))throw Lt;return Lt},le.times=function(p,y){if((p=ht(p))<1||p>R)return[];var O=L,$=Gi(p,L);y=rr(y),p-=L;for(var Z=Fl($,y);++O<p;)y(O);return Z},le.toFinite=jt,le.toInteger=ht,le.toLength=Zt,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 Ra(p);if(!p||!(y=sa(y)))return p;var $=Qi(p),Z=Qi(y);return no($,_a($,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($,_a($,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=X(Z.source,At(Sr.exec(Z))+"g")),Z.lastIndex=0;_t=Z.exec(xt);)var qt=_t.index;Ue=Ue.slice(0,qt===f?xe:qt)}}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,(Me={},Dn(le,(function(p,y){vn.call(le.prototype,y)||(Me[y]=p)})),Me),{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,L),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(L)},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),qt=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 rn=p.apply(ve,xe);return rn.__actions__.push({func:ad,args:[qt],thisArg:f}),new ja(rn,xn)}return qn&&Lt?p.apply(this,xe):(rn=this.thru(qt),qn?$?rn.value()[0]:rn.value():rn)})})),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,Fa=dr.length;++Mi<Fa;){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__,qt=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,rn=p[_t+=y];++Lt<qt;){var sr=xt[Lt],Pn=sr.iteratee,qe=sr.type,yr=Pn(rn);if(qe==2)rn=yr;else if(!yr){if(qe==1)continue e;break e}}qn[xn++]=rn}return qn},le.prototype.at=Hi,le.prototype.chain=function(){return Po(this)},le.prototype.commit=function(){return new ja(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:[Hu],thisArg:f}),new ja(y,this.__chain__)}return this.thru(Hu)},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),_=r(62),g=r(174),b=r(28),x=s.TypeError,A=b("toPrimitive");n.exports=function(S,E){if(!v(S)||f(S))return S;var T,I=_(S,A);if(I){if(E===void 0&&(E="default"),T=c(I,S,E),!v(T)||f(T))return T;throw x("Can't convert object to primitive value")}return E===void 0&&(E="number"),g(S,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(g),x=f.f,A=v.f,S=0;S<b.length;S++){var E=b[S];s(_,E)||x(_,E,A(g,E))}}},function(n,a,r){var s=r(46),c=r(15),v=r(74),f=r(112),_=r(32),g=c([].concat);n.exports=s("Reflect","ownKeys")||function(b){var x=v.f(_(b)),A=f.f;return A?g(x,A(b)):x}},function(n,a,r){var s=r(15),c=r(35),v=r(41),f=r(137).indexOf,_=r(72),g=s([].push);n.exports=function(b,x){var A,S=v(b),E=0,T=[];for(A in S)!c(_,A)&&c(S,A)&&g(T,A);for(;x.length>E;)c(S,A=x[E++])&&(~f(T,A)||g(T,A));return T}},function(n,a,r){var s=r(41),c=r(75),v=r(45),f=function(_){return function(g,b,x){var A,S=s(g),E=v(S),T=c(x,E);if(_&&b!=b){for(;E>T;)if((A=S[T++])!=A)return!0}else for(;E>T;T++)if((_||T in S)&&S[T]===b)return _||T||0;return!_&&-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),_=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(g){return _&&s(g)=="Window"?(function(b){try{return v(b)}catch{return f(_)}})(g):v(c(g))}},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(_){var g=s.Symbol||(s.Symbol={});c(g,_)||f(g,_,{value:v.f(_)})}},function(n,a,r){var s,c,v,f=r(18),_=r(30),g=r(60),b=r(101),x=r(42),A=r(28),S=r(71),E=A("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={}:S&&(s=g(s)),_(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),_=r(35),g=r(38).f,b=r(74),x=r(139),A=r(183),S=r(90),E=r(185),T=!1,I=S("meta"),R=0,U=function(D){g(D,I,{value:{objectID:"O"+R++,weakData:{}}})},L=n.exports={enable:function(){L.enable=function(){},T=!0;var D=b.f,W=c([].splice),Y={};Y[I]=1,D(Y).length&&(b.f=function(B){for(var V=D(B),z=0,H=V.length;z<H;z++)if(V[z]===I){W(V,z,1);break}return V},s({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:x.f}))},fastKey:function(D,W){if(!f(D))return typeof D=="symbol"?D:(typeof D=="string"?"S":"P")+D;if(!_(D,I)){if(!A(D))return"F";if(!W)return"E";U(D)}return D[I].objectID},getWeakData:function(D,W){if(!_(D,I)){if(!A(D))return!0;if(!W)return!1;U(D)}return D[I].weakData},onFreeze:function(D){return E&&T&&A(D)&&!_(D,I)&&U(D),D}};v[I]=!0},function(n,a,r){var s=r(28),c=r(80),v=s("iterator"),f=Array.prototype;n.exports=function(_){return _!==void 0&&(c.Array===_||f[v]===_)}},function(n,a,r){var s=r(7),c=r(34),v=r(56),f=r(32),_=r(88),g=r(118),b=s.TypeError;n.exports=function(x,A){var S=arguments.length<2?g(x):A;if(v(S))return f(c(S,x));throw b(_(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(_==="throw")throw g;return g}b=s(b,f)}catch(A){x=!0,b=A}if(_==="throw")throw g;if(x)throw b;return c(b),g}},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=_.constructor)&&b!==g&&c(x=b.prototype)&&x!==g.prototype&&v(f,x),f}},function(n,a,r){var s=r(42);n.exports=function(c,v,f){for(var _ in v)s(c,_,v[_],f);return c}},function(n,a,r){var s=r(46),c=r(38),v=r(28),f=r(36),_=v("species");n.exports=function(g){var b=s(g),x=c.f;f&&b&&!b[_]&&x(b,_,{configurable:!0,get:function(){return this}})}},function(n,a,r){var s=r(15),c=r(59),v=r(39),f=r(44),_=s("".charAt),g=s("".charCodeAt),b=s("".slice),x=function(A){return function(S,E){var T,I,R=v(f(S)),U=c(E),L=R.length;return U<0||U>=L?A?"":void 0:(T=g(R,U))<55296||T>56319||U+1===L||(I=g(R,U+1))<56320||I>57343?A?_(R,U):T:A?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 g=c("a","y");return g.lastIndex=2,g.exec("abcd")!=null})),f=v||s((function(){return!c("a","y").sticky})),_=v||s((function(){var g=c("^r","gy");return g.lastIndex=2,g.exec("str")!=null}));n.exports={BROKEN_CARET:_,MISSED_STICKY:f,UNSUPPORTED_Y:v}},function(n,a,r){var s=r(16),c=r(79).find,v=r(100),f="find",_=!0;f in[]&&Array(1).find((function(){_=!1})),s({target:"Array",proto:!0,forced:_},{find:function(g){return c(this,g,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),_=r(39),g=r(198),b=c("".indexOf);s({target:"String",proto:!0,forced:!g("includes")},{includes:function(x){return!!~b(_(f(this)),_(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 _;return s(f)&&((_=f[v])!==void 0?!!_: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),_=s("".replace),g="["+f+"]",b=RegExp("^"+g+g+"*"),x=RegExp(g+g+"*$"),A=function(S){return function(E){var T=v(c(E));return 1&S&&(T=_(T,b,"")),2&S&&(T=_(T,x,"")),T}};n.exports={start:A(1),end:A(2),trim:A(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 _(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 g,b=[],x=!1,A=-1;function S(){x&&g&&(x=!1,g.length?b=g.concat(b):A=-1,b.length&&E())}function E(){if(!x){var R=_(S);x=!0;for(var U=b.length;U;){for(g=b,b=[];++A<U;)g&&g[A].run();A=-1,U=b.length}g=null,x=!1,(function(L){if(s===clearTimeout)return clearTimeout(L);if((s===f||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(L);try{s(L)}catch{try{return s.call(null,L)}catch{return s.call(this,L)}}})(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 L=1;L<arguments.length;L++)U[L-1]=arguments[L];b.push(new T(R,U)),b.length!==1||x||_(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,_){var g,b=s(f).constructor;return b===void 0||(g=s(b)[v])==null?_:c(g)}},function(n,a,r){var s=r(7),c=r(99),v=r(88),f=s.TypeError;n.exports=function(_){if(c(_))return _;throw f(v(_)+" 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),_=r(39),g=r(44),b=r(62),x=r(124),A=r(125);c("match",(function(S,E,T){return[function(I){var R=g(this),U=I==null?void 0:b(I,S);return U?s(U,I,R):new RegExp(I)[S](_(R))},function(I){var R=v(this),U=_(I),L=T(E,R,U);if(L.done)return L.value;if(!R.global)return A(R,U);var D=R.unicode;R.lastIndex=0;for(var W,Y=[],B=0;(W=A(R,U))!==null;){var V=_(W[0]);Y[B]=V,V===""&&(R.lastIndex=x(U,f(R.lastIndex),D)),B++}return B===0?null:Y}]}))},function(n,a,r){var s,c,v,f,_=r(7),g=r(76),b=r(64),x=r(30),A=r(35),S=r(18),E=r(138),T=r(98),I=r(91),R=r(169),U=r(128),L=_.setImmediate,D=_.clearImmediate,W=_.process,Y=_.Dispatch,B=_.Function,V=_.MessageChannel,z=_.String,H=0,q={},ee="onreadystatechange";try{s=_.location}catch{}var ue=function(Ne){if(A(q,Ne)){var Ae=q[Ne];delete q[Ne],Ae()}},ie=function(Ne){return function(){ue(Ne)}},be=function(Ne){ue(Ne.data)},De=function(Ne){_.postMessage(z(Ne),s.protocol+"//"+s.host)};L&&D||(L=function(Ne){var Ae=T(arguments,1);return q[++H]=function(){g(x(Ne)?Ne:B(Ne),void 0,Ae)},c(H),H},D=function(Ne){delete q[Ne]},U?c=function(Ne){W.nextTick(ie(Ne))}:Y&&Y.now?c=function(Ne){Y.now(ie(Ne))}:V&&!R?(f=(v=new V).port2,v.port1.onmessage=be,c=b(f.postMessage,f)):_.addEventListener&&x(_.postMessage)&&!_.importScripts&&s&&s.protocol!=="file:"&&!S(De)?(c=De,_.addEventListener("message",be,!1)):c=ee in I("script")?function(Ne){E.appendChild(I("script")).onreadystatechange=function(){E.removeChild(this),ue(Ne)}}:function(Ne){setTimeout(ie(Ne),0)}),n.exports={set:L,clear:D}},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,_;this.promise=new v((function(g,b){if(f!==void 0||_!==void 0)throw TypeError("Bad Promise constructor");f=g,_=b})),this.resolve=s(f),this.reject=s(_)};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(V){throw new Error("[mobx-utils] "+V)}function f(V,z){z===void 0&&(z="Illegal state"),V||v(z)}var _=function(V){return V&&V!==Object.prototype&&Object.getOwnPropertyNames(V).concat(_(Object.getPrototypeOf(V))||[])},g=function(V){return(function(z){var H=_(z);return H.filter((function(q,ee){return H.indexOf(q)===ee}))})(V).filter((function(z){return z!=="constructor"&&!~z.indexOf("__")}))},b="pending",x="fulfilled",A="rejected";function S(V){switch(this.state){case b:return V.pending&&V.pending(this.value);case A:return V.rejected&&V.rejected(this.value);case x:return V.fulfilled?V.fulfilled(this.value):this.value}}function E(V,z){if(f(arguments.length<=2,"fromPromise expects up to two arguments"),f(typeof V=="function"||typeof V=="object"&&V&&typeof V.then=="function","Please pass a promise or function to fromPromise"),V.isPromiseBasedObservable===!0)return V;typeof V=="function"&&(V=new Promise(V));var H=V;V.then(Object(c.k)("observableFromPromise-resolve",(function(ee){H.value=ee,H.state=x})),Object(c.k)("observableFromPromise-reject",(function(ee){H.value=ee,H.state=A}))),H.isPromiseBasedObservable=!0,H.case=S;var q=z&&z.state===x?z.value:void 0;return Object(c.q)(H,{value:q,state:b},{},{deep:!1}),H}(function(V){V.reject=Object(c.k)("fromPromise.reject",(function(z){var H=V(Promise.reject(z));return H.state=A,H.value=z,H})),V.resolve=Object(c.k)("fromPromise.resolve",(function(z){z===void 0&&(z=void 0);var H=V(Promise.resolve(z));return H.state=x,H.value=z,H}))})(E||(E={}));var T=function(V,z,H,q){var ee,ue=arguments.length,ie=ue<3?z:q===null?q=Object.getOwnPropertyDescriptor(z,H):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(V,z,H,q);else for(var be=V.length-1;be>=0;be--)(ee=V[be])&&(ie=(ue<3?ee(ie):ue>3?ee(z,H,ie):ee(z,H))||ie);return ue>3&&ie&&Object.defineProperty(z,H,ie),ie};(function(){function V(z,H){var q=this;Object(c.G)((function(){q.current=H,q.subscription=z.subscribe(q)}))}V.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},V.prototype.next=function(z){this.current=z},V.prototype.complete=function(){this.dispose()},V.prototype.error=function(z){this.current=z,this.dispose()},T([c.C.ref],V.prototype,"current",void 0),T([c.k.bound],V.prototype,"next",null),T([c.k.bound],V.prototype,"complete",null),T([c.k.bound],V.prototype,"error",null)})();var I=function(){return I=Object.assign||function(V){for(var z,H=1,q=arguments.length;H<q;H++)for(var ee in z=arguments[H])Object.prototype.hasOwnProperty.call(z,ee)&&(V[ee]=z[ee]);return V},I.apply(this,arguments)},R=function(V,z,H,q){var ee,ue=arguments.length,ie=ue<3?z:q===null?q=Object.getOwnPropertyDescriptor(z,H):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(V,z,H,q);else for(var be=V.length-1;be>=0;be--)(ee=V[be])&&(ie=(ue<3?ee(ie):ue>3?ee(z,H,ie):ee(z,H))||ie);return ue>3&&ie&&Object.defineProperty(z,H,ie),ie},U=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function V(z){var H=this;this.model=z,this.localValues=c.C.map({}),this.localComputedValues=c.C.map({}),this.isPropertyDirty=function(q){return H.localValues.has(q)},f(Object(c.A)(z),"createViewModel expects an observable object"),g(z).forEach((function(q){if(q!==c.a&&q!=="__mobxDidRunLazyInitializers"){if(f(U.indexOf(q)===-1,"The propertyname "+q+" is reserved and cannot be used with viewModels"),Object(c.w)(z,q)){var ee=Object(c.h)(z,q).derivation;H.localComputedValues.set(q,Object(c.m)(ee.bind(H)))}var ue=Object.getOwnPropertyDescriptor(z,q),ie=ue?{enumerable:ue.enumerable}:{};Object.defineProperty(H,q,I(I({},ie),{configurable:!0,get:function(){return Object(c.w)(z,q)?H.localComputedValues.get(q).get():H.isPropertyDirty(q)?H.localValues.get(q):H.model[q]},set:Object(c.k)((function(be){be!==H.model[q]?H.localValues.set(q,be):H.localValues.delete(q)}))}))}}))}Object.defineProperty(V.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),V.prototype.submit=function(){var z=this;Object(c.B)(this.localValues).forEach((function(H){var q=z.localValues.get(H),ee=z.model[H];Object(c.y)(ee)?ee.replace(q):Object(c.z)(ee)?(ee.clear(),ee.merge(q)):Object(c.v)(q)||(z.model[H]=q)})),this.localValues.clear()},V.prototype.reset=function(){this.localValues.clear()},V.prototype.resetProperty=function(z){this.localValues.delete(z)},R([c.m],V.prototype,"isDirty",null),R([c.m],V.prototype,"changedValues",null),R([c.k.bound],V.prototype,"submit",null),R([c.k.bound],V.prototype,"reset",null),R([c.k.bound],V.prototype,"resetProperty",null)})();function L(V){if(!V)return"ROOT";for(var z=[];V.parent;)z.push(V.path),V=V.parent;return z.reverse().join("/")}function D(V){return Object(c.A)(V)||Object(c.y)(V)||Object(c.z)(V)}function W(V,z){var H=new WeakMap;function q(ie){var be=H.get(ie.object);(function(De,Ne){switch(De.type){case"add":ee(De.newValue,Ne,De.name);break;case"update":ue(De.oldValue),ee(De.newValue,Ne,De.name||""+De.index);break;case"remove":case"delete":ue(De.oldValue);break;case"splice":De.removed.map(ue),De.added.forEach((function(rt,tt){return ee(rt,Ne,""+(De.index+tt))}));for(var Ae=De.index+De.addedCount;Ae<De.object.length;Ae++)if(D(De.object[Ae])){var Te=H.get(De.object[Ae]);Te&&(Te.path=""+Ae)}}})(ie,be),z(ie,L(be),V)}function ee(ie,be,De){if(D(ie)){var Ne=H.get(ie);if(Ne){if(Ne.parent!==be||Ne.path!==De)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+L(be)+"/"+De+"', but it already exists at '"+L(Ne.parent)+"/"+Ne.path+"'")}else{var Ae={parent:be,path:De,dispose:Object(c.D)(ie,q)};H.set(ie,Ae),Object(c.p)(ie).forEach((function(Te){var rt=Te[0];return ee(Te[1],Ae,rt)}))}}}function ue(ie){if(D(ie)){var be=H.get(ie);if(!be)return;H.delete(ie),be.dispose(),Object(c.L)(ie).forEach(ue)}}return ee(V,void 0,""),function(){ue(V)}}var Y,B=(Y=function(V,z){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,q){H.__proto__=q}||function(H,q){for(var ee in q)q.hasOwnProperty(ee)&&(H[ee]=q[ee])},Y(V,z)},function(V,z){function H(){this.constructor=V}Y(V,z),V.prototype=z===null?Object.create(z):(H.prototype=z.prototype,new H)});(function(V){function z(H,q,ee){var ue=ee===void 0?{}:ee,ie=ue.name,be=ie===void 0?"ogm"+(1e3*Math.random()|0):ie,De=ue.keyToName,Ne=De===void 0?function(rt){return""+rt}:De,Ae=V.call(this)||this;Ae._keyToName=Ne,Ae._groupBy=q,Ae._ogmInfoKey=Symbol("ogmInfo"+be),Ae._base=H;for(var Te=0;Te<H.length;Te++)Ae._addItem(H[Te]);return Ae._disposeBaseObserver=Object(c.D)(Ae._base,(function(rt){if(rt.type==="splice")Object(c.J)((function(){for(var tt=0,Be=rt.removed;tt<Be.length;tt++){var dt=Be[tt];Ae._removeItem(dt)}for(var St=0,He=rt.added;St<He.length;St++){var Qt=He[St];Ae._addItem(Qt)}}));else{if(rt.type!=="update")throw new Error("illegal state");Object(c.J)((function(){Ae._removeItem(rt.oldValue),Ae._addItem(rt.newValue)}))}})),Ae}B(z,V),z.prototype.clear=function(){throw new Error("not supported")},z.prototype.delete=function(H){throw new Error("not supported")},z.prototype.set=function(H,q){throw new Error("not supported")},z.prototype.dispose=function(){this._disposeBaseObserver();for(var H=0;H<this._base.length;H++){var q=this._base[H];q[this._ogmInfoKey].reaction(),delete q[this._ogmInfoKey]}},z.prototype._getGroupArr=function(H){var q=V.prototype.get.call(this,H);return q===void 0&&(q=Object(c.C)([],{name:"GroupArray["+this._keyToName(H)+"]",deep:!1}),V.prototype.set.call(this,H,q)),q},z.prototype._removeFromGroupArr=function(H,q){var ee=V.prototype.get.call(this,H);ee.length===1?V.prototype.delete.call(this,H):(q===ee.length-1||(ee[q]=ee[ee.length-1],ee[q][this._ogmInfoKey].groupArrIndex=q),ee.length--)},z.prototype._addItem=function(H){var q=this,ee=this._groupBy(H),ue=this._getGroupArr(ee),ie={groupByValue:ee,groupArrIndex:ue.length,reaction:Object(c.F)((function(){return q._groupBy(H)}),(function(be,De){var Ne=H[q._ogmInfoKey];q._removeFromGroupArr(Ne.groupByValue,Ne.groupArrIndex);var Ae=q._getGroupArr(be),Te=Ae.length;Ae.push(H),Ne.groupByValue=be,Ne.groupArrIndex=Te}))};Object.defineProperty(H,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:ie}),ue.push(H)},z.prototype._removeItem=function(H){var q=H[this._ogmInfoKey];this._removeFromGroupArr(q.groupByValue,q.groupArrIndex),q.reaction(),delete H[this._ogmInfoKey]}})(c.b),(function(){function V(z,H){this.base=z,this.args=H,this.closestIdx=0,this.isDisposed=!1;for(var q=this.closest=this.root=z,ee=0;ee<this.args.length-1&&(q=q.get(H[ee]));ee++)this.closest=q;this.closestIdx=ee}return V.prototype.exists=function(){this.assertNotDisposed();var z=this.args.length;return this.closestIdx>=z-1&&this.closest.has(this.args[z-1])},V.prototype.get=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");return this.closest.get(this.args[this.args.length-1])},V.prototype.set=function(z){this.assertNotDisposed();for(var H=this.args.length,q=this.closest,ee=this.closestIdx;ee<H-1;ee++){var ue=new Map;q.set(this.args[ee],ue),q=ue}this.closestIdx=H-1,this.closest=q,q.set(this.args[H-1],z)},V.prototype.delete=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var z=this.args.length;this.closest.delete(this.args[z-1]);for(var H=this.root,q=[H],ee=0;ee<z-1;ee++)H=H.get(this.args[ee]),q.push(H);for(ee=q.length-1;ee>0;ee--)q[ee].size===0&&q[ee-1].delete(this.args[ee-1]);this.isDisposed=!0},V.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},V})(),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",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},A={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},S=1;S<20;++S)g[111+S]="f"+S;for(S=0;S<=9;++S)g[S+96]=S.toString();D.prototype.bind=function(W,Y,B){var V=this;return W=W instanceof Array?W:[W],V._bindMultiple.call(V,W,Y,B),V},D.prototype.unbind=function(W,Y){return this.bind.call(this,W,(function(){}),Y)},D.prototype.trigger=function(W,Y){var B=this;return B._directMap[W+":"+Y]&&B._directMap[W+":"+Y]({},W),B},D.prototype.reset=function(){var W=this;return W._callbacks={},W._directMap={},W},D.prototype.stopCallback=function(W,Y){if((" "+Y.className+" ").indexOf(" mousetrap ")>-1||L(Y,this.target))return!1;if("composedPath"in W&&typeof W.composedPath=="function"){var B=W.composedPath()[0];B!==W.target&&(Y=B)}return Y.tagName=="INPUT"||Y.tagName=="SELECT"||Y.tagName=="TEXTAREA"||Y.isContentEditable},D.prototype.handleKey=function(){var W=this;return W._handleKey.apply(W,arguments)},D.addKeycodes=function(W){for(var Y in W)W.hasOwnProperty(Y)&&(g[Y]=W[Y]);_=null},D.init=function(){var W=D(v);for(var Y in W)Y.charAt(0)!=="_"&&(D[Y]=(function(B){return function(){return W[B].apply(W,arguments)}})(Y))},D.init(),c.Mousetrap=D,n.exports&&(n.exports=D),(s=(function(){return D}).call(a,r,a,n))===void 0||(n.exports=s)}function E(W,Y,B){W.addEventListener?W.addEventListener(Y,B,!1):W.attachEvent("on"+Y,B)}function T(W){if(W.type=="keypress"){var Y=String.fromCharCode(W.which);return W.shiftKey||(Y=Y.toLowerCase()),Y}return g[W.which]?g[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,Y,B){return B||(B=(function(){if(!_)for(var V in _={},g)V>95&&V<112||g.hasOwnProperty(V)&&(_[g[V]]=V);return _})()[W]?"keydown":"keypress"),B=="keypress"&&Y.length&&(B="keydown"),B}function U(W,Y){var B,V,z,H=[];for(B=(function(q){return q==="+"?["+"]:(q=q.replace(/\+{2}/g,"+plus")).split("+")})(W),z=0;z<B.length;++z)V=B[z],A[V]&&(V=A[V]),Y&&Y!="keypress"&&x[V]&&(V=x[V],H.push("shift")),I(V)&&H.push(V);return{key:V,modifiers:H,action:Y=R(V,H,Y)}}function L(W,Y){return W!==null&&W!==v&&(W===Y||L(W.parentNode,Y))}function D(W){var Y=this;if(W=W||v,!(Y instanceof D))return new D(W);Y.target=W,Y._callbacks={},Y._directMap={};var B,V={},z=!1,H=!1,q=!1;function ee(Ae){Ae=Ae||{};var Te,rt=!1;for(Te in V)Ae[Te]?rt=!0:V[Te]=0;rt||(q=!1)}function ue(Ae,Te,rt,tt,Be,dt){var St,He,Qt,Fe,we=[],Re=rt.type;if(!Y._callbacks[Ae])return[];for(Re=="keyup"&&I(Ae)&&(Te=[Ae]),St=0;St<Y._callbacks[Ae].length;++St)if(He=Y._callbacks[Ae][St],(tt||!He.seq||V[He.seq]==He.level)&&Re==He.action&&(Re=="keypress"&&!rt.metaKey&&!rt.ctrlKey||(Qt=Te,Fe=He.modifiers,Qt.sort().join(",")===Fe.sort().join(",")))){var Ye=!tt&&He.combo==Be,Ot=tt&&He.seq==tt&&He.level==dt;(Ye||Ot)&&Y._callbacks[Ae].splice(St,1),we.push(He)}return we}function ie(Ae,Te,rt,tt){Y.stopCallback(Te,Te.target||Te.srcElement,rt,tt)||Ae(Te,rt)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(Te),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(Te))}function be(Ae){typeof Ae.which!="number"&&(Ae.which=Ae.keyCode);var Te=T(Ae);Te&&(Ae.type!="keyup"||z!==Te?Y.handleKey(Te,(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})(Ae),Ae):z=!1)}function De(Ae,Te,rt,tt){function Be(Qt){return function(){q=Qt,++V[Ae],clearTimeout(B),B=setTimeout(ee,1e3)}}function dt(Qt){ie(rt,Qt,Ae),tt!=="keyup"&&(z=T(Qt)),setTimeout(ee,10)}V[Ae]=0;for(var St=0;St<Te.length;++St){var He=St+1===Te.length?dt:Be(tt||U(Te[St+1]).action);Ne(Te[St],He,tt,Ae,St)}}function Ne(Ae,Te,rt,tt,Be){Y._directMap[Ae+":"+rt]=Te;var dt,St=(Ae=Ae.replace(/\s+/g," ")).split(" ");St.length>1?De(Ae,St,Te,rt):(dt=U(Ae,rt),Y._callbacks[dt.key]=Y._callbacks[dt.key]||[],ue(dt.key,dt.modifiers,{type:dt.action},tt,Ae,Be),Y._callbacks[dt.key][tt?"unshift":"push"]({callback:Te,modifiers:dt.modifiers,action:dt.action,seq:tt,level:Be,combo:Ae}))}Y._handleKey=function(Ae,Te,rt){var tt,Be=ue(Ae,Te,rt),dt={},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,dt[Be[tt].seq]=1,ie(Be[tt].callback,rt,Be[tt].combo,Be[tt].seq)}else He||ie(Be[tt].callback,rt,Be[tt].combo);var Qt=rt.type=="keypress"&&H;rt.type!=q||I(Ae)||Qt||ee(dt),H=He&&rt.type=="keydown"},Y._bindMultiple=function(Ae,Te,rt){for(var tt=0;tt<Ae.length;++tt)Ne(Ae[tt],Te,rt)},E(W,"keypress",be),E(W,"keydown",be),E(W,"keyup",be)}})(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),_=s.TypeError;n.exports=function(g,b){var x,A;if(b==="string"&&v(x=g.toString)&&!f(A=c(x,g))||v(x=g.valueOf)&&!f(A=c(x,g))||b!=="string"&&v(x=g.toString)&&!f(A=c(x,g)))return A;throw _("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),_=r(77);n.exports=s?Object.defineProperties:function(g,b){v(g);for(var x,A=f(b),S=_(b),E=S.length,T=0;E>T;)c.f(g,x=S[T++],A[x]);return g}},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),_=r(28)("species"),g=s.Array;n.exports=function(b){var x;return c(b)&&(x=b.constructor,(v(x)&&(x===g||c(x.prototype))||f(x)&&(x=x[_])===null)&&(x=void 0)),x===void 0?g: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),_=r(80),g=function(){return this};n.exports=function(b,x,A,S){var E=x+" Iterator";return b.prototype=c(s,{next:v(+!S,A)}),f(b,E,!1,!0),_[E]=g,b}},function(n,a,r){var s=r(7),c=r(30),v=s.String,f=s.TypeError;n.exports=function(_){if(typeof _=="object"||c(_))return _;throw f("Can't set "+v(_)+" as a prototype")}},function(n,a,r){var s=r(16),c=r(7),v=r(15),f=r(95),_=r(42),g=r(144),b=r(117),x=r(119),A=r(30),S=r(33),E=r(18),T=r(120),I=r(78),R=r(148);n.exports=function(U,L,D){var W=U.indexOf("Map")!==-1,Y=U.indexOf("Weak")!==-1,B=W?"set":"add",V=c[U],z=V&&V.prototype,H=V,q={},ee=function(Ae){var Te=v(z[Ae]);_(z,Ae,Ae=="add"?function(rt){return Te(this,rt===0?0:rt),this}:Ae=="delete"?function(rt){return!(Y&&!S(rt))&&Te(this,rt===0?0:rt)}:Ae=="get"?function(rt){return Y&&!S(rt)?void 0:Te(this,rt===0?0:rt)}:Ae=="has"?function(rt){return!(Y&&!S(rt))&&Te(this,rt===0?0:rt)}:function(rt,tt){return Te(this,rt===0?0:rt,tt),this})};if(f(U,!A(V)||!(Y||z.forEach&&!E((function(){new V().entries().next()})))))H=D.getConstructor(L,U,W,B),g.enable();else if(f(U,!0)){var ue=new H,ie=ue[B](Y?{}:-0,1)!=ue,be=E((function(){ue.has(1)})),De=T((function(Ae){new V(Ae)})),Ne=!Y&&E((function(){for(var Ae=new V,Te=5;Te--;)Ae[B](Te,Te);return!Ae.has(-0)}));De||((H=L((function(Ae,Te){x(Ae,z);var rt=R(new V,Ae,H);return Te!=null&&b(Te,rt[B],{that:rt,AS_ENTRIES:W}),rt}))).prototype=z,z.constructor=H),(be||Ne)&&(ee("delete"),ee("has"),W&&ee("get")),(Ne||ie)&&ee(B),Y&&z.clear&&delete z.clear}return q[U]=H,s({global:!0,forced:H!=V},q),I(H,U),Y||D.setStrong(H,U,W),H}},function(n,a,r){var s=r(18),c=r(33),v=r(51),f=r(184),_=Object.isExtensible,g=s((function(){}));n.exports=g||f?function(b){return!!c(b)&&(!f||v(b)!="ArrayBuffer")&&(!_||_(b))}:_},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),_=r(119),g=r(117),b=r(116),x=r(150),A=r(36),S=r(144).fastKey,E=r(58),T=E.set,I=E.getterFor;n.exports={getConstructor:function(R,U,L,D){var W=R((function(H,q){_(H,Y),T(H,{type:U,index:c(null),first:void 0,last:void 0,size:0}),A||(H.size=0),q!=null&&g(q,H[D],{that:H,AS_ENTRIES:L})})),Y=W.prototype,B=I(U),V=function(H,q,ee){var ue,ie,be=B(H),De=z(H,q);return De?De.value=ee:(be.last=De={index:ie=S(q,!0),key:q,value:ee,previous:ue=be.last,next:void 0,removed:!1},be.first||(be.first=De),ue&&(ue.next=De),A?be.size++:H.size++,ie!=="F"&&(be.index[ie]=De)),H},z=function(H,q){var ee,ue=B(H),ie=S(q);if(ie!=="F")return ue.index[ie];for(ee=ue.first;ee;ee=ee.next)if(ee.key==q)return ee};return v(Y,{clear:function(){for(var H=B(this),q=H.index,ee=H.first;ee;)ee.removed=!0,ee.previous&&(ee.previous=ee.previous.next=void 0),delete q[ee.index],ee=ee.next;H.first=H.last=void 0,A?H.size=0:this.size=0},delete:function(H){var q=this,ee=B(q),ue=z(q,H);if(ue){var ie=ue.next,be=ue.previous;delete ee.index[ue.index],ue.removed=!0,be&&(be.next=ie),ie&&(ie.previous=be),ee.first==ue&&(ee.first=ie),ee.last==ue&&(ee.last=be),A?ee.size--:q.size--}return!!ue},forEach:function(H){for(var q,ee=B(this),ue=f(H,arguments.length>1?arguments[1]:void 0);q=q?q.next:ee.first;)for(ue(q.value,q.key,this);q&&q.removed;)q=q.previous},has:function(H){return!!z(this,H)}}),v(Y,L?{get:function(H){var q=z(this,H);return q&&q.value},set:function(H,q){return V(this,H===0?0:H,q)}}:{add:function(H){return V(this,H=H===0?0:H,H)}}),A&&s(Y,"size",{get:function(){return B(this).size}}),W},setStrong:function(R,U,L){var D=U+" Iterator",W=I(U),Y=I(D);b(R,U,(function(B,V){T(this,{type:D,target:B,state:W(B),kind:V,last:void 0})}),(function(){for(var B=Y(this),V=B.kind,z=B.last;z&&z.removed;)z=z.previous;return B.target&&(B.last=z=z?z.next:B.state.first)?V=="keys"?{value:z.key,done:!1}:V=="values"?{value:z.value,done:!1}:{value:[z.key,z.value],done:!1}:(B.target=void 0,{value:void 0,done:!0})}),L?"entries":"values",!L,!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),_=r(189),g=r(145),b=r(99),x=r(45),A=r(63),S=r(146),E=r(118),T=s.Array;n.exports=function(I){var R=f(I),U=b(this),L=arguments.length,D=L>1?arguments[1]:void 0,W=D!==void 0;W&&(D=c(D,L>2?arguments[2]:void 0));var Y,B,V,z,H,q,ee=E(R),ue=0;if(!ee||this==T&&g(ee))for(Y=x(R),B=U?new this(Y):T(Y);Y>ue;ue++)q=W?D(R[ue],ue):R[ue],A(B,ue,q);else for(H=(z=S(R,ee)).next,B=U?new this:[];!(V=v(H,z)).done;ue++)q=W?_(z,D,[V.value,ue],!0):V.value,A(B,ue,q);return B.length=ue,B}},function(n,a,r){var s=r(32),c=r(147);n.exports=function(v,f,_,g){try{return g?f(s(_)[0],_[1]):f(_)}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),_=r(45),g=r(39),b=r(18),x=r(193),A=r(121),S=r(194),E=r(195),T=r(70),I=r(196),R=[],U=c(R.sort),L=c(R.push),D=b((function(){R.sort(void 0)})),W=b((function(){R.sort(null)})),Y=A("sort"),B=!b((function(){if(T)return T<70;if(!(S&&S>3)){if(E)return!0;if(I)return I<603;var V,z,H,q,ee="";for(V=65;V<76;V++){switch(z=String.fromCharCode(V),V){case 66:case 69:case 70:case 72:H=3;break;case 68:case 71:H=4;break;default:H=2}for(q=0;q<47;q++)R.push({k:z+q,v:H})}for(R.sort((function(ue,ie){return ie.v-ue.v})),q=0;q<R.length;q++)z=R[q].k.charAt(0),ee.charAt(ee.length-1)!==z&&(ee+=z);return ee!=="DGBEFHACIJK"}}));s({target:"Array",proto:!0,forced:D||!W||!Y||!B},{sort:function(V){V!==void 0&&v(V);var z=f(this);if(B)return V===void 0?U(z):U(z,V);var H,q,ee=[],ue=_(z);for(q=0;q<ue;q++)q in z&&L(ee,z[q]);for(x(ee,(function(ie){return function(be,De){return De===void 0?-1:be===void 0?1:ie!==void 0?+ie(be,De)||0:g(be)>g(De)?1:-1}})(V)),H=ee.length,q=0;q<H;)z[q]=ee[q++];for(;q<ue;)delete z[q++];return z}})},function(n,a,r){var s=r(114),c=Math.floor,v=function(g,b){var x=g.length,A=c(x/2);return x<8?f(g,b):_(g,v(s(g,0,A),b),v(s(g,A),b),b)},f=function(g,b){for(var x,A,S=g.length,E=1;E<S;){for(A=E,x=g[E];A&&b(g[A-1],x)>0;)g[A]=g[--A];A!==E++&&(g[A]=x)}return g},_=function(g,b,x,A){for(var S=b.length,E=x.length,T=0,I=0;T<S||I<E;)g[T+I]=T<S&&I<E?A(b[T],x[I])<=0?b[T++]:x[I++]:T<S?b[T++]:x[I++];return g};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),_=s("".replace),g=s("".slice),b=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,x=/\$([$&'`]|\d{1,2})/g;n.exports=function(A,S,E,T,I,R){var U=E+A.length,L=T.length,D=x;return I!==void 0&&(I=c(I),D=b),_(R,D,(function(W,Y){var B;switch(f(Y,0)){case"$":return"$";case"&":return A;case"`":return g(S,0,E);case"'":return g(S,U);case"<":B=I[g(Y,1,-1)];break;default:var V=+Y;if(V===0)return W;if(V>L){var z=v(V/10);return z===0?W:z<=L?T[z-1]===void 0?f(Y,1):T[z-1]+f(Y,1):W}B=T[V-1]}return B===void 0?"":B}))}},function(n,a,r){var s=r(36),c=r(15),v=r(34),f=r(18),_=r(77),g=r(112),b=r(84),x=r(40),A=r(85),S=Object.assign,E=Object.defineProperty,T=c([].concat);n.exports=!S||f((function(){if(s&&S({b:1},S(E({},"a",{enumerable:!0,get:function(){E(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},R={},U=Symbol(),L="abcdefghijklmnopqrst";return I[U]=7,L.split("").forEach((function(D){R[D]=D})),S({},I)[U]!=7||_(S({},R)).join("")!=L}))?function(I,R){for(var U=x(I),L=arguments.length,D=1,W=g.f,Y=b.f;L>D;)for(var B,V=A(arguments[D++]),z=W?T(_(V),W(V)):_(V),H=z.length,q=0;H>q;)B=z[q++],s&&!v(Y,V,B)||(U[B]=V[B]);return U}:S},function(n,a,r){var s=r(7),c=r(15),v=r(56),f=r(33),_=r(35),g=r(98),b=s.Function,x=c([].concat),A=c([].join),S={},E=function(T,I,R){if(!_(S,I)){for(var U=[],L=0;L<I;L++)U[L]="a["+L+"]";S[I]=b("C,a","return new C("+A(U,",")+")")}return S[I](T,R)};n.exports=b.bind||function(T){var I=v(this),R=I.prototype,U=g(arguments,1),L=function(){var D=x(U,g(arguments));return this instanceof L?E(I,D.length,D):I.apply(T,D)};return f(R)&&(L.prototype=R),L}},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,_=s("".replace);n.exports=function(g,b,x,A){var S=v(c(g)),E="<"+b;return x!==""&&(E+=" "+x+'="'+_(v(A),f,"&quot;")+'"'),E+">"+S+"</"+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,_=r(16),g=r(71),b=r(7),x=r(46),A=r(34),S=r(209),E=r(42),T=r(149),I=r(102),R=r(78),U=r(150),L=r(56),D=r(30),W=r(33),Y=r(119),B=r(92),V=r(117),z=r(120),H=r(164),q=r(168).set,ee=r(210),ue=r(213),ie=r(214),be=r(170),De=r(215),Ne=r(58),Ae=r(95),Te=r(28),rt=r(216),tt=r(128),Be=r(70),dt=Te("species"),St="Promise",He=Ne.getterFor(St),Qt=Ne.set,Fe=Ne.getterFor(St),we=S&&S.prototype,Re=S,Ye=we,Ot=b.TypeError,bt=b.document,Ft=b.process,en=be.f,on=en,Wt=!!(bt&&bt.createEvent&&b.dispatchEvent),nt=D(b.PromiseRejectionEvent),sn="unhandledrejection",We=!1,yn=Ae(St,(function(){var $e=B(Re),lt=$e!==String(Re);if(!lt&&Be===66||g&&!Ye.finally)return!0;if(Be>=51&&/native code/.test($e))return!1;var an=new Re((function(Tn){Tn(1)})),tn=function(Tn){Tn((function(){}),(function(){}))};return(an.constructor={})[dt]=tn,!(We=an.then((function(){}))instanceof tn)||!lt&&rt&&!nt})),Kn=yn||!z((function($e){Re.all($e).catch((function(){}))})),te=function($e){var lt;return!(!W($e)||!D(lt=$e.then))&&lt},Gn=function($e,lt){if(!$e.notified){$e.notified=!0;var an=$e.reactions;ee((function(){for(var tn=$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=tn:(ur&&ur.enter(),li=Nn(tn),ur&&(ur.exit(),Yo=!0)),li===ti.promise?Zn(Ot("Promise-chain cycle")):(Ei=te(li))?A(Ei,li,Un,Zn):Un(li)):Zn(tn)}catch(to){ur&&!Yo&&ur.exit(),Zn(to)}}$e.reactions=[],$e.notified=!1,lt&&!$e.rejection&&Dr($e)}))}},br=function($e,lt,an){var tn,Tn;Wt?((tn=bt.createEvent("Event")).promise=lt,tn.reason=an,tn.initEvent($e,!1,!0),b.dispatchEvent(tn)):tn={promise:lt,reason:an},!nt&&(Tn=b["on"+$e])?Tn(tn):$e===sn&&ie("Unhandled promise rejection",an)},Dr=function($e){A(q,b,(function(){var lt,an=$e.facade,tn=$e.value;if(zr($e)&&(lt=De((function(){tt?Ft.emit("unhandledRejection",tn,an):br(sn,an,tn)})),$e.rejection=tt||zr($e)?2:1,lt.error))throw lt.value}))},zr=function($e){return $e.rejection!==1&&!$e.parent},jn=function($e){A(q,b,(function(){var lt=$e.facade;tt?Ft.emit("rejectionHandled",lt):br("rejectionhandled",lt,$e.value)}))},ko=function($e,lt,an){return function(tn){$e(lt,tn,an)}},Se=function($e,lt,an){$e.done||($e.done=!0,an&&($e=an),$e.value=lt,$e.state=2,Gn($e,!0))},Qe=function($e,lt,an){if(!$e.done){$e.done=!0,an&&($e=an);try{if($e.facade===lt)throw Ot("Promise can't be resolved itself");var tn=te(lt);tn?ee((function(){var Tn={done:!1};try{A(tn,lt,ko(Qe,Tn,$e),ko(Se,Tn,$e))}catch(Sr){Se(Tn,Sr,$e)}})):($e.value=lt,$e.state=1,Gn($e,!1))}catch(Tn){Se({done:!1},Tn,$e)}}};if(yn&&(Ye=(Re=function($e){Y(this,Ye),L($e),A(s,this);var lt=He(this);try{$e(ko(Qe,lt),ko(Se,lt))}catch(an){Se(lt,an)}}).prototype,(s=function($e){Qt(this,{type:St,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=T(Ye,{then:function($e,lt){var an=Fe(this),tn=an.reactions,Tn=en(H(this,Re));return Tn.ok=!D($e)||$e,Tn.fail=D(lt)&&lt,Tn.domain=tt?Ft.domain:void 0,an.parent=!0,tn[tn.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,lt=He($e);this.promise=$e,this.resolve=ko(Qe,lt),this.reject=ko(Se,lt)},be.f=en=function($e){return $e===Re||$e===v?new c($e):on($e)},!g&&D(S)&&we!==Object.prototype)){f=we.then,We||(E(we,"then",(function($e,lt){var an=this;return new Re((function(tn,Tn){A(f,an,tn,Tn)})).then($e,lt)}),{unsafe:!0}),E(we,"catch",Ye.catch,{unsafe:!0}));try{delete we.constructor}catch{}I&&I(we,Ye)}_({global:!0,wrap:!0,forced:yn},{Promise:Re}),R(Re,St,!1,!0),U(St),v=x(St),_({target:St,stat:!0,forced:yn},{reject:function($e){var lt=en(this);return A(lt.reject,void 0,$e),lt.promise}}),_({target:St,stat:!0,forced:g||yn},{resolve:function($e){return ue(g&&this===v?Re:this,$e)}}),_({target:St,stat:!0,forced:Kn},{all:function($e){var lt=this,an=en(lt),tn=an.resolve,Tn=an.reject,Sr=De((function(){var li=L(lt.resolve),Ei=[],Yo=0,ti=1;V($e,(function(Nn){var Un=Yo++,Zn=!1;ti++,A(li,lt,Nn).then((function(ur){Zn||(Zn=!0,Ei[Un]=ur,--ti||tn(Ei))}),Tn)})),--ti||tn(Ei)}));return Sr.error&&Tn(Sr.value),an.promise},race:function($e){var lt=this,an=en(lt),tn=an.reject,Tn=De((function(){var Sr=L(lt.resolve);V($e,(function(li){A(Sr,lt,li).then(an.resolve,tn)}))}));return Tn.error&&tn(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,A=r(7),S=r(64),E=r(50).f,T=r(168).set,I=r(169),R=r(211),U=r(212),L=r(128),D=A.MutationObserver||A.WebKitMutationObserver,W=A.document,Y=A.process,B=A.Promise,V=E(A,"queueMicrotask"),z=V&&V.value;z||(s=function(){var H,q;for(L&&(H=Y.domain)&&H.exit();c;){q=c.fn,c=c.next;try{q()}catch(ee){throw c?f():v=void 0,ee}}v=void 0,H&&H.enter()},I||L||U||!D||!W?!R&&B&&B.resolve?((b=B.resolve(void 0)).constructor=B,x=S(b.then,b),f=function(){x(s)}):L?f=function(){Y.nextTick(s)}:(T=S(T,A),f=function(){T(s)}):(_=!0,g=W.createTextNode(""),new D(s).observe(g,{characterData:!0}),f=function(){g.data=_=!_})),n.exports=z||function(H){var q={fn:H,next:void 0};v&&(v.next=q),c||(c=q,f()),v=q}},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,_){if(s(f),c(_)&&_.constructor===f)return _;var g=v.f(f);return(0,g.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 _=s(this),g=v(_),b=arguments.length,x=c(b>1?arguments[1]:void 0,g),A=b>2?arguments[2]:void 0,S=A===void 0?g:c(A,g);S>x;)_[x++]=f;return _}},function(n,a,r){var s=r(16),c=r(7),v=r(15),f=r(59),_=r(160),g=r(219),b=r(18),x=c.RangeError,A=c.String,S=Math.floor,E=v(g),T=v("".slice),I=v(1 .toFixed),R=function(W,Y,B){return Y===0?B:Y%2==1?R(W,Y-1,B*W):R(W*W,Y/2,B)},U=function(W,Y,B){for(var V=-1,z=B;++V<6;)z+=Y*W[V],W[V]=z%1e7,z=S(z/1e7)},L=function(W,Y){for(var B=6,V=0;--B>=0;)V+=W[B],W[B]=S(V/Y),V=V%Y*1e7},D=function(W){for(var Y=6,B="";--Y>=0;)if(B!==""||Y===0||W[Y]!==0){var V=A(W[Y]);B=B===""?V:B+E("0",7-V.length)+V}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 Y,B,V,z,H=_(this),q=f(W),ee=[0,0,0,0,0,0],ue="",ie="0";if(q<0||q>20)throw x("Incorrect fraction digits");if(H!=H)return"NaN";if(H<=-1e21||H>=1e21)return A(H);if(H<0&&(ue="-",H=-H),H>1e-21)if(B=(Y=(function(be){for(var De=0,Ne=be;Ne>=4096;)De+=12,Ne/=4096;for(;Ne>=2;)De+=1,Ne/=2;return De})(H*R(2,69,1))-69)<0?H*R(2,-Y,1):H/R(2,Y,1),B*=4503599627370496,(Y=52-Y)>0){for(U(ee,0,B),V=q;V>=7;)U(ee,1e7,0),V-=7;for(U(ee,R(10,V,1),0),V=Y-1;V>=23;)L(ee,1<<23),V-=23;L(ee,1<<V),U(ee,1,1),L(ee,2),ie=D(ee)}else U(ee,0,B),U(ee,1<<-Y,0),ie=D(ee)+E("0",q);return ie=q>0?ue+((z=ie.length)<=q?"0."+E("0",q-z)+ie:T(ie,0,z-q)+"."+T(ie,z-q)):ue+ie}})},function(n,a,r){var s=r(7),c=r(59),v=r(39),f=r(44),_=s.RangeError;n.exports=function(g){var b=v(f(this)),x="",A=c(g);if(A<0||A==1/0)throw _("Wrong number of repetitions");for(;A>0;(A>>>=1)&&(b+=b))1&A&&(x+=b);return x}},function(n,a,r){var s=r(36),c=r(15),v=r(77),f=r(41),_=c(r(84).f),g=c([].push),b=function(x){return function(A){for(var S,E=f(A),T=v(E),I=T.length,R=0,U=[];I>R;)S=T[R++],s&&!_(E,S)||g(U,x?[S,E[S]]:E[S]);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 yu})),r.d(a,"LogicFlow",(function(){return g1})),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 u0})),r.d(a,"CircleNode",(function(){return p0})),r.d(a,"PolygonNode",(function(){return g0})),r.d(a,"DiamondNode",(function(){return E0})),r.d(a,"EllipseNode",(function(){return M0})),r.d(a,"TextNode",(function(){return N0})),r.d(a,"HtmlNode",(function(){return j0})),r.d(a,"BaseEdge",(function(){return pm})),r.d(a,"LineEdge",(function(){return q0})),r.d(a,"PolylineEdge",(function(){return Q0})),r.d(a,"BezierEdge",(function(){return r1})),r.d(a,"Arrow",(function(){return a8})),r.d(a,"BaseEdgeModel",(function(){return xf})),r.d(a,"BezierEdgeModel",(function(){return vb})),r.d(a,"LineEdgeModel",(function(){return qu})),r.d(a,"PolylineEdgeModel",(function(){return Sa})),r.d(a,"BaseNodeModel",(function(){return yd})),r.d(a,"CircleNodeModel",(function(){return wb})),r.d(a,"DiamondNodeModel",(function(){return Ab})),r.d(a,"EllipseNodeModel",(function(){return Nb})),r.d(a,"PolygonNodeModel",(function(){return Ib})),r.d(a,"RectNodeModel",(function(){return Bb})),r.d(a,"TextNodeModel",(function(){return Gb})),r.d(a,"HtmlNodeModel",(function(){return Xb})),r.d(a,"EditConfigModel",(function(){return ef})),r.d(a,"GraphModel",(function(){return u2})),r.d(a,"SnaplineModel",(function(){return HO})),r.d(a,"Keyboard",(function(){return Cx})),r.d(a,"get",(function(){return C2})),r.d(a,"defaults",(function(){return j2})),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 Zt})),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 nn})),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 Yt})),r.d(s,"costByPoints",(function(){return Tt})),r.d(s,"heuristicCostEstimate",(function(){return Jt})),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 Yu})),r.d(s,"ScaleMatrix",(function(){return nm})),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),_=Object(f.b)("observerBatching");function g(i){i()}var b=!1;function x(){return b}function A(i){return Object(c.t)(i)}var S,E=1e4,T=new Set;function I(){S===void 0&&(S=setTimeout(R,1e4))}function R(){S=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,L=[],D={};function W(i){return"observer"+i}function Y(i,o,l){o===void 0&&(o="observed"),l===void 0&&(l=D),x();var u,h=(function(j){return function(){U?L.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,A),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,L=[];try{var F=j();U=!1;var Q=L.length>0?L:void 0;return v.d.useLayoutEffect((function(){Q&&Q.forEach((function(ne){return ne()}))}),[Q]),F}finally{U=!1}})((function(){var j,F;if(M.track((function(){try{j=i()}catch(Q){F=Q}})),F)throw F;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 V(i,o){var l,u,h,d=B({forwardRef:!1},o),m=i.displayName||i.name,w=function(M,j){return Y((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){z[M]||Object.defineProperty(h,M,Object.getOwnPropertyDescriptor(u,M))})),l.displayName=m,l}var z={$$typeof:!0,render:!0,compare:!0,type:!0};function H(i){var o=i.children,l=i.render,u=o||l;return typeof u!="function"?null:Y(u)}function q(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`.")}H.propTypes={children:q,render:q},H.displayName="Observer";var ee;(ee=v.g)||(ee=g),Object(c.n)({reactionScheduler:ee}),Object(f.a)()[_]=!0;var ue=0,ie={};function be(i){return ie[i]||(ie[i]=(function(o){if(typeof Symbol=="function")return Symbol(o);var l="__$mobx-react "+o+" ("+ue+")";return ue++,l})(i)),ie[i]}function De(i,o){if(Ne(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])||!Ne(i[l[h]],o[l[h]]))return!1;return!0}function Ne(i,o){return i===o?i!==0||1/i==1/o:i!=i&&o!=o}function Ae(i,o,l){Object.hasOwnProperty.call(i,o)?i[o]=l:Object.defineProperty(i,o,{enumerable:!1,configurable:!0,writable:!0,value:l})}var Te=be("patchMixins"),rt=be("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 dt(i,o,l){var u=(function(w,M){var j=w[Te]=w[Te]||{},F=j[M]=j[M]||{};return F.locks=F.locks||0,F.methods=F.methods||[],F})(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",Qt=be("isMobXReactObserver"),Fe=be("isUnmounted"),we=be("skipRender"),Re=be("isForcingUpdate");function Ye(i){var o=i.prototype;if(i[Qt]?Ot(o):i[Qt]=!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;en(o,"props"),en(o,"state");var l=o.render;return o.render=function(){return bt.call(this,l)},dt(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;Ae(this,we,!1),Ae(this,Re,!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{Ae(o,Re,!0),o[we]||v.a.prototype.forceUpdate.call(o),w=!1}finally{Ae(o,Re,!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||!De(this.props,i)}function en(i,o){var l=be("reactProp_"+o+"_valueHolder"),u=be("reactProp_"+o+"_atomHolder");function h(){return this[u]||Ae(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[Re]||De(this[l],d)?Ae(this,l,d):(Ae(this,l,d),Ae(this,we,!0),h.call(this).reportChanged(),Ae(this,we,!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)(H,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):V(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},lt=function(i){var o=this.__data__,l=o.delete(i);return this.size=o.size,l},an=function(i){return this.__data__.get(i)},tn=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,ha=function(i){if(i!=null){try{return gc.call(i)}catch{}try{return i+""}catch{}}return""},$s=/^\[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:$s).test(ha(i))},Au=function(i,o){return i==null?void 0:i[o]},Na=function(i,o){var l=Au(i,o);return oa(l)?l:void 0},va=Na(Tn.a,"Map"),Pa=Na(Object,"create"),bc=function(){this.__data__=Pa?Pa(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,Fs=function(i){var o=this.__data__;if(Pa){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 Pa?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]=Pa&&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=Fs,Il.prototype.has=Ec,Il.prototype.set=rp;var Fd=Il,gl=function(){this.size=0,this.__data__={hash:new Fd,map:new(va||Qe),string:new Fd}},Oc=function(i){var o=typeof i;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?i!=="__proto__":i===null},Mu=function(i,o){var l=i.__data__;return Oc(o)?l[typeof o=="string"?"string":"hash"]:l.map},xc=function(i){var o=Mu(this,i).delete(i);return this.size-=o?1:0,o},Sc=function(i){return Mu(this,i).get(i)},op=function(i){return Mu(this,i).has(i)},Bd=function(i,o){var l=Mu(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(!va||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=lt,ls.prototype.get=an,ls.prototype.has=tn,ls.prototype.set=Vd;var ma=ls,ku=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=ku,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},Tu=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),F=d.get(o);if(j&&F)return j==o&&F==i;var Q=-1,ne=!0,ge=2&l?new Ll:void 0;for(d.set(i,o),d.set(o,i);++Q<w;){var ke=i[Q],Le=o[Q];if(u)var ft=m?u(Le,ke,Q,o,i,d):u(ke,Le,Q,i,o,d);if(ft!==void 0){if(ft)continue;ne=!1;break}if(ge){if(!$l(o,(function(ct,Et){if(!Tu(ge,Et)&&(ke===ct||h(ke,ct,l,u,d)))return ge.push(Et)}))){ne=!1;break}}else if(ke!==Le&&!h(ke,Le,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 F=ss(w(i),w(o),u,h,d,m);return m.delete(i),F;case"[object Symbol]":if($i)return $i.call(i)==$i.call(o)}return!1},ya=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:ya(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]"},Nu=Object.prototype,Hd=Nu.hasOwnProperty,Tc=Nu.propertyIsEnumerable,Pu=ui((function(){return arguments})())?ui:function(i){return Vr(i)&&Hd.call(i,"callee")&&!Tc.call(i,"callee")},Ha=Pu,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},ga=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)&&ga(i.length)&&!!Cr[to(i)]},Ca=function(i){return function(o){return i(o)}},mi=r(49),cs=mi.a&&mi.a.isTypedArray,Fl=cs?Ca(cs):Ui,Ra=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&&!Ra.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},Bs=Object.prototype,Xa=function(i){var o=i&&i.constructor;return i===(typeof o=="function"&&o.prototype||Bs)},_a=function(i,o){return function(l){return i(o(l))}},Nc=_a(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&&ga(i.length)&&!za(i)},Vs=function(i){return Ko(i)?mo(i):Pc(i)},qa=function(i){return ip(i,Vs,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 F=w[j];if(!(m?F in o:ni.call(o,F)))return!1}var Q=d.get(i),ne=d.get(o);if(Q&&ne)return Q==o&&ne==i;var ge=!0;d.set(i,o),d.set(o,i);for(var ke=m;++j<M;){var Le=i[F=w[j]],ft=o[F];if(u)var ct=m?u(ft,Le,F,o,i,d):u(Le,ft,F,i,o,d);if(!(ct===void 0?Le===ft||h(Le,ft,l,u,d):ct)){ge=!1;break}ke||(ke=F=="constructor")}if(ge&&!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||(ge=!1)}return d.delete(i),d.delete(o),ge},ia=Na(Tn.a,"DataView"),ba=Na(Tn.a,"Promise"),Cu=Na(Tn.a,"Set"),Wi=Na(Tn.a,"WeakMap"),Qi="[object Map]",ci="[object Promise]",aa="[object Set]",ji="[object WeakMap]",vt="[object DataView]",Vt=ha(ia),Ut=ha(va),bn=ha(ba),pr=ha(Cu),Rr=ha(Wi),yo=to;(ia&&yo(new ia(new ArrayBuffer(1)))!=vt||va&&yo(new va)!=Qi||ba&&yo(ba.resolve())!=ci||Cu&&yo(new Cu)!=aa||Wi&&yo(new Wi)!=ji)&&(yo=function(i){var o=to(i),l=o=="[object Object]"?i.constructor:void 0,u=l?ha(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]",X="[object Array]",ae="[object Object]",Ee=Object.prototype.hasOwnProperty,Ke=function(i,o,l,u,h,d){var m=lo(i),w=lo(o),M=m?X:N(i),j=w?X:N(o),F=(M=M==C?ae:M)==ae,Q=(j=j==C?ae:j)==ae,ne=M==j;if(ne&&Object(Vi.a)(i)){if(!Object(Vi.a)(o))return!1;m=!0,F=!1}if(ne&&!F)return d||(d=new ma),m||Fl(i)?ss(i,o,l,u,h,d):si(i,o,M,l,u,h,d);if(!(1&l)){var ge=F&&Ee.call(i,"__wrapped__"),ke=Q&&Ee.call(o,"__wrapped__");if(ge||ke){var Le=ge?i.value():i,ft=ke?o.value():o;return d||(d=new ma),h(Le,ft,l,u,d)}}return!!ne&&(d||(d=new ma),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))},Kt=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 F=new ma,Q;if(!(Q===void 0?wt(j,M,3,u,F):Q))return!1}}return!0},Sn=function(i){return i==i&&!Lr(i)},Or=function(i){for(var o=Vs(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||Kt(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},Us=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)&&ga(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=Us(l,i);return u===void 0&&u===o?lp(l,i):wt(o,u,3)}},Ws=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)}},Gs=function(i){return To(i)?Xd(Ka(i)):mh(i)},jc=function(i){return typeof i=="function"?i:i==null?Ws:typeof i=="object"?lo(i)?Rc(i[0],i[1]):qr(i):Gs(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,Vs)})),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=Na(Object,"defineProperty");return i({},"",{}),i}catch{}})(),Ru=function(i,o,l){o=="__proto__"&&Kd?Kd(i,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[o]=l},Hv=Object.prototype.hasOwnProperty,ju=function(i,o,l){var u=i[o];Hv.call(i,o)&&te(u,l)&&(l!==void 0||o in i)||Ru(i,o,l)},Du=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?Ru(l,w,M):ju(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)},zs=Math.max,ps=function(i,o,l){return o=zs(o===void 0?i.length-1:o,0),function(){for(var u=arguments,h=-1,d=zs(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)}},Iu=function(i){return function(){return i}},Ic=Kd?function(i,o){return Kd(i,"toString",{configurable:!0,enumerable:!1,value:Iu(o),writable:!0})}:Ws,hs=Date.now,Xv=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=Xv(Ic),qv=function(i,o){return Lc(ps(i,o,Ws),i+"")},Yv=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 qv((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&&Yv(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))Du(o,Vs(o),i);else for(var l in o)Zd.call(o,l)&&ju(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 F=w[M];(j=void 0)==void 0&&(j=Lr(F)?F:Ji(o[h+1])?[]:{})}ju(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},Hs=function(i,o){return le(i,o,(function(l,u){return lp(i,u)}))},Ul=Sr?Sr.isConcatSpreadable:void 0,ja=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=ja),d||(d=[]);++m<w;){var M=o[m];u(M)?ya(d,M):d[d.length]=M}return d},xi=function(i){return i!=null&&i.length?jr(i):[]},Ur,Ja,Wl,wa,Jd,Qd,sp,_h,Gl,Go,Lu,up,zl,Qa,$c,vs,Ea,cp,dp,el=(function(i){return Lc(ps(i,void 0,xi),i+"")})((function(i,o){return i==null?{}:Hs(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",wa,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",Lu,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",Ea,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}}),wa=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}}),Lu=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}}),Ea=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,$u,Da;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(F){j=!0,m=F}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 Ia(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 Oa(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),Ia(this,"SCALE_X",pp,this),Ia(this,"SKEW_Y",hp,this),Ia(this,"SKEW_X",Bc,this),Ia(this,"SCALE_Y",zi,this),Ia(this,"TRANSLATE_X",tf,this),Ia(this,"TRANSLATE_Y",$u,this),Ia(this,"ZOOM_SIZE",Da,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=Oa(jo.prototype,"SCALE_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),hp=Oa(jo.prototype,"SKEW_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Bc=Oa(jo.prototype,"SKEW_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),zi=Oa(jo.prototype,"SCALE_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),tf=Oa(jo.prototype,"TRANSLATE_X",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),$u=Oa(jo.prototype,"TRANSLATE_Y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Da=Oa(jo.prototype,"ZOOM_SIZE",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),Oa(jo.prototype,"zoom",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"zoom"),jo.prototype),Oa(jo.prototype,"resetZoom",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"resetZoom"),jo.prototype),Oa(jo.prototype,"translate",[c.k],Object.getOwnPropertyDescriptor(jo.prototype,"translate"),jo.prototype),Oa(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=_a(Object.getPrototypeOf,Object),kr=Object.prototype.hasOwnProperty,Kv=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},Xs=function(i,o){var l=_p(i.buffer);return new i.constructor(l,i.byteOffset,i.byteLength)},Uc=/\w*$/,Zv=function(i){var o=new i.constructor(i.source,Uc.exec(i));return o.lastIndex=i.lastIndex,o},Sh=Sr?Sr.prototype:void 0,xa=Sh?Sh.valueOf:void 0,Jv=function(i){return xa?Object(xa.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 Xs(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 Zv(i);case"[object Symbol]":return Jv(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,qs=af?Ca(af):ys,lf=function(i){return Vr(i)&&N(i)=="[object Set]"},wp=mi.a&&mi.a.isSet,sf=wp?Ca(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 Qv=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=Kv(o);else{var F=N(o),Q=F==uf||F=="[object GeneratorFunction]";if(Object(Vi.a)(o))return Object(yp.a)(o,M);if(F==cf||F==Gc||Q&&!d)w=Q?{}:sa(o);else{if(!Yr[F])return d?o:{};w=of(o,F,M)}}m||(m=new ma);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))})):qs(o)&&o.forEach((function(ke,Le){w.set(Le,i(ke,l,u,Le,o,m))}));var ge=j?void 0:qa(o);return nf(ge||o,(function(ke,Le){ge&&(ke=o[Le=ke]),ju(w,Le,i(ke,l,u,Le,o,m))})),w},no=function(i){return Qv(i,5)},df=function(i,o,l){(l!==void 0&&!te(i[o],l)||l===void 0&&!(o in i))&&Ru(i,o,l)},Mh=function(i){return Vr(i)&&Ko(i)},Ys=Function.prototype,kh=Object.prototype,Fu=Ys.toString,Th=kh.hasOwnProperty,Ks=Fu.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&&Fu.call(l)==Ks},tl=function(i,o){if((o!=="constructor"||typeof i[o]!="function")&&o!="__proto__")return i[o]},Xl=function(i){return Du(i,rf(i))},Zs=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 F=void 0,Q=F===void 0;if(Q){var ne=lo(M),ge=!ne&&Object(Vi.a)(M),ke=!ne&&!ge&&Fl(M);F=M,ne||ge||ke?lo(w)?F=w:Mh(w)?F=gp(w):ge?(Q=!1,F=Object(yp.a)(M,!0)):ke?(Q=!1,F=Wc(M,!0)):F=[]:yi(M)||Ha(M)?(F=w,Ha(w)?F=Xl(w):Lr(w)&&!za(w)||(F=sa(M))):Q=!1}Q&&(m.set(M,F),h(F,M,u,d,m),m.delete(M)),df(i,l,F)}},Js=function i(o,l,u,h,d){o!==l&&qd(l,(function(m,w){if(d||(d=new ma),Lr(m))Zs(o,l,w,u,i,h,d);else{var M=void 0;M===void 0&&(M=m),df(o,w,M)}}),rf)},Qs=yh((function(i,o,l){Js(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=Qs(o,i)),o};r(82),r(166);function eu(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(F){for(var Q=F.length,ne=0;ne<Q;ne++)if(F[ne]){var ge=F[ne],ke=ge.callback;ge.once&&(F.splice(ne,1),F.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}}])&&eu(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(F){j=!0,m=F}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 Bu(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 Bu(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 Bu(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 Vu=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),F=j[0],Q=j[1];return h>w&&h<F&&d>M&&d<Q},Uu=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=Vs(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}},Wu=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,Gu=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=Gu(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)),Wu(i,jc(o),h)})),rr=new Uint8Array(16);function zu(){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=[],tu=0;tu<256;++tu)di.push((tu+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||zu)();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),F=m-j*d;return u>=d&&u<=w&&h>=m&&h<=M&&Math.abs(h-j*u+F)<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,nu,Kc,Zc,ws,ru,_f,Mp,ou,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(em(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},em=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,F=w.width,Q=w.height,ne=w.radius;return[{x:M-F/2+ne,y:j-Q/2+ne,r:ne},{x:M+F/2-ne,y:j-Q/2+ne,r:ne},{x:M-F/2+ne,y:j+Q/2-ne,r:ne},{x:M+F/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)})),iu(i,o,u)},iu=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 F=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(F-i.y)<Math.abs(Q-i.y)?F: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,F=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+F/2&&i.x!==M-F/2||(u=i.y>m&&i.y<w),u},Hu=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)),F=d+Math.sqrt(w*w-(i.y-m)*(i.y-m)*w*w/(M*M));u={x:Math.abs(j-i.x)<Math.abs(F-i.x)?j:F,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)),ge=Math.abs(Q-i.y)<Math.abs(ne-i.y)?Q:ne;u={x:i.x,y:ge}}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,F=M.end,Q=j,ne=F;j.x>F.x&&(Q=F,ne=j);var ge={x:i.x,y:i.y};if(Q.x===ne.x&&o===fo.HORIZONTAL&&(ge={x:Q.x,y:i.y}),Q.y===ne.y&&o===fo.VERTICAL&&(ge={x:i.x,y:Q.y}),Q.x!==ne.x&&Q.y!==ne.y){var ke=(ne.y-Q.y)/(ne.x-Q.x),Le=(Q.x*ne.y-ne.x*Q.y)/(Q.x-ne.x);o===fo.HORIZONTAL?ge={x:(i.y-Le)/ke,y:i.y}:o===fo.VERTICAL&&(ge={x:i.x,y:ke*i.x+Le})}if(Ii(ge,j,F)){var ft=al(ge.x,ge.y,i.x,i.y);ft<d&&(d=ft,u=ge)}})),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},au=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,lu=function(){return++Of};function Xu(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?Xu(Object(l),!0).forEach((function(u){Hi(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Xu(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",nu,this),Po(this,"sourceNodeId",Kc,this),Po(this,"targetNodeId",Zc,this),Po(this,"startPoint",ws,this),Po(this,"endPoint",ru,this),Po(this,"text",_f,this),Po(this,"properties",Mp,this),Po(this,"points",ou,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||lu()),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 F=mr(j,h);(w===void 0||F<w)&&(w=F,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 F=mr(j,w.startPoint);(m===void 0||F<m)&&(m=F,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,F=d.editable;this.text={value:M,draggable:j,x:m+u,y:w+h,editable:F}}}},{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})(),nu=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}}),ru=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{}}}),ou=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 su(){return su=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}},su.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 La(i)}function La(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,qu=(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(La(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({},su(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(F){j=!0,m=F}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 $a(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function tm(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=uu(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 uu(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 Sa=(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;$a(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),F=j[0],Q=j[1];return{x:(F.x+Q.x)/2,y:(F.y+Q.y)/2}}},{key:"getAfterAnchor",value:function(d,m,w){var M,j;return w.forEach((function(F){var Q;d===fo.HORIZONTAL?Q=Math.abs(m.y-F.y):d===fo.VERTICAL&&(Q=Math.abs(m.x-F.x)),(!j||j>Q)&&(j=Q,M=F)})),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(ct){return ct}));if(d===1){var j=M[d],F=M[m],Q=M[d-1];if(lr(Q,j,this.sourceNode)){if(Er(j,F,this.sourceNode)){var ne=$o(j,F,this.sourceNode);ne&&(M[d]=ne,M.splice(d-1,1),d--,m--)}}else this.sourceNode.anchors.forEach((function(ct){(ct.x===Q.x&&ct.x===j.x||ct.y===Q.y&&ct.y===j.y)&&al(ct.x,ct.y,j.x,j.y)<al(Q.x,Q.y,j.x,j.y)&&(M[d-1]=ct)}))}if(m===w.length-2){var ge=M[d],ke=M[m],Le=M[m+1];if(lr(ke,Le,this.targetNode)){if(Er(ge,ke,this.targetNode)){var ft=$o(ge,ke,this.targetNode);ft&&(M[m]=ft,M.splice(m+1,1))}}else this.targetNode.anchors.forEach((function(ct){(ct.x===Le.x&&ct.x===ke.x||ct.y===Le.y&&ct.y===ke.y)&&al(ct.x,ct.y,ke.x,ke.y)<al(Le.x,Le.y,ke.x,ke.y)&&(M[m+1]=ct)}))}return M}},{key:"getDraggingPoints",value:function(d,m,w,M,j){var F=j.map((function(ge){return ge})),Q=this.getAfterAnchor(d,w,M),ne=this.getCrossPoint(d,w,Q);return m==="start"?(F.unshift(ne),F.unshift(Q)):(F.push(ne),F.push(Q)),F}},{key:"updateCrossPoints",value:function(d){var m=d.map((function(zt){return zt})),w=d[0],M=d[1],j=d[m.length-2],F=d[m.length-1],Q=this.sourceNode,ne=this.targetNode,ge=Q.modelType,ke=ne.modelType,Le=Ro(w,M),ft=m[0];switch(ge){case Mr.RECT_NODE:Q.radius!==0&&(td(w,Q)||(ft=ed(w,Le,Q)));break;case Mr.CIRCLE_NODE:ft=iu(w,Le,Q);break;case Mr.ELLIPSE_NODE:ft=Hu(w,Le,Q);break;case Mr.DIAMOND_NODE:case Mr.POLYGON_NODE:ft=nd(w,Le,Q)}ft&&(m[0]=ft);var ct=Ro(j,F),Et=m[m.length-1];switch(ke){case Mr.RECT_NODE:ne.radius!==0&&(td(F,ne)||(Et=ed(F,ct,ne)));break;case Mr.CIRCLE_NODE:Et=iu(F,ct,ne);break;case Mr.ELLIPSE_NODE:Et=Hu(F,ct,ne);break;case Mr.DIAMOND_NODE:case Mr.POLYGON_NODE:Et=nd(F,ct,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,F=d.endIndex,Q=d.direction,ne=this.pointsList,ge=ne;return Q===fo.HORIZONTAL?(ne[j]={x:w.x,y:w.y+m.y},ne[F]={x:M.x,y:M.y+m.y},ge=this.pointsList.map((function(ke){return ke}))):Q===fo.VERTICAL&&(ne[j]={x:w.x+m.x,y:w.y},ne[F]={x:M.x+m.x,y:M.y},ge=this.pointsList.map((function(ke){return ke}))),this.updatePointsAfterDrag(ge),this.draggingPointList=ge,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ne[j]),end:Object.assign({},ne[F]),startIndex:j,endIndex:F,direction:Q}}},{key:"dragAppend",value:function(d,m){this.isDragging=!0;var w=d.start,M=d.end,j=d.startIndex,F=d.endIndex,Q=d.direction,ne=this.pointsList;if(Q===fo.HORIZONTAL){ne[j]={x:w.x,y:w.y+m.y},ne[F]={x:M.x,y:M.y+m.y};var ge=this.pointsList.map((function(gn){return gn}));if(j!==0&&F!==this.pointsList.length-1&&(ge=this.removeCrossPoints(j,F,ge)),j===0){var ke={x:w.x,y:w.y+m.y};if(!Os(ke,this.sourceNode)){var Le=this.sourceNode.anchors;ge=this.getDraggingPoints(Q,"start",ke,Le,ge)}}if(F===this.pointsList.length-1){var ft={x:M.x,y:M.y+m.y};if(!Os(ft,this.targetNode)){var ct=this.targetNode.anchors;ge=this.getDraggingPoints(Q,"end",ft,ct,ge)}}this.updatePointsAfterDrag(ge),this.draggingPointList=ge}else if(Q===fo.VERTICAL){ne[j]={x:w.x+m.x,y:w.y},ne[F]={x:M.x+m.x,y:M.y};var Et=this.pointsList.map((function(gn){return gn}));if(j!==0&&F!==this.pointsList.length-1&&(Et=this.removeCrossPoints(j,F,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(F===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[F]),startIndex:j,endIndex:F,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,F=cr({x:m.x,y:m.y},{x:w.x,y:w.y},M,j,this.offset||0);this.pointsList=F,this.initPoints()}}])&&tm(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),cu=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,F=u;m<h&&w<50;){var Q=F=d(1-w/100),ne=Q.x,ge=Q.y;m=al(M,j,ne,ge),w++}return F}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,F){return M+j*w[F]}))})(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 st(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(F){j=!0,m=F}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 qu(i,o);break;case"polyline":l=new Sa(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},Zt=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(F){l.push(F.x),u.push(F.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}]},nn=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))},Yt=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},Jt=function(i,o,l,u,h){return Yt(i,o)+Yt(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={},F={},Q={};F[o.id]=0,Q[o.id]=Jt(o,l,o);var ne={};i.forEach((function(Le){ne[Le.id]=Le}));for(var ge=function(){var Le=void 0,ft=1/0;if(M.forEach((function(Et){Q[Et.id]<ft&&(ft=Q[Et.id],Le=Et)})),Le===l){var ct=[];return Cn(ct,ne,j,l.id),{v:ct}}Hn(M,Le),w.push(Le),Mt(i,Le,u,h).forEach((function(Et){if(w.indexOf(Et)===-1){M.indexOf(Et)===-1&&M.push(Et);var zt=Q[Le.id]+Yt(Le,Et);F[Et.id]&&zt>=F[Et.id]||(j[Et.id]=Le.id,F[Et.id]=zt,Q[Et.id]=F[Et.id]+Jt(Et,l,o,d,m))}}))};M.length;){var ke=ge();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),F=At(M,m,o);if(jt(w,M)){var Q=Zo(i,o,j,F);return[i,j].concat(st(Q),[F,o])}var ne=pt([j,F]),ge=Ze(w,ne),ke=Ze(M,ne),Le=[];Le=(Le=Le.concat($t(ge))).concat($t(ke));var ft={x:(i.x+o.x)/2,y:(i.y+o.y)/2};[ne,ge,ke].forEach((function(Et){Le=Le.concat(Nt(Et,ft).filter((function(zt){return nn(zt,w)&&nn(zt,M)})))})),[{x:j.x,y:F.y},{x:F.x,y:j.y}].forEach((function(Et){nn(Et,w)&&nn(Et,M)&&Le.push(Et)})),Le.unshift(j),Le.push(F),Le=ht(Le);var ct=Ln(Le,j,F,d,m,i,o);return ct.unshift(i),ct.push(o),ct.length>2&&(ct=mn(ct)),ht(ct)},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,F,Q){var ne=(j.y-M.y)*(Q.x-F.x)-(M.x-j.x)*(F.y-Q.y);if(ne===0)return!1;var ge=((j.x-M.x)*(Q.x-F.x)*(F.y-M.y)+(j.y-M.y)*(Q.x-F.x)*M.x-(Q.y-F.y)*(j.x-M.x)*F.x)/ne,ke=-((j.y-M.y)*(Q.y-F.y)*(F.x-M.x)+(j.x-M.x)*(Q.y-F.y)*M.y-(Q.x-F.x)*(j.y-M.y)*F.y)/ne;return(ge-M.x)*(ge-j.x)<=0&&(ke-M.y)*(ke-j.y)<=0&&(ge-F.x)*(ge-Q.x)<=0&&(ke-F.y)*(ke-Q.y)<=0&&{x:ge,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=cu(se(se({},h),{},{type:"start"})),m=cu(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 ge=ne.start,ke=ne.end;if(ge.x===ke.x){var Le={x:ge.x,y:h};if(Ii(Le,ge,ke)){var ft=Math.abs(ge.x-u);ft<m&&(m=ft,l=Le)}}else if(ge.y===ke.y){var ct={x:u,y:ge.y};if(Ii(ct,ge,ke)){var Et=Math.abs(ge.y-h);Et<m&&(m=Et,l=ct)}}})),!l){var j=w[0],F=j.start,Q=j.end;l={x:F.x+(Q.x-F.x)/2,y:F.y+(Q.y-F.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,F=j===void 0?_o:j,Q=u.eventType,ne=Q===void 0?"":Q,ge=u.eventCenter,ke=ge===void 0?null:ge,Le=u.step,ft=Le===void 0?1:Le,ct=u.isStopPropagation,Et=ct===void 0||ct,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,Aa;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}),(Aa=h.eventCenter)===null||Aa===void 0||Aa.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=F,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 ut(i){return ut=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},ut(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&&(ut(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 Ie(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 Ie(i,o,l){return Ie=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},Ie.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 Me(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),Me(Ge(m=o.call(this,3)),"x",void 0),Me(Ge(m),"y",void 0),Me(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(F){j=!0,m=F}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&&rn(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 qt(this,l)}}function qt(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}}),rn(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&&rn(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 rn(i,o){return rn=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},rn(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,Fa,Jl,ki,As,du,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 F=u.getColumn(j);h[d][j]=m.reduce((function(Q,ne,ge){return Q+ne*F[ge]}),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),F=j[0],Q=j[1];return"matrix(".concat(h," ").concat(d," ").concat(w," ").concat(M," ").concat(F," ").concat(Q,")")}},{key:"translate",value:function(u,h){return this.cross(new kf(u,h))}},{key:"rotate",value:function(u){return this.cross(new Yu(u))}},{key:"scale",value:function(u,h){return this.cross(new nm(u,h))}}]),l})(An(Array)),Yu=(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),nm=(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},rm={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){pu(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(F){j=!0,m=F}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 fu(i){return(function(o){if(Array.isArray(o))return V_(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 V_(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)?V_(i,o):void 0}}function V_(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 ay(i){return ay=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},ay(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 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 pu(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 l2,s2=200,u2=(qe=(function(){function i(u){(function(ge,ke){if(!(ge instanceof ke))throw new TypeError("Cannot call a class as a function")})(this,i),pu(this,"rootEl",void 0),ks(this,"width",yr,this),ks(this,"height",Br,this),pu(this,"theme",void 0),pu(this,"eventCenter",void 0),pu(this,"modelMap",new Map),pu(this,"topElement",void 0),pu(this,"animation",void 0),pu(this,"idGenerator",void 0),pu(this,"edgeGenerator",void 0),pu(this,"nodeMoveRules",[]),pu(this,"customTrajectory",void 0),ks(this,"edgeType",Jn,this),ks(this,"nodes",dr,this),ks(this,"edges",Mi,this),ks(this,"overlapMode",Fa,this),ks(this,"background",Jl,this),ks(this,"transformModel",ki,this),ks(this,"editConfigModel",As,this),ks(this,"gridSize",du,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,F=u.edgeGenerator,Q=u.animation,ne=u.customTrajectory;this.background=w,ay(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"?Qs(no(Lp),h):no(h===!0?rm:Lp),this.partial=u.partial,this.overlapMode=u.overlapMode||0,this.idGenerator=j,this.customTrajectory=ne,this.edgeGenerator=tr(this,F),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(fu(this.nodes),fu(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,F){return j.zIndex-F.zIndex}));for(var h=[],d=[-200,-200],m=[this.width+s2,this.height+s2],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 F=0;F<j.length;F++){var Q=j[F];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,F=M.minY,Q=M.maxX,ne=M.maxY,ge=[{x:j,y:F},{x:Q,y:F},{x:Q,y:ne},{x:j,y:ne}],ke=w,Le=0;Le<ge.length;Le++){var ft=ge[Le],ct=ft.x,Et=ft.y,zt=this.transformModel.CanvasPointToHtmlPoint([ct,Et]),En=pd(zt,2);if(ct=En[0],Et=En[1],Vu([ct,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=Vu(Fn,h,d),Wr=Vu(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 F=this.edges[j];if(F.isDragging){w=!0;break}M.push(F.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=lu()),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),ay(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),F=pd(j,2);h=F[0],d=F[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,F=M.y,Q=h-j,ne=d-F;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,F=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,F)}}},{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,F=j.x,Q=j.y;u.moveText(F-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 F=this.edges[j],Q=F.textPosition,ne=Q.x,ge=Q.y,ke=M[F.sourceNodeId],Le=M[F.targetNodeId],ft=void 0,ct=void 0;if(ke&&Le&&F.modelType===Mr.POLYLINE_EDGE){var Et=pd(ke,2);ft=Et[0],ct=Et[1],F.updatePointsList(ft,ct)}else{if(ke){var zt=pd(ke,2);ft=zt[0],ct=zt[1],F.moveStartPoint(ft,ct)}if(Le){var En=pd(Le,2);ft=En[0],ct=En[1],F.moveEndPoint(ft,ct)}}(ke||Le)&&this.handleEdgeTextMove(F,ne,ge)}}},{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 F=rd(M,j.startPoint,M.width,M.height);j.updateStartPoint(F)}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,ge=Q.y,ke=Q.width,Le=Q.height,ft=Q.getNodeStyle().strokeWidth,ct=ft===void 0?0:ft,Et=ne+ke/2+ct,zt=ne-ke/2-ct,En=ge+Le/2+ct,wn=ge-Le/2-ct;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,fu(h)),w=Math.max.apply(Math,fu(h)),M=Math.min.apply(Math,fu(d)),j=w-m||0,F=Math.max.apply(Math,fu(d))-M||0;return{virtualRectWidth:j,virtualRectHeight:F,virtualRectCenterPositionX:m+j/2,virtualRectCenterPositionY:M+F/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,F=this.getVirtualRectSize(),Q=F.virtualRectCenterPositionX,ne=F.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 F=m||M.clientWidth,Q=w||M.clientHeight,ne=this.getVirtualRectSize(),ge=ne.virtualRectWidth,ke=ne.virtualRectHeight,Le=ne.virtualRectCenterPositionX,ft=ne.virtualRectCenterPositionY,ct=(ge+h)/F,Et=(ke+u)/Q,zt=0;zt=1/Math.max(ct,Et);var En=[F/2,Q/2];j.zoom(zt,En),j.focusOn(Le,ft,F,Q)}}},{key:"openEdgeAnimation",value:function(u){this.getEdgeModelById(u).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(u){this.getEdgeModelById(u).closeEdgeAnimation()}}],l&&CC(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[]}}),Fa=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}),du=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),RC=u2;function U_(i){return U_=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},U_(i)}function W_(){return W_=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},W_.apply(this,arguments)}function jC(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 G_(i,o){return G_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},G_(i,o)}function DC(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 IC(this,l)}}function IC(i,o){if(o&&(U_(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ku(i)}function Ku(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function ly(i){return ly=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},ly(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 c2,LC=yu(l2=(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&&G_(d,m)})(h,i);var o,l,u=DC(h);function h(d){var m;(function(F,Q){if(!(F instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,h),hd(Ku(m=u.call(this)),"stepDrag",void 0),hd(Ku(m),"stepScrollX",0),hd(Ku(m),"stepScrollY",0),hd(Ku(m),"onDragging",(function(F){var Q=F.deltaX,ne=F.deltaY;m.setState({isDragging:!0});var ge=m.props.graphModel,ke=ge.transformModel;ge.editConfigModel.stopMoveGraph!==!0&&ke.translate(Q,ne)})),hd(Ku(m),"onDragEnd",(function(){m.setState({isDragging:!1})})),hd(Ku(m),"zoomHandler",(function(F){var Q=m.props,ne=Q.graphModel,ge=ne.editConfigModel,ke=ne.transformModel,Le=ne.gridSize,ft=Q.graphModel,ct=F.deltaX,Et=F.deltaY;if(ge.stopScrollGraph||F.ctrlKey===!0){if(!ge.stopZoomGraph){F.preventDefault();var zt=ft.getPointByClient({x:F.clientX,y:F.clientY}).canvasOverlayPosition,En=zt.x,wn=zt.y;ke.zoom(F.deltaY<0,[En,wn])}}else{if(F.preventDefault(),m.stepScrollX+=ct,m.stepScrollY+=Et,Math.abs(m.stepScrollX)>=Le){var Yn=m.stepScrollX%Le,gn=m.stepScrollX-Yn;ke.translate(-gn*ke.SCALE_X,0),m.stepScrollX=Yn}if(Math.abs(m.stepScrollY)>=Le){var Fn=m.stepScrollY%Le,Mn=m.stepScrollY-Fn;ke.translate(0,-Mn*ke.SCALE_Y),m.stepScrollY=Fn}}})),hd(Ku(m),"clickHandler",(function(F){if(F.target.getAttribute("name")==="canvas-overlay"){var Q=m.props.graphModel;Q.selectElements.size>0&&Q.clearSelectElements(),Q.eventCenter.emit(Dn.BLANK_CLICK,{e:F})}})),hd(Ku(m),"handleContextMenu",(function(F){if(F.target.getAttribute("name")==="canvas-overlay"){F.preventDefault();var Q=m.props.graphModel,ne=Q.getPointByClient({x:F.clientX,y:F.clientY});Q.eventCenter.emit(Dn.BLANK_CONTEXTMENU,{e:F,position:ne})}})),hd(Ku(m),"mouseDownHandler",(function(F){var Q=m.props.graphModel,ne=Q.eventCenter,ge=Q.editConfigModel,ke=Q.transformModel.SCALE_X,Le=Q.gridSize,ft=F.target,ct=!ge.adjustEdge&&!ge.adjustNodePosition;(ft.getAttribute("name")==="canvas-overlay"||ct)&&(ge.stopMoveGraph!==!0?(m.stepDrag.setStep(Le*ke),m.stepDrag.handleMouseDown(F)):ne.emit(Dn.BLANK_MOUSEDOWN,{e:F}),m.clickHandler(F))}));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",W_({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))}}])&&jC(o.prototype,l),h})(We.a))||l2;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 $C(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function FC(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 H_(i,o){return H_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},H_(i,o)}function BC(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 VC(this,l)}}function VC(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 sy(i){return sy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},sy(i)}var UC=yu(c2=(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&&H_(d,m)})(h,i);var o,l,u=BC(h);function h(){return $C(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(F){return F(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())}}])&&FC(o.prototype,l),h})(We.a))||c2;function X_(i){return X_=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},X_(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 q_(i,o){return q_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},q_(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=uy(i);if(o){var h=uy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return HC(this,l)}}function HC(i,o){if(o&&(X_(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 uy(i){return uy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},uy(i)}var d2,XC=(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&&q_(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.background;return Object(We.g)("div",{className:"lf-background"},Object(We.g)("div",{style:d,className:"lf-background-area"}))}}])&&GC(o.prototype,l),h})(We.a);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 qC(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function YC(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 K_(i,o){return K_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},K_(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=cy(i);if(o){var h=cy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return ZC(this,l)}}function ZC(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 f2(i)}function f2(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 JC(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var p2=yu(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&&K_(d,m)})(h,i);var o,l,u=KC(h);function h(){var d;qC(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return JC(f2(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,F=d.size,Q=d.visible,ne=Math.min(Math.max(2,j),F/2),ge=1;return Q||(ge=0),Object(We.g)("rect",{width:ne,height:ne,rx:ne/2,ry:ne/2,fill:w,opacity:ge})}},{key:"renderMesh",value:function(){var d=this.props,m=d.config,w=m.color,M=m.thickness,j=M===void 0?1:M,F=d.size,Q=d.visible,ne=Math.min(Math.max(1,j),F/2),ge="M ".concat(F," 0 H0 M0 0 V0 ").concat(F),ke=1;return Q||(ke=0),Object(We.g)("path",{d:ge,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(","),F="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:F,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,")")})))}}])&&YC(o.prototype,l),h})(We.a))||d2;p2.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);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 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(F){j=!0,m=F}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 h2(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 h2(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 h2(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 v2,Bh=function(i){var o={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(i).forEach((function(l){var u=QC(l,2),h=u[0],d=u[1];(h==="style"||Z_(d)!=="object")&&(o[h]=d)})),Object(We.g)("line",o)};function J_(i){return J_=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},J_(i)}function m2(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 dy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?m2(Object(l),!0).forEach((function(u){eR(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):m2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function eR(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}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 Q_(i,o){return Q_=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Q_(i,o)}function rR(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 oR(this,l)}}function oR(i,o){if(o&&(J_(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)}var y2,iR=yu(v2=(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&&Q_(d,m)})(h,i);var o,l,u=rR(h);function h(){return tR(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(),F=m.x,Q=F===void 0?0:F,ne=m.y,ge=ne===void 0?0:ne,ke=dy(dy({x1:-1e5,y1:ge,x2:1e5,y2:ge},j),{},{stroke:w?j.stroke:"none"}),Le=dy(dy({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,Le))}}])&&nR(o.prototype,l),h})(We.a))||v2;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 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(F){j=!0,m=F}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 g2(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 g2(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 g2(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(F){var Q=aR(F,2),ne=Q[0],ge=Q[1];eb(ge)!=="object"&&(j[ne]=ge)})),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 tb(i){return tb=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},tb(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 _2(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 b2(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?_2(Object(l),!0).forEach((function(u){lR(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):_2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function lR(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function sR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function uR(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 nb(i,o){return nb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},nb(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=py(i);if(o){var h=py(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return dR(this,l)}}function dR(i,o){if(o&&(tb(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 py(i){return py=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},py(i)}Tf.defaultProps={className:"",radius:""};var w2,fR=yu(y2=(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&&nb(d,m)})(h,i);var o,l,u=cR(h);function h(){return sR(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,F=[];return m.forEach((function(Q){if(Q.isHovered||Q.isSelected){var ne=Q.isHovered,ge=Q.isSelected,ke=Q.x,Le=Q.y,ft=Q.width,ct=Q.height;if(j&&ge||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=b2(b2({},zt),En)}F.push(Object(We.g)(Tf,Vh({transform:Q.transform,className:"lf-outline-node",x:ke,y:Le,width:ft+10,height:ct+10},zt)))}}})),F}},{key:"getEdgeOutline",value:function(){for(var d=this.props.graphModel,m=d.edges,w=d.editConfigModel,M=w.edgeSelectedOutline,j=w.hoverOutline,F=[],Q=0;Q<m.length;Q++){var ne=m[Q];(M&&ne.isSelected||j&&ne.isHovered)&&(ne.modelType===Mr.LINE_EDGE?F.push(this.getLineOutline(ne)):ne.modelType===Mr.POLYLINE_EDGE?F.push(this.getPolylineOutline(ne)):ne.modelType===Mr.BEZIER_EDGE&&F.push(this.getBezierOutline(ne)))}return F}},{key:"getLineOutline",value:function(d){var m=d.startPoint,w=d.endPoint,M=(m.x+w.x)/2,j=(m.y+w.y)/2,F=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:F,height:Q},ne))}},{key:"getPolylineOutline",value:function(d){var m=d.points,w=ir(m),M=pt(w,8),j=M.x,F=M.y,Q=M.width,ne=M.height,ge=d.getOutlineStyle();return Object(We.g)(Tf,Vh({className:"lf-outline",x:j,y:F,width:Q,height:ne},ge))}},{key:"getBezierOutline",value:function(d){var m=d.path,w=go(m),M=pt(w,8),j=M.x,F=M.y,Q=M.width,ne=M.height,ge=d.getOutlineStyle();return Object(We.g)(Tf,Vh({className:"lf-outline",x:j,y:F,width:Q,height:ne},ge))}},{key:"render",value:function(){return Object(We.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&uR(o.prototype,l),h})(We.a))||y2;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 pR(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(F){j=!0,m=F}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 E2(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 E2(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 E2(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 F=pR(j,2),Q=F[0],ne=F[1];rb(ne)!=="object"&&(M[Q]=ne)})),M.className=w?"lf-basic-shape ".concat(w):"lf-basic-shape",Object(We.g)("circle",M)}function ob(i){return ob=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},ob(i)}function hR(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(F){j=!0,m=F}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 O2(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 O2(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 O2(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 om(){return om=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},om.apply(this,arguments)}function x2(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function vR(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 S2(i,o,l){return o&&vR(i.prototype,o),i}function A2(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&&ib(i,o)}function ib(i,o){return ib=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},ib(i,o)}function M2(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 mR(this,l)}}function mR(i,o){if(o&&(ob(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hy(i)}function hy(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 ab(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var k2,T2=(function(i){A2(l,i);var o=M2(l);function l(){var u;return x2(this,l),ab(hy(u=o.call(this)),"dragHandler",void 0),ab(hy(u),"onDragging",(function(h){var d=h.event,m=u.props,w=m.graphModel,M=m.bezierModel,j=m.type,F=w.getPointByClient({x:d.clientX,y:d.clientY}).canvasOverlayPosition,Q=F.x,ne=F.y;M.updateAdjustAnchor({x:Q,y:ne},j),w.eventCenter.emit(Dn.EDGE_ADJUST,{data:M.getData()})})),ab(hy(u),"onDragEnd",(function(){u.props.bezierModel.isDragging=!1})),u.dragHandler=new ye({onDragging:u.onDragging,onDragEnd:u.onDragEnd}),u}return S2(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,om({className:"lf-bezier-adjust-anchor",x:d,y:m},w,{onMouseDown:function(M){u.dragHandler.handleMouseDown(M)}}))}}]),l})(We.a),yR=yu(w2=(function(i){A2(l,i);var o=M2(l);function l(){return x2(this,l),o.apply(this,arguments)}return S2(l,[{key:"getBezierAdjust",value:function(u,h){var d=u.path,m=u.id,w=hR(go(d),4),M=w[0],j=w[1],F=w[2],Q=w[3],ne=u.getEdgeStyle().adjustLine,ge=[];return ge.push(Object(We.g)(Bh,om({x1:M.x,y1:M.y,x2:j.x,y2:j.y},ne))),ge.push(Object(We.g)(T2,{position:j,bezierModel:u,graphModel:h,key:"".concat(m,"_ePre"),type:"sNext"})),ge.push(Object(We.g)(Bh,om({x1:Q.x,y1:Q.y,x2:F.x,y2:F.y},ne))),ge.push(Object(We.g)(T2,{position:F,bezierModel:u,graphModel:h,key:"".concat(m,"_sNext"),type:"ePre"})),ge}},{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))||w2;function lb(i){return lb=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},lb(i)}function gR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function _R(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 sb(i,o){return sb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},sb(i,o)}function bR(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 wR(this,l)}}function wR(i,o){if(o&&(lb(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 N2,ER=yu(k2=(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&&sb(d,m)})(h,i);var o,l,u=bR(h);function h(){return gR(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))}}])&&_R(o.prototype,l),h})(We.a))||k2;function ub(i){return ub=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},ub(i)}function cb(){return cb=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},cb.apply(this,arguments)}function OR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function xR(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 db(i,o){return db=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},db(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=yy(i);if(o){var h=yy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return AR(this,l)}}function AR(i,o){if(o&&(ub(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 yy(i){return yy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},yy(i)}var MR=yu(N2=(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&&db(d,m)})(h,i);var o,l,u=SR(h);function h(){return OR(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,F=m.dnd,Q=m.snaplineModel,ne={};j.width&&(ne.width="".concat(w.width,"px")),j.height&&(ne.height="".concat(w.height,"px"));var ge=j.grid,ke=w.fakerNode,Le=w.editConfigModel.adjustEdge;return Object(We.g)("div",{className:"lf-graph","flow-id":w.flowId,style:ne},Object(We.g)(LC,{graphModel:w,dnd:F},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)(ER,{graphModel:w},Object(We.g)(fR,{graphModel:w}),Le?Object(We.g)(yR,{graphModel:w}):"",j.snapline!==!1?Object(We.g)(iR,{snaplineModel:Q}):""),Object(We.g)(UC,{graphModel:w,tool:M}),j.background&&Object(We.g)(XC,{background:j.background}),j.grid&&Object(We.g)(p2,cb({},ge,{graphModel:w})))}}],l&&xR(o.prototype,l),h})(We.a))||N2,kR=MR;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 gy(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){vd(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 TR(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 NR=(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(gy(gy({},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 F=h.fakerNode.getData();h.lf.setNodeSnapLine(F),h.lf.graphModel.eventCenter.emit(Dn.NODE_DND_DRAG,{data:F})}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(gy(gy({},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=Us(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}}}])&&TR(o.prototype,l),i})();function C2(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=Qs({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},l)),Qs({},j2,i)}var uo,R2,j2={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function fb(i){return fb=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},fb(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(F){j=!0,m=F}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 D2(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 D2(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 D2(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 I2(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 _y(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?I2(Object(l),!0).forEach((function(u){L2(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):I2(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function PR(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 CR(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 im(){return im=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=jR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},im.apply(this,arguments)}function jR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Nf(i))!==null;);return i}function hb(i,o){return hb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},hb(i,o)}function DR(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 IR(this,l)}}function IR(i,o){if(o&&(fb(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 Nf(i){return Nf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Nf(i)}function L2(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function hu(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 vb=(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&&hb(d,m)})(h,i);var o,l,u=DR(h);function h(){var d;CR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return L2(by(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.BEZIER_EDGE),PR(by(d),"path",R2,by(d)),d}return o=h,(l=[{key:"initEdgeData",value:function(d){this.offset=100,im(Nf(h.prototype),"initEdgeData",this).call(this,d)}},{key:"getEdgeStyle",value:function(){var d=this.graphModel.theme.bezier;return _y(_y({},im(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=im(Nf(h.prototype),"getData",this).call(this),m=this.pointsList.map((function(w){return{x:w.x,y:w.y}}));return _y(_y({},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=pb(d,4),w=m[0],M=m[1],j=m[2],F=m[3];return"M ".concat(w.x," ").concat(w.y,`
C `).concat(M.x," ").concat(M.y,`,
`).concat(j.x," ").concat(j.y,`,
`).concat(F.x," ").concat(F.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=pb(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=pb(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,F=Jo({start:m,end:w,sourceNode:M,targetNode:j,offset:this.offset}),Q=F.sNext,ne=F.ePre;this.pointsList=[m,Q,ne,w],this.initPoints()}}])&&RR(o.prototype,l),h})(ld),R2=hu(uo.prototype,"path",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),hu(uo.prototype,"initPoints",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"initPoints"),uo.prototype),hu(uo.prototype,"updatePoints",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updatePoints"),uo.prototype),hu(uo.prototype,"updateStartPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateStartPoint"),uo.prototype),hu(uo.prototype,"updateEndPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateEndPoint"),uo.prototype),hu(uo.prototype,"moveStartPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"moveStartPoint"),uo.prototype),hu(uo.prototype,"moveEndPoint",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"moveEndPoint"),uo.prototype),hu(uo.prototype,"updateAdjustAnchor",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateAdjustAnchor"),uo.prototype),hu(uo.prototype,"getAdjustStart",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"getAdjustStart"),uo.prototype),hu(uo.prototype,"getAdjustEnd",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"getAdjustEnd"),uo.prototype),hu(uo.prototype,"updateAfterAdjustStartAndEnd",[c.k],Object.getOwnPropertyDescriptor(uo.prototype,"updateAfterAdjustStartAndEnd"),uo.prototype),uo),un,$2,F2,B2,V2,U2,W2,G2,z2,H2,X2,q2,Y2,K2,Z2,J2,Q2,eO,tO,nO,rO,oO,iO,LR=function(i){return i==null};function $R(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(F){j=!0,m=F}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||aO(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 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 aO(i,o){if(i){if(typeof i=="string")return lO(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)?lO(i,o):void 0}}function lO(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 sO(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?sO(Object(l),!0).forEach((function(u){Tl(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):sO(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 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 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,uO,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",$2,this),Ti(this,"x",F2,this),Ti(this,"y",B2,this),Ti(this,"text",V2,this),Ti(this,"properties",U2,this),Ti(this,"_width",W2,this),Ti(this,"_height",G2,this),Ti(this,"anchorsOffset",z2,this),Ti(this,"isSelected",H2,this),Ti(this,"isHovered",X2,this),Ti(this,"isShowAnchor",q2,this),Ti(this,"isDragging",Y2,this),Ti(this,"isHitable",K2,this),Ti(this,"draggable",Z2,this),Ti(this,"visible",J2,this),Ti(this,"enableRotate",Q2,this),Tl(this,"virtual",!1),Tl(this,"graphModel",void 0),Ti(this,"zIndex",eO,this),Ti(this,"state",tO,this),Ti(this,"autoToFront",nO,this),Ti(this,"style",rO,this),Ti(this,"transform",oO,this),Ti(this,"_rotate",iO,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||lu())}},{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,F=0;F<w.length;F++){var Q=w[F];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,F=0;F<w.length;F++){var Q=w[F];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 ge=typeof Symbol<"u"&&Q[Symbol.iterator]||Q["@@iterator"];if(!ge){if(Array.isArray(Q)||(ge=aO(Q))||ne){ge&&(Q=ge);var ke=0,Le=function(){};return{s:Le,n:function(){return ke>=Q.length?{done:!0}:{done:!1,value:Q[ke++]}},e:function(zt){throw zt},f:Le}}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,ct=!0,Et=!1;return{s:function(){ge=ge.call(Q)},n:function(){var zt=ge.next();return ct=zt.done,zt},e:function(zt){Et=!0,ft=zt},f:function(){try{ct||ge.return==null||ge.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(mb(j)==="object"){var F=j;if(F.x===!1&&F.y===!1)return!1;m=m&&F.x,w=w&&F.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 F=al(h.x,h.y,w[j].x,w[j].y);F<M&&(M=F,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,F=$R(new Ms([M,j,1]).translate(-h,-d).rotate(m).translate(h,d)[0],2),Q=F[0],ne=F[1];w.x=Q,w.y=ne})),u}},{key:"getAnchorInfo",value:function(u){if(!LR(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 F=this.y+h;this.y=F,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 F=this.isAllowMoveNode(u,h);typeof F=="boolean"?(m=F,w=F):(m=F.x,w=F.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,F=d.editable;this.text={value:M,editable:F,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&&FR(o.prototype,l),i})(),$2=Nr(un.prototype,"type",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),F2=Nr(un.prototype,"x",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),B2=Nr(un.prototype,"y",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),V2=Nr(un.prototype,"text",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),U2=Nr(un.prototype,"properties",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),W2=Nr(un.prototype,"_width",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),G2=Nr(un.prototype,"_height",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),z2=Nr(un.prototype,"anchorsOffset",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),H2=Nr(un.prototype,"isSelected",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),X2=Nr(un.prototype,"isHovered",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),q2=Nr(un.prototype,"isShowAnchor",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Y2=Nr(un.prototype,"isDragging",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),K2=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}}),J2=Nr(un.prototype,"visible",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Q2=Nr(un.prototype,"enableRotate",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),eO=Nr(un.prototype,"zIndex",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),tO=Nr(un.prototype,"state",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),nO=Nr(un.prototype,"autoToFront",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),rO=Nr(un.prototype,"style",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),oO=Nr(un.prototype,"transform",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iO=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 yb(i){return yb=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},yb(i)}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){fO(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 BR(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 VR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function UR(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 gb(){return gb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=WR(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},gb.apply(this,arguments)}function WR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Wh(i))!==null;);return i}function _b(i,o){return _b=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},_b(i,o)}function GR(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 zR(this,l)}}function zR(i,o){if(o&&(yb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wy(i)}function wy(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 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 bb(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 Ba,pO,hO,wb=(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&&_b(d,m)})(h,i);var o,l,u=GR(h);function h(){var d;VR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return fO(wy(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.CIRCLE_NODE),BR(wy(d),"r",uO,wy(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=gb(Wh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.circle;return dO(dO({},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")}]}}])&&UR(o.prototype,l),h})(yd),uO=bb(md.prototype,"r",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),bb(md.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(md.prototype,"width"),md.prototype),bb(md.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(md.prototype,"height"),md.prototype),md);r(129);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 Ob(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(F){j=!0,m=F}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 vO(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 vO(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 vO(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 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 HR(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function XR(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 xb(){return xb=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}},xb.apply(this,arguments)}function qR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=zh(i))!==null;);return i}function Sb(i,o){return Sb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Sb(i,o)}function YR(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 KR(this,l)}}function KR(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 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 _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 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 Zu,bO,wO,Ab=(Ba=(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&&Sb(d,m)})(h,i);var o,l,u=YR(h);function h(){var d;HR(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return _O(Gh(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.DIAMOND_NODE),gO(Gh(d),"rx",pO,Gh(d)),gO(Gh(d),"ry",hO,Gh(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=xb(zh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.diamond;return yO(yO({},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=Ob(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=Ob(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=Ob(m,2);return{x:M[0],y:M[1],id:"".concat(d.id,"_").concat(w)}}))}}])&&XR(o.prototype,l),h})(yd),pO=Hh(Ba.prototype,"rx",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),hO=Hh(Ba.prototype,"ry",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Hh(Ba.prototype,"points",[c.m],Object.getOwnPropertyDescriptor(Ba.prototype,"points"),Ba.prototype),Hh(Ba.prototype,"pointsPosition",[c.m],Object.getOwnPropertyDescriptor(Ba.prototype,"pointsPosition"),Ba.prototype),Hh(Ba.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Ba.prototype,"width"),Ba.prototype),Hh(Ba.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Ba.prototype,"height"),Ba.prototype),Ba);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 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){SO(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 xO(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 kb(){return kb=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}},kb.apply(this,arguments)}function QR(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=qh(i))!==null;);return i}function Tb(i,o){return Tb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Tb(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=qh(i);if(o){var h=qh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return t3(this,l)}}function t3(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 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 SO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function Ey(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,AO,Nb=(Zu=(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=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 SO(Xh(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.ELLIPSE_NODE),xO(Xh(d),"rx",bO,Xh(d)),xO(Xh(d),"ry",wO,Xh(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=kb(qh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.ellipse;return OO(OO({},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")}]}}])&&JR(o.prototype,l),h})(yd),bO=Ey(Zu.prototype,"rx",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),wO=Ey(Zu.prototype,"ry",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),Ey(Zu.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Zu.prototype,"width"),Zu.prototype),Ey(Zu.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Zu.prototype,"height"),Zu.prototype),Zu);function Pb(i){return Pb=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},Pb(i)}function Cb(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(F){j=!0,m=F}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 MO(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 MO(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 MO(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 kO(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 TO(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?kO(Object(l),!0).forEach((function(u){NO(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):kO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function n3(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 r3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function o3(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 Rb(){return Rb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=i3(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Rb.apply(this,arguments)}function i3(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Yh(i))!==null;);return i}function jb(i,o){return jb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},jb(i,o)}function a3(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 l3(this,l)}}function l3(i,o){if(o&&(Pb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oy(i)}function Oy(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 NO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function xy(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 Db,PO,Ib=(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&&jb(d,m)})(h,i);var o,l,u=a3(h);function h(){var d;r3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return NO(Oy(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.POLYGON_NODE),n3(Oy(d),"points",AO,Oy(d)),d}return o=h,(l=[{key:"getNodeStyle",value:function(){var d=Rb(Yh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.polygon;return TO(TO({},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=Cb(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=Cb(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(F,Q){var ne=Cb(F,2),ge=ne[0],ke=ne[1];return{x:m+ge-M/2,y:w+ke-j/2,id:"".concat(d.id,"_").concat(Q)}}))}}])&&o3(o.prototype,l),h})(yd),AO=xy(Ts.prototype,"points",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),xy(Ts.prototype,"pointsPosition",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"pointsPosition"),Ts.prototype),xy(Ts.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"width"),Ts.prototype),xy(Ts.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Ts.prototype,"height"),Ts.prototype),Ts);function Lb(i){return Lb=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},Lb(i)}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 RO(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){jO(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 s3(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 u3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function c3(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 $b(){return $b=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=d3(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},$b.apply(this,arguments)}function d3(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Kh(i))!==null;);return i}function Fb(i,o){return Fb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Fb(i,o)}function f3(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 p3(this,l)}}function p3(i,o){if(o&&(Lb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sy(i)}function Sy(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 jO(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,Bb=(Db=(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&&Fb(d,m)})(h,i);var o,l,u=f3(h);function h(){var d;u3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return jO(Sy(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.RECT_NODE),s3(Sy(d),"radius",PO,Sy(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=$b(Kh(h.prototype),"getNodeStyle",this).call(this),m=this.graphModel.theme.rect;return RO(RO({},d),no(m))}}])&&c3(o.prototype,l),h})(yd),PO=(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})(Db.prototype,"radius",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Db);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 DO(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?DO(Object(l),!0).forEach((function(u){$O(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):DO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function h3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function v3(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 Ub(){return Ub=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(i,o,l){var u=m3(i,o);if(u){var h=Object.getOwnPropertyDescriptor(u,o);return h.get?h.get.call(arguments.length<3?i:l):h.value}},Ub.apply(this,arguments)}function m3(i,o){for(;!Object.prototype.hasOwnProperty.call(i,o)&&(i=Zh(i))!==null;);return i}function Wb(i,o){return Wb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Wb(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=Zh(i);if(o){var h=Zh(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return g3(this,l)}}function g3(i,o){if(o&&(Vb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LO(i)}function LO(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 $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 FO(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 Gb=(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&&Wb(d,m)})(h,i);var o,l,u=y3(h);function h(){var d;h3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return $O(LO(d=u.call.apply(u,[this].concat(w))),"modelType",Mr.TEXT_NODE),d}return o=h,(l=[{key:"getTextStyle",value:function(){var d=Ub(Zh(h.prototype),"getTextStyle",this).call(this),m=this.graphModel.theme.text;return IO(IO({},d),no(m))}},{key:"width",get:function(){var d=String(this.text.value).split(/[\r\n]/g),m=this.getTextStyle().fontSize;return au({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 au({rows:d,fontSize:m,rowsLength:d.length}).height}}])&&v3(o.prototype,l),h})(yd),FO(Pf.prototype,"width",[c.m],Object.getOwnPropertyDescriptor(Pf.prototype,"width"),Pf.prototype),FO(Pf.prototype,"height",[c.m],Object.getOwnPropertyDescriptor(Pf.prototype,"height"),Pf.prototype),Pf);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 _3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function b3(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 Hb(i,o){return Hb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Hb(i,o)}function w3(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 E3(this,l)}}function E3(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 BO(i)}function BO(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 O3(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var vu,VO,UO,WO,Xb=(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&&Hb(d,m)})(h,i);var o,l,u=w3(h);function h(){var d;_3(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return O3(BO(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")}]}}])&&b3(o.prototype,l),h})(yd);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 qb(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 x3(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 zO(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function am(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 HO=(vu=(function(){function i(u){(function(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")})(this,i),zO(this,"graphModel",void 0),qb(this,"isShowHorizontal",VO,this),qb(this,"isShowVertical",UO,this),qb(this,"position",WO,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?GO(Object(d),!0).forEach((function(m){zO(u,m,d[m])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):GO(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 F=h[j];if(F.id!==u.id&&(d===F.x&&(w=!0),m===F.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 F=this.graphModel.getNodeModelById(M);m=xo(F)}}for(var Q=0;Q<h.length;Q++){var ne=h[Q];if(ne.id!==u.id){var ge=xo(ne);if(ge.minY===m.minY||ge.maxY===m.minY){w=!0,d=m.minY;break}if(ge.minY===m.maxY||ge.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 F=this.graphModel.getNodeModelById(M);m=xo(F)}}for(var Q=0;Q<h.length;Q++){var ne=h[Q];if(ne.id!==u.id){var ge=xo(ne);if(ge.minX===m.minX||ge.maxX===m.minX){w=!0,d=m.minX;break}if(ge.minX===m.maxX||ge.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&&x3(o.prototype,l),i})(),VO=am(vu.prototype,"isShowHorizontal",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),UO=am(vu.prototype,"isShowVertical",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),WO=am(vu.prototype,"position",[c.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),am(vu.prototype,"clearSnapline",[c.k],Object.getOwnPropertyDescriptor(vu.prototype,"clearSnapline"),vu.prototype),am(vu.prototype,"setNodeSnapLine",[c.k],Object.getOwnPropertyDescriptor(vu.prototype,"setNodeSnapLine"),vu.prototype),vu),lm=new Map,XO=function(i){var o=ta(),l=window.requestAnimationFrame((function u(){if(i(),lm.get(o)){var h=window.requestAnimationFrame(u);lm.set(o,h)}}));return lm.set(o,l),o},My=function(i){var o=lm.get(i);o&&(window.cancelAnimationFrame(o),lm.delete(i))};function Yb(i){return Yb=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},Yb(i)}function sm(){return sm=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},sm.apply(this,arguments)}function qO(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 um(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?qO(Object(l),!0).forEach((function(u){Qu(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):qO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function S3(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(F){j=!0,m=F}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 YO(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 YO(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 YO(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 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 Kb(i,o){return Kb=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},Kb(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=ky(i);if(o){var h=ky(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return k3(this,l)}}function k3(i,o){if(o&&(Yb(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ju(i)}function Ju(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 Qu(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&&Kb(d,m)})(h,i);var o,l,u=M3(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),Qu(Ju(d=u.call(this)),"preTargetNode",void 0),Qu(Ju(d),"sourceRuleResults",void 0),Qu(Ju(d),"targetRuleResults",void 0),Qu(Ju(d),"dragHandler",void 0),Qu(Ju(d),"t",void 0),Qu(Ju(d),"onDragStart",(function(m){var w=m.event,M=d.props,j=M.anchorData,F=M.nodeModel,Q=M.graphModel;Q.overlapMode,Q.selectNodeById(F.id),F.autoToFront&&Q.toFront(F.id),Q.eventCenter.emit(Dn.ANCHOR_DRAGSTART,{data:j,e:w,nodeModel:F}),d.setState({startX:j.x,startY:j.y,endX:j.x,endY:j.y})})),Qu(Ju(d),"onDragging",(function(m){var w=m.event,M=d.props,j=M.graphModel,F=M.nodeModel,Q=M.anchorData,ne=j.transformModel,ge=j.eventCenter,ke=j.width,Le=j.height,ft=j.editConfigModel,ct=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&&My(d.t);var vr=[];gn<10?vr=[10,0]:gn+10>ke?vr=[-10,0]:Fn<10?vr=[0,10]:Fn+10>Le&&(vr=[0,-10]),d.setState({endX:$r,endY:Wr,dragging:!0}),d.moveAnchorEnd($r,Wr),vr.length>0&&!Et&&ct&&(d.t=XO((function(){var Jr=S3(vr,2),_i=Jr[0],bi=Jr[1];ne.translate(_i,bi);var Aa=d.state,ts=Aa.endX,ns=Aa.endY;d.setState({endX:ts-_i,endY:ns-bi}),d.moveAnchorEnd(ts-_i,ns-bi)}))),ge.emit(Dn.ANCHOR_DRAG,{data:Q,e:w,nodeModel:F})})),Qu(Ju(d),"onDragEnd",(function(m){var w=m.event;d.t&&My(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,F=j.graphModel,Q=j.nodeModel,ne=j.anchorData;F.eventCenter.emit(Dn.ANCHOR_DRAGEND,{data:ne,e:w,nodeModel:Q,edgeModel:M})})),Qu(Ju(d),"checkEnd",(function(m){var w=d.props,M=w.graphModel,j=w.nodeModel,F=w.anchorData,Q=F.x,ne=F.y,ge=F.id,ke=(M.edgeType,d.state),Le=ke.endX,ft=ke.endY,ct=ke.dragging,Et=Qc({x:Le,y:ft},M);if(d.preTargetNode&&d.preTargetNode.state!==Zr.DEFAULT&&d.preTargetNode.setElementState(Zr.DEFAULT),ct&&Et&&Et.node){var zt=Et.node,En=Et.anchor.id,wn="".concat(j.id,"_").concat(zt.id,"_").concat(En,"_").concat(ge),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(um(um({},vr),{},{sourceNodeId:j.id,sourceAnchorId:ge,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,F=m.y,Q=um(um({},w),w.hover);return Object(We.g)("g",null,Object(We.g)(Uh,sm({className:"lf-node-anchor-hover"},Q,{x:j,y:F})),Object(We.g)(Uh,sm({className:"lf-node-anchor"},w,{x:j,y:F})))}},{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,F=w.anchorData,Q=Qc({x:d,y:m},M);if(Q){var ne=Q.node,ge=Q.anchor.id;if(this.preTargetNode&&this.preTargetNode!==Q.node&&this.preTargetNode.setElementState(Zr.DEFAULT),F.id===ge)return;this.preTargetNode=ne;var ke="".concat(j.id,"_").concat(ne.id,"_").concat(ge,"_").concat(F.id);if(!this.targetRuleResults.has(ke)){var Le=Q.anchor,ft=j.isAllowConnectedAsSource(ne,F,Le),ct=ne.isAllowConnectedAsTarget(j,F,Le);this.sourceRuleResults.set(ke,Yl(ft)),this.targetRuleResults.set(ke,Yl(ct))}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,F=m.endY,Q=this.props,ne=Q.anchorData.edgeAddable,ge=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(um({sourcePoint:{x:w,y:M},targetPoint:{x:j,y:F}},ge)):Object(We.g)(Bh,sm({x1:w,y1:M,x2:j,y2:F},ge,{"pointer-events":"none"}))))}}])&&A3(o.prototype,l),h})(We.a);function KO(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 N3(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?KO(Object(l),!0).forEach((function(u){P3(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):KO(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function P3(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}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 C3(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(F){j=!0,m=F}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 JO(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,F=j===void 0?"default":j,Q=i.textWidth,ne=Q===void 0?"":Q,ge=i.model,ke={textAnchor:"middle","dominant-baseline":"middle",x:l,y:h,fill:M};if(Object.entries(i).forEach((function(En){var wn=C3(En,2),Yn=wn[0],gn=wn[1];Zb(gn)!=="object"&&(ke[Yn]=gn)})),d){var Le=String(d).split(/[\r\n]/g),ft=Le.length;if(F!=="default"){var ct=ge.BaseType,Et=ge.modelType;if(ct===co.NODE&&Et!==Mr.TEXT_NODE||ct===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,Aa=gn.width,ts=gn.textHeight,ns=En.textWidth||Aa,nc=String(wn).split(/[\r\n]/g),Gp=nc.length,Qy=od({rows:nc,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>Qy?gn.height:Qy;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?nc.join(""):"",style:N3({},En)},nc.map((function(Df){return Object(We.g)("div",{className:"lf-node-text--auto-wrap-inner"},Df)}))))))})(i)}if(ft>1){var zt=Le.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 Jb(i){return Jb=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},Jb(i)}function Qb(){return Qb=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},Qb.apply(this,arguments)}function R3(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(F){j=!0,m=F}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 QO(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 QO(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 QO(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,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 e0(i,o){return e0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},e0(i,o)}function D3(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 I3(this,l)}}function I3(i,o){if(o&&(Jb(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 Ty(i){return Ty=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ty(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 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&&e0(d,m)})(h,i);var o,l,u=D3(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,F=M.deltaY,Q=m.props,ne=Q.model,ge=R3(Q.graphModel.transformModel.fixDeltaXY(j,F),2),ke=ge[0],Le=ge[1];ne.moveText(ke,Le)})),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,F=j.draggable,Q=j.model,ne=j.graphModel.editConfigModel.nodeTextDraggable;(F||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,F=M.value,Q=M.x,ne=M.y,ge=M.editable,ke=M.draggable,Le={x:Q,y:ne,className:"",value:F};ge?Le.className="lf-element-text":ke||j.nodeTextDraggable?Le.className="lf-text-draggable":Le.className="lf-text-disabled";var ft=m.getTextStyle();return Object(We.g)(JO,Qb({},Le,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())}}])&&j3(o.prototype,l),h})(We.a),L3=Us(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,tx=r(130);function t0(i){return t0=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},t0(i)}function n0(){return n0=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},n0.apply(this,arguments)}function $3(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 r0(i,o){return r0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},r0(i,o)}function F3(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=Ny(i);if(o){var h=Ny(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return B3(this,l)}}function B3(i,o){if(o&&(t0(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 Ny(i){return Ny=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ny(i)}function cm(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var V3=(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&&r0(d,m)})(h,i);var o,l,u=F3(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),cm(Jh(m=u.call(this,d)),"style",{}),cm(Jh(m),"defaultAngle",void 0),cm(Jh(m),"normal",void 0),cm(Jh(m),"stepperDrag",void 0),cm(Jh(m),"onDragging",(function(w){var M,j=w.event,F=m.props,Q=F.graphModel,ne=F.nodeModel,ge=F.eventCenter,ke=Q.selectNodes,Le=ne.x,ft=ne.y,ct=j.clientX,Et=j.clientY,zt=Q.getPointByClient({x:ct,y:Et}).canvasOverlayPosition,En=zt.x,wn=zt.y,Yn=new Xe(En-Le,wn-ft),gn=((M=m.normal)===null||M===void 0?void 0:M.angle(Yn))-m.defaultAngle,Fn=new kf(-Le,-ft).rotate(gn).translate(Le,ft).toString();ne.transform=Fn,ne.rotate=gn;var Mn=Object(tx.map)(ke,(function(Wr){return Wr.id}));Mn.indexOf(ne.id)===-1&&(Mn=[ne.id]);var $r=Object(tx.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)}}))})),ge.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,F=M-m.height/2-20;return this.normal=new Xe(1,0),this.defaultAngle=this.normal.angle(new Xe(j-w,F-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,n0({},this.style,{cx:j,cy:F}))))}}])&&$3(o.prototype,l),h})(We.a);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)}var U3=["className"];function Py(){return Py=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},Py.apply(this,arguments)}function W3(i,o){if(i==null)return{};var l,u,h=(function(m,w){if(m==null)return{};var M,j,F={},Q=Object.keys(m);for(j=0;j<Q.length;j++)M=Q[j],w.indexOf(M)>=0||(F[M]=m[M]);return F})(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 Cy(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(F){j=!0,m=F}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 nx(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 nx(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 nx(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 rx(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 G3(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 z3(this,l)}}function z3(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 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 Ry(i){return Ry=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ry(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&&i0(m,w)})(d,i);var o,l,u,h=G3(d);function d(m){var w;(function(ne,ge){if(!(ne instanceof ge))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 ge=ne.event,ke=ge.clientX,Le=ge.clientY,ft=w.props,ct=ft.model,Et=ft.graphModel.getPointByClient({x:ke,y:Le}).canvasOverlayPosition,zt=Et.x,En=Et.y;w.moveOffset={x:ct.x-zt,y:ct.y-En}})),da(ra(w),"onDragging",(function(ne){var ge=ne.event,ke=w.props,Le=ke.model,ft=ke.graphModel,ct=ft.editConfigModel,Et=ct.stopMoveGraph,zt=ct.autoExpand,En=ft.transformModel,wn=ft.selectNodes,Yn=ft.width,gn=ft.height,Fn=ft.gridSize;Le.isDragging=!0;var Mn=ge.clientX,$r=ge.clientY,Wr=ft.getPointByClient({x:Mn,y:$r}).canvasOverlayPosition,vr=Wr.x,Jr=Wr.y,_i=Cy(En.CanvasPointToHtmlPoint([vr,Jr]),2),bi=_i[0],Aa=_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||Aa<0||bi>Yn||Aa>gn)){var ts=Cy(En.CanvasPointToHtmlPoint([vr-Le.width/2,Jr-Le.height/2]),2),ns=ts[0],nc=ts[1],Gp=Cy(En.CanvasPointToHtmlPoint([vr+Le.width/2,Jr+Le.height/2]),2),Qy=Gp[0],zp=Gp[1],jf=Math.max(Fn,20),Df=[];ns<0?Df=[jf,0]:Qy>ft.width?Df=[-jf,0]:nc<0?Df=[0,jf]:zp>ft.height&&(Df=[0,-jf]),w.t&&My(w.t);var k8=new kf(-vr,-Jr).rotate(Le.rotate).translate(vr,Jr).toString();Le.transform=k8;var eg=wn.map((function(tg){return tg.id}));eg.indexOf(Le.id)===-1&&(eg=[Le.id]),Df.length>0&&!Et&&zt?w.t=XO((function(){var tg=Cy(Df,2),Lx=tg[0],$x=tg[1];En.translate(Lx,$x);var T8=-Lx/En.SCALE_X,N8=-$x/En.SCALE_X;ft.moveNodes(eg,T8,N8)})):ft.moveNodes(eg,vr-Le.x,Jr-Le.y)}}else ft.moveNode2Coordinate(Le.id,vr,Jr)})),da(ra(w),"onDragEnd",(function(){w.t&&My(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 ge=w.mouseUpDrag===!1;if(w.startTime){var ke=w.props,Le=ke.model,ft=ke.graphModel;if(ge){var ct={data:Le.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=Uu(ne,En);ct.isMultiple=wn,Le.isSelected&&!zt&&wn?(ct.isSelected=!1,Le.setSelected(!1)):(ft.selectNodeById(Le.id,wn),ct.isSelected=!0,w.toFront()),zt?(En.nodeTextEdit&&Le.text.editable&&(Le.setSelected(!1),ft.setElementStateById(Le.id,Zr.TEXT_EDIT)),ft.eventCenter.emit(Dn.NODE_DBCLICK,ct)):(ft.eventCenter.emit(Dn.ELEMENT_CLICK,ct),ft.eventCenter.emit(Dn.NODE_CLICK,ct))}}}})),da(ra(w),"handleContextMenu",(function(ne){ne.preventDefault();var ge=w.props,ke=ge.model,Le=ge.graphModel,ft=ke.getData(),ct=Le.getPointByClient({x:ne.clientX,y:ne.clientY});Le.setElementStateById(ke.id,Zr.SHOW_MENU,ct.domOverlayPosition),ke.isSelected||Le.selectNodeById(ke.id),Le.eventCenter.emit(Dn.NODE_CONTEXTMENU,{data:ft,e:ne,position:ct}),w.toFront()})),da(ra(w),"handleMouseDown",(function(ne){var ge=w.props,ke=ge.model,Le=ge.graphModel;w.startTime=new Date().getTime(),Le.editConfigModel.adjustNodePosition&&ke.draggable&&w.stepDrag&&w.stepDrag.handleMouseDown(ne)})),da(ra(w),"setHoverON",(function(ne){var ge=w.props,ke=ge.model,Le=ge.graphModel;if(!ke.isHovered){var ft=ke.getData();ke.setHovered(!0),Le.eventCenter.emit(Dn.NODE_MOUSEENTER,{data:ft,e:ne})}})),da(ra(w),"setHoverOFF",(function(ne){var ge=w.props,ke=ge.model,Le=ge.graphModel,ft=ke.getData();ke.isHovered&&(ke.setHovered(!1),Le.eventCenter.emit(Dn.NODE_MOUSELEAVE,{data:ft,e:ne}))})),da(ra(w),"onMouseOut",(function(ne){L3&&w.setHoverOFF(ne)}));var M=m.graphModel,j=M.gridSize,F=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:F,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,F=M.isSelected,Q=M.isHitable,ne=M.isDragging,ge=M.isShowAnchor;return Q&&(F||ge)&&!ne?Yd(M.anchors,(function(ke,Le){var ft=M.getAnchorLineStyle(ke),ct=M.getAnchorStyle(ke);return Object(We.g)(T3,{anchorData:ke,node:m,style:ct,edgeStyle:ft,anchorIndex:Le,nodeModel:M,graphModel:j,setHoverOFF:m.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var m=this.props,w=m.model,M=m.graphModel,j=w.isSelected,F=w.isHitable,Q=w.enableRotate,ne=w.isHovered,ge=w.getRotateControlStyle().style;if(F&&(j||ne)&&Q)return Object(We.g)(V3,{graphModel:M,nodeModel:w,eventCenter:M.eventCenter,style:ge})}},{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,F=!1;return(w.text.draggable||j.nodeTextDraggable)&&(F=!0),Object(We.g)(ex,{editable:j.nodeTextEdit&&w.text.editable,model:w,graphModel:M,draggable:F})}}},{key:"getStateClassName",value:function(){var m=this.props.model,w=m.state,M=m.isDragging,j=m.isSelected,F="lf-node";switch(w){case Zr.ALLOW_CONNECT:F+=" lf-node-allow";break;case Zr.NOT_ALLOW_CONNECT:F+=" lf-node-not-allow";break;default:F+=" lf-node-default"}return M&&(F+=" lf-isDragging"),j&&(F+=" lf-node-selected"),F}},{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,F=j.editConfigModel,Q=F.hideAnchors,ne=F.adjustNodePosition,ge=F.allowRotation,ke=j.gridSize,Le=j.transformModel.SCALE_X,ft=M.isHitable,ct=M.draggable,Et=M.transform,zt=M.getOuterGAttributes(),En=zt.className,wn=En===void 0?"":En,Yn=W3(zt,U3),gn=Object(We.g)("g",{className:"lf-node-content"},Object(We.g)("g",{transform:Et},this.getShape(),this.getText(),ge&&this.getRotateControl()),!Q&&this.getAnchors());return ft?(ne&&ct&&this.stepDrag.setStep(ke*Le),m=Object(We.g)("g",Py({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",Py({className:"".concat(this.getStateClassName()," ").concat(wn)},Yn),gn),m}}])&&rx(o.prototype,l),u&&rx(o,u),d})(We.a);function a0(i){return a0=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},a0(i)}function l0(){return l0=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},l0.apply(this,arguments)}function H3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function X3(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 q3(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 Y3(this,l)}}function Y3(i,o){if(o&&(a0(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 u0=(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=q3(h);function h(){return H3(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,l0({},m,{x:d.x,y:d.y,width:d.width,height:d.height,radius:d.radius}))}}])&&X3(o.prototype,l),h})(gd);function c0(i){return c0=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},c0(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 K3(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Z3(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 f0(i,o){return f0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},f0(i,o)}function J3(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 Q3(this,l)}}function Q3(i,o){if(o&&(c0(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 p0=(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&&f0(d,m)})(h,i);var o,l,u=J3(h);function h(){return K3(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,d0({},j,{x:m,y:w,r:M}))}}])&&Z3(o.prototype,l),h})(gd);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 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(F){j=!0,m=F}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 ox(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 ox(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 ox(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 ix(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=ej(h,2),m=d[0],w=d[1];h0(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 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 m0(){return m0=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},m0.apply(this,arguments)}function tj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function nj(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 y0(i,o){return y0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},y0(i,o)}function rj(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 oj(this,l)}}function oj(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(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 g0=(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&&y0(d,m)})(h,i);var o,l,u=rj(h);function h(){return tj(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,F=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)(ix,m0({},Q,{points:F,x:m,y:w})))}}])&&nj(o.prototype,l),h})(gd);function _0(i){return _0=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},_0(i)}function b0(){return b0=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},b0.apply(this,arguments)}function ij(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function aj(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 w0(i,o){return w0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},w0(i,o)}function lj(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 sj(this,l)}}function sj(i,o){if(o&&(_0(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 E0=(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&&w0(d,m)})(h,i);var o,l,u=lj(h);function h(){return ij(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)(ix,b0({},m,{points:d.points,x:d.x,y:d.y})))}}])&&aj(o.prototype,l),h})(gd);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 uj(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(F){j=!0,m=F}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 ax(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 ax(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 ax(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 cj(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,F={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=uj(Q,2),ge=ne[0],ke=ne[1];O0(ke)!=="object"&&(F[ge]=ke)})),F.className=j?"lf-basic-shape ".concat(j):"lf-basic-shape",Object(We.g)("ellipse",F)}function x0(i){return x0=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},x0(i)}function S0(){return S0=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},S0.apply(this,arguments)}function dj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}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 A0(i,o){return A0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},A0(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=$y(i);if(o){var h=$y(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return hj(this,l)}}function hj(i,o){if(o&&(x0(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 M0=(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&&A0(d,m)})(h,i);var o,l,u=pj(h);function h(){return dj(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)(cj,S0({},m,{x:d.x,y:d.y,rx:d.rx,ry:d.ry}))}}])&&fj(o.prototype,l),h})(gd);function k0(i){return k0=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},k0(i)}function lx(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 sx(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?lx(Object(l),!0).forEach((function(u){vj(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):lx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function vj(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function mj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function yj(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 T0(i,o){return T0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},T0(i,o)}function gj(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 _j(this,l)}}function _j(i,o){if(o&&(k0(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)}var N0=(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&&T0(d,m)})(h,i);var o,l,u=gj(h);function h(){return mj(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,F=d.y,Q=sx(sx({},m.background),{},{x:j,y:F-1,width:w,height:M});return Object(We.g)(Tf,Q)}},{key:"getShape",value:function(){return Object(We.g)("g",null,this.getBackground())}}])&&yj(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 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 bj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function wj(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 R0(i,o){return R0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},R0(i,o)}function Ej(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=By(i);if(o){var h=By(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Oj(this,l)}}function Oj(i,o){if(o&&(P0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dm(i)}function dm(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function By(i){return By=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},By(i)}function Vy(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&&R0(d,m)})(h,i);var o,l,u=Ej(h);function h(){var d;bj(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return Vy(dm(d=u.call.apply(u,[this].concat(w))),"ref",void 0),Vy(dm(d),"currentProperties",void 0),Vy(dm(d),"preProperties",void 0),Vy(dm(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,F=d.getNodeStyle();return this.currentProperties=JSON.stringify(d.properties),Object(We.g)("foreignObject",C0({},F,{x:m-j/2,y:w-M/2,width:j,height:M,ref:this.setRef}))}}])&&wj(o.prototype,l),h})(gd);function D0(i){return D0=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},D0(i)}function I0(){return I0=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},I0.apply(this,arguments)}function ux(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?ux(Object(l),!0).forEach((function(u){F0(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):ux(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}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 L0(i,o){return L0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},L0(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=Uy(i);if(o){var h=Uy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Aj(this,l)}}function Aj(i,o){if(o&&(D0(o)==="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $0(i)}function $0(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 F0(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var Mj=(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=Sj(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),F0($0(m=u.call(this,d)),"setHoverON",(function(){m.setState({isHovered:!0})})),F0($0(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 F,Q=m.fontSize,ne=m.overflowMode,ge=m.lineHeight,ke=m.wrapPadding,Le=m.textWidth,ft=w.value,ct=w.x,Et=w.y,zt=String(ft).split(/[\r\n]/g),En=zt.length;if(ne==="autoWrap"&&Le){var wn=od({rows:zt,style:{fontSize:"".concat(Q,"px"),width:"".concat(Le,"px"),lineHeight:ge,padding:ke},rowsLength:En,className:"lf-get-text-height"});F=Vp(Vp({},j),{},{x:ct-1,y:Et-1,width:Le,height:wn})}else{zt&&zt.forEach((function($r){Fo($r)}));var Yn=au({rows:zt,fontSize:Q,rowsLength:En}),gn=Yn.width,Fn=Yn.height;if(ne==="ellipsis"&&(gn=Le||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],ct+=(Mn[1]-Mn[3])/2,Et+=(Mn[2]-Mn[0])/2)}F=Vp(Vp({},j),{},{x:ct-1,y:Et-1,width:gn,height:Fn})}return Object(We.g)(Tf,F)}}},{key:"getShape",value:function(){var d=this.props.model,m=d.text,w=m.value,M=m.x,j=m.y;if(w){var F=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)(JO,I0({},F,{model:d})))}}}])&&xj(o.prototype,l),h})(ex);function B0(i){return B0=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},B0(i)}var ec,kj=["text","sourceAnchorId","targetAnchorId"];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 _d(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){es(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 Tj(i,o){if(i==null)return{};var l,u,h=(function(m,w){if(m==null)return{};var M,j,F={},Q=Object.keys(m);for(j=0;j<Q.length;j++)M=Q[j],w.indexOf(M)>=0||(F[M]=m[M]);return F})(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 Nj(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(F){j=!0,m=F}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 Pj(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 V0(i,o){return V0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},V0(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=Wy(i);if(o){var h=Wy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Rj(this,l)}}function Rj(i,o){if(o&&(B0(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 Wy(i){return Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Wy(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"})(ec||(ec={}));var fx=(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&&V0(d,m)})(h,i);var o,l,u=Cj(h);function h(d){var m;(function(F,Q){if(!(F 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(F){m.stepDrag&&m.stepDrag.handleMouseDown(F)})),es(Ql(m),"onDragStart",(function(){var F=m.props,Q=F.x,ne=F.y,ge=F.edgeModel,ke=ge.startPoint,Le=ge.endPoint,ft=ge.pointsList;m.oldEdge={startPoint:ke,endPoint:Le,pointsList:ft},m.setState({endX:Q,endY:ne,dragging:!0})})),es(Ql(m),"onDragging",(function(F){var Q=F.deltaX,ne=F.deltaY,ge=m.state,ke=ge.endX,Le=ge.endY,ft=m.props,ct=ft.graphModel,Et=ft.type,zt=ct.transformModel,En=ct.editConfigModel,wn=Nj(zt.moveCanvasPointByHtml([ke,Le],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:Le},ct);if(Mn&&Mn.node&&m.isAllowAdjust(Mn).pass){var $r,Wr=Fn.startPoint,vr=Fn.endPoint,Jr=Fn.sourceNode,_i=Fn.targetNode;Et===ec.SOURCE?$r={startPoint:{x:Mn.anchor.x,y:Mn.anchor.y},endPoint:{x:vr.x,y:vr.y},sourceNode:Mn.node,targetNode:_i}:Et===ec.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===ec.SOURCE?Fn.updateStartPoint({x:Yn,y:gn}):Et===ec.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(F){var Q=F.event;try{var ne;m.setState({dragging:!1});var ge=m.props,ke=ge.graphModel,Le=ge.edgeModel,ft=ge.type,ct=m.state,Et=ct.endX,zt=ct.endY,En=ct.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=Le.getData(),Jr=vr.text,_i=vr.sourceAnchorId,bi=_i===void 0?"":_i,Aa=vr.targetAnchorId;Yn=_d(_d({sourceAnchorId:bi,targetAnchorId:Aa===void 0?"":Aa},Tj(vr,kj)),{},{text:(Jr==null?void 0:Jr.value)||""}),ft===ec.SOURCE?(Yn=_d(_d({},ke.edgeGenerator(ke.getNodeModelById(wn.node.id).getData(),ke.getNodeModelById(Le.targetNodeId).getData(),Yn)),{},{sourceNodeId:wn.node.id,sourceAnchorId:wn.anchor.id,startPoint:{x:wn.anchor.x,y:wn.anchor.y},targetNodeId:Le.targetNodeId,endPoint:_d({},Le.endPoint)}),Le.sourceNodeId===wn.node.id&&Le.sourceAnchorId===wn.anchor.id&&(gn=!0)):ft===ec.TARGET&&(Yn=_d(_d({},ke.edgeGenerator(ke.getNodeModelById(Le.sourceNodeId).getData(),ke.getNodeModelById(wn.node.id).getData(),Yn)),{},{sourceNodeId:Le.sourceNodeId,startPoint:_d({},Le.startPoint),targetNodeId:wn.node.id,targetAnchorId:wn.anchor.id,endPoint:{x:wn.anchor.x,y:wn.anchor.y}}),Le.targetNodeId===wn.node.id&&Le.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=Le.getData();ke.deleteEdgeById(Le.id);var nc=ke.addEdge(_d({},Yn));ke.eventCenter.emit(Dn.EDGE_EXCHANGE_NODE,{data:{newEdge:nc.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 F=m.props.edgeModel,Q=m.oldEdge,ne=Q.startPoint,ge=Q.endPoint,ke=Q.pointsList;F.updateStartPoint(ne),F.updateEndPoint(ge),F.modelType!==Mr.LINE_EDGE&&(F.pointsList=ke,F.initPoints())})),es(Ql(m),"getAdjustPointStyle",(function(){var F=m.props,Q=F.graphModel.theme;return F.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,F=w.targetNode,Q=w.sourceAnchorId,ne=w.targetAnchorId,ge=m.type,ke=null,Le=null,ft=null,ct=null;if(ge===ec.SOURCE?(ke=d.node,Le=F,ft=d.anchor,ct=F.getAnchorInfo(ne)):(ke=j,Le=d.node,ct=d.anchor,ft=j.getAnchorInfo(Q)),this.preTargetNode&&this.preTargetNode!==d.node&&this.preTargetNode.setElementState(Zr.DEFAULT),this.preTargetNode=d.node,ct.id===ft.id)return{pass:!1,msg:"",newTargetNode:Le};var Et="".concat(ke.id,"_").concat(Le.id,"_").concat(ft.id,"_").concat(ct.id);if(!this.targetRuleResults.has(Et)){var zt=ke.isAllowConnectedAsSource(Le,ft,ct,M),En=Le.isAllowConnectedAsTarget(ke,ft,ct,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 ge===ec.SOURCE?ke.setElementState(Wr):Le.setElementState(Wr),{pass:Yn&&Mn,msg:$r||gn,newTargetNode:Le}}},{key:"render",value:function(){var d=this.props,m=d.x,w=d.y,M=d.getAdjustPointShape,j=d.edgeModel,F=this.state.dragging;return Object(We.g)("g",{pointerEvents:F?"none":"",onMouseDown:this.handleMouseDown},F?"":M(m,w,j))}}])&&Pj(o.prototype,l),h})(We.a);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 fm(){return fm=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},fm.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(F){j=!0,m=F}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 px(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 px(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 px(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){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 W0(i,o){return W0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},W0(i,o)}function Lj(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 $j(this,l)}}function $j(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 mu(i)}function mu(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Gy(i){return Gy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Gy(i)}function tc(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var pm=(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&&W0(d,m)})(h,i);var o,l,u=Lj(h);function h(){var d;Dj(this,h);for(var m=arguments.length,w=new Array(m),M=0;M<m;M++)w[M]=arguments[M];return tc(mu(d=u.call.apply(u,[this].concat(w))),"startTime",void 0),tc(mu(d),"contextMenuTime",void 0),tc(mu(d),"clickTimer",void 0),tc(mu(d),"textRef",Object(We.f)()),tc(mu(d),"handleHover",(function(j,F){var Q=d.props,ne=Q.model,ge=Q.graphModel.eventCenter;ne.setHovered(j);var ke=j?Dn.EDGE_MOUSEENTER:Dn.EDGE_MOUSELEAVE,Le=ne.getData();ge.emit(ke,{data:Le,e:F})})),tc(mu(d),"setHoverON",(function(j){d.props.model.isHovered||(d.textRef&&d.textRef.current&&d.textRef.current.setHoverON(),d.handleHover(!0,j))})),tc(mu(d),"setHoverOFF",(function(j){d.props.model.isHovered&&(d.textRef&&d.textRef.current&&d.textRef.current.setHoverOFF(),d.handleHover(!1,j))})),tc(mu(d),"handleContextMenu",(function(j){j.preventDefault(),d.contextMenuTime=new Date().getTime(),d.clickTimer&&clearTimeout(d.clickTimer);var F=d.props,Q=F.model,ne=F.graphModel,ge=ne.getPointByClient({x:j.clientX,y:j.clientY});ne.setElementStateById(Q.id,Zr.SHOW_MENU,ge.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:ge})})),tc(mu(d),"handleMouseDown",(function(j){j.stopPropagation(),d.startTime=new Date().getTime()})),tc(mu(d),"handleMouseUp",(function(j){if(d.startTime&&!(new Date().getTime()-d.startTime>200||j.button===2)){var F=j.detail===2,Q=d.props,ne=Q.model,ge=Q.graphModel,ke=ne==null?void 0:ne.getData(),Le=ge.getPointByClient({x:j.clientX,y:j.clientY});if(F){var ft=ge.editConfigModel,ct=ge.textEditElement;if(ct&&ct.id===ne.id&&ge.setElementStateById(ne.id,Zr.DEFAULT),ft.edgeTextEdit&&ne.text.editable&&ge.setElementStateById(ne.id,Zr.TEXT_EDIT),ne.modelType===Mr.POLYLINE_EDGE){var Et=ne,zt=ge.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}ge.eventCenter.emit(Dn.EDGE_DBCLICK,{data:ke,e:j,position:Le})}else ge.eventCenter.emit(Dn.ELEMENT_CLICK,{data:ke,e:j,position:Le}),ge.eventCenter.emit(Dn.EDGE_CLICK,{data:ke,e:j,position:Le});var gn=ge.editConfigModel;ge.selectEdgeById(ne.id,Uu(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)(Mj,{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,F=w.refX,Q=F===void 0?2:F,ne=jj(this.getLastTwoPoints(),2),ge=ne[0],ke=ne[1],Le="auto";return ge!==null&&ke!==null&&(Le=Dp(Af({x:ke.x-ge.x,y:ke.y-ge.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:Le,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,fm({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)(fx,fm({type:"SOURCE"},M,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:m,graphModel:w})),Object(We.g)(fx,fm({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():"")}}])&&Ij(o.prototype,l),h})(We.a);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 Fj(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(F){j=!0,m=F}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 hx(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 hx(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 hx(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 hm=function(i){var o={d:""};return Object.entries(i).forEach((function(l){var u=Fj(l,2),h=u[0],d=u[1],m=G0(d);h!=="style"&&m==="object"||(o[h]=d)})),Object(We.g)("path",o)};function z0(i){return z0=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},z0(i)}function H0(){return H0=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},H0.apply(this,arguments)}function Bj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Vj(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 X0(i,o){return X0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},X0(i,o)}function Uj(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=zy(i);if(o){var h=zy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return Wj(this,l)}}function Wj(i,o){if(o&&(z0(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 zy(i){return zy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},zy(i)}var q0=(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&&X0(d,m)})(h,i);var o,l,u=Uj(h);function h(){return Bj(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,F=d.getEdgeStyle(),Q=d.getEdgeAnimationStyle(),ne=Q.strokeDasharray,ge=Q.stroke,ke=Q.strokeDashoffset,Le=Q.animationName,ft=Q.animationDuration,ct=Q.animationIterationCount,Et=Q.animationTimingFunction,zt=Q.animationDirection;return Object(We.g)(Bh,H0({},F,{x1:m.x,y1:m.y,x2:w.x,y2:w.y},j,M?{strokeDasharray:ne,stroke:ge,style:{strokeDashoffset:ke,animationName:Le,animationDuration:ft,animationIterationCount:ct,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,F=M.strokeWidth,Q=M.fill,ne=M.strokeDasharray,ge=M.stroke;return Object(We.g)(hm,{d:j,fill:Q,strokeWidth:F,stroke:ge,strokeDasharray:ne})}}])&&Vj(o.prototype,l),h})(pm);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 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(F){j=!0,m=F}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 vx(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 vx(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 vx(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 zj=function(i){var o={points:"",fill:"none"};return Object.entries(i).forEach((function(l){var u=Gj(l,2),h=u[0],d=u[1];(h==="style"||Y0(d)!=="object")&&(o[h]=d)})),Object(We.g)("polyline",o)};function K0(i){return K0=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},K0(i)}function mx(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 Hy(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?mx(Object(l),!0).forEach((function(u){wd(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):mx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return 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 Hj(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(F){j=!0,m=F}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 yx(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 yx(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 yx(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 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 J0(i,o){return J0=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},J0(i,o)}function qj(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 Yj(this,l)}}function Yj(i,o){if(o&&(K0(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 Xy(i){return Xy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Xy(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 Q0=(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&&J0(d,m)})(h,i);var o,l,u=qj(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,F=j.model,Q=j.graphModel;d.isDragging=!0;var ne=Q.transformModel,ge=Q.editConfigModel,ke=Hj(ne.fixDeltaXY(w,M),2),Le=ke[0],ft=ke[1],ct=F,Et=ge.adjustEdgeMiddle;d.appendInfo=Et?ct.dragAppendSimple(d.appendInfo,{x:Le,y:ft}):ct.dragAppend(d.appendInfo,{x:Le,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(),F=d.getEdgeAnimationStyle(),Q=F.strokeDasharray,ne=F.stroke,ge=F.strokeDashoffset,ke=F.animationName,Le=F.animationDuration,ft=F.animationIterationCount,ct=F.animationTimingFunction,Et=F.animationDirection;return Object(We.g)(zj,Z0({points:m},j,M,w?{strokeDasharray:Q,stroke:ne,style:{strokeDashoffset:ge,animationName:ke,animationDuration:Le,animationIterationCount:ft,animationTimingFunction:ct,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},F=cu(Hy(Hy({},j),{},{type:"start"})),Q=cu(Hy(Hy({},j),{},{type:"end"}));m="M".concat(F.leftX," ").concat(F.leftY,`
L`).concat(F.rightX," ").concat(F.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,F=m.strokeDasharray,Q=m.stroke;return Object(We.g)(hm,{d:w,fill:j,strokeWidth:M,stroke:Q,strokeDasharray:F})}},{key:"getAppendWidth",value:function(){for(var d=this,m=this.props,w=m.model,M=m.graphModel,j=w.pointsList,F=w.draggable,Q=[],ne=j.length,ge=function(Le){var ft="lf-polyline-append",ct={start:{x:j[Le].x,y:j[Le].y},end:{x:j[Le+1].x,y:j[Le+1].y},startIndex:Le,endIndex:Le+1,direction:"",dragAble:!0},Et=Object(We.g)("g",{className:ft},d.getAppendShape(ct)),zt=M.editConfigModel,En=zt.adjustEdge,wn=zt.adjustEdgeMiddle;if(En&&F){var Yn=ct.startIndex,gn=ct.endIndex,Fn=wn&&(Yn===0||gn===ne-1);ct.dragAble=!Fn,ct.start.x===ct.end.x?(ct.dragAble&&(ft+="-ew-resize"),ct.direction=fo.VERTICAL):ct.start.y===ct.end.y&&(ct.dragAble&&(ft+="-ns-resize"),ct.direction=fo.HORIZONTAL),Et=Object(We.g)("g",{className:d.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(Mn){return d.beforeDragStart(Mn,ct)}},Object(We.g)("g",{className:ft},d.getAppendShape(ct)))}Q.push(Et)},ke=0;ke<ne-1;ke++)ge(ke);return Object(We.g)("g",null,Q)}}])&&Xj(o.prototype,l),h})(pm);function e1(i){return e1=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},e1(i)}function Kj(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(F){j=!0,m=F}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 t1(){return t1=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},t1.apply(this,arguments)}function Zj(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function Jj(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 n1(i,o){return n1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},n1(i,o)}function Qj(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 e8(this,l)}}function e8(i,o){if(o&&(e1(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 r1=(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&&n1(d,m)})(h,i);var o,l,u=Qj(h);function h(){return Zj(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,F=d.getEdgeAnimationStyle(),Q=F.strokeDasharray,ne=F.stroke,ge=F.strokeDashoffset,ke=F.animationName,Le=F.animationDuration,ft=F.animationIterationCount,ct=F.animationTimingFunction,Et=F.animationDirection;return Object(We.g)(hm,t1({d:w},m,j,M?{strokeDasharray:Q,stroke:ne,style:{strokeDashoffset:ge,animationName:ke,animationDuration:Le,animationIterationCount:ft,animationTimingFunction:ct,animationDirection:Et}}:{}))}},{key:"getAppendWidth",value:function(){var d=this.props.model.path;return Object(We.g)(hm,{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}})),F=Kj(pi(j,M),2);return{start:F[0],end:F[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)}}])&&Jj(o.prototype,l),h})(pm);function o1(i){return o1=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},o1(i)}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 t8(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}function n8(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}function r8(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 i1(i,o){return i1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},i1(i,o)}function o8(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 i8(this,l)}}function i8(i,o){if(o&&(o1(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 Yy(i){return Yy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Yy(i)}var a8=(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&&i1(d,m)})(h,i);var o,l,u=o8(h);function h(){return n8(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,F={start:M,end:j,offset:w.offset,verticalLength:w.verticalLength,type:"end"},Q=cu(F),ne=Q.leftX,ge=Q.leftY,ke=Q.rightX,Le=Q.rightY;return(function(ft){for(var ct=1;ct<arguments.length;ct++){var Et=arguments[ct]!=null?arguments[ct]:{};ct%2?_x(Object(Et),!0).forEach((function(zt){t8(ft,zt,Et[zt])})):Object.getOwnPropertyDescriptors?Object.defineProperties(ft,Object.getOwnPropertyDescriptors(Et)):_x(Object(Et)).forEach((function(zt){Object.defineProperty(ft,zt,Object.getOwnPropertyDescriptor(Et,zt))}))}return ft})({d:"M".concat(ne," ").concat(ge," L").concat(j.x," ").concat(j.y," L").concat(ke," ").concat(Le," 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)(hm,{d:m,fill:j,strokeWidth:w,stroke:M})}},{key:"render",value:function(){return Object(We.g)("g",{className:"lf-arrow"},this.getShape())}}],l&&r8(o.prototype,l),h})(We.a),bx=function(i,o){return wt(i,o)},l8=function(i){var o=i==null?0:i.length;return o?i[o-1]:void 0},a1=function(){return Tn.a.Date.now()},s8=Math.max,u8=Math.min,c8=function(i,o,l){var u,h,d,m,w,M,j=0,F=!1,Q=!1,ne=!0;if(typeof i!="function")throw new TypeError("Expected a function");function ge(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),F?ge(zt):m}function Le(zt){var En=zt-M;return M===void 0||En>=o||En<0||Q&&zt-j>=d}function ft(){var zt=a1();if(Le(zt))return ct(zt);w=setTimeout(ft,(function(En){var wn=o-(En-M);return Q?u8(wn,d-(En-j)):wn})(zt))}function ct(zt){return w=void 0,ne&&u?ge(zt):(u=h=void 0,m)}function Et(){var zt=a1(),En=Le(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),ge(M)}return w===void 0&&(w=setTimeout(ft,o)),m}return o=Gu(o)||0,Lr(l)&&(F=!!l.leading,d=(Q="maxWait"in l)?s8(Gu(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:ct(a1())},Et},d8=r(172);function f8(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 wx,Ex,Ox,p8=(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){bx(l8(this.undos),u)||(this.undos.push(u),bx(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(d8.a)(u,c8((function(){var d=u.modelToHistoryData();d&&h.add(d)}),this.waitTime))}}])&&f8(o.prototype,l),i})();function l1(i){return l1=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},l1(i)}function h8(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(F){j=!0,m=F}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 xx(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 xx(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 xx(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 Sx(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?Sx(Object(l),!0).forEach((function(u){Wp(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Sx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Ax(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 s1(i,o){return s1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},s1(i,o)}function v8(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 m8(this,l)}}function m8(i,o){if(o&&(l1(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 Ky(i){return Ky=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Ky(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 Mx,kx,Tx,u1=yu((Ox=Ex=(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&&s1(m,w)})(d,i);var o,l,u,h=v8(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,F=M.theme,Q=F.inputText,ne=M.textEditElement;if(ne){var ge;if((ge=ne.text)===null||ge===void 0||!ge.value)if(ne.BaseType===co.EDGE){var ke=(ne=ne).text,Le=ne.textPosition,ft=Le.x,ct=Le.y;ke.x=ft,ke.y=ct,ne.setText(ke)}else ne=ne;var Et={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(ne.BaseType===co.EDGE){var zt=F.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=F.nodeText,Mn=Fn.overflowMode,$r=Fn.lineHeight,Wr=Fn.wrapPadding,vr=Fn.textWidth,Jr=ne,_i=Jr.width,bi=Jr.modelType,Aa=Jr.textWidth||vr||_i;(bi!==Mr.TEXT_NODE&&Mn==="autoWrap"||bi===Mr.TEXT_NODE&&vr)&&(w=Up(Up({},Et),{},{width:Aa,minWidth:Aa,lineHeight:$r,padding:Wr}))}var ts=ne.text,ns=ts.x,nc=ts.y,Gp=h8(j.CanvasPointToHtmlPoint([ns,nc]),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}}])&&Ax(o.prototype,l),u&&Ax(o,u),d})(We.a),Wp(Ex,"toolName","textEdit"),wx=Ox))||wx,y8=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 c1(i){return c1=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},c1(i)}function Nx(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(F){j=!0,m=F}finally{try{M||h.return==null||h.return()}finally{if(j)throw m}}return w}})(i,o)||Px(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 g8(i){return(function(o){if(Array.isArray(o))return d1(o)})(i)||(function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(i)||Px(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 Px(i,o){if(i){if(typeof i=="string")return d1(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)?d1(i,o):void 0}}function d1(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 _8(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 f1(i,o){return f1=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},f1(i,o)}function b8(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=Zy(i);if(o){var h=Zy(this).constructor;l=Reflect.construct(u,arguments,h)}else l=u.apply(this,arguments);return w8(this,l)}}function w8(i,o){if(o&&(c1(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 Zy(i){return Zy=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},Zy(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 p1=yu((Tx=kx=(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&&f1(d,m)})(h,i);var o,l,u=b8(h);function h(d){var m;(function(F,Q){if(!(F 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(F){m.stepDrag.handleMouseDown(F)})),tv(ev(m),"handleWheelEvent",(function(F){var Q,ne;F.preventDefault();var ge=F.deltaX,ke=F.deltaY,Le=F.clientX,ft=F.clientY,ct=F.ctrlKey,Et=new WheelEvent("wheel",{deltaX:ge,deltaY:ke,clientX:Le,clientY:ft,ctrlKey:ct});(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(F){var Q=F.deltaX,ne=F.deltaY,ge=m.props.graphModel,ke=ge.getSelectElements(!0);ge.moveNodes(ke.nodes.map((function(Le){return Le.id})),Q,ne)})),tv(ev(m),"handleContextMenu",(function(F){F.preventDefault();var Q=m.props,ne=Q.graphModel,ge=Q.graphModel,ke=ge.eventCenter,Le=ge.selectElements,ft=ne.getPointByClient({x:F.clientX,y:F.clientY}),ct={nodes:[],edges:[]};g8(Le.values()).forEach((function(Et){Et.BaseType===co.NODE&&ct.nodes.push(Et.getData()),Et.BaseType===co.EDGE&&ct.edges.push(Et.getData())})),ke.emit(Dn.SELECTION_CONTEXTMENU,{data:ct,e:F,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,F=Number.MIN_SAFE_INTEGER,Q=Number.MIN_SAFE_INTEGER;m.forEach((function(Le){var ft={x:0,y:0,x1:0,y1:0};Le.BaseType===co.NODE&&(ft=(function(ct){var Et=ct.x,zt=ct.y,En=ct.width,wn=ct.height;return{x:Et-En/2,y:zt-wn/2,x1:Et+En/2,y1:zt+wn/2}})(Le)),Le.BaseType===co.EDGE&&(ft=y8(Le)),M=Math.min(M,ft.x),j=Math.min(j,ft.y),F=Math.max(F,ft.x1),Q=Math.max(Q,ft.y1)}));var ne=Nx(w.CanvasPointToHtmlPoint([M,j]),2);M=ne[0],j=ne[1];var ge=Nx(w.CanvasPointToHtmlPoint([F,Q]),2);F=ge[0],Q=ge[1];var ke={left:"".concat(M-10,"px"),top:"".concat(j-10,"px"),width:"".concat(F-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})}}}])&&_8(o.prototype,l),h})(We.a),tv(kx,"toolName","multipleSelect"),Mx=Tx))||Mx;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 Jy(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var O8=(function(){function i(u){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),Jy(this,"tools",void 0),Jy(this,"components",void 0),Jy(this,"toolMap",new Map),Jy(this,"instance",void 0),this.instance=u,this.isDisabledTool(u1.toolName)||this.registerTool(u1.toolName,u1),this.isDisabledTool(p1.toolName)||this.registerTool(p1.toolName,p1);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}}])&&E8(o.prototype,l),i})(),x8=r(173),S8=r.n(x8);function A8(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 h1(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var Cx=(function(){function i(u){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,i),h1(this,"mousetrap",void 0),h1(this,"options",void 0),h1(this,"target",void 0),u.keyboard||(u.keyboard={enabled:!1}),this.options=u;var h=u.lf;this.target=h.container,this.mousetrap=new S8.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,F=M.callback,Q=M.action;return u.on(j,F,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")}}])&&A8(o.prototype,l),i})(),M8=Cx,Ed=null;function Rx(i,o){return i.x+=o,i.y+=o,i.text&&(i.text.x+=o,i.text.y+=o),i}function jx(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,v1=40;function m1(i){return m1=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},m1(i)}function Dx(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 vm(i){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?Dx(Object(l),!0).forEach((function(u){hi(i,u,l[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):Dx(Object(l)).forEach((function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(l,u))}))}return i}function Ix(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 y1=Symbol("plugin register by Logicflow.use"),g1=(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=C2(h),this.options=h,this.container=this.initContainer(h.container),this.plugins=h.plugins,this.graphModel=new RC(vm({},h)),this.tool=new O8(this),this.history=new p8(this.graphModel.eventCenter),this.dnd=new NR({lf:this}),this.keyboard=new M8({lf:this,keyboard:h.keyboard}),h.snapline!==!1&&(this.snaplineModel=new HO(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 F=M.keyboard,Q=F.options.keyboard;F.on(["cmd + c","ctrl + c"],(function(){if(v1=nv,!Q.enabled||j.textEditElement)return!0;var ne=M.options.guards,ge=j.getSelectElements(!1);return ne&&ne.beforeClone&&!ne.beforeClone(ge)||ge.nodes.length===0&&ge.edges.length===0?(Ed=null,!0):((Ed=ge).nodes.forEach((function(ke){return Rx(ke,nv)})),Ed.edges.forEach((function(ke){return jx(ke,nv)})),!1)})),F.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,v1);if(!ne)return!0;ne.nodes.forEach((function(ge){return M.selectElementById(ge.id,!0)})),ne.edges.forEach((function(ge){return M.selectElementById(ge.id,!0)})),Ed.nodes.forEach((function(ge){return Rx(ge,nv)})),Ed.edges.forEach((function(ge){return jx(ge,nv)})),v1+=nv}return!1})),F.on(["cmd + z","ctrl + z"],(function(){return!Q.enabled||!!j.textEditElement||(M.undo(),!1)})),F.on(["cmd + y","ctrl + y"],(function(){return!Q.enabled||!!j.textEditElement||(M.redo(),!1)})),F.on(["backspace"],(function(){if(!Q.enabled||j.textEditElement)return!0;var ne=j.getSelectElements(!0);return M.clearSelectElements(),ne.edges.forEach((function(ge){return M.deleteEdge(ge.id)})),ne.nodes.forEach((function(ge){return M.deleteNode(ge.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:pm,BaseEdgeModel:xf,BaseNode:gd,BaseNodeModel:yd,RectNode:u0,RectNodeModel:Bb,CircleNode:p0,CircleNodeModel:wb,PolygonNode:g0,PolygonNodeModel:Ib,TextNode:N0,TextNodeModel:Gb,LineEdge:q0,LineEdgeModel:qu,DiamondNode:E0,DiamondNodeModel:Ab,PolylineEdge:Q0,PolylineEdgeModel:Sa,BezierEdge:r1,BezierEdgeModel:vb,EllipseNode:M0,EllipseNodeModel:Nb,HtmlNode:j0,HtmlNodeModel:Xb,h:We.g,type:h};this.viewMap.forEach((function(ne){var ge=ne.extendKey;ge&&(w[ge]=ne)})),this.graphModel.modelMap.forEach((function(ne){var ge=ne.extendKey;ge&&(w[ge]=ne)}));var M=d(w),j=M.view,F=M.model,Q=j;m&&!Q.isObervered&&(Q.isObervered=!0,Q=sn(Q)),this.setView(h,Q),this.graphModel.setModel(h,F)}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:u0,model:Bb,type:"rect"}),this.registerElement({type:"circle",view:p0,model:wb}),this.registerElement({type:"polygon",view:g0,model:Ib}),this.registerElement({type:"line",view:q0,model:qu}),this.registerElement({type:"polyline",view:Q0,model:Sa}),this.registerElement({type:"bezier",view:r1,model:vb}),this.registerElement({type:"text",view:N0,model:Gb}),this.registerElement({type:"ellipse",view:M0,model:Nb}),this.registerElement({type:"diamond",view:E0,model:Ab}),this.registerElement({type:"html",view:j0,model:Xb})}},{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 F=m,Q=F.x,ne=F.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 F=[];return d.forEach((function(Q){Q.targetNodeId===w&&F.push(Q)})),F}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:[]},F=0;F<m.length;F++){var Q=m[F],ne=Q.id,ge=this.addNode(Q);if(!ge)return;ne&&(M[ne]=ge.id),j.nodes.push(ge)}return w.forEach((function(ke){var Le=ke.sourceNodeId,ft=ke.targetNodeId;M[Le]&&(Le=M[Le]),M[ft]&&(ft=M[ft]);var ct=d.graphModel.addEdge(vm(vm({},ke),{},{sourceNodeId:Le,targetNodeId:ft}));j.edges.push(ct)})),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,F=null;M[y1]?(j=M.extension,F=M.props):j=M;var Q=j.pluginName||j.name;m.indexOf(Q)===-1&&d.installPlugin(j,F)}))}},{key:"installPlugin",value:function(h,d){if(m1(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(vm(vm({},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)(kR,{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={},y1,y1),hi(w,"extension",h),hi(w,"props",d),w))}}],l&&Ix(o.prototype,l),u&&Ix(o,u),i})();function yu(i){return sn(i)}hi(g1,"extensions",new Map),a.default=g1}])}))})(ig,ig.exports)),ig.exports}var hn=MV();const LT=CD(hn);var kV=(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})(),TV=(globalThis==null?void 0:globalThis._ids)||new kV;function Vv(){return TV.next()}var $T=(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){$T(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){$T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="StartEventNode",t})(hn.CircleNode);var FT=(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)}})(),jg=function(){return jg=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},jg.apply(this,arguments)};(function(e){FT(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){FT(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",jg(jg({},a),{cx:r,cy:s,r:c-5})))},t.extendKey="EndEventView",t})(hn.CircleNode);var BT=(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)}})(),Am=function(){return Am=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},Am.apply(this,arguments)};(function(e){BT(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){BT(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",Am(Am({},f),{x:a,y:r,points:v})),hn.h("path",Am({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 VT=(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)}})(),Dg=function(){return Dg=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},Dg.apply(this,arguments)};(function(e){VT(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){VT(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",Dg(Dg({},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 UT=(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)};(function(e){UT(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){UT(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",bw({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 WT=(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){WT(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){WT(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="SequenceFlowEdge",t})(hn.PolylineEdge);var bS={width:40,height:40},wS={width:40,height:40},ES={width:40,height:40},OS={width:100,height:80},xS={width:100,height:80},NV=(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})(),PV=(globalThis==null?void 0:globalThis._ids)||new NV;function SS(){return PV.next()}function GT(e){return Object.prototype.toString.call(e)}function CV(e){return" ".repeat(e)}function Ig(e){var t=e;return GT(e)==="[object Object]"?(t={},Object.keys(e).forEach(function(n){var a=n;n.charAt(0)==="-"&&(a=n.substring(1)),t[a]=Ig(e[n])})):Array.isArray(e)&&(t=[],e.forEach(function(n,a){t[a]=Ig(n)})),t}function RV(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(Ig(e)).replace(/"/g,"'")}return t}var rv=`
`;function mg(e,t,n){var a=CV(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)+'="'+RV(e)+'"';if(Array.isArray(e))e.forEach(function(f){r+=mg(f,t,n+1)});else if(GT(e)==="[object Object]"){var s=Object.keys(e),c="",v="";r+=(n===0?"":rv+a)+"<"+t,s.forEach(function(f){f.charAt(0)==="-"?c+=mg(e[f],f,n+1):v+=mg(e[f],f,n+1)}),r+=c+(v!==""?">"+v+(rv+a)+"</"+t+">":" />")}else r+=rv+a+("<"+t+">"+e.toString()+"</"+t+">");return r}function jV(e){var t="";for(var n in e)t+=mg(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(g){var b;g&&g.responseXML&&g.responseXML.documentElement&&(b=s.parseDOM(g.responseXML.documentElement)),c(b,g),v&&v(g)}}else a.asynchronous=!1;var f;if(typeof HTTP<"u"&&HTTP.Request){a.uri=e;var _=new HTTP.Request(a);_&&(f=_.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var _=new Ajax.Request(e,a);_&&(f=_.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 DV=function(e){return new hl.ObjTree().parseXML(e)},IV=(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)}})(),ww=function(){return ww=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},ww.apply(this,arguments)},E_=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 zT=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],AS=["properties","startPoint","endPoint","pointsList"];function MS(e){var t=e?AS.concat(e):AS;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=E_(c,2),f=v[0],_=v[1];typeof _!="object"?f.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(f)?s[f]=_:s["-"+f]=_:t.includes(f)?s["-"+f]=a(_):s[f]=a(_)}),s)}return a(n)}}function Lg(e){var t={};return Object.entries(e).forEach(function(n){var a=E_(n,2),r=a[0],s=a[1];r.indexOf("-")===0?t[r.substring(1)]=Ig(s):typeof s=="string"?t[r]=s:Object.prototype.toString.call(s)==="[object Object]"?t[r]=Lg(s):Array.isArray(s)?t[r]=s.map(function(c){return Lg(c)}):t[r]=s}),t}function LV(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=MS(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 _={"-id":s.id,"-sourceRef":s.sourceNodeId,"-targetRef":s.targetNodeId};if(!((c=s.text)===null||c===void 0)&&c.value&&(_["-name"]=(v=s.text)===null||v===void 0?void 0:v.value),s.properties){var g=MS(n)(s.properties);Object.assign(_,g)}return _});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 $V(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,_=v.y;return{"-x":f,"-y":_}}),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,_=Qf.shapeConfigMap.get(n.type);_&&(s=_.width,c=_.height),v-=s/2,f-=c/2;var g={"-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&&(g["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}}),g})}function FV(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=VV(c,v)}else{var f=a["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];t=t.concat(BV(c,f,s))}}})}return{nodes:t,edges:n}}function BV(e,t,n){var a=[];if(Array.isArray(e))e.forEach(function(c){var v;Array.isArray(t)?v=t.find(function(_){return _["-bpmnElement"]===c["-id"]}):v=t;var f=kS(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=kS(r,n,e);a.push(s)}return a}function kS(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=E_(b,2),A=x[0],S=x[1];zT.indexOf(A)===-1&&(v||(v={}),v[A]=S)}),v&&(v=Lg(v));var f;if(s&&(f={x:a,y:r,value:s},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var _=e["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(_["-x"])+Number(_["-width"])/2,f.y=Number(_["-y"])+Number(_["-height"])/2}var g={id:e["-bpmnElement"],type:t,x:a,y:r,properties:v};return f&&(g.text=f),g}function VV(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(TS(s,r))});else{var a=void 0;Array.isArray(t)?a=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):a=t,n.push(TS(a,e))}return n}function TS(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 _=E_(f,2),g=_[0],b=_[1];zT.indexOf(g)===-1&&(c||(c={}),c[g]=b)}),c&&(c=Lg(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=ww({},n.processAttributes);LV(c,r,s);var v={"-id":"BPMNPlane_1","-bpmnElement":c["-id"]};$V(v,r);var f=n.definitionAttributes;f["bpmn:process"]=c,f["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":v};var _={"bpmn:definitions":f};return _},this.adapterIn=function(r){if(r)return FV(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_"+SS()},this.definitionAttributes={"-id":"Definitions_"+SS(),"-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:bS.width,height:bS.height});Qf.shapeConfigMap.set(uc.END,{width:wS.width,height:wS.height});Qf.shapeConfigMap.set(uc.GATEWAY,{width:ES.width,height:ES.height});Qf.shapeConfigMap.set(uc.SYSTEM,{width:OS.width,height:OS.height});Qf.shapeConfigMap.set(uc.USER,{width:xS.width,height:xS.height});(function(e){IV(t,e);function t(n){var a=e.call(this,n)||this;a.adapterXmlIn=function(s){var c=DV(s);return a.adapterIn(c)},a.adapterXmlOut=function(s,c){var v=a.adapterOut(s,c);return jV(v)};var r=n.lf;return r.adapterIn=a.adapterXmlIn,r.adapterOut=a.adapterXmlOut,a}return t.pluginName="bpmnXmlAdapter",t})(Qf);var UV=(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})(),WV=(globalThis==null?void 0:globalThis._ids)||new UV;function GV(){return WV.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 PE,Pi,HT,Jp,NS,XT,qT,YT,CE,Ew,Ow,xw={},KT=[],zV=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,O_=Array.isArray;function Ad(e,t){for(var n in t)e[n]=t[n];return e}function RE(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Mm(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?PE.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 yg(e,c,a,r,null)}function yg(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??++HT,__i:-1,__u:0};return r==null&&Pi.vnode!=null&&Pi.vnode(s),s}function jE(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 ZT(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ZT(e)}}function PS(e){(!e.__d&&(e.__d=!0)&&Jp.push(e)&&!$g.__r++||NS!=Pi.debounceRendering)&&((NS=Pi.debounceRendering)||XT)($g)}function $g(){for(var e,t,n,a,r,s,c,v=1;Jp.length;)Jp.length>v&&Jp.sort(qT),e=Jp.shift(),v=Jp.length,e.__d&&(n=void 0,a=void 0,r=(a=(t=e).__v).__e,s=[],c=[],t.__P&&((n=Ad({},a)).__v=a.__v+1,Pi.vnode&&Pi.vnode(n),eN(t.__P,n,a,t.__n,t.__P.namespaceURI,32&a.__u?[r]:null,s,r??Tv(a),!!(32&a.__u),c),n.__v=a.__v,n.__.__k[n.__i]=n,qV(s,n,c),a.__e=a.__=null,n.__e!=r&&ZT(n)));$g.__r=0}function JT(e,t,n,a,r,s,c,v,f,_,g){var b,x,A,S,E,T,I,R=a&&a.__k||KT,U=t.length;for(f=HV(n,t,R,f,U),b=0;b<U;b++)(A=n.__k[b])!=null&&(x=A.__i==-1?xw:R[A.__i]||xw,A.__i=b,T=eN(e,A,x,r,s,c,v,f,_,g),S=A.__e,A.ref&&x.ref!=A.ref&&(x.ref&&DE(x.ref,null,A),g.push(A.ref,A.__c||S,A)),E==null&&S!=null&&(E=S),(I=!!(4&A.__u))||x.__k===A.__k?f=QT(A,f,e,I):typeof A.type=="function"&&T!==void 0?f=T:S&&(f=S.nextSibling),A.__u&=-7);return n.__e=E,f}function HV(e,t,n,a,r){var s,c,v,f,_,g=n.length,b=g,x=0;for(e.__k=new Array(r),s=0;s<r;s++)(c=t[s])!=null&&typeof c!="boolean"&&typeof c!="function"?(f=s+x,(c=e.__k[s]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?yg(null,c,null,null,null):O_(c)?yg(jE,{children:c},null,null,null):c.constructor==null&&c.__b>0?yg(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=e,c.__b=e.__b+1,v=null,(_=c.__i=XV(c,n,f,b))!=-1&&(b--,(v=n[_])&&(v.__u|=2)),v==null||v.__v==null?(_==-1&&(r>g?x--:r<g&&x++),typeof c.type!="function"&&(c.__u|=4)):_!=f&&(_==f-1?x--:_==f+1?x++:(_>f?x--:x++,c.__u|=4))):e.__k[s]=null;if(b)for(s=0;s<g;s++)(v=n[s])!=null&&(2&v.__u)==0&&(v.__e==a&&(a=Tv(v)),nN(v,v));return a}function QT(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=QT(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 XV(e,t,n,a){var r,s,c,v=e.key,f=e.type,_=t[n],g=_!=null&&(2&_.__u)==0;if(_===null&&e.key==null||g&&v==_.key&&f==_.type)return n;if(a>(g?1:0)){for(r=n-1,s=n+1;r>=0||s<t.length;)if((_=t[c=r>=0?r--:s++])!=null&&(2&_.__u)==0&&v==_.key&&f==_.type)return c}return-1}function CS(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||zV.test(t)?n:n+"px"}function ag(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||CS(e.style,t,"");if(n)for(t in n)a&&n[t]==a[t]||CS(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(YT,"$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=CE,e.addEventListener(t,s?Ow:Ew,s)):e.removeEventListener(t,s?Ow:Ew,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 RS(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=CE++;else if(t.t<n.u)return;return n(Pi.event?Pi.event(t):t)}}}function eN(e,t,n,a,r,s,c,v,f,_){var g,b,x,A,S,E,T,I,R,U,L,D,W,Y,B,V,z,H=t.type;if(t.constructor!=null)return null;128&n.__u&&(f=!!(32&n.__u),s=[v=t.__e=n.__e]),(g=Pi.__b)&&g(t);e:if(typeof H=="function")try{if(I=t.props,R="prototype"in H&&H.prototype.render,U=(g=H.contextType)&&a[g.__c],L=g?U?U.props.value:g.__:a,n.__c?T=(b=t.__c=n.__c).__=b.__E:(R?t.__c=b=new H(I,L):(t.__c=b=new gv(I,L),b.constructor=H,b.render=KV),U&&U.sub(b),b.props=I,b.state||(b.state={}),b.context=L,b.__n=a,x=b.__d=!0,b.__h=[],b._sb=[]),R&&b.__s==null&&(b.__s=b.state),R&&H.getDerivedStateFromProps!=null&&(b.__s==b.state&&(b.__s=Ad({},b.__s)),Ad(b.__s,H.getDerivedStateFromProps(I,b.__s))),A=b.props,S=b.state,b.__v=t,x)R&&H.getDerivedStateFromProps==null&&b.componentWillMount!=null&&b.componentWillMount(),R&&b.componentDidMount!=null&&b.__h.push(b.componentDidMount);else{if(R&&H.getDerivedStateFromProps==null&&I!==A&&b.componentWillReceiveProps!=null&&b.componentWillReceiveProps(I,L),!b.__e&&b.shouldComponentUpdate!=null&&b.shouldComponentUpdate(I,b.__s,L)===!1||t.__v==n.__v){for(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)}),D=0;D<b._sb.length;D++)b.__h.push(b._sb[D]);b._sb=[],b.__h.length&&c.push(b);break e}b.componentWillUpdate!=null&&b.componentWillUpdate(I,b.__s,L),R&&b.componentDidUpdate!=null&&b.__h.push(function(){b.componentDidUpdate(A,S,E)})}if(b.context=L,b.props=I,b.__P=e,b.__e=!1,W=Pi.__r,Y=0,R){for(b.state=b.__s,b.__d=!1,W&&W(t),g=b.render(b.props,b.state,b.context),B=0;B<b._sb.length;B++)b.__h.push(b._sb[B]);b._sb=[]}else do b.__d=!1,W&&W(t),g=b.render(b.props,b.state,b.context),b.state=b.__s;while(b.__d&&++Y<25);b.state=b.__s,b.getChildContext!=null&&(a=Ad(Ad({},a),b.getChildContext())),R&&!x&&b.getSnapshotBeforeUpdate!=null&&(E=b.getSnapshotBeforeUpdate(A,S)),V=g,g!=null&&g.type===jE&&g.key==null&&(V=tN(g.props.children)),v=JT(e,O_(V)?V:[V],t,n,a,r,s,c,v,f,_),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(z=s.length;z--;)RE(s[z]);Sw(t)}else t.__e=n.__e,t.__k=n.__k,q.then||Sw(t);Pi.__e(q,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):v=t.__e=YV(n.__e,t,n,a,r,s,c,f,_);return(g=Pi.diffed)&&g(t),128&t.__u?void 0:v}function Sw(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Sw)}function qV(e,t,n){for(var a=0;a<n.length;a++)DE(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 tN(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:O_(e)?e.map(tN):Ad({},e)}function YV(e,t,n,a,r,s,c,v,f){var _,g,b,x,A,S,E,T=n.props,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(_=0;_<s.length;_++)if((A=s[_])&&"setAttribute"in A==!!R&&(R?A.localName==R:A.nodeType==3)){e=A,s[_]=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&&PE.call(e.childNodes),T=n.props||xw,!v&&s!=null)for(T={},_=0;_<e.attributes.length;_++)T[(A=e.attributes[_]).name]=A.value;for(_ in T)if(A=T[_],_!="children"){if(_=="dangerouslySetInnerHTML")b=A;else if(!(_ in I)){if(_=="value"&&"defaultValue"in I||_=="checked"&&"defaultChecked"in I)continue;ag(e,_,null,A,r)}}for(_ in I)A=I[_],_=="children"?x=A:_=="dangerouslySetInnerHTML"?g=A:_=="value"?S=A:_=="checked"?E=A:v&&typeof A!="function"||T[_]===A||ag(e,_,A,T[_],r);if(g)v||b&&(g.__html==b.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(b&&(e.innerHTML=""),JT(t.type=="template"?e.content:e,O_(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(_=s.length;_--;)RE(s[_]);v||(_="value",R=="progress"&&S==null?e.removeAttribute("value"):S!=null&&(S!==e[_]||R=="progress"&&!S||R=="option"&&S!=T[_])&&ag(e,_,S,T[_],r),_="checked",E!=null&&E!=e[_]&&ag(e,_,E,T[_],r))}return e}function DE(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 nN(e,t,n){var a,r;if(Pi.unmount&&Pi.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||DE(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]&&nN(a[r],t,n||typeof e.type!="function");n||RE(e.__e),e.__c=e.__=e.__e=void 0}function KV(e,t,n){return this.constructor(e,n)}PE=KT.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}},HT=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),PS(this))},gv.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),PS(this))},gv.prototype.render=jE,Jp=[],XT=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qT=function(e,t){return e.__v.__b-t.__v.__b},$g.__r=0,YT=/(PointerCapture)$|Capture$/i,CE=0,Ew=RS(!1),Ow=RS(!0);var 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 IE(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,_=km(km({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",km({},_))}IE.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 ZV=(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)},JV=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},QV=hn.LogicFlowUtil.StepDrag,eU=(function(e){ZV(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,_=v.y;a.nodeModel.x=f+s/2,a.nodeModel.y=_+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,_=r.height,g=r.PCTResizeInfo,b=r.pct,x=b===void 0?1:b,A=r.freezeWidth,S=A===void 0?!1:A,E=r.freezeHeight,T=E===void 0?!1:E,I={width:f,height:_,deltaX:c,deltaY:v};if(g){var R=4,U=0,L=0;switch(s){case 0:L=(c*-1-v)/R;break;case 1:L=(c-v)/R;break;case 2:L=(c+v)/R;break;case 3:L=(c*-1+v)/R;break}L!==0&&(U=Math.round(L/g.ResizeBasis.basisHeight*1e5)/1e3),g.ResizePCT.widthPCT=Math.max(Math.min(g.ResizePCT.widthPCT+U,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit),g.ResizePCT.hightPCT=Math.max(Math.min(g.ResizePCT.hightPCT+U,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit);var D=Math.round(g.ResizePCT.widthPCT*g.ResizeBasis.basisWidth/100),W=Math.round(g.ResizePCT.hightPCT*g.ResizeBasis.basisHeight/100);switch(s){case 0:c=f-D,v=_-W;break;case 1:c=D-f,v=_-W;break;case 2:c=D-f,v=W-_;break;case 3:c=f-D,v=W-_;break}return I.width=D,I.height=W,I.deltaX=c/x,I.deltaY=v/x,I}switch(s){case 0:I.width=S?f:f-c*x,I.height=T?_:_-v*x;break;case 1:I.width=S?f:f+c*x,I.height=T?_:_-v*x;break;case 2:I.width=S?f:f+c*x,I.height=T?_:_+v*x;break;case 3:I.width=S?f:f-c*x,I.height=T?_:_+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 _=c.find(function(g){return g.id===f.sourceAnchorId});f.updateStartPoint({x:_.x,y:_.y})}),v.targetEdges.forEach(function(f){var _=c.find(function(g){return g.id===f.targetAnchorId});f.updateEndPoint({x:_.x,y:_.y})})},a.updateRect=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel,f=v.id,_=v.x,g=v.y,b=v.width,x=v.height,A=v.radius,S=v.PCTResizeInfo,E=a.nodeModel,T=E.minWidth,I=E.minHeight,R=E.maxWidth,U=E.maxHeight,L=a.index,D=T===R,W=I===U,Y=a.getResize({index:L,deltaX:s,deltaY:c,width:b,height:x,PCTResizeInfo:S,pct:1,freezeWidth:D,freezeHeight:W});if(Y.width<T||Y.width>R||Y.height<I||Y.height>U){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:D?0:Y.deltaX,deltaY:W?0:Y.deltaY}),a.nodeModel.width=Y.width,a.nodeModel.height=Y.height,a.nodeModel.setProperties({nodeSize:{width:Y.width,height:Y.height}}),a.getNodeEdges(f);var B={x:_,y:g,width:b,height:x,radius:A},V={x:a.nodeModel.x,y:a.nodeModel.y,width:a.nodeModel.width,height:a.nodeModel.height,radius:A};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:B,afterNode:V})},a.updateEllipse=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel,f=v.id,_=v.rx,g=v.ry,b=v.x,x=v.y,A=v.PCTResizeInfo,S=a.index,E=a.nodeModel,T=E.minWidth,I=E.minHeight,R=E.maxWidth,U=E.maxHeight,L=T===R,D=I===U,W=_,Y=g,B=a.getResize({index:S,deltaX:s,deltaY:c,width:W,height:Y,PCTResizeInfo:A,pct:1/2,freezeWidth:L,freezeHeight:D});if(B.width<T/2||B.width>R/2||B.height<I/2||B.height>U/2){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:L?0:B.deltaX,deltaY:D?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 V={x:b,y:x},z={rx:B.width,ry:B.height,x:a.nodeModel.x,y:a.nodeModel.y};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:Qp(Qp({},V),{rx:_,ry:g}),afterNode:z})},a.updateDiamond=function(r){var s=r.deltaX,c=r.deltaY,v=a.nodeModel;v.id;var f=v.rx,_=v.ry,g=v.x,b=v.y,x=v.PCTResizeInfo,A=a.index,S=a.nodeModel,E=S.minWidth,T=S.minHeight,I=S.maxWidth,R=S.maxHeight,U=E===I,L=T===R,D=f,W=_,Y=a.getResize({index:A,deltaX:s,deltaY:c,width:D,height:W,PCTResizeInfo:x,pct:1/2,freezeWidth:U,freezeHeight:L});if(Y.width<E/2||Y.width>I/2||Y.height<T/2||Y.height>R/2){a.dragHandler.cancelDrag();return}a.updatePosition({deltaX:U?0:Y.deltaX,deltaY:L?0:Y.deltaY}),a.nodeModel.rx=Y.width,a.nodeModel.ry=Y.height,a.nodeModel.setProperties({nodeSize:{rx:Y.width,ry:Y.height}});var B={x:g,y:b,rx:f,ry:_},V={rx:Y.width,ry:Y.height,x:a.nodeModel.x,y:a.nodeModel.y};a.updateEdgePointByAnchors(),a.eventEmit({beforeNode:B,afterNode:V})},a.eventEmit=function(r){var s=r.beforeNode,c=r.afterNode,v=a.nodeModel,f=v.id,_=v.modelType,g=v.type,b=Qp({id:f,modelType:_,type:g},s),x=Qp({id:f,modelType:_,type:g},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,_=a.nodeModel.modelType;s=JV(f.fixDeltaXY(c,v),2),c=s[0],v=s[1],_===hv.RECT_NODE||_===hv.HTML_NODE?a.updateRect({deltaX:c,deltaY:v}):_===hv.ELLIPSE_NODE?a.updateEllipse({deltaX:c,deltaY:v}):_===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 QV({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 Mm("g",{className:"lf-resize-control-"+s},Mm(IE,Qp({className:"lf-node-control"},{x:a,y:r},v,{onMouseDown:this.dragHandler.handleMouseDown})))},t})(gv),tU=(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)},x_=(function(e){tU(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,_={minX:s-v/2,minY:c-f/2,maxX:s+v/2,maxY:c+f/2},g=_.minX,b=_.minY,x=_.maxX,A=_.maxY,S=[{x:g,y:b},{x,y:b},{x,y:A},{x:g,y:A}];return S.map(function(E,T){return Mm(eU,Fg({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 Mm(IE,Fg({fill:"none"},v,{x:a,y:r,width:s,height:c}))},t.prototype.render=function(){return Mm("g",{className:"lf-resize-control"},this.getGroupSolid(),this.getResizeControl())},t})(gv),rN=(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)}})(),nU=(function(e){rN(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),rU=(function(e){rN(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(x_,{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),oN={view:rU,model:nU},iN=(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){iN(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){iN(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(x_,{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 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)};function oU(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,_=e.stroke,g=_===void 0?"#000":_,b=e.points,x=e.className,A=x===void 0?"lf-basic-shape":x,S={fill:f,fillOpacity:n,strokeWidth:r,stroke:g,strokeOpacity:c,points:"",className:A};return S.points=b.map(function(E){return E.join(",")}).join(" "),hn.h("polygon",Aw({},S))}var 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)}})(),Mw=function(){return Mw=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},Mw.apply(this,arguments)};(function(e){aN(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){aN(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(x_,{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(oU,Mw({},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 lN=(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)}})(),iU=(function(e){lN(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),aU=(function(e){lN(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(x_,{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),sN={view:aU,model:iU},uN=(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)}})(),Bg=function(){return Bg=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},Bg.apply(this,arguments)},lU=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},sU=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(lU(arguments[t]));return e},jS=500,DS=300,uU=-1e4;(function(e){uN(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.isGroup=!0,n.unfoldedWidth=jS,n.unfoldedHight=DS,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=jS,this.height=DS,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=uU,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,_=s.targetNodeId,g=s.startPoint,b=s.endPoint,x=s.type,A=s.text,S=s.getProperties(),E={id:v+"__"+c,sourceNodeId:f,targetNodeId:_,startPoint:g,endPoint:b,type:x,properties:S,text:A==null?void 0:A.value};s.virtual&&r.graphModel.deleteEdgeById(s.id);var T=r.graphModel.group.getNodeGroup(_);T||(T=r.graphModel.getNodeModelById(_));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=sU(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})(oN.model);(function(e){uN(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 _=this.props.model.getNodeStyle().strokeWidth,g=this.props.model.getAddableOutlineStyle(),b=a+_+8,x=r+_+8;return hn.h("rect",Bg(Bg({},g),{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})(oN.view);var IS=(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)}})(),Tm=function(){return Tm=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},Tm.apply(this,arguments)};function cU(e){var t=(function(a){IS(r,a);function r(s,c){var v=this;s.id||(s.id="Flow_"+GV());var f=Tm(Tm(Tm({},{}),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){IS(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}}cU();var LS={width:40,height:40},$S={width:40,height:40},FS={width:100,height:80},Vg={width:100,height:80},BS={width:100,height:80},VS={width:100,height:80},US={width:100,height:80},WS={width:100,height:80},GS={width:100,height:80},zS={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(g){var b;g&&g.responseXML&&g.responseXML.documentElement&&(b=s.parseDOM(g.responseXML.documentElement)),c(b,g),v&&v(g)}}else a.asynchronous=!1;var f;if(typeof HTTP<"u"&&HTTP.Request){a.uri=e;var _=new HTTP.Request(a);_&&(f=_.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var _=new Ajax.Request(e,a);_&&(f=_.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 dU=function(e){return new vl.ObjTree().parseXML(e)};function cN(e){return Object.prototype.toString.call(e)}function HS(e){return" ".repeat(e)}function Ug(e){return cN(e)==="[object Object]"?Object.keys(e).reduce(function(t,n){var a=n;return n.charAt(0)==="-"&&(a=n.substring(1)),t[a]=Ug(e[n]),t},{}):Array.isArray(e)?e.map(function(t){return Ug(t)}):e}function fU(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(Ug(e)).replace(/"/g,"'")}return t}var XS=`
`;function gg(e,t,n){var a=HS(n),r="",s=XS+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)+'="'+fU(e)+'"';if(Array.isArray(e))r+=e.map(function(_){return gg(_,t,n+1)}).join("");else if(cN(e)==="[object Object]"){var c=Object.keys(e),v="",f=e["-json"]?XS+HS(n+1)+e["-json"]:"";r+=(n===0?"":s)+"<"+t,c.forEach(function(_){_.charAt(0)==="-"?v+=gg(e[_],_,n+1):f+=gg(e[_],_,n+1)}),r+=v+(f!==""?">"+f+s+"</"+t+">":" />")}else r+=s+"<"+t+">"+e.toString()+"</"+t+">";return r}function pU(e){var t="";for(var n in e)t+=gg(e[n],n,0);return t}var hU=(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)}})(),kw=function(){return kw=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},kw.apply(this,arguments)},qS=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},LE=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 dN=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],vU=["properties","startPoint","endPoint","pointsList"],Wg={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},fN=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="",_="";try{for(var g=LE(Object.keys(t)),b=g.next();!b.done;b=g.next()){var x=b.value;x.includes("bpmn:")&&(r=Uv(x.split(":"),2),f=r[1],_=(s=t[x])===null||s===void 0?void 0:s["#text"])}}catch(A){n={error:A}}finally{try{b&&!b.done&&(a=g.return)&&a.call(g)}finally{if(n)throw n.error}}return{"-definitionId":v,"-definitionType":c,"-timerType":f,"-timerValue":_}}},"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 mU(e){var t=e??{},n=t.retainedAttrsFields,a=t.excludeFields,r=t.transformer,s=new Set(_v(vU,n||[])),c={in:new Set(_v(Wg.in,(a==null?void 0:a.in)||[])),out:new Set(_v(Wg.out,(a==null?void 0:a.out)||[]))};return Rs=fN(Rs,r),function(v){var f=v.nodes,_=v.edges;function g(b,x){var A,S,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(z){b[z]=I[z]})}b!=null&&b.children&&(b.children=b.children.map(function(z){var H=f.find(function(q){return q.id===z})||_.find(function(q){return q.id===z});return H||{}}));var U={};if(typeof b=="string")return b;if(Array.isArray(b))return b.map(function(z){return g(z,"")}).filter(function(z){return z!=null});try{for(var L=LE(Object.entries(b)),D=L.next();!D.done;D=L.next()){var W=Uv(D.value,2),Y=W[0],B=W[1];if(((E=B)===null||E===void 0?void 0:E.flag)===1)return;var V=[x,Y].filter(function(z){return z}).join(".");c.out.has(V)||(typeof B!="object"?Y.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(Y)?U[Y]=B:U["-"+Y]=B:s.has(V)?U["-"+Y]=g(B,V):U[Y]=g(B,V))}}catch(z){A={error:z}}finally{try{D&&!D.done&&(S=L.return)&&S.call(L)}finally{if(A)throw A.error}}return U}}return g(v,"")}}function Gg(e){var t,n,a={};try{for(var r=LE(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)]=Ug(f):typeof f=="string"?a[v]=f:Object.prototype.toString.call(f)==="[object Object]"?a[v]=Gg(f):Array.isArray(f)?a[v]=f.map(function(_){return Gg(_)}):a[v]=f}}catch(_){t={error:_}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return a}function yU(e,t,n){var a,r=new Map,s=mU(n)(t);s.nodes.forEach(function(v){var f=v["-id"],_=v["-type"],g=v.text,b=v.children,x=qS(v,["-id","-type","text","children"]),A={"-id":f};g!=null&&g["-value"]&&(A["-name"]=g["-value"]),x["-json"]&&(A["-json"]=x["-json"]),x["-properties"]&&Object.assign(A,x["-properties"]),b&&(A.children=b),e[_]||(e[_]=[]),e[_].push(A),r.set(f,A)});var c=s.edges.map(function(v){var f=v["-id"];v["-type"];var _=v["-sourceNodeId"],g=v["-targetNodeId"],b=v.text,x=qS(v,["-id","-type","-sourceNodeId","-targetNodeId","text"]),A=r.get(g);A["bpmn:incoming"]||(A["bpmn:incoming"]=[]),A["bpmn:incoming"].push(f);var S={"-id":f,"-sourceRef":_,"-targetRef":g};return b!=null&&b["-value"]&&(S["-name"]=b["-value"]),x["-json"]&&(S["-json"]=x["-json"]),x["-properties"]&&Object.assign(S,x["-properties"]),S});return t.edges.forEach(function(v){var f=v.sourceNodeId,_=v.id,g=r.get(f);g["bpmn:outgoing"]||(g["bpmn:outgoing"]=[]),g["bpmn:outgoing"].push(_)}),(a=e["bpmn:subProcess"])===null||a===void 0||a.forEach(function(v){var f={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},_=[];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(L){f[U].add(L)})});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 g=f["bpmn:incoming"],b=f["bpmn:outgoing"];b.forEach(function(E){g.has(E)&&_.push(E)});for(var x=function(E){var T=c.findIndex(function(I){return I["-id"]===_[E]});T>=0?(v["bpmn:sequenceFlow"]||(v["bpmn:sequenceFlow"]=[]),v["bpmn:sequenceFlow"].push(c[T]),c.splice(T,1)):E++,A=E},A,S=0;S<_.length;)x(S),S=A;delete v.children}),e[fl.FLOW]=c,e}function gU(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,_=v.y;return{"-x":f,"-y":_}}),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,_=Dl.shapeConfigMap.get(n.type);_&&(s=_.width,c=_.height),v-=s/2,f-=c/2;var g={"-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&&(g["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}}),g})}var _U=["bpmn:incoming","bpmn:outgoing"];function bU(e,t){var n=[],a=[],r=new Map,s=t??{},c=s.transformer,v=s.excludeFields,f={in:new Set(_v(Wg.in,(v==null?void 0:v.in)||[])),out:new Set(_v(Wg.out,(v==null?void 0:v.out)||[]))};Rs=fN(Rs,c);var _=e["bpmn:definitions"];if(_){var g=_["bpmn:process"];(function(x,A){A.forEach(function(S){try{Object.keys(x).forEach(function(E){try{S(E)}catch(T){console.error(T)}})}catch(E){console.error(E)}})})(g,[function(x){function A(E){E["-children"]||(E["-children"]=[]),Object.keys(E).forEach(function(T){var I;T.indexOf("bpmn:")===0&&!_U.includes(T)&&(g[T]||(g[T]=[]),!Array.isArray(g[T])&&(g[T]=[g[T]]),Array.isArray(E[T])?(I=g[T]).push.apply(I,_v(E[T])):g[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 S=g[x];Array.isArray(S)?S.forEach(function(E){x==="bpmn:subProcess"&&A(E)}):A(S)}},function(x){var A=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]):S(E[T]);var L=void 0;(L=Reflect.ownKeys(U)).length>0&&L.forEach(function(D){Reflect.set(E,D,U[D])})}})};function S(E){r.set(E["-id"],E),Array.isArray(E)?E.forEach(function(T){S(T)}):typeof E=="object"&&A(E)}S(g[x])},function(x){if(x.indexOf("bpmn:")===0){var A=g[x];if(x==="bpmn:sequenceFlow"){var S=_["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];a=EU(A,S)}else{var E=_["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(x==="bpmn:boundaryEvent"){var T=g[x],I=function(R){var U=R["-attachedToRef"],L=r.get(U);L["-boundaryEvents"]||(L["-boundaryEvents"]=[]),L["-boundaryEvents"].push(R["-id"])};Array.isArray(T)?T.forEach(function(R){I(R)}):I(T)}n=n.concat(wU(A,E,x))}}}])}var b=function(x,A,S){Object.keys(x).forEach(function(E){var T=S?S+"."+E:E;A.has(T)?delete x[E]:typeof x[E]=="object"&&b(x[E],A,T)})};return n.forEach(function(x){var A,S;if(!((A=t==null?void 0:t.mapping)===null||A===void 0)&&A.in){var E=(S=t==null?void 0:t.mapping)===null||S===void 0?void 0:S.in,T=x.type;E[T]&&(x.type=E[T])}b(x,f.in,"")}),a.forEach(function(x){var A,S;if(!((A=t==null?void 0:t.mapping)===null||A===void 0)&&A.in){var E=(S=t==null?void 0:t.mapping)===null||S===void 0?void 0:S.in,T=x.type;E[T]&&(x.type=E[T])}b(x,f.in,"")}),{nodes:n,edges:a}}function wU(e,t,n){var a=[];if(Array.isArray(e))e.forEach(function(c){var v;Array.isArray(t)?v=t.find(function(_){return _["-bpmnElement"]===c["-id"]}):v=t;var f=YS(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=YS(r,n,e);a.push(s)}return a}function YS(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 A=Uv(x,2),S=A[0],E=A[1];dN.includes(S)||(f[S]=E)}),f=Gg(f);var _;if(c&&(_={x:a,y:r,value:c},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var g=e["bpmndi:BPMNLabel"]["dc:Bounds"];_.x=Number(g["-x"])+Number(g["-width"])/2,_.y=Number(g["-y"])+Number(g["-height"])/2}var b={id:e["-bpmnElement"],type:t,x:a,y:r,properties:f};return s&&(b.children=s),_&&(b.text=_),b}function EU(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(KS(s,r))});else{var a=void 0;Array.isArray(t)?a=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):a=t,n.push(KS(a,e))}return n}function KS(e,t){var n,a=t["-name"];if(a){var r=e["bpmndi:BPMNLabel"]["dc:Bounds"],s=0;a.split(`
`).forEach(function(_){s<_.length&&(s=_.length)}),n={value:a,x:Number(r["-x"])+s*10/2,y:Number(r["-y"])+7}}var c={};Object.entries(t).forEach(function(_){var g=Uv(_,2),b=g[0],x=g[1];dN.includes(b)||(c[b]=x)}),c=Gg(c);var v=e["di:waypoint"].map(function(_){return{x:Number(_["-x"]),y:Number(_["-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=kw({},n.processAttributes);yU(f,r,s);var _={"-id":"BPMNPlane_1","-bpmnElement":f["-id"]};gU(_,r);var g=n.definitionAttributes;g["bpmn:process"]=f,g["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":_};var b={"bpmn:definitions":g};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,A=function(S){Array.isArray(S)&&S.forEach(function(E){return A(E)}),typeof S=="object"&&Object.keys(S).forEach(function(E){var T;(T=x[E])?(S[T]=ce.cloneDeep(S[E]),delete S[E],A(S[T])):A(S[E])})};A(b)}return b},this.adapterIn=function(r,s){if(r)return bU(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:LS.width,height:LS.height});Dl.shapeConfigMap.set(fl.END,{width:$S.width,height:$S.height});Dl.shapeConfigMap.set(fl.INTERMEDIATE_CATCH,{width:Vg.width,height:Vg.height});Dl.shapeConfigMap.set(fl.INTERMEDIATE_THROW,{width:Vg.width,height:Vg.height});Dl.shapeConfigMap.set(fl.BOUNDARY,{width:FS.width,height:FS.height});Dl.shapeConfigMap.set(fl.PARALLEL_GATEWAY,{width:BS.width,height:BS.height});Dl.shapeConfigMap.set(fl.INCLUSIVE_GATEWAY,{width:VS.width,height:VS.height});Dl.shapeConfigMap.set(fl.EXCLUSIVE_GATEWAY,{width:US.width,height:US.height});Dl.shapeConfigMap.set(fl.SYSTEM,{width:WS.width,height:WS.height});Dl.shapeConfigMap.set(fl.USER,{width:GS.width,height:GS.height});Dl.shapeConfigMap.set(fl.SUBPROCESS,{width:zS.width,height:zS.height});(function(e){hU(t,e);function t(n){var a=e.call(this,n)||this;a.adapterXmlIn=function(c){var v=dU(c);return a.adapterIn(v,a.props)},a.adapterXmlOut=function(c){var v=a.adapterOut(c,a.props);return pU(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 OU=(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 _=n.startPoint,g=_.x,b=_.y,x=n.wrapper.style,A=g,S=b,E=v-g,T=f-b;v<g&&(A=v,E=g-v),f<b&&(S=f,T=b-f),x.left=A+"px",x.top=S+"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,_=f.x,g=f.y;if(!(Math.abs(_-c)<10&&Math.abs(g-v)<10)){var b=[Math.min(c,_),Math.min(v,g)],x=[Math.max(c,_),Math.max(v,g)],A=n.lf.graphModel.getAreaElement(b,x,n.isWholeEdge,n.isWholeNode,!0),S=n.lf.graphModel.group;A.forEach(function(E){(!S||!S.getNodeGroup(E.id))&&n.lf.selectElementById(E.id,!0)}),n.lf.emit("selection:selected",A)}},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,_=f.x,g=f.y;a.startPoint={x:_,y:g},a.endPoint={x:_,y:g};var b=document.createElement("div");b.className="lf-selection-select",b.oncontextmenu=function(A){A.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)}}})},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})(),pN=(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)},Nm=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},xU={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function SU(e){for(var t=e,n=1;n<t.length-1;){var a=Nm(t[n-1],2),r=a[0],s=a[1],c=Nm(t[n],2),v=c[0],f=c[1],_=Nm(t[n+1],2),g=_[0],b=_[1];r===v&&v===g||s===f&&f===b?t.splice(n,1):n++}return t}function AU(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 MU(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,_=xU[f]||"-",g="L "+e[0]+" "+e[1];if(_==="-")g+="L "+t[0]+" "+t[1]+" L "+n[0]+" "+n[1];else{var b=Nm(AU(t,f,_,v),2),x=b[0],A=b[1];x&&A&&(g+="L "+x[0]+" "+x[1]+" Q "+t[0]+" "+t[1]+" "+A[0]+" "+A[1],r=Nm(A,2),t[0]=r[0],t[1]=r[1])}return g}function kU(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+=MU(r,s,c,t)}a+="L "+e[n][0]+" "+e[n][1]}return a}(function(e){pN(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(),_=n.getEdgeAnimationStyle(),g=SU(a.split(" ").map(function(A){return A.split(",").map(function(S){return+S})})),b=kU(g,v),x=vv(vv(vv({style:r?_:{}},f),s),{fill:"none"});return hn.h("path",vv({d:b},x))},t})(hn.PolylineEdge);(function(e){pN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(hn.PolylineEdgeModel);let S_=!1;const Xf=Zf({});function hN(e,t,n,a,r,s,c){s||(s=(v,f)=>({nodeModel:v,graph:f})),c||(c=(v,f)=>({getNode:()=>v,getGraph:()=>f})),S_&&(Xf[e]=RD(Vn({render:()=>kv(jD,{to:n},[kv(t,s(a,r))]),provide:()=>c(a,r)})))}function vN(e){S_&&delete Xf[e]}function TU(e){Object.keys(Xf).forEach(t=>{t.startsWith(e)&&delete Xf[t]})}function NU(){Object.keys(Xf).forEach(e=>{delete Xf[e]})}function zg(){return S_}function PU(){return S_=!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 sN.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 KD[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,_;const n=[];return 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:(v=this.props.model.properties.node_data)==null?void 0:v.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((_=(f=this.props.model.properties)==null?void 0:f.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((c,v)=>[...c,...v],[]);return[...(this.props.graphModel.getNodeModelById("start-node")||this.props.graphModel.getNodeModelById("loop-start-node")).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(zg())hN(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=ik({render(){return this.r},provide(){return{getNode:()=>a,getGraph:()=>r,workflowMode:sc.Application}}}),this.app.use(DD,{locale:ID}),this.app.use(LD),this.app.use($D),this.app.use(ok);for(const[c,v]of Object.entries(FD))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(){zg()&&vN(this.targetId()),this.unmountVueComponent()}}class vo extends sN.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.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}=ok.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(g=>g.targetAnchorId==v.id&&g.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!==nr.Base&&([nr.Start,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 CU=class extends ho{constructor(t){super(t,AV)}};const RU={type:"ai-chat-node",model:vo,view:CU},mN=Object.freeze(Object.defineProperty({__proto__:null,default:RU},Symbol.toStringTag,{value:"Module"})),jU={class:"title-decoration-1 mb-8"},DU={class:"flex align-center"},IU={class:"mr-4"},LU=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=je(),s=$n({get:()=>(f.nodeModel.properties.node_data||me.set(f.nodeModel.properties,"node_data",a),f.nodeModel.properties.node_data),set:g=>{me.set(f.nodeModel.properties,"node_data",g)}});function c(g,b){const x=`${g}_list`;b?f.nodeModel.properties.node_data[x]||me.set(f.nodeModel.properties.node_data,x,[]):delete f.nodeModel.properties.node_data[x]}const v=()=>{if(!f.nodeModel.properties.node_data.application_id){me.set(f.nodeModel.properties,"status",500);return}po({type:"application",systemType:n.value}).getApplicationDetail(f.nodeModel.properties.node_data.application_id).then(g=>{const b=me.cloneDeep(f.nodeModel.properties.node_data.api_input_field_list),x=me.cloneDeep(f.nodeModel.properties.node_data.user_input_field_list);if(Zw(g.data.type)){const A=g.data.work_flow.nodes[0].properties.node_data,S=me.cloneDeep(g.data.work_flow.nodes[0].properties.api_input_field_list),E=me.cloneDeep(g.data.work_flow.nodes[0].properties.user_input_field_list),T=(S||[]).map(L=>{const D=b==null?void 0:b.find(W=>W.variable==L.variable);return D?{...L,value:D.value,label:typeof L.label=="object"&&L.label!=null?L.label.label:L.label}:L});me.set(f.nodeModel.properties.node_data,"api_input_field_list",T);const I=(E||[]).map(L=>{const D=x==null?void 0:x.find(W=>W.field==L.field);return D?{...L,value:D.value,label:typeof L.label=="object"&&L.label!=null?L.label.label:L.label}:L});me.set(f.nodeModel.properties.node_data,"user_input_field_list",I);const R=A.file_upload_enable,U=A.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(L=>{delete f.nodeModel.properties.node_data[L]}),me.set(f.nodeModel.properties,"status",g.data.id?200:500)}}).catch(g=>{console.log(g),me.set(f.nodeModel.properties,"status",500)})},f=e,_=()=>{var g;return(g=r.value)==null?void 0:g.validate().catch(b=>Promise.reject({node:f.nodeModel,errMessage:b}))};return Ir(()=>{v(),me.set(f.nodeModel,"validate",_)}),(g,b)=>{const x=J("el-form-item"),A=J("AppIcon"),S=J("el-tooltip"),E=J("el-switch"),T=J("el-form"),I=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",jU,de(g.$t("views.applicationWorkflow.nodeSetting")),1),k(I,{shadow:"never",class:"card-never"},{default:P(()=>[k(T,{onSubmit:b[7]||(b[7]=Xt(()=>{},["prevent"])),model:s.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:P(()=>[k(x,{label:g.$t("views.applicationWorkflow.nodes.startNode.question"),prop:"question_reference_address",rules:{message:g.$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:g.$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?(_e(),at(x,{key:0,label:g.$t("views.problem.relateParagraph.selectDocument"),prop:"document_list",rules:{message:g.$t("views.chatLog.documentPlaceholder"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$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?(_e(),at(x,{key:1,label:g.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),prop:"image_list",rules:{message:g.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$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?(_e(),at(x,{key:2,label:g.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:g.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$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?(_e(),at(x,{key:3,label:g.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.label"),prop:"video_list",rules:{message:g.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),trigger:"blur",required:!1}},{default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$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),(_e(!0),Ht(ar,null,Gr(s.value.api_input_field_list,(R,U)=>(_e(),Ht("div",{key:"api-input-"+U},[k(x,{label:R.variable,prop:"api_input_field_list."+U+".value",rules:[{required:R.is_required,message:`${g.$t("common.inputPlaceholder")}${R.variable}`,trigger:"blur"}]},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.api_input_field_list[U].value,"onUpdate:modelValue":L=>s.value.api_input_field_list[U].value=L},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(_e(!0),Ht(ar,null,Gr(s.value.user_input_field_list,(R,U)=>(_e(),Ht("div",{key:"user-input-"+U},[k(x,{label:R.label,prop:"user_input_field_list."+U+".value",rules:[{required:R.required,message:`${g.$t("common.inputPlaceholder")}${R.label}`,trigger:"blur"}]},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.user_input_field_list[U].value,"onUpdate:modelValue":L=>s.value.user_input_field_list[U].value=L},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),k(x,{label:g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:b[6]||(b[6]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",DU,[K("div",IU,[K("span",null,de(g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(S,{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(A,{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 $U extends ho{constructor(t){super(t,LU)}}const FU={type:"application-node",model:vo,view:$U},yN=Object.freeze(Object.defineProperty({__proto__:null,default:FU},Symbol.toStringTag,{value:"Module"}));/**!
* Sortable 1.15.6
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function JS(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?JS(Object(n),!0).forEach(function(a){BU(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JS(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function _g(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_g=function(t){return typeof t}:_g=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_g(e)}function BU(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 VU(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 UU(e,t){if(e==null)return{};var n=VU(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 WU="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),ey=Md(/Edge/i),QS=Md(/firefox/i),Pm=Md(/safari/i)&&!Md(/chrome/i)&&!Md(/android/i),$E=Md(/iP(ad|od|hone)/i),gN=Md(/chrome/i)&&Md(/android/i),_N={capture:!1,passive:!1};function ro(e,t,n){e.addEventListener(t,n,!Rd&&_N)}function Qr(e,t,n){e.removeEventListener(t,n,!Rd&&_N)}function Hg(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 bN(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function bu(e,t,n,a){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Hg(e,t):Hg(e,t))||a&&e===n)return e;if(e===n)break}while(e=bN(e))}return null}var eA=/\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(eA," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(eA," ")}}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 wN(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 lc(){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!==lc()?(s=e.getBoundingClientRect(),c=s.top,v=s.left,f=s.bottom,_=s.right,g=s.height,b=s.width):(c=0,v=0,f=window.innerHeight,_=window.innerWidth,g=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,_=v+s.width;break}while(r=r.parentNode);if(a&&e!==window){var A=bv(r||e),S=A&&A.a,E=A&&A.d;A&&(c/=E,v/=S,b/=S,g/=E,f=c+g,_=v+b)}return{top:c,left:v,bottom:f,right:_,width:b,height:g}}}function tA(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===lc())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)&&bu(c[s],n.draggable,e,!1)){if(r===t)return c[s];r++}s++}return null}function FE(e,t){for(var n=e.lastElementChild;n&&(n===_r.ghost||xr(n,"display")==="none"||t&&!Hg(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||Hg(e,t))&&n++;return n}function nA(e){var t=0,n=0,a=lc();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 GU(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 lc();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 lc();if(a||t)return n;a=!0}}while(n=n.parentNode);return lc()}function zU(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function E1(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 Cm;function EN(e,t){return function(){if(!Cm){var n=arguments,a=this;n.length===1?e.call(a,n[0]):e.apply(a,n),Cm=setTimeout(function(){Cm=void 0},t)}}}function HU(){clearTimeout(Cm),Cm=void 0}function ON(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function xN(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 SN(e,t,n){var a={};return Array.from(e.children).forEach(function(r){var s,c,v,f;if(!(!bu(r,t.draggable,e,!1)||r.animated||r===n)){var _=Yi(r);a.left=Math.min((s=a.left)!==null&&s!==void 0?s:1/0,_.left),a.top=Math.min((c=a.top)!==null&&c!==void 0?c:1/0,_.top),a.right=Math.max((v=a.right)!==null&&v!==void 0?v:-1/0,_.right),a.bottom=Math.max((f=a.bottom)!==null&&f!==void 0?f:-1/0,_.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 XU(){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(GU(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,_=v.target,g=_.fromRect,b=Yi(_),x=_.prevFromRect,A=_.prevToRect,S=v.rect,E=bv(_,!0);E&&(b.top-=E.f,b.left-=E.e),_.toRect=b,_.thisAnimationDuration&&E1(x,b)&&!E1(g,b)&&(S.top-b.top)/(S.left-b.left)===(g.top-b.top)/(g.left-b.left)&&(f=YU(S,x,A,r.options)),E1(b,g)||(_.prevFromRect=g,_.prevToRect=b,f||(f=r.options.animation),r.animate(_,S,b,f)),f&&(s=!0,c=Math.max(c,f),clearTimeout(_.animationResetTimer),_.animationResetTimer=setTimeout(function(){_.animationTime=0,_.prevFromRect=null,_.fromRect=null,_.prevToRect=null,_.thisAnimationDuration=null},f),_.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,_=v&&v.d,g=(r.left-s.left)/(f||1),b=(r.top-s.top)/(_||1);a.animatingX=!!g,a.animatingY=!!b,xr(a,"transform","translate3d("+g+"px,"+b+"px,0)"),this.forRepaintDummy=qU(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 qU(e){return e.offsetWidth}function YU(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=[],O1={initializeByDefault:!0},ty={mount:function(t){for(var n in O1)O1.hasOwnProperty(n)&&!(n in t)&&(t[n]=O1[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 _=new v(t,n,t.options);_.sortable=t,_.options=t.options,t[f]=_,Td(a,_.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 KU(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,_=e.newIndex,g=e.oldDraggableIndex,b=e.newDraggableIndex,x=e.originalEvent,A=e.putSortable,S=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&&!ey?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=_,E.oldDraggableIndex=g,E.newDraggableIndex=b,E.originalEvent=x,E.pullMode=A?A.lastPutMode:void 0;var R=cc(cc({},S),ty.getEventProperties(a,t));for(var U in R)E[U]=R[U];n&&n.dispatchEvent(E),T[I]&&T[I].call(t,E)}}var ZU=["evt"],Pl=function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=a.evt,s=UU(a,ZU);ty.pluginEvent.bind(_r)(t,n,cc({dragEl:On,parentEl:Ni,ghostEl:Pr,rootEl:vi,nextEl:Yp,lastDownEl:bg,cloneEl:wi,cloneHidden:Ff,dragStarted:wm,putSortable:ka,activeSortable:_r.active,originalEvent:r,oldIndex:mv,oldDraggableIndex:Rm,newIndex:os,newDraggableIndex:$f,hideGhostForTarget:TN,unhideGhostForTarget:NN,cloneNowHidden:function(){Ff=!0},cloneNowShown:function(){Ff=!1},dispatchSortableEvent:function(v){ul({sortable:n,name:v,originalEvent:r})}},s))};function ul(e){KU(cc({putSortable:ka,cloneEl:wi,targetEl:On,rootEl:vi,oldIndex:mv,oldDraggableIndex:Rm,newIndex:os,newDraggableIndex:$f},e))}var On,Ni,Pr,vi,Yp,bg,wi,Ff,mv,os,Rm,$f,lg,ka,uv=!1,Xg=!1,qg=[],Hp,_u,x1,S1,rA,oA,wm,iv,jm,Dm=!1,sg=!1,wg,Ua,A1=[],Tw=!1,Yg=[],A_=typeof document<"u",ug=$E,iA=ey||Rd?"cssFloat":"float",JU=A_&&!gN&&!$E&&"draggable"in document.createElement("div"),AN=(function(){if(A_){if(Rd)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),MN=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),_=v&&parseInt(v.marginLeft)+parseInt(v.marginRight)+Yi(s).width,g=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"||_>=r&&a[iA]==="none"||c&&a[iA]==="none"&&_+g>r)?"vertical":"horizontal"},QU=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,_=a?n.width:n.height;return r===v||s===f||r+c/2===v+_/2},eW=function(t,n){var a;return qg.some(function(r){var s=r[Rl].options.emptyInsertThreshold;if(!(!s||FE(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},kN=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||_g(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},TN=function(){!AN&&Pr&&xr(Pr,"display","none")},NN=function(){!AN&&Pr&&xr(Pr,"display","")};A_&&!gN&&document.addEventListener("click",function(e){if(Xg)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Xg=!1,!1},!0);var Xp=function(t){if(On){t=t.touches?t.touches[0]:t;var n=eW(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)}}},tW=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 MN(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&&(!Pm||$E),emptyInsertThreshold:5};ty.initializePlugins(this,e,n);for(var a in n)!(a in t)&&(t[a]=n[a]);kN(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:JU,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)),qg.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Td(this,XU())}_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,_=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||f,g=r.filter;if(uW(a),!On&&!(/mousedown|pointerdown/.test(c)&&t.button!==0||r.disabled)&&!_.isContentEditable&&!(!this.nativeDraggable&&Pm&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=bu(f,r.draggable,a,!1),!(f&&f.animated)&&bg!==f)){if(mv=Cs(f),Rm=Cs(f,r.draggable),typeof g=="function"){if(g.call(this,t,f,this)){ul({sortable:n,rootEl:_,name:"filter",targetEl:f,toEl:a,fromEl:a}),Pl("filter",n,{evt:t}),s&&t.preventDefault();return}}else if(g&&(g=g.split(",").some(function(b){if(b=bu(_,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}),g)){s&&t.preventDefault();return}r.handle&&!bu(_,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 _=Yi(a);if(vi=s,On=a,Ni=On.parentNode,Yp=On.nextSibling,bg=a,lg=c.group,_r.dragged=On,Hp={target:On,clientX:(n||t).clientX,clientY:(n||t).clientY},rA=Hp.clientX-_.left,oA=Hp.clientY-_.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(),!QS&&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(g){wN(On,g.trim(),M1)}),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)),QS&&this.nativeDraggable&&(this.options.touchStartThreshold=4,On.draggable=!0),Pl("delayStart",this,{evt:t}),c.delay&&(!c.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ey||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&&M1(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?Eg(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",tW);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(_u){this._lastX=_u.clientX,this._lastY=_u.clientY,TN();for(var t=document.elementFromPoint(_u.clientX,_u.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(_u.clientX,_u.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:_u.clientX,clientY:_u.clientY,target:t,rootEl:n}),a&&!this.options.dragoverBubble)break}t=n}while(n=bN(n));NN()}},_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,_=ug&&Ua&&nA(Ua),g=(s.clientX-Hp.clientX+r.x)/(v||1)+(_?_[0]-A1[0]:0)/(v||1),b=(s.clientY-Hp.clientY+r.y)/(f||1)+(_?_[1]-A1[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+=g-(x1||0),c.f+=b-(S1||0)):c={a:1,b:0,c:0,d:1,e:g,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),x1=g,S1=b,_u=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Pr){var t=this.options.fallbackOnBody?document.body:vi,n=Yi(On,!0,ug,!0,t),a=this.options;if(ug){for(Ua=t;xr(Ua,"position")==="static"&&xr(Ua,"transform")==="none"&&Ua!==document;)Ua=Ua.parentNode;Ua!==document.body&&Ua!==document.documentElement?(Ua===document&&(Ua=lc()),n.top+=Ua.scrollTop,n.left+=Ua.scrollLeft):Ua=lc(),A1=nA(Ua)}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",ug?"absolute":"fixed"),xr(Pr,"zIndex","100000"),xr(Pr,"pointerEvents","none"),_r.ghost=Pr,t.appendChild(Pr),xr(Pr,"transform-origin",rA/parseInt(Pr.style.width)*100+"% "+oA/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=xN(On),wi.removeAttribute("id"),wi.draggable=!1,wi.style["will-change"]="",this._hideClone(),rs(wi,this.options.chosenClass,!1),_r.clone=wi),a.cloneId=Eg(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?(Xg=!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=Eg(a._dragStarted.bind(a,n,t)),ro(document,"selectstart",a),wm=!0,window.getSelection().removeAllRanges(),Pm&&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,_=_r.active,g=lg===f,b=v.sort,x=ka||_,A,S=this,E=!1;if(Tw)return;function T(Ne,Ae){Pl(Ne,S,cc({evt:t,isOwner:g,axis:A?"vertical":"horizontal",revert:c,dragRect:r,targetRect:s,canSort:b,fromSortable:x,target:a,completed:R,onMove:function(rt,tt){return cg(vi,n,On,r,rt,Yi(rt),t,tt)},changed:U},Ae))}function I(){T("dragOverAnimationCapture"),S.captureAnimationState(),S!==x&&x.captureAnimationState()}function R(Ne){return T("dragOverCompleted",{insertion:Ne}),Ne&&(g?_._hideClone():_._showClone(S),S!==x&&(rs(On,ka?ka.options.ghostClass:_.options.ghostClass,!1),rs(On,v.ghostClass,!0)),ka!==S&&S!==_r.active?ka=S:S===_r.active&&ka&&(ka=null),x===S&&(S._ignoreWhileAnimating=a),S.animateAll(function(){T("dragOverAnimationComplete"),S._ignoreWhileAnimating=null}),S!==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),!Ne&&Xp(t)),!v.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),E=!0}function U(){os=Cs(On),$f=Cs(On,v.draggable),ul({sortable:S,name:"change",toEl:n,newIndex:os,newDraggableIndex:$f,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),a=bu(a,v.draggable,n,!0),T("dragOver"),_r.eventCanceled)return E;if(On.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||S._ignoreWhileAnimating===a)return R(!1);if(Xg=!1,_&&!v.disabled&&(g?b||(c=Ni!==vi):ka===this||(this.lastPutMode=lg.checkPull(this,_,On,t))&&f.checkPut(this,_,On,t))){if(A=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 L=FE(n,v.draggable);if(!L||iW(t,A,this)&&!L.animated){if(L===On)return R(!1);if(L&&n===t.target&&(a=L),a&&(s=Yi(a)),cg(vi,n,On,r,a,s,t,!!a)!==!1)return I(),L&&L.nextSibling?n.insertBefore(On,L.nextSibling):n.appendChild(On),Ni=n,U(),R(!0)}else if(L&&oW(t,A,this)){var D=Nv(n,0,v,!0);if(D===On)return R(!1);if(a=D,s=Yi(a),cg(vi,n,On,r,a,s,t,!1)!==!1)return I(),n.insertBefore(On,D),Ni=n,U(),R(!0)}else if(a.parentNode===n){s=Yi(a);var W=0,Y,B=On.parentNode!==n,V=!QU(On.animated&&On.toRect||r,a.animated&&a.toRect||s,A),z=A?"top":"left",H=tA(a,"top","top")||tA(On,"top","top"),q=H?H.scrollTop:void 0;iv!==a&&(Y=s[z],Dm=!1,sg=!V&&v.invertSwap||B),W=aW(t,a,s,A,V?1:v.swapThreshold,v.invertedSwapThreshold==null?v.swapThreshold:v.invertedSwapThreshold,sg,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,jm=W;var ie=a.nextElementSibling,be=!1;be=W===1;var De=cg(vi,n,On,r,a,s,t,be);if(De!==!1)return(De===1||De===-1)&&(be=De===1),Tw=!0,setTimeout(rW,30),I(),be&&!ie?n.appendChild(On):a.parentNode.insertBefore(On,be?ie:a),H&&ON(H,0,q-H.scrollTop),Ni=On.parentNode,Y!==void 0&&!sg&&(wg=Math.abs(Y-Yi(a)[z])),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,sg=!1,Dm=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Nw(this.cloneId),Nw(this._dragStartId),this.nativeDraggable&&(Qr(document,"drop",this),Qr(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pm&&xr(document.body,"user-select",""),xr(On,"transform",""),t&&(wm&&(t.cancelable&&t.preventDefault(),!a.dropBubble&&t.stopPropagation()),Pr&&Pr.parentNode&&Pr.parentNode.removeChild(Pr),(vi===Ni||ka&&ka.lastPutMode!=="clone")&&wi&&wi.parentNode&&wi.parentNode.removeChild(wi),On&&(this.nativeDraggable&&Qr(On,"dragend",this),M1(On),On.style["will-change"]="",wm&&!uv&&rs(On,ka?ka.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})),ka&&ka.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=Rm),ul({sortable:this,name:"end",toEl:Ni,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Pl("nulling",this),vi=On=Ni=Pr=Yp=wi=bg=Ff=Hp=_u=wm=os=$f=mv=Rm=iv=jm=ka=lg=_r.dragged=_r.ghost=_r.clone=_r.active=null,Yg.forEach(function(t){t.checked=!0}),Yg.length=x1=S1=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":On&&(this._onDragOver(t),nW(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],bu(n,c.draggable,this.el,!1)&&t.push(n.getAttribute(c.dataIdAttr)||sW(n));return t},sort:function(t,n){var a={},r=this.el;this.toArray().forEach(function(s,c){var v=r.children[c];bu(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 bu(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=ty.modifyOption(this,t,n);typeof r<"u"?a[t]=r:a[t]=n,t==="group"&&kN(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(),qg.splice(qg.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 nW(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function cg(e,t,n,a,r,s,c,v){var f,_=e[Rl],g=_.options.onMove,b;return window.CustomEvent&&!Rd&&!ey?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),g&&(b=g.call(_,f,c)),b}function M1(e){e.draggable=!1}function rW(){Tw=!1}function oW(e,t,n){var a=Yi(Nv(n.el,0,n.options,!0)),r=SN(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 iW(e,t,n){var a=Yi(FE(n.el,n.options.draggable)),r=SN(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 aW(e,t,n,a,r,s,c,v){var f=a?e.clientY:e.clientX,_=a?n.height:n.width,g=a?n.top:n.left,b=a?n.bottom:n.right,x=!1;if(!c){if(v&&wg<_*r){if(!Dm&&(jm===1?f>g+_*s/2:f<b-_*s/2)&&(Dm=!0),Dm)x=!0;else if(jm===1?f<g+wg:f>b-wg)return-jm}else if(f>g+_*(1-r)/2&&f<b-_*(1-r)/2)return lW(t)}return x=x||c,x&&(f<g+_*s/2||f>b-_*s/2)?f>g+_/2?1:-1:0}function lW(e){return Cs(On)<Cs(e)?1:-1}function sW(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 uW(e){Yg.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&Yg.push(a)}}function Eg(e){return setTimeout(e,0)}function Nw(e){return clearTimeout(e)}A_&&ro(document,"touchmove",function(e){(_r.active||uv)&&e.cancelable&&e.preventDefault()});_r.utils={on:ro,off:Qr,css:xr,find:wN,is:function(t,n){return!!bu(t,n,t,!1)},extend:zU,throttle:EN,closest:bu,toggleClass:rs,clone:xN,index:Cs,nextTick:Eg,cancelNextTick:Nw,detectDirection:MN,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)),ty.mount(a)})};_r.create=function(e,t){return new _r(e,t)};_r.version=WU;var qi=[],Em,Pw,Cw=!1,k1,T1,Kg,Om;function cW(){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)),aA(),Og(),HU()},nulling:function(){Kg=Pw=Em=Cw=Om=k1=T1=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(Kg=n,a||this.options.forceAutoScrollFallback||ey||Rd||Pm){N1(n,this.options,v,a);var f=Vf(v,!0);Cw&&(!Om||s!==k1||c!==T1)&&(Om&&aA(),Om=setInterval(function(){var _=Vf(document.elementFromPoint(s,c),!0);_!==f&&(f=_,Og()),N1(n,r.options,_,a)},10),k1=s,T1=c)}else{if(!this.options.bubbleScroll||Vf(v,!0)===lc()){Og();return}N1(n,this.options,Vf(v,!1),!1)}}},Td(e,{pluginName:"scroll",initializeByDefault:!0})}function Og(){qi.forEach(function(e){clearInterval(e.pid)}),qi=[]}function aA(){clearInterval(Om)}var N1=EN(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=lc(),_=!1,g;Pw!==n&&(Pw=n,Og(),Em=t.scroll,g=t.scrollFn,Em===!0&&(Em=Vf(n,!0)));var b=0,x=Em;do{var A=x,S=Yi(A),E=S.top,T=S.bottom,I=S.left,R=S.right,U=S.width,L=S.height,D=void 0,W=void 0,Y=A.scrollWidth,B=A.scrollHeight,V=xr(A),z=A.scrollLeft,H=A.scrollTop;A===f?(D=U<Y&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),W=L<B&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(D=U<Y&&(V.overflowX==="auto"||V.overflowX==="scroll"),W=L<B&&(V.overflowY==="auto"||V.overflowY==="scroll"));var q=D&&(Math.abs(R-r)<=c&&z+U<Y)-(Math.abs(I-r)<=c&&!!z),ee=W&&(Math.abs(T-s)<=c&&H+L<B)-(Math.abs(E-s)<=c&&!!H);if(!qi[b])for(var ue=0;ue<=b;ue++)qi[ue]||(qi[ue]={});(qi[b].vx!=q||qi[b].vy!=ee||qi[b].el!==A)&&(qi[b].el=A,qi[b].vx=q,qi[b].vy=ee,clearInterval(qi[b].pid),(q!=0||ee!=0)&&(_=!0,qi[b].pid=setInterval((function(){a&&this.layer===0&&_r.active._onTouchMove(Kg);var ie=qi[this.layer].vy?qi[this.layer].vy*v:0,be=qi[this.layer].vx?qi[this.layer].vx*v:0;typeof g=="function"&&g.call(_r.dragged.parentNode[Rl],be,ie,e,Kg,qi[this.layer].el)!=="continue"||ON(qi[this.layer].el,be,ie)}).bind({layer:b}),24))),b++}while(t.bubbleScroll&&x!==f&&(x=Vf(x,!1)));Cw=_}},30),PN=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 _=a||s;v();var g=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,b=document.elementFromPoint(g.clientX,g.clientY);f(),_&&!_.el.contains(b)&&(c("spill"),this.onSpill({dragEl:r,putSortable:a}))}};function BE(){}BE.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:PN};Td(BE,{pluginName:"revertOnSpill"});function VE(){}VE.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:PN};Td(VE,{pluginName:"removeOnSpill"});_r.mount(new cW);_r.mount(VE,BE);const dW={class:"dialog-footer"},fW=Vn({__name:"ApiFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je({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"}]}),_=je(!1);Zm(_,A=>{A||(v.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},c.value=!1)});const g=A=>{A&&(v.value=me.cloneDeep(A),c.value=!0),_.value=!0},b=()=>{_.value=!1,c.value=!1},x=async A=>{A&&await A.validate(S=>{S&&a("refresh",v.value)})};return t({open:g,close:b}),(A,S)=>{const E=J("el-input"),T=J("el-form-item"),I=J("el-switch"),R=J("el-form"),U=J("el-button"),L=J("el-dialog");return _e(),at(L,{title:c.value?A.$t("common.param.editParam"):A.$t("common.param.addParam"),modelValue:_.value,"onUpdate:modelValue":S[10]||(S[10]=D=>_.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:P(()=>[K("span",dW,[k(U,{onClick:S[8]||(S[8]=Xt(D=>_.value=!1,["prevent"]))},{default:P(()=>[et(de(A.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:S[9]||(S[9]=D=>x(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:f,model:v.value,"require-asterisk-position":"right"},{default:P(()=>[k(T,{label:A.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:P(()=>[k(E,{modelValue:v.value.variable,"onUpdate:modelValue":S[0]||(S[0]=D=>v.value.variable=D),placeholder:A.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:S[1]||(S[1]=D=>v.value.variable=v.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(T,{label:A.$t("common.desc")},{default:P(()=>[k(E,{modelValue:v.value.desc,"onUpdate:modelValue":S[2]||(S[2]=D=>v.value.desc=D),placeholder:A.$t("common.descPlaceholder"),onBlur:S[3]||(S[3]=D=>v.value.name=v.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(T,{label:A.$t("dynamicsForm.paramForm.required.label"),onClick:S[5]||(S[5]=Xt(()=>{},["prevent"]))},{default:P(()=>[k(I,{size:"small",modelValue:v.value.is_required,"onUpdate:modelValue":S[4]||(S[4]=D=>v.value.is_required=D)},null,8,["modelValue"])]),_:1},8,["label"]),k(T,{label:A.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:v.value.is_required,message:A.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:v.value.default_value,"onUpdate:modelValue":S[6]||(S[6]=D=>v.value.default_value=D),placeholder:A.$t("dynamicsForm.default.placeholder"),onBlur:S[7]||(S[7]=D=>v.value.name=v.value.name.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),pW={class:"flex-between mb-16"},hW={class:"lighter"},vW=["title"],mW=["title"],yW=["title"],gW={class:"mr-4"},_W=Vn({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(null),r=je(),s=je([]);function c(g,b){typeof b<"u"&&(a.value=b),r.value.open(g)}function v(g){s.value.splice(g,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),_()}function f(g){for(let x=0;x<s.value.length;x++)if(s.value[x].variable===g.variable&&a.value!==x){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+g.variable);return}const b=t.nodeModel.properties.user_input_field_list;for(let x=0;x<b.length;x++)if(b[x].field===g.variable){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+g.variable);return}a.value!==null?s.value.splice(a.value,1,g):s.value.push(g),a.value=null,r.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),_()}function _(){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 A=me.cloneDeep([...s.value]),[S]=A.splice(x.oldIndex,1);A.splice(x.newIndex,0,S),s.value=A,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(g=>g.assignment_method==="api_input").forEach(g=>{s.value.push(g)}),me.set(t.nodeModel.properties,"api_input_field_list",s),_()}),(g,b)=>{var R;const x=J("AppIcon"),A=J("el-button"),S=J("el-table-column"),E=J("el-switch"),T=J("el-tooltip"),I=J("el-table");return _e(),Ht(ar,null,[K("div",pW,[K("h5",hW,de(g.$t("views.model.modelForm.title.apiParamPassing")),1),k(A,{link:"",type:"primary",onClick:b[0]||(b[0]=U=>c())},{default:P(()=>[k(x,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(g.$t("common.add")),1)]),_:1})]),((R=t.nodeModel.properties.api_input_field_list)==null?void 0:R.length)>0?(_e(),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(S,{prop:"variable",label:g.$t("dynamicsForm.paramForm.field.label")},{default:P(({row:U})=>[K("span",{class:"ellipsis-1",title:U.variable},de(U.variable),9,vW)]),_:1},8,["label"]),k(S,{prop:"desc",label:g.$t("common.desc")},{default:P(({row:U})=>[K("span",{class:"ellipsis-1",title:U.desc},de(U.desc),9,mW)]),_:1},8,["label"]),k(S,{prop:"default_value",label:g.$t("dynamicsForm.default.label")},{default:P(({row:U})=>[K("span",{class:"ellipsis-1",title:U.default_value},de(U.default_value),9,yW)]),_:1},8,["label"]),k(S,{label:g.$t("common.required")},{default:P(({row:U})=>[K("div",{onClick:b[1]||(b[1]=Xt(()=>{},["stop"]))},[k(E,{disabled:"",size:"small",modelValue:U.is_required,"onUpdate:modelValue":L=>U.is_required=L},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(S,{label:g.$t("common.operation"),align:"left",width:"90"},{default:P(({row:U,$index:L})=>[K("span",gW,[k(T,{effect:"dark",content:g.$t("common.modify"),placement:"top"},{default:P(()=>[k(A,{type:"primary",text:"",onClick:Xt(D=>c(U,L),["stop"])},{default:P(()=>[k(x,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(T,{effect:"dark",content:g.$t("common.delete"),placement:"top"},{default:P(()=>[k(A,{type:"primary",text:"",onClick:D=>v(L)},{default:P(()=>[k(x,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(fW,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:f},null,512)],64)}}}),bW={class:"dialog-footer"},wW=Vn({__name:"UserFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je(),f=(T,I)=>T.every(R=>BD.get(I,R,void 0)!==void 0),_=$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}}),g=je(null),b=je([{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=je(!1),A=(T,I)=>{x.value=!0,T?(c.value=!0,v.value=me.cloneDeep(T),g.value=I):v.value=null},S=()=>{x.value=!1,c.value=!1,g.value=null,v.value=null},E=async()=>{const T=r.value;T&&await T.validate().then(()=>{a("refresh",T==null?void 0:T.getData(),g.value),c.value=!1,v.value=null,g.value=null})};return t({open:A,close:S}),(T,I)=>{const R=J("el-button"),U=J("el-dialog");return _e(),at(U,{title:c.value?T.$t("common.param.editParam"):T.$t("common.param.addParam"),modelValue:x.value,"onUpdate:modelValue":I[2]||(I[2]=L=>x.value=L),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":S,"append-to-body":""},{footer:P(()=>[K("span",bW,[k(R,{onClick:Xt(S,["prevent"])},{default:P(()=>[et(de(T.$t("common.cancel")),1)]),_:1}),k(R,{type:"primary",onClick:I[1]||(I[1]=L=>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:_.value,"onUpdate:modelValue":I[0]||(I[0]=L=>_.value=L),"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"])}}}),EW={class:"dialog-footer"},OW=Vn({__name:"UserInputTitleDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je({title:yt("chat.userInput")}),v=Zf({title:[{required:!0,message:yt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),f=je(!1),_=x=>{x&&(c.value=me.cloneDeep(x)),f.value=!0},g=()=>{f.value=!1},b=async x=>{x&&await x.validate(A=>{A&&a("refresh",c.value)})};return t({open:_,close:g}),(x,A)=>{const S=J("el-input"),E=J("el-form-item"),T=J("el-form"),I=J("el-button"),R=J("el-dialog");return _e(),at(R,{title:x.$t("common.setting"),modelValue:f.value,"onUpdate:modelValue":A[5]||(A[5]=U=>f.value=U),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":g,"append-to-body":""},{footer:P(()=>[K("span",EW,[k(I,{onClick:A[3]||(A[3]=Xt(U=>f.value=!1,["prevent"]))},{default:P(()=>[et(de(x.$t("common.cancel")),1)]),_:1}),k(I,{type:"primary",onClick:A[4]||(A[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:A[2]||(A[2]=Xt(()=>{},["prevent"]))},{default:P(()=>[k(E,{label:x.$t("common.title"),prop:"title"},{default:P(()=>[k(S,{modelValue:c.value.title,"onUpdate:modelValue":A[0]||(A[0]=U=>c.value.title=U),maxlength:"64","show-word-limit":"",onBlur:A[1]||(A[1]=U=>c.value.title=c.value.title.trim())},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),xW={class:"flex-between mb-16"},SW=["title"],AW={class:"ml-4"},MW=["title"],kW={key:0},TW=["title"],NW={key:1},PW=["title"],CW=["title"],RW={class:"mr-4"},jW=Vn({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je(),s=je([]),c=je({title:yt("chat.userInput")});function v(S,E){a.value.open(S,E)}function f(){r.value.open(c.value)}function _(S){s.value.splice(S,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),A()}function g(S,E){for(let I=0;I<s.value.length;I++)if(s.value[I].field===S.field&&E!==I){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+S.field);return}const T=t.nodeModel.properties.api_input_field_list;for(let I=0;I<T.length;I++)if(T[I].variable===S.field){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+S.field);return}E!==null?s.value.splice(E,1,S):s.value.push(S),a.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),A()}function b(S){c.value=S,r.value.close()}const x=S=>{var E;if(S.input_type==="PasswordInput")return"******";if(S.default_value){const T=(E=S.option_list)==null?void 0:E.filter(I=>S.default_value.indexOf(I.value)>-1).map(I=>I.label).join(",");return T||S.default_value}if(S.default_value!==void 0)return S.default_value};function A(){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=me.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(S=>S.assignment_method==="user_input").forEach(S=>{s.value.push(S)}),s.value.forEach((S,E)=>{switch(S.label=S.label||S.name,S.field=S.field||S.variable,S.required=S.required||S.is_required,S.type){case"input":S.input_type="TextInput";break;case"select":S.input_type="SingleSelect";break;case"date":S.input_type="DatePicker";break}}),me.set(t.nodeModel.properties,"user_input_field_list",s),t.nodeModel.properties.user_input_config&&(c.value=t.nodeModel.properties.user_input_config),me.set(t.nodeModel.properties,"user_input_config",c),A()}),(S,E)=>{var Y;const T=J("AppIcon"),I=J("el-button"),R=J("el-table-column"),U=J("el-tag"),L=J("el-switch"),D=J("el-tooltip"),W=J("el-table");return _e(),Ht(ar,null,[K("div",xW,[K("h5",{class:"break-all ellipsis lighter",style:{"max-width":"80%"},title:c.value.title},de(c.value.title),9,SW),K("div",null,[k(I,{type:"primary",link:"",onClick:f},{default:P(()=>[k(T,{iconName:"app-setting"})]),_:1}),K("span",AW,[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(S.$t("common.add")),1)]),_:1})])])]),((Y=t.nodeModel.properties.user_input_field_list)==null?void 0:Y.length)>0?(_e(),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:S.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:B})=>[K("span",{title:B.field,class:"ellipsis-1"},de(B.field),9,MW)]),_:1},8,["label"]),k(R,{prop:"label",label:S.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:B})=>[B.label&&B.label.input_type==="TooltipLabel"?(_e(),Ht("span",kW,[K("span",{title:B.label.label,class:"ellipsis-1"},de(B.label.label),9,TW)])):(_e(),Ht("span",NW,[K("span",{title:B.label,class:"ellipsis-1"},de(B.label),9,PW)]))]),_:1},8,["label"]),k(R,{label:S.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:P(({row:B})=>[B.input_type==="TextInput"?(_e(),at(U,{key:0,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):pn("",!0),B.input_type==="PasswordInput"?(_e(),at(U,{key:1,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):pn("",!0),B.input_type==="Slider"?(_e(),at(U,{key:2,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):pn("",!0),B.input_type==="SwitchInput"?(_e(),at(U,{key:3,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):pn("",!0),B.input_type==="SingleSelect"?(_e(),at(U,{key:4,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):pn("",!0),B.input_type==="MultiSelect"?(_e(),at(U,{key:5,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):pn("",!0),B.input_type==="RadioCard"?(_e(),at(U,{key:6,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):pn("",!0),B.input_type==="DatePicker"?(_e(),at(U,{key:7,type:"info",class:"info-tag"},{default:P(()=>[et(de(S.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):pn("",!0)]),_:1},8,["label"]),k(R,{prop:"default_value",label:S.$t("dynamicsForm.default.label")},{default:P(({row:B})=>[K("span",{title:B.default_value,class:"ellipsis-1"},de(x(B)),9,CW)]),_:1},8,["label"]),k(R,{label:S.$t("common.required")},{default:P(({row:B})=>[K("div",{onClick:E[1]||(E[1]=Xt(()=>{},["stop"]))},[k(L,{disabled:"",size:"small",modelValue:B.required,"onUpdate:modelValue":V=>B.required=V},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(R,{label:S.$t("common.operation"),align:"left",width:"90"},{default:P(({row:B,$index:V})=>[K("span",RW,[k(D,{effect:"dark",content:S.$t("common.modify"),placement:"top"},{default:P(()=>[k(I,{type:"primary",text:"",onClick:Xt(z=>v(B,V),["stop"])},{default:P(()=>[k(T,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(D,{effect:"dark",content:S.$t("common.delete"),placement:"top"},{default:P(()=>[k(I,{type:"primary",text:"",onClick:z=>_(V)},{default:P(()=>[k(T,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(wW,{ref_key:"UserFieldFormDialogRef",ref:a,onRefresh:g},null,512),k(OW,{ref_key:"UserInputTitleDialogRef",ref:r,onRefresh:b},null,512)],64)}}}),DW="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",IW="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",LW="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",$W="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",FW="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",BW={class:"p-8"},VW={class:"flex-between"},UW={class:"flex align-center"},WW={class:"line-height-22 mt-4"},GW={class:"flex-between"},zW={class:"flex align-center"},HW={class:"line-height-22 mt-4"},XW={class:"flex-between"},qW={class:"flex align-center"},YW={class:"line-height-22 mt-4"},KW={class:"flex-between"},ZW={class:"flex align-center"},JW={class:"line-height-22 mt-4"},QW={class:"flex-between"},eG={class:"flex align-center"},tG={class:"line-height-22 mt-4"},nG={class:"dialog-footer"},rG=Vn({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=e,s=je(!1),c=je(!1),v=je(""),f=je(!1),_=je(),g=je(),b=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],x=["JPG","JPEG","PNG","GIF"],A=["MP3","WAV","OGG","ACC","M4A"],S=["MP4","AVI","MKV","MOV","FLV","WMV"],E=je({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(Y=>Y!==W)},U=()=>{c.value=!0,Gf(()=>{g.value.input.focus()})},L=()=>{if(v.value){if(v.value=v.value.toUpperCase(),E.value.otherExtensions.includes(v.value)||b.includes(v.value)||x.includes(v.value)||A.includes(v.value)){c.value=!1,v.value="",UD(yt("common.fileUpload.existingExtensionsTip"));return}E.value.otherExtensions.push(v.value)}c.value=!1,v.value=""};async function D(){const W=_.value;W&&await W.validate().then(()=>{const Y=me.cloneDeep(E.value);a("refresh",Y),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),s.value=!1})}return t({open:T}),(W,Y)=>{const B=J("el-slider"),V=J("el-form-item"),z=J("el-text"),H=J("el-checkbox"),q=J("el-card"),ee=J("el-tag"),ue=J("el-input"),ie=J("el-button"),be=J("el-space"),De=J("el-form"),Ne=J("el-scrollbar"),Ae=J("el-dialog");return _e(),at(Ae,{title:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:s.value,"onUpdate:modelValue":Y[19]||(Y[19]=Te=>s.value=Te),"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(()=>[K("span",nG,[k(ie,{onClick:Xt(I,["prevent"])},{default:P(()=>[et(de(W.$t("common.cancel")),1)]),_:1}),k(ie,{type:"primary",onClick:Y[18]||(Y[18]=Te=>D()),loading:f.value},{default:P(()=>[et(de(W.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(Ne,{"max-height":"550"},{default:P(()=>[K("div",BW,[k(De,{"label-position":"top",ref_key:"fieldFormRef",ref:_,model:E.value,"require-asterisk-position":"right"},{default:P(()=>[k(V,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:P(()=>[k(B,{modelValue:E.value.maxFiles,"onUpdate:modelValue":Y[0]||(Y[0]=Te=>E.value.maxFiles=Te),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:P(()=>[k(B,{modelValue:E.value.fileLimit,"onUpdate:modelValue":Y[1]||(Y[1]=Te=>E.value.fileLimit=Te),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:P(()=>[k(q,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:Y[4]||(Y[4]=Xt(Te=>E.value.document=!E.value.document,["stop"]))},{default:P(()=>[K("div",VW,[K("div",UW,[Y[20]||(Y[20]=K("img",{class:"mr-12",src:DW,alt:""},null,-1)),K("div",null,[K("p",WW,[et(de(W.$t("common.fileUpload.document"))+" ",1),k(z,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),K("p",null,de(b.join("、")),1)])]),k(H,{modelValue:E.value.document,"onUpdate:modelValue":Y[2]||(Y[2]=Te=>E.value.document=Te),onChange:Y[3]||(Y[3]=Te=>E.value.document=!E.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),k(q,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:Y[7]||(Y[7]=Xt(Te=>E.value.image=!E.value.image,["stop"]))},{default:P(()=>[K("div",GW,[K("div",zW,[Y[21]||(Y[21]=K("img",{class:"mr-12",src:IW,alt:""},null,-1)),K("div",null,[K("p",HW,[et(de(W.$t("common.fileUpload.image"))+" ",1),k(z,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),K("p",null,de(x.join("、")),1)])]),k(H,{modelValue:E.value.image,"onUpdate:modelValue":Y[5]||(Y[5]=Te=>E.value.image=Te),onChange:Y[6]||(Y[6]=Te=>E.value.image=!E.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),k(q,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:Y[10]||(Y[10]=Xt(Te=>E.value.audio=!E.value.audio,["stop"]))},{default:P(()=>[K("div",XW,[K("div",qW,[Y[22]||(Y[22]=K("img",{class:"mr-12",src:LW,alt:""},null,-1)),K("div",null,[K("p",YW,[et(de(W.$t("common.fileUpload.audio"))+" ",1),k(z,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),K("p",null,de(A.join("、")),1)])]),k(H,{modelValue:E.value.audio,"onUpdate:modelValue":Y[8]||(Y[8]=Te=>E.value.audio=Te),onChange:Y[9]||(Y[9]=Te=>E.value.audio=!E.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),k(q,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:Y[13]||(Y[13]=Xt(Te=>E.value.video=!E.value.video,["stop"]))},{default:P(()=>[K("div",KW,[K("div",ZW,[Y[23]||(Y[23]=K("img",{class:"mr-12",width:"32",src:$W,alt:""},null,-1)),K("div",null,[K("p",JW,[et(de(W.$t("common.fileUpload.video"))+" ",1),k(z,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),K("p",null,de(S.join("、")),1)])]),k(H,{modelValue:E.value.video,"onUpdate:modelValue":Y[11]||(Y[11]=Te=>E.value.video=Te),onChange:Y[12]||(Y[12]=Te=>E.value.video=!E.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),k(q,{shadow:"hover",class:Cl(["card-checkbox cursor w-full mb-8",E.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:Y[17]||(Y[17]=Xt(Te=>E.value.other=!E.value.other,["stop"]))},{default:P(()=>[K("div",QW,[K("div",eG,[Y[24]||(Y[24]=K("img",{class:"mr-12",width:32,src:FW,alt:""},null,-1)),K("div",null,[K("p",tG,[et(de(W.$t("common.fileUpload.other"))+" ",1),k(z,{class:"color-secondary"},{default:P(()=>[et(de(W.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),k(be,{wrap:"",size:2,class:"mt-4"},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(E.value.otherExtensions,Te=>(_e(),at(ee,{key:Te,closable:"","disable-transitions":!1,onClose:rt=>R(Te),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(Te),1)]),_:2},1032,["onClose"]))),128)),c.value?(_e(),at(ue,{key:0,ref_key:"InputRef",ref:g,modelValue:v.value,"onUpdate:modelValue":Y[14]||(Y[14]=Te=>v.value=Te),size:"small",onKeyup:VD(L,["enter"]),onBlur:L},null,8,["modelValue"])):(_e(),at(ie,{key:1,class:"button-new-tag",size:"small",onClick:Xt(U,["stop"])},{default:P(()=>[et(" + "+de(W.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),k(H,{modelValue:E.value.other,"onUpdate:modelValue":Y[15]||(Y[15]=Te=>E.value.other=Te),onChange:Y[16]||(Y[16]=Te=>E.value.other=!E.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),oG={class:"dialog-footer"},iG=Vn({__name:"ChatFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je(null),f=je({field:"",label:""}),_=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"}]}),g=je(!1),b=(S,E)=>{S&&(f.value=me.cloneDeep(S),c.value=!0,v.value=E),g.value=!0},x=()=>{g.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},A=async S=>{S&&await S.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(S,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),L=J("el-dialog");return _e(),at(L,{title:c.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:g.value,"onUpdate:modelValue":E[3]||(E[3]=D=>g.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[K("span",oG,[k(U,{onClick:Xt(x,["prevent"])},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=D=>A(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:_,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:S.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:_.field},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=D=>f.value.field=D),maxlength:64,placeholder:S.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(I,{label:S.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:_.label},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=D=>f.value.label=D),maxlength:64,"show-word-limit":"",placeholder:S.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),aG={class:"flex-between mb-16"},lG={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},sG={class:"ml-4"},uG=["title"],cG=["title"],dG={class:"mr-4"},fG=Vn({__name:"ChatFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je([]);function s(f,_){a.value.open(f,_)}function c(f){r.value.splice(f,1),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function v(f,_){for(let g=0;g<r.value.length;g++)if(r.value[g].field===f.field&&_!==g){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(_)?r.value.push(f):r.value.splice(_,1,f),a.value.close(),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return Ir(()=>{t.nodeModel.properties.chat_input_field_list&&(r.value=me.cloneDeep(t.nodeModel.properties.chat_input_field_list)),me.set(t.nodeModel.properties,"chat_input_field_list",r)}),(f,_)=>{var E;const g=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),A=J("el-tooltip"),S=J("el-table");return _e(),Ht(ar,null,[K("div",aG,[K("h5",lG,de(f.$t("views.applicationWorkflow.variable.chat")),1),K("div",null,[K("span",sG,[k(b,{link:"",type:"primary",onClick:_[0]||(_[0]=T=>s())},{default:P(()=>[k(g,{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?(_e(),at(S,{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})=>[K("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,uG)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[K("span",null,[K("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,cG)])]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[K("span",dG,[k(A,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:Xt(R=>s(T,I),["stop"])},{default:P(()=>[k(g,{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:R=>c(I)},{default:P(()=>[k(g,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(iG,{ref_key:"ChatFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),pG={class:"flex-between"},hG={class:"flex align-center"},vG={class:"mr-4"},mG={class:"flex-between"},yG={class:"mr-4"},gG={class:"flex"},_G={class:"flex-between"},bG={class:"mr-4"},wG={class:"flex"},EG={class:"w-full"},OG={class:"flex-between w-full"},xG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(null),f=je(),_=je(),g=je(),b=je(),x={name:"",desc:"",prologue:yt("views.application.form.defaultPrologue")},A=ee=>ee.ctrlKey===!0?(ee.preventDefault(),!0):(ee.stopPropagation(),!0);function S(ee){me.set(s.nodeModel.properties.node_data,"prologue",ee)}const E=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:ee=>{me.set(s.nodeModel.properties,"node_data",ee)}}),T=je(),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(ie=>{c.value=me.groupBy(ie==null?void 0:ie.data,"provider")})}function L(){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(ie=>{v.value=me.groupBy(ie==null?void 0:ie.data,"provider")})}function D(){Gf(()=>{var ee;E.value.tts_model_id?(ee=f.value)==null||ee.reset_default(E.value.tts_model_id,a):V({})})}function W(){E.value.tts_model_enable||(E.value.tts_model_id="",E.value.tts_type="BROWSER")}function Y(){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)},V=ee=>{E.value.tts_model_params_setting=ee},z=()=>{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")},H=()=>{var ee;(ee=b.value)==null||ee.open(E.value.file_upload_setting)},q=ee=>{E.value.file_upload_setting=ee};return Ir(()=>{me.set(s.nodeModel,"validate",I),s.nodeModel.properties.node_data.tts_type||me.set(s.nodeModel.properties.node_data,"tts_type","BROWSER"),L(),U()}),(ee,ue)=>{const ie=J("el-input"),be=J("el-form-item"),De=J("MdEditorMagnify"),Ne=J("AppIcon"),Ae=J("el-tooltip"),Te=J("el-button"),rt=J("el-switch"),tt=J("el-checkbox"),Be=J("ModelSelect"),dt=J("el-radio"),St=J("el-radio-group"),He=J("Operation"),Qt=J("el-icon"),Fe=J("el-form");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(Fe,{onSubmit:ue[13]||(ue[13]=Xt(()=>{},["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(be,{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(ie,{modelValue:E.value.name,"onUpdate:modelValue":ue[0]||(ue[0]=we=>E.value.name=we),maxlength:"64",placeholder:_n(yt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:ue[1]||(ue[1]=we=>{var Re;return E.value.name=(Re=E.value.name)==null?void 0:Re.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(be,{label:ee.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:P(()=>[k(ie,{modelValue:E.value.desc,"onUpdate:modelValue":ue[2]||(ue[2]=we=>E.value.desc=we),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(be,{label:ee.$t("views.application.form.prologue")},{default:P(()=>[k(De,{onWheel:A,title:ee.$t("views.application.form.prologue"),modelValue:E.value.prologue,"onUpdate:modelValue":ue[3]||(ue[3]=we=>E.value.prologue=we),style:{height:"150px"},onSubmitDialog:S},null,8,["title","modelValue"])]),_:1},8,["label"]),k(be,null,{label:P(()=>[K("div",pG,[K("div",hG,[K("span",vG,de(ee.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),k(Ae,{effect:"dark",content:ee.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:P(()=>[k(Ne,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),K("div",null,[E.value.file_upload_enable?(_e(),at(Te,{key:0,type:"primary",link:"",onClick:H,class:"mr-4"},{default:P(()=>[k(Ne,{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]=we=>E.value.file_upload_enable=we),onChange:z},null,8,["modelValue"])])])]),_:1}),k(jW,{ref_key:"UserInputFieldTableFef",ref:_,"node-model":e.nodeModel},null,8,["node-model"]),k(_W,{ref_key:"ApiInputFieldTableFef",ref:g,"node-model":e.nodeModel},null,8,["node-model"]),k(fG,{ref:"ChatFieldTeble","node-model":e.nodeModel},null,8,["node-model"]),k(be,null,{label:P(()=>[K("div",mG,[K("span",yG,de(ee.$t("views.application.form.voiceInput.label")),1),K("div",gG,[E.value.stt_model_enable?(_e(),at(tt,{key:0,modelValue:E.value.stt_autosend,"onUpdate:modelValue":ue[5]||(ue[5]=we=>E.value.stt_autosend=we)},{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]=we=>E.value.stt_model_enable=we),onChange:Y},null,8,["modelValue"])])])]),default:P(()=>[Wa(k(Be,{onWheel:A,modelValue:E.value.stt_model_id,"onUpdate:modelValue":ue[7]||(ue[7]=we=>E.value.stt_model_id=we),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(be,null,{label:P(()=>[K("div",_G,[K("span",bG,de(ee.$t("views.application.form.voicePlay.label")),1),K("div",wG,[E.value.tts_model_enable?(_e(),at(tt,{key:0,modelValue:E.value.tts_autoplay,"onUpdate:modelValue":ue[8]||(ue[8]=we=>E.value.tts_autoplay=we)},{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]=we=>E.value.tts_model_enable=we),onChange:W},null,8,["modelValue"])])])]),default:P(()=>[K("div",EG,[Wa(k(St,{modelValue:E.value.tts_type,"onUpdate:modelValue":ue[10]||(ue[10]=we=>E.value.tts_type=we)},{default:P(()=>[k(dt,{label:ee.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),k(dt,{label:ee.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Wf,E.value.tts_model_enable]])]),K("div",OG,[E.value.tts_type==="TTS"&&E.value.tts_model_enable?(_e(),at(Be,{key:0,onWheel:A,modelValue:E.value.tts_model_id,"onUpdate:modelValue":ue[11]||(ue[11]=we=>E.value.tts_model_id=we),placeholder:ee.$t("views.application.form.voicePlay.placeholder"),options:v.value,onChange:ue[12]||(ue[12]=we=>D()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):pn("",!0),E.value.tts_type==="TTS"&&E.value.tts_model_enable?(_e(),at(Te,{key:1,onClick:B,disabled:!E.value.tts_model_id,class:"ml-8"},{default:P(()=>[k(Qt,null,{default:P(()=>[k(Qt,null,{default:P(()=>[k(He)]),_:1})]),_:1})]),_:1},8,["disabled"])):pn("",!0)])]),_:1})]),_:1},8,["model"]),k(lk,{ref_key:"TTSModeParamSettingDialogRef",ref:f,onRefresh:V},null,512),k(rG,{ref_key:"FileUploadSettingDialogRef",ref:b,"node-model":e.nodeModel,onRefresh:q},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),SG=Kf(xG,[["__scopeId","data-v-940d4dcd"]]);class AG extends ho{constructor(t){super(t,SG)}}class MG extends vo{constructor(t,n){super(t,n)}get_width(){return 600}}const kG={type:"base-node",model:MG,view:AG},CN=Object.freeze(Object.defineProperty({__proto__:null,default:kG},Symbol.toStringTag,{value:"Module"})),TG={class:"handle flex-between lighter"},NG={class:"flex align-center"},PG={key:0,class:"info"},CG={key:0,class:"mt-8"},RG=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=me.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]).map(L=>L.id===T.id?{...L,height:E.height,index:I}:L);me.set(t.nodeModel.properties,"branch_condition_list",U),b(t.nodeModel.properties.node_data.branch,!0)},s=$n({get:()=>(t.nodeModel.properties.node_data||(me.set(t.nodeModel.properties,"node_data",n),b(n.branch,!0)),t.nodeModel.properties.node_data),set:E=>{me.set(t.nodeModel.properties,"node_data",E)}}),c=je(),v=je(),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 _(E){const{oldIndex:T,newIndex:I}=E;if(T===void 0||I===void 0)return;const R=me.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},L={...R[I],type:R[T].type,id:R[T].id};R[I]=U,R[T]=L,me.set(t.nodeModel.properties.node_data,"branch",R)}function g(){const E=me.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),me.set(t.nodeModel.properties.node_data,"branch",E)}function b(E,T){const I=me.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]),R=E.map((U,L)=>{const D=I.find(W=>W.id===U.id);if(D)return{index:L,height:D.height,id:U.id};if(T)return{index:L,height:12,id:U.id}}).filter(U=>U);me.set(t.nodeModel.properties,"branch_condition_list",R),t.nodeModel.refreshBranch()}function x(E){const T=me.cloneDeep(t.nodeModel.properties.node_data.branch);T[E].conditions.push({field:[],compare:"",value:""}),me.set(t.nodeModel.properties.node_data,"branch",T)}function A(E,T){const I=me.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(L=>t.nodeModel.id+"_"+L.id+"_right");t.nodeModel.graphModel.eventCenter.emit("delete_edge",t.nodeModel.outgoing.edges.filter(L=>U.includes(L.sourceAnchorId)).map(L=>L.id)),b(I,!1),I.forEach((L,D)=>{L.type==="ELSE IF "+(D+1)&&(L.type="ELSE IF "+D)})}me.set(t.nodeModel.properties.node_data,"branch",I)}function S(E,T,I){if(["is_null","is_not_null","is_true","is_not_true"].includes(E)){const R=me.cloneDeep(t.nodeModel.properties.node_data.branch);R[T].conditions[I].value=1,me.set(t.nodeModel.properties.node_data,"branch",R)}}return Ir(()=>{me.set(t.nodeModel,"validate",f)}),(E,T)=>{const I=J("el-option"),R=J("el-select"),U=J("el-form-item"),L=J("el-col"),D=J("el-input"),W=J("AppIcon"),Y=J("el-button"),B=J("el-row"),V=J("el-card"),z=J("el-form"),H=Mv("resize");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(z,{model:s.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:c,onSubmit:T[0]||(T[0]=Xt(()=>{},["prevent"]))},{default:P(()=>[k(_n(pk),{ref:"el",modelValue:s.value.branch,disabled:s.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:_},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(s.value.branch,(q,ee)=>Wa((_e(),at(V,{key:q.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(()=>[K("div",TG,[K("span",NG,[T[1]||(T[1]=K("img",{src:hk,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),et(" "+de(q.type),1)]),q.conditions.length>1?(_e(),Ht("div",PG,[K("span",null,de(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(R,{teleported:!1,modelValue:q.condition,"onUpdate:modelValue":ue=>q.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"]),K("span",null,de(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),ee!==s.value.branch.length-1?(_e(),Ht("div",CG,[(_e(!0),Ht(ar,null,Gr(q.conditions,(ue,ie)=>(_e(),at(B,{key:ie,gutter:8},{default:P(()=>[k(L,{span:11},{default:P(()=>[k(U,{prop:"branch."+ee+".conditions."+ie+".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":be=>ue.field=be},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(L,{span:6},{default:P(()=>[k(U,{prop:"branch."+ee+".conditions."+ie+".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":be=>ue.compare=be,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:be=>S(be,ee,ie)},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(_n(rE),(be,De)=>(_e(),at(I,{key:De,label:be.label,value:be.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(L,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(ue.compare)?pn("",!0):(_e(),at(U,{key:0,prop:"branch."+ee+".conditions."+ie+".value",rules:{required:!0,message:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(D,{modelValue:ue.value,"onUpdate:modelValue":be=>ue.value=be,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(L,{span:1},{default:P(()=>[k(Y,{disabled:s.value.branch.length===2&&q.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:be=>A(ee,ie)},{default:P(()=>[k(W,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):pn("",!0),ee!==s.value.branch.length-1?(_e(),at(Y,{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"])),[[H,ue=>r(ue,q,ee)]])),128))]),_:1},8,["modelValue","disabled"]),k(Y,{link:"",type:"primary",onClick:g},{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 jG extends ho{constructor(t){super(t,RG)}}const DG=(e,t)=>e.filter((n,a)=>a<t).map(n=>n.height+8).reduce((n,a)=>n+a,0);class IG 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=[];if(f.push({x:n-r/2+10,y:v?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),c)for(let _=0;_<c.length;_++){const g=c[_],b=DG(c,_);f.push({x:n+r/2-10,y:v?a-s/2+75+b+g.height/2:a-15,id:`${t}_${g.id}_right`,type:"right"})}return f}}const LG={type:"condition-node",model:IG,view:jG},RN=Object.freeze(Object.defineProperty({__proto__:null,default:LG},Symbol.toStringTag,{value:"Module"})),$G={class:"title-decoration-1 mb-8"},FG=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={document_list:["start-node","document"]},a=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:r=>{me.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 _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",$G,de(r.$t("views.applicationWorkflow.nodeSetting")),1),k(f,{shadow:"never",class:"card-never"},{default:P(()=>[k(v,{onSubmit:s[1]||(s[1]=Xt(()=>{},["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]=_=>a.value.document_list=_)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});let BG=class extends ho{constructor(t){super(t,FG)}};const VG={type:"document-extract-node",model:vo,view:BG},jN=Object.freeze(Object.defineProperty({__proto__:null,default:VG},Symbol.toStringTag,{value:"Module"})),UG={class:"dialog-footer"},WG=Vn({__name:"AddFormCollect",props:{title:{default:yt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const a=e,r=je(!1),s=je(),c=je({}),v=je(!1),f=()=>{r.value=!0},_=()=>{r.value=!1,c.value={}},g=()=>{var b;(b=s.value)==null||b.validate().then(()=>{var x;a.addFormField((x=s.value)==null?void 0:x.getData()),_()})};return t({close:_,open:f}),(b,x)=>{const A=J("el-button"),S=J("el-dialog");return _e(),at(S,{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":_,"append-to-body":""},{footer:P(()=>[K("span",UG,[k(A,{onClick:x[1]||(x[1]=Xt(E=>r.value=!1,["prevent"]))},{default:P(()=>[et(de(b.$t("common.cancel")),1)]),_:1}),k(A,{type:"primary",onClick:x[2]||(x[2]=E=>g()),loading:v.value},{default:P(()=>[et(de(b.$t("common.add")),1)]),_:1},8,["loading"])])]),default:P(()=>[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"])}}}),GG={class:"dialog-footer"},zG=Vn({__name:"EditFormCollect",props:{title:{default:yt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const a=e,r=je(!1),s=je(),c=je({}),v=je(0),f=je(!1),_=(x,A)=>{r.value=!0,c.value=x,v.value=A},g=()=>{r.value=!1,c.value={}},b=()=>{var x;(x=s.value)==null||x.validate().then(()=>{var A;a.editFormField((A=s.value)==null?void 0:A.getData(),v.value),g()})};return t({close:g,open:_}),(x,A)=>{const S=J("el-button"),E=J("el-dialog");return _e(),at(E,{title:e.title,modelValue:r.value,"onUpdate:modelValue":A[3]||(A[3]=T=>r.value=T),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":g,"append-to-body":""},{footer:P(()=>[K("span",GG,[k(S,{onClick:A[1]||(A[1]=Xt(T=>r.value=!1,["prevent"]))},{default:P(()=>[et(de(x.$t("common.cancel")),1)]),_:1}),k(S,{type:"primary",onClick:A[2]||(A[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":A[0]||(A[0]=T=>c.value=T),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:s},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),HG={class:"title-decoration-1 mb-8"},XG={class:"flex align-center"},qG={class:"mr-4"},YG={class:"flex-between"},KG={class:"lighter"},ZG=["title"],JG={key:0},QG=["title"],ez={key:1},tz=["title"],nz=["title"],rz={class:"mr-4"},oz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e;eE("getModel",()=>t.nodeModel);const n=je(),a=je(),r=(R,U)=>{const L=A.value.form_field_list.map((D,W)=>U===W?me.cloneDeep(R):me.cloneDeep(D));A.value.form_field_list=L,c()},s=R=>{if(A.value.form_field_list.some(U=>U.field===R.field)){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+R.field);return}A.value.form_field_list=me.cloneDeep([...A.value.form_field_list,R]),c()},c=()=>{const R=[{label:yt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...A.value.form_field_list.map(U=>({value:U.field,label:typeof U.label=="string"?U.label:U.label.label}))];me.set(t.nodeModel.properties.config,"fields",R),t.nodeModel.clear_next_node_field(!1),I()},v=je(),f=je(),_=()=>{var R;(R=v.value)==null||R.open()},g=(R,U)=>{var L;(L=f.value)==null||L.open(me.cloneDeep(R),U)},b=R=>{A.value.form_field_list=A.value.form_field_list.filter(U=>U.field!==R.field),c()},x=je({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:[]}),A=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",x.value),t.nodeModel.properties.node_data),set:R=>{me.set(t.nodeModel.properties,"node_data",R)}}),S=R=>{var U;if(R.default_value){const L=(U=R.option_list)==null?void 0:U.filter(D=>R.default_value.indexOf(D.value)>-1).map(D=>D.label).join(",");return L||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){me.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:L=>{if(L.oldIndex===void 0||L.newIndex===void 0)return;const D=me.cloneDeep([...A.value.form_field_list]),[W]=D.splice(L.oldIndex,1);D.splice(L.newIndex,0,W),A.value.form_field_list=D,c()}})}return Ir(()=>{me.set(t.nodeModel,"validate",E),c(),t.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(R,U)=>{const L=J("AppIcon"),D=J("el-tooltip"),W=J("MdEditorMagnify"),Y=J("el-form-item"),B=J("el-button"),V=J("el-table-column"),z=J("el-tag"),H=J("el-switch"),q=J("el-table"),ee=J("el-form"),ue=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",HG,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]=Xt(()=>{},["prevent"])),model:A.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:P(()=>[k(Y,{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(()=>[K("div",XG,[K("div",qG,[K("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),U[5]||(U[5]=K("span",{class:"color-danger"},"*",-1))])]),k(D,{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(L,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(W,{title:R.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:A.value.form_content_format,"onUpdate:modelValue":U[0]||(U[0]=ie=>A.value.form_content_format=ie),style:{height:"150px"},onSubmitDialog:T},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(Y,{label:R.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:U[3]||(U[3]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",YG,[K("h5",KG,de(R.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),k(B,{link:"",type:"primary",onClick:U[1]||(U[1]=ie=>_())},{default:P(()=>[k(L,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(R.$t("common.add")),1)]),_:1})])]),default:P(()=>[A.value.form_field_list.length>0?(_e(),at(q,{key:0,class:"border",data:A.value.form_field_list,ref_key:"tableRef",ref:a,"row-key":"field"},{default:P(()=>[k(V,{prop:"field",label:R.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:P(({row:ie})=>[K("span",{title:ie.field,class:"ellipsis-1"},de(ie.field),9,ZG)]),_:1},8,["label"]),k(V,{prop:"label",label:R.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:ie})=>[ie.label&&ie.label.input_type==="TooltipLabel"?(_e(),Ht("span",JG,[K("span",{title:ie.label.label,class:"ellipsis-1"},de(ie.label.label),9,QG)])):(_e(),Ht("span",ez,[K("span",{title:ie.label,class:"ellipsis-1"},de(ie.label),9,tz)]))]),_:1},8,["label"]),k(V,{label:R.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:P(({row:ie})=>[k(z,{type:"info",class:"info-tag"},{default:P(()=>{var be;return[et(de((be=_n(WD).find(De=>De.value===ie.input_type))==null?void 0:be.label),1)]}),_:2},1024)]),_:1},8,["label"]),k(V,{prop:"default_value",label:R.$t("dynamicsForm.default.label")},{default:P(({row:ie})=>[K("span",{title:ie.default_value,class:"ellipsis-1"},de(S(ie)),9,nz)]),_:1},8,["label"]),k(V,{label:R.$t("common.required"),width:"55"},{default:P(({row:ie})=>[K("div",{onClick:U[2]||(U[2]=Xt(()=>{},["stop"]))},[k(H,{disabled:"",size:"small",modelValue:ie.required,"onUpdate:modelValue":be=>ie.required=be},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(V,{label:R.$t("common.operation"),align:"left",width:"80"},{default:P(({row:ie,$index:be})=>[K("span",rz,[k(D,{effect:"dark",content:R.$t("common.modify"),placement:"top"},{default:P(()=>[k(B,{type:"primary",text:"",onClick:Xt(De=>g(ie,be),["stop"])},{default:P(()=>[k(L,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(D,{effect:"dark",content:R.$t("common.delete"),placement:"top"},{default:P(()=>[k(B,{type:"primary",text:"",onClick:De=>b(ie)},{default:P(()=>[k(L,{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(WG,{ref_key:"addFormCollectRef",ref:v,addFormField:s},null,512),k(zG,{ref_key:"editFormCollectRef",ref:f,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class iz extends ho{constructor(t){super(t,oz)}getConfig(t){return t.model.properties.config}}const az={type:"form-node",model:vo,view:iz},DN=Object.freeze(Object.defineProperty({__proto__:null,default:az},Symbol.toStringTag,{value:"Module"})),lz={class:"title-decoration-1 mb-8"},sz={class:"flex-between w-full"},uz={class:"flex align-center"},cz={class:"mr-4"},dz={class:"flex align-center"},fz={class:"mr-4"},pz={class:"flex align-center"},hz={class:"mr-4"},vz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=()=>{var D;return(D=f.value)==null?void 0:D.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},g=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.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"]},A=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:D=>{me.set(s.nodeModel.properties,"node_data",D)}}),S=t();function E(){var W;const D=r.value==="systemManage"?{model_type:"TTI",workspace_id:(W=S.value)==null?void 0:W.workspace_id}:{model_type:"TTI"};po({type:"model",systemType:r.value}).getSelectModelList(D).then(Y=>{c.value=me.groupBy(Y==null?void 0:Y.data,"provider")})}const T=()=>{Gf(()=>{var D;A.value.model_id?(D=v.value)==null||D.reset_default(A.value.model_id,a):R({})})},I=D=>{var W;D&&((W=v.value)==null||W.open(D,a,A.value.model_params_setting))};function R(D){me.set(s.nodeModel.properties.node_data,"model_params_setting",D)}function U(D){me.set(s.nodeModel.properties.node_data,"prompt",D)}function L(D){me.set(s.nodeModel.properties.node_data,"negative_prompt",D)}return Ir(()=>{E(),me.set(s.nodeModel,"validate",_)}),(D,W)=>{const Y=J("AppIcon"),B=J("el-button"),V=J("ModelSelect"),z=J("el-form-item"),H=J("el-tooltip"),q=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ie=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",lz,de(D.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[6]||(W[6]=Xt(()=>{},["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(z,{label:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:P(()=>[K("div",sz,[K("div",null,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),W[7]||(W[7]=K("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!A.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=be=>I(A.value.model_id)),onRefreshForm:R},{default:P(()=>[k(Y,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(V,{onChange:T,onWheel:g,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=be=>A.value.model_id=be),placeholder:D.$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(z,{label:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",uz,[K("div",cz,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),W[8]||(W[8]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=be=>A.value.prompt=be),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",dz,[K("div",fz,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:A.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=be=>A.value.negative_prompt=be),placeholder:D.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:L},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[5]||(W[5]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",pz,[K("div",hz,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":W[4]||(W[4]=be=>A.value.is_result=be)},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 mz=class extends ho{constructor(t){super(t,vz)}};const yz={type:"image-generate-node",model:vo,view:mz},IN=Object.freeze(Object.defineProperty({__proto__:null,default:yz},Symbol.toStringTag,{value:"Module"})),gz={class:"title-decoration-1 mb-8"},_z={class:"flex-between w-full"},bz={class:"flex align-center"},wz={class:"mr-4"},Ez={class:"flex align-center"},Oz={class:"mr-4"},xz={class:"flex align-center"},Sz={class:"mr-4"},Az=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=()=>{var D;return(D=f.value)==null?void 0:D.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},g=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.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:[]},A=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:D=>{me.set(s.nodeModel.properties,"node_data",D)}}),S=t();function E(){var W;const D=r.value==="systemManage"?{model_type:"ITV",workspace_id:(W=S.value)==null?void 0:W.workspace_id}:{model_type:"ITV"};po({type:"model",systemType:r.value}).getSelectModelList(D).then(Y=>{c.value=me.groupBy(Y==null?void 0:Y.data,"provider")})}const T=()=>{Gf(()=>{var D;A.value.model_id?(D=v.value)==null||D.reset_default(A.value.model_id,a):R({})})},I=D=>{var W;D&&((W=v.value)==null||W.open(D,a,A.value.model_params_setting))};function R(D){me.set(s.nodeModel.properties.node_data,"model_params_setting",D)}function U(D){me.set(s.nodeModel.properties.node_data,"prompt",D)}function L(D){me.set(s.nodeModel.properties.node_data,"negative_prompt",D)}return Ir(()=>{E(),me.set(s.nodeModel,"validate",_)}),(D,W)=>{const Y=J("AppIcon"),B=J("el-button"),V=J("ModelSelect"),z=J("el-form-item"),H=J("el-tooltip"),q=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ie=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",gz,de(D.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[8]||(W[8]=Xt(()=>{},["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(z,{label:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:P(()=>[K("div",_z,[K("div",null,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),W[9]||(W[9]=K("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!A.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=be=>I(A.value.model_id)),onRefreshForm:R},{default:P(()=>[k(Y,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(V,{onChange:T,onWheel:g,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=be=>A.value.model_id=be),onFocus:E,placeholder:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:c.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",bz,[K("div",wz,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),W[10]||(W[10]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=be=>A.value.prompt=be),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",Ez,[K("div",Oz,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:A.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=be=>A.value.negative_prompt=be),placeholder:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:L},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),W[11]||(W[11]=K("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:A.value.first_frame_url,"onUpdate:modelValue":W[4]||(W[4]=be=>A.value.first_frame_url=be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:P(()=>[k(oo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:A.value.last_frame_url,"onUpdate:modelValue":W[5]||(W[5]=be=>A.value.last_frame_url=be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[7]||(W[7]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",xz,[K("div",Sz,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":W[6]||(W[6]=be=>A.value.is_result=be)},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 Mz extends ho{constructor(t){super(t,Az)}}const kz={type:"image-to-video-node",model:vo,view:Mz},LN=Object.freeze(Object.defineProperty({__proto__:null,default:kz},Symbol.toStringTag,{value:"Module"})),Tz={class:"title-decoration-1 mb-8"},Nz={class:"flex-between w-full"},Pz={class:"flex-between"},Cz={class:"flex align-center"},Rz={class:"flex align-center"},jz={class:"mr-4"},Dz={class:"flex-between"},Iz={class:"flex align-center"},Lz={class:"mr-4"},$z=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=je(),g=()=>{var B;return Promise.all([_.value?_.value.validate():Promise.resolve(""),(B=f.value)==null?void 0:B.validate()]).catch(V=>Promise.reject({node:s.nodeModel,errMessage:V}))},b=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),A={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"]},S=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",A),s.nodeModel.properties.node_data),set:B=>{me.set(s.nodeModel.properties,"node_data",B)}}),E=t();function T(){var V;const B=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=E.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};po({type:"model",systemType:r.value}).getSelectModelList(B).then(z=>{c.value=me.groupBy(z==null?void 0:z.data,"provider")})}function I(B){me.set(s.nodeModel.properties.node_data,"system",B)}function R(B){me.set(s.nodeModel.properties.node_data,"prompt",B)}const U=B=>{var V;B&&((V=v.value)==null||V.open(B,a,S.value.model_params_setting))};function L(B){me.set(s.nodeModel.properties.node_data,"model_params_setting",B)}const D=je(),W=B=>{var V;B&&((V=D.value)==null||V.open(B,a))},Y=B=>{me.set(s.nodeModel.properties.node_data,"system",B)};return Ir(()=>{T(),me.set(s.nodeModel,"validate",g)}),(B,V)=>{const z=J("AppIcon"),H=J("el-button"),q=J("ModelSelect"),ee=J("el-form-item"),ue=J("el-tooltip"),ie=J("MdEditorMagnify"),be=J("el-option"),De=J("el-select"),Ne=J("el-input-number"),Ae=J("el-switch"),Te=J("el-form"),rt=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",Tz,de(B.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Te,{onSubmit:V[10]||(V[10]=Xt(()=>{},["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(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(()=>[K("div",Nz,[K("div",null,[K("span",null,[et(de(_n(yt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),V[11]||(V[11]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{disabled:!S.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=tt=>U(S.value.model_id)),onRefreshForm:L},{default:P(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(q,{onWheel:b,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=tt=>S.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(()=>[K("div",Pz,[K("div",Cz,[K("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(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(H,{type:"primary",link:"",onClick:V[2]||(V[2]=tt=>W(S.value.model_id)),disabled:!S.value.model_id},{default:P(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:P(()=>[k(ie,{title:B.$t("views.application.form.roleSettings.label"),modelValue:S.value.system,"onUpdate:modelValue":V[3]||(V[3]=tt=>S.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(()=>[K("div",Rz,[K("div",jz,[K("span",null,[et(de(B.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=K("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(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ie,{onWheel:b,title:B.$t("views.application.form.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=tt=>S.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(()=>[K("div",Dz,[K("div",null,de(B.$t("views.application.form.historyRecord.label")),1),k(De,{modelValue:S.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=tt=>S.value.dialogue_type=tt),type:"small",style:{width:"100px"}},{default:P(()=>[k(be,{label:B.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(be,{label:B.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[k(Ne,{modelValue:S.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=tt=>S.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),V[13]||(V[13]=K("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:_,nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:S.value.image_list,"onUpdate:modelValue":V[7]||(V[7]=tt=>S.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:V[9]||(V[9]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",Iz,[K("div",Lz,[K("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(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Ae,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=tt=>S.value.is_result=tt)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:L},null,512),k(oE,{onReplace:Y,ref_key:"GeneratePromptDialogRef",ref:D},null,512)]),_:1},8,["node-model"])}}});let Fz=class extends ho{constructor(t){super(t,$z)}};const Bz={type:"image-understand-node",model:vo,view:Fz},$N=Object.freeze(Object.defineProperty({__proto__:null,default:Bz},Symbol.toStringTag,{value:"Module"})),Vz={class:"title-decoration-1 mb-8"},Uz={class:"flex-between"},Wz={class:"flex-between"},Gz={class:"flex-between"},zz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=je(),c=je();function v(){const W=me.cloneDeep(T.nodeModel.properties.node_data.branch),Y={id:is(),content:"",isOther:!1};W.splice(W.length-1,0,Y),_(W,!0),me.set(T.nodeModel.properties.node_data,"branch",W),T.nodeModel.refreshBranch()}function f(W){var ee;const Y=me.cloneDeep(T.nodeModel.properties.node_data.branch),B=Y.find(ue=>ue.id===W);if(!B||B.isOther||Y.filter(ue=>!ue.isOther).length<=1)return;const z=`${T.nodeModel.id}_${W}_right`,H=(((ee=T.nodeModel.outgoing)==null?void 0:ee.edges)||[]).filter(ue=>ue.sourceAnchorId===z).map(ue=>ue.id);H.length>0&&T.nodeModel.graphModel.eventCenter.emit("delete_edge",H);const q=Y.filter(ue=>ue.id!==W);me.set(T.nodeModel.properties.node_data,"branch",q),_(q,!1)}function _(W,Y){const B=me.cloneDeep(T.nodeModel.properties.branch_condition_list?T.nodeModel.properties.branch_condition_list:[]),V=W.map((z,H)=>{const q=B.find(ee=>ee.id===z.id);if(q)return{index:H,height:q.height,id:z.id};if(Y)return{index:H,height:12,id:z.id}}).filter(z=>z);me.set(T.nodeModel.properties,"branch_condition_list",V),T.nodeModel.refreshBranch()}const g=W=>W.ctrlKey===!0?(W.preventDefault(),!0):(W.stopPropagation(),!0),b=W=>{var Y;W?(Y=c.value)==null||Y.reset_default(W,a):A({})},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 A(W){me.set(T.nodeModel.properties.node_data,"model_params_setting",W)}const S=W=>{var Y;W&&((Y=c.value)==null||Y.open(W,a,E.value.model_params_setting))},E=$n({get:()=>(T.nodeModel.properties.node_data||(me.set(T.nodeModel.properties,"node_data",x),_(x.branch,!0)),T.nodeModel.properties.node_data),set:W=>{me.set(T.nodeModel.properties,"node_data",W)}}),T=e,I=je(),R=je(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(Y=>Y.content)).size)throw yt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(Y=>Promise.reject({node:T.nodeModel,errMessage:Y}))},L=t();function D(){var Y;const W=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Y=L.value)==null?void 0:Y.workspace_id}:{model_type:"LLM"};po({type:"model",systemType:r.value}).getSelectModelList(W).then(B=>{R.value=me.groupBy(B==null?void 0:B.data,"provider")})}return Ir(()=>{var W;D(),typeof((W=T.nodeModel.properties.node_data)==null?void 0:W.is_result)>"u"&&vc(T.nodeModel)&&me.set(T.nodeModel.properties.node_data,"is_result",!0),me.set(T.nodeModel,"validate",U)}),(W,Y)=>{const B=J("AppIcon"),V=J("el-button"),z=J("ModelSelect"),H=J("el-form-item"),q=J("el-input-number"),ee=J("el-input"),ue=J("el-col"),ie=J("el-row"),be=J("el-form"),De=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",Vz,de(W.$t("views.applicationWorkflow.nodeSetting")),1),k(De,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(be,{onSubmit:Y[4]||(Y[4]=Xt(()=>{},["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(H,{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(()=>[K("div",Uz,[K("div",null,[K("span",null,[et(de(W.$t("views.application.form.aiModel.label")),1),Y[5]||(Y[5]=K("span",{class:"color-danger"},"*",-1))])]),k(V,{type:"primary",link:"",disabled:!E.value.model_id,onClick:Y[0]||(Y[0]=Ne=>S(E.value.model_id)),onRefreshForm:A},{default:P(()=>[k(B,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(z,{onChange:b,onWheel:g,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":Y[1]||(Y[1]=Ne=>E.value.model_id=Ne),placeholder:W.$t("views.application.form.aiModel.placeholder"),options:R.value,onSubmitModel:D,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(H,{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(()=>[K("div",Wz,[K("div",null,[K("span",null,[et(de(W.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),Y[6]||(Y[6]=K("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":Y[2]||(Y[2]=Ne=>E.value.content_list=Ne)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(H,{label:W.$t("views.application.form.historyRecord.label")},{default:P(()=>[k(q,{modelValue:E.value.dialogue_number,"onUpdate:modelValue":Y[3]||(Y[3]=Ne=>E.value.dialogue_number=Ne),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(H,null,{label:P(()=>[K("div",Gz,[K("div",null,[K("span",null,[et(de(W.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),Y[7]||(Y[7]=K("span",{class:"color-danger"},"*",-1))])]),k(V,{onClick:v,type:"primary",size:"large",link:""},{default:P(()=>[k(B,{iconName:"app-add-outlined"})]),_:1})])]),default:P(()=>[K("div",null,[(_e(!0),Ht(ar,null,Gr(E.value.branch,(Ne,Ae)=>(_e(),Ht("div",{key:Ne.id,class:"mb-8"},[k(H,{prop:`branch.${Ae}.content`,rules:{message:W.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:P(()=>[k(ie,{gutter:12,align:"middle"},{default:P(()=>[k(ue,{span:21},{default:P(()=>[k(ee,{modelValue:Ne.content,"onUpdate:modelValue":Te=>Ne.content=Te,style:{width:"210px"},disabled:Ne.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(()=>[Ne.isOther?pn("",!0):(_e(),at(V,{key:0,link:"",size:"large",disabled:E.value.branch.filter(Te=>!Te.isOther).length<=1,onClick:Te=>f(Ne.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:A},null,512)]),_:1},8,["nodeModel"])}}});class Hz extends ho{constructor(t){super(t,zz)}}class Xz 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=[];if(f.push({x:n-r/2+10,y:v?a:a-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),c)for(let g=0;g<c.length;g++){const b=c[g];f.push({x:n+r/2-10,y:v?a-s/2+397+g*41.36:a-15,id:`${t}_${b.id}_right`,type:"right"}),console.log(a-s/2+397+100/2)}return f}}const qz={type:"intent-node",model:Xz,view:Hz},FN=Object.freeze(Object.defineProperty({__proto__:null,default:qz},Symbol.toStringTag,{value:"Module"})),Yz={class:"handle flex-between lighter mb-8"},Kz={key:0,class:"info"},Zz=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},a=_=>_.ctrlKey===!0?(_.preventDefault(),!0):(_.stopPropagation(),!0),r=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:_=>{me.set(t.nodeModel.properties,"node_data",_)}}),s=()=>{var g;const _=me.cloneDeep(((g=r.value)==null?void 0:g.condition_list)||[]);_.push({field:[],compare:"",value:""}),me.set(t.nodeModel.properties.node_data,"condition_list",_)},c=_=>{var b;const g=me.cloneDeep(((b=r.value)==null?void 0:b.condition_list)||[]);g.splice(_,1),me.set(t.nodeModel.properties.node_data,"condition_list",g)},v=je(),f=()=>{var g;const _=[(g=v.value)==null?void 0:g.validate()];return Promise.all(_).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))};return Ir(()=>{me.set(t.nodeModel,"validate",f)}),(_,g)=>{const b=J("el-option"),x=J("el-select"),A=J("el-form-item"),S=J("el-col"),E=J("el-input"),T=J("AppIcon"),I=J("el-button"),R=J("el-row"),U=J("el-form"),L=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(L,{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:g[1]||(g[1]=Xt(()=>{},["prevent"]))},{default:P(()=>[K("div",Yz,[r.value.condition_list.length>1?(_e(),Ht("div",Kz,[K("span",null,de(_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(x,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":g[0]||(g[0]=D=>r.value.condition=D),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(b,{label:_.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(b,{label:_.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),K("span",null,de(_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),(_e(!0),Ht(ar,null,Gr(r.value.condition_list,(D,W)=>(_e(),at(R,{key:W,gutter:8},{default:P(()=>[k(S,{span:11},{default:P(()=>[k(A,{prop:"condition_list."+W+".field",rules:{type:"array",required:!0,message:_.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.field,"onUpdate:modelValue":Y=>D.field=Y},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(S,{span:6},{default:P(()=>[k(A,{prop:"condition_list."+W+".compare",rules:{required:!0,message:_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:P(()=>[k(x,{onWheel:a,teleported:!1,modelValue:D.compare,"onUpdate:modelValue":Y=>D.compare=Y,placeholder:_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(_n(rE),(Y,B)=>(_e(),at(b,{key:B,label:Y.label,value:Y.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(S,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(D.compare)?pn("",!0):(_e(),at(A,{key:0,prop:"condition_list."+W+".value",rules:{required:!0,message:_.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:D.value,"onUpdate:modelValue":Y=>D.value=Y,placeholder:_.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(S,{span:1},{default:P(()=>[k(I,{link:"",type:"info",class:"mt-4",onClick:Y=>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:g[2]||(g[2]=D=>s())},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(_.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class Jz extends ho{constructor(t){super(t,Zz)}}const Qz={type:"loop-break-node",model:vo,view:Jz},BN=Object.freeze(Object.defineProperty({__proto__:null,default:Qz},Symbol.toStringTag,{value:"Module"})),eH={class:"handle flex-between lighter mb-8"},tH={key:0,class:"info"},nH=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},a=_=>_.ctrlKey===!0?(_.preventDefault(),!0):(_.stopPropagation(),!0),r=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:_=>{me.set(t.nodeModel.properties,"node_data",_)}}),s=()=>{var g;const _=me.cloneDeep(((g=r.value)==null?void 0:g.condition_list)||[]);_.push({field:[],compare:"",value:""}),me.set(t.nodeModel.properties.node_data,"condition_list",_)},c=_=>{var b;const g=me.cloneDeep(((b=r.value)==null?void 0:b.condition_list)||[]);g.splice(_,1),me.set(t.nodeModel.properties.node_data,"condition_list",g)},v=je(),f=()=>{var g;const _=[(g=v.value)==null?void 0:g.validate()];return Promise.all(_).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))};return Ir(()=>{me.set(t.nodeModel,"validate",f)}),(_,g)=>{const b=J("el-option"),x=J("el-select"),A=J("el-form-item"),S=J("el-col"),E=J("el-input"),T=J("AppIcon"),I=J("el-button"),R=J("el-row"),U=J("el-form"),L=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(L,{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:g[1]||(g[1]=Xt(()=>{},["prevent"]))},{default:P(()=>[K("div",eH,[r.value.condition_list.length>1?(_e(),Ht("div",tH,[K("span",null,de(_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(x,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":g[0]||(g[0]=D=>r.value.condition=D),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(b,{label:_.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(b,{label:_.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),K("span",null,de(_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):pn("",!0)]),(_e(!0),Ht(ar,null,Gr(r.value.condition_list,(D,W)=>(_e(),at(R,{key:W,gutter:8},{default:P(()=>[k(S,{span:11},{default:P(()=>[k(A,{prop:"condition_list."+W+".field",rules:{type:"array",required:!0,message:_.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[k(oo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.field,"onUpdate:modelValue":Y=>D.field=Y},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(S,{span:6},{default:P(()=>[k(A,{prop:"condition_list."+W+".compare",rules:{required:!0,message:_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:P(()=>[k(x,{onWheel:a,teleported:!1,modelValue:D.compare,"onUpdate:modelValue":Y=>D.compare=Y,placeholder:_.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(_n(rE),(Y,B)=>(_e(),at(b,{key:B,label:Y.label,value:Y.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(S,{span:6},{default:P(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(D.compare)?pn("",!0):(_e(),at(A,{key:0,prop:"condition_list."+W+".value",rules:{required:!0,message:_.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:P(()=>[k(E,{modelValue:D.value,"onUpdate:modelValue":Y=>D.value=Y,placeholder:_.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(S,{span:1},{default:P(()=>[k(I,{link:"",type:"info",class:"mt-4",onClick:Y=>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:g[2]||(g[2]=D=>s())},{default:P(()=>[k(T,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(_.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class rH extends ho{constructor(t){super(t,nH)}}const oH={type:"loop-continue-node",model:vo,view:rH},VN=Object.freeze(Object.defineProperty({__proto__:null,default:oH},Symbol.toStringTag,{value:"Module"})),iH=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||me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:g=>{me.set(t.nodeModel.properties,"node_data",g)}}),r=$n(()=>t.nodeModel.properties.showNode!==void 0?t.nodeModel.properties.showNode:(me.set(t.nodeModel.properties,"showNode",!0),!0));Zm(r,()=>{r.value?me.throttle(_,1e3)():me.throttle(f,1e3)()});const s=je(),c=je(),v=()=>{var g;return Promise.all([c.value?c.value.validate():Promise.resolve(""),(g=s.value)==null?void 0:g.validate()]).catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))},f=()=>{const b=t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).find(x=>x.type==rg.type);b&&(b.set_loop_body(),t.nodeModel.graphModel.deleteNode(b.id))},_=()=>{if(!t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).some(b=>b.type==rg.type)){let b={nodes:[ZD],edges:[]},x=t.nodeModel.x,A=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,A=t.nodeModel.properties.node_data.loop.y);const S=t.nodeModel.graphModel.addNode({type:rg.type,properties:{...rg.properties,workflow:b,loop_node_id:t.nodeModel.id},x,y:A});t.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:t.nodeModel.id,sourceAnchorId:t.nodeModel.id+"_children",targetNodeId:S.id,virtual:!0})}};return Ir(()=>{var g;typeof((g=t.nodeModel.properties.node_data)==null?void 0:g.is_result)>"u"&&vc(t.nodeModel)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),me.set(t.nodeModel,"validate",v),t.nodeModel.virtual||_()}),(g,b)=>{const x=J("el-option"),A=J("el-select"),S=J("el-form-item"),E=J("el-input-number"),T=J("el-form"),I=J("el-card");return _e(),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]=Xt(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:s},{default:P(()=>[k(S,{label:g.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:b[1]||(b[1]=Xt(()=>{},["prevent"])),prop:"loop_type",rules:{message:g.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:P(()=>[k(A,{modelValue:a.value.loop_type,"onUpdate:modelValue":b[0]||(b[0]=R=>a.value.loop_type=R),type:"small"},{default:P(()=>[k(x,{label:g.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),k(x,{label:g.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),k(x,{label:g.$t("views.applicationWorkflow.nodes.loopNode.loopType.infiniteLoop"),value:"LOOP"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),a.value.loop_type=="ARRAY"?(_e(),at(S,{key:0,label:g.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:b[3]||(b[3]=Xt(()=>{},["prevent"])),prop:"array",rules:{message:g.$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:g.$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"?(_e(),at(S,{key:1,label:g.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:b[5]||(b[5]=Xt(()=>{},["prevent"])),prop:"number",rules:{message:g.$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 aH extends ho{constructor(t){const n=t.model.properties.config;super(t,iH),t.model.properties.config=n}}class lH 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!==nr.Base&&(this.type!==nr.Start&&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 sH={type:"loop-node",model:lH,view:aH},UN=Object.freeze(Object.defineProperty({__proto__:null,default:sH},Symbol.toStringTag,{value:"Module"})),uH={class:"dialog-footer"},cH=Vn({__name:"LoopFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je(null),f=je({field:"",label:""}),_=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"}]}),g=je(!1),b=(S,E)=>{S&&(f.value=me.cloneDeep(S),c.value=!0,v.value=E),g.value=!0},x=()=>{g.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},A=async S=>{S&&await S.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(S,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),L=J("el-dialog");return _e(),at(L,{title:c.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:g.value,"onUpdate:modelValue":E[3]||(E[3]=D=>g.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[K("span",uH,[k(U,{onClick:Xt(x,["prevent"])},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=D=>A(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:_,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:S.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:_.field},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=D=>f.value.field=D),maxlength:64,placeholder:S.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(I,{label:S.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:_.label},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=D=>f.value.label=D),maxlength:64,"show-word-limit":"",placeholder:S.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),dH={class:"flex-between mb-16"},fH={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},pH={class:"ml-4"},hH=["title"],vH=["title"],mH={class:"mr-4"},yH=Vn({__name:"LoopFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je([]);function s(f,_){a.value.open(f,_)}function c(f){r.value.splice(f,1)}function v(f,_){for(let g=0;g<r.value.length;g++)if(r.value[g].field===f.field&&_!==g){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(_)?r.value.push(f):r.value.splice(_,1,f),a.value.close()}return Ir(()=>{t.nodeModel.properties.loop_input_field_list&&(r.value=me.cloneDeep(t.nodeModel.properties.loop_input_field_list)),me.set(t.nodeModel.properties,"loop_input_field_list",r)}),(f,_)=>{var E;const g=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),A=J("el-tooltip"),S=J("el-table");return _e(),Ht(ar,null,[K("div",dH,[K("h5",fH,de(f.$t("views.applicationWorkflow.variable.loop")),1),K("div",null,[K("span",pH,[k(b,{link:"",type:"primary",onClick:_[0]||(_[0]=T=>s())},{default:P(()=>[k(g,{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?(_e(),at(S,{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})=>[K("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,hH)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[K("span",null,[K("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,vH)])]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[K("span",mH,[k(A,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:Xt(R=>s(T,I),["stop"])},{default:P(()=>[k(g,{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:R=>c(I)},{default:P(()=>[k(g,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(cH,{ref_key:"ChatFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),gH={class:"title-decoration-1 mb-8"},_H={class:"title-decoration-1 mb-8"},bH={class:"break-all"},wH=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}));Zm(n,()=>{t.nodeModel.graphModel.refresh_loop_fields(me.cloneDeep(n.value))});const a=je(!1);return Ir(()=>{t.nodeModel.graphModel.refresh_loop_fields(me.cloneDeep(n.value))}),(r,s)=>{const c=J("AppIcon"),v=J("el-button"),f=J("el-tooltip");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>{var _;return[K("h5",gH,de(r.$t("views.applicationWorkflow.nodeSetting")),1),k(yH,{nodeModel:e.nodeModel},null,8,["nodeModel"]),(_=n.value)!=null&&_.length?(_e(),Ht(ar,{key:0},[K("h5",_H,de(r.$t("views.applicationWorkflow.variable.loop")),1),(_e(!0),Ht(ar,null,Gr(n.value||[],(g,b)=>(_e(),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)},[K("span",bH,de(g.label)+" "+de("{"+g.value+"}"),1),a.value===!0?(_e(),at(f,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(v,{link:"",onClick:x=>_n($m)(`{{loop.${g.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 EH extends ho{constructor(t){super(t,wH)}get_node_field_list(){var n,a;const t=[];return this.props.model.type==="loop-start-node"&&t.push({value:"loop",label:yt("views.applicationWorkflow.variable.loop"),type:"loop",children:(this.props.model.properties.loop_input_field_list?this.props.model.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})||[]}),t.push({value:this.props.model.id,label:this.props.model.properties.stepName,type:this.props.model.type,children:((a=(n=this.props.model.properties)==null?void 0:n.config)==null?void 0:a.fields)||[]}),t}}const OH={type:"loop-start-node",model:vo,view:EH},WN=Object.freeze(Object.defineProperty({__proto__:null,default:OH},Symbol.toStringTag,{value:"Module"})),xH={class:"dialog-footer"},SH=Vn({__name:"McpServerInputDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(!1),s=je(!1),c=je(),v=je({}),f=je([]);function _(b){r.value=!0,f.value=b}const g=async b=>{b&&await b.validate(x=>{x&&(a("refresh",v.value),r.value=!1)})};return t({open:_}),(b,x)=>{const A=J("el-input"),S=J("el-form-item"),E=J("el-form"),T=J("el-button"),I=J("el-dialog");return _e(),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(()=>[K("span",xH,[k(T,{onClick:x[0]||(x[0]=Xt(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=>g(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(()=>[(_e(!0),Ht(ar,null,Gr(f.value,R=>(_e(),at(S,{label:R,key:R,prop:R,rules:{required:!0,message:b.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:P(()=>[k(A,{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"])}}}),AH={class:"title-decoration-1 mb-8"},MH={class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},kH={class:"flex-between"},TH={class:"flex align-center"},NH=["src"],PH={class:"flex-between"},CH={class:"ml-4"},RH={class:"title-decoration-1 mb-8"},jH={key:0,class:"p-8-12"},DH={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},IH={class:"flex-between"},LH={key:1},$H={key:2,class:"color-danger"},FH={key:0,class:"p-8-12"},BH={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},VH={class:"flex-between"},UH={key:1},WH={key:2,class:"color-danger"},GH=`{
"math": {
"url": "your_server",
"transport": "sse"
}
}`,zH=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Li(),{params:{id:a}}=n,s=Ga("getApplicationDetail")(),c=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),v=je(),f=je(!1),_=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),g={mcp_tool:"",mcp_tools:[],mcp_servers:"",mcp_server:"",mcp_source:"referencing",mcp_tool_id:"",tool_params:{},tool_form_field:[],params_nested:""},b=je([]);function x(B){me.set(t.nodeModel.properties.node_data,"mcp_servers",B)}async function A(){const B=await po({type:"tool",systemType:c.value}).getToolById(L.value.mcp_tool_id,f);L.value.mcp_servers=B.data.code}function S(){if(L.value.mcp_source==="referencing"&&!L.value.mcp_tool_id){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(L.value.mcp_source==="referencing"&&L.value.mcp_tool_id&&!b.value.find(B=>B.id===L.value.mcp_tool_id)){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(L.value.mcp_source==="custom"&&!L.value.mcp_servers){ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(L.value.mcp_servers);const B=I(L.value.mcp_servers);if(B.length>0){T.value.open(B);return}}catch{ei(yt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}E(L.value.mcp_servers)}function E(B){po({type:"application",systemType:c.value}).getMcpTools(a,B,f).then(V=>{var z;L.value.mcp_tools=V.data,zf(yt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),L.value.mcp_server=(z=L.value.mcp_tools.find(H=>H.name===L.value.mcp_tool))==null?void 0:z.server})}const T=je();function I(B){const V=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,z=new Set,H=q=>{if(typeof q=="string"){let ee;for(;(ee=V.exec(q))!==null;)z.add(ee[1])}else Array.isArray(q)?q.forEach(H):q&&typeof q=="object"&&Object.values(q).forEach(H)};if(typeof B=="string")try{H(JSON.parse(B))}catch{H(B)}else H(B);return[...z]}function R(B){let V=L.value.mcp_servers;for(const z in B)V=V.replace(`{{${z}}}`,B[z]);E(V)}function U(){var V,z,H,q,ee,ue;L.value.mcp_server=(V=L.value.mcp_tools.find(ie=>ie.name===L.value.mcp_tool))==null?void 0:V.server;const B=(z=L.value.mcp_tools.find(ie=>ie.name===L.value.mcp_tool))==null?void 0:z.args_schema;L.value.tool_form_field=[];for(const ie in B==null?void 0:B.properties){const be=B==null?void 0:B.properties[ie].properties;if(be){L.value.params_nested=ie;for(const De in be){let Ne="TextInput";be[De].type==="string"?Ne="TextInput":be[De].type==="number"?Ne="NumberInput":be[De].type==="boolean"?Ne="SwitchInput":(be[De].type==="array"||be[De].type==="object")&&(Ne="JsonInput"),L.value.tool_form_field.push({field:De,label:{input_type:"TooltipLabel",label:De,attrs:{tooltip:be[De].description},props_info:{}},input_type:Ne,source:"referencing",required:((H=B.properties[ie].required)==null?void 0:H.indexOf(De))!==-1,props_info:{rules:[{required:((q=B.properties[ie].required)==null?void 0:q.indexOf(De))!==-1,message:yt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{L.value.params_nested="";let De="TextInput";B.properties[ie].type==="string"?De="TextInput":B.properties[ie].type==="number"?De="NumberInput":B.properties[ie].type==="boolean"?De="SwitchInput":(B.properties[ie].type==="array"||B.properties[ie].type==="object")&&(De="JsonInput"),L.value.tool_form_field.push({field:ie,label:{input_type:"TooltipLabel",label:ie,attrs:{tooltip:B.properties[ie].description},props_info:{}},input_type:De,source:"referencing",required:((ee=B.required)==null?void 0:ee.indexOf(ie))!==-1,props_info:{rules:[{required:((ue=B.required)==null?void 0:ue.indexOf(ie))!==-1,message:yt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}L.value.params_nested?L.value.tool_params={[L.value.params_nested]:{}}:L.value.tool_params={}}const L=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",g),t.nodeModel.properties.node_data),set:B=>{me.set(t.nodeModel.properties,"node_data",B)}}),D=je(),W=async()=>{if(v.value){const B=L.value.tool_form_field.filter(V=>V.required).map(V=>V.label.label);if(B.length>0){for(const V of B)if(L.value.params_nested){if(!L.value.tool_params[L.value.params_nested][V])return Promise.reject({node:t.nodeModel,errMessage:V+yt("dynamicsForm.tip.requiredMessage")})}else if(!L.value.tool_params[V])return Promise.reject({node:t.nodeModel,errMessage:V+yt("dynamicsForm.tip.requiredMessage")})}}if(D.value){const B=me.cloneDeep(L.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 Y(){var V;const B=c.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(V=s.value)==null?void 0:V.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};po({type:"tool",systemType:c.value}).getAllToolList(B,f).then(z=>{b.value=[...z.data.shared_tools,...z.data.tools].filter(H=>H.is_active)})}return Ir(()=>{var B;typeof((B=t.nodeModel.properties.node_data)==null?void 0:B.is_result)>"u"&&vc(t.nodeModel)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),t.nodeModel.properties.node_data.mcp_servers&&!t.nodeModel.properties.node_data.mcp_source&&me.set(t.nodeModel.properties.node_data,"mcp_source","custom"),Y(),me.set(t.nodeModel,"validate",W)}),(B,V)=>{const z=J("el-option"),H=J("el-select"),q=J("MdEditorMagnify"),ee=J("el-avatar"),ue=J("ToolIcon"),ie=J("el-tag"),be=J("el-form-item"),De=J("AppIcon"),Ne=J("el-button"),Ae=J("el-tooltip"),Te=J("el-form"),rt=J("el-text"),tt=J("el-input"),Be=J("el-input-number"),dt=J("el-switch"),St=Mv("loading");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",AH,de(B.$t("views.applicationWorkflow.nodeSetting")),1),K("div",MH,[k(Te,{onSubmit:V[5]||(V[5]=Xt(()=>{},["prevent"])),model:L.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:D,"hide-required-asterisk":""},{default:P(()=>[k(be,{label:"MCP Server Config"},{label:P(()=>[K("div",kH,[V[8]||(V[8]=K("div",null,[et(" MCP Server Config "),K("span",{class:"color-danger"},"*")],-1)),k(H,{teleported:!1,modelValue:L.value.mcp_source,"onUpdate:modelValue":V[0]||(V[0]=He=>L.value.mcp_source=He),size:"small",style:{width:"85px"}},{default:P(()=>[k(z,{label:B.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),k(z,{label:B.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[L.value.mcp_source==="custom"?(_e(),at(q,{key:0,onWheel:_,title:"MCP Server Config",modelValue:L.value.mcp_servers,"onUpdate:modelValue":V[1]||(V[1]=He=>L.value.mcp_servers=He),style:{height:"150px"},onSubmitDialog:x,placeholder:GH},null,8,["modelValue"])):(_e(),at(H,{key:1,modelValue:L.value.mcp_tool_id,"onUpdate:modelValue":V[2]||(V[2]=He=>L.value.mcp_tool_id=He),filterable:"",onChange:A},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(b.value,He=>(_e(),at(z,{key:He.id,label:He.name,value:He.id},{default:P(()=>[K("div",TH,[He!=null&&He.icon?(_e(),at(ee,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:P(()=>[K("img",{src:_n(Bf)(He==null?void 0:He.icon),alt:""},null,8,NH)]),_:2},1024)):(_e(),at(ue,{key:1,size:20,type:He==null?void 0:He.tool_type,class:"mr-8"},null,8,["type"])),K("span",null,de(He.name),1),He.scope==="SHARED"?(_e(),at(ie,{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(be,null,{label:P(()=>[K("div",PH,[K("span",null,de(B.$t("views.tool.title")),1),k(Ne,{type:"primary",link:"",onClick:V[3]||(V[3]=He=>S())},{default:P(()=>[k(De,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(B.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:P(()=>[k(H,{modelValue:L.value.mcp_tool,"onUpdate:modelValue":V[4]||(V[4]=He=>L.value.mcp_tool=He),onChange:U,filterable:""},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(L.value.mcp_tools,He=>(_e(),at(z,{key:He.value,label:He.name,value:He.name,class:"flex align-center"},{default:P(()=>[k(Ae,{effect:"dark",content:He.description,placement:"top-start","popper-class":"max-w-350"},{default:P(()=>[k(De,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),K("span",CH,de(He.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),K("h5",RH,de(B.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),L.value.tool_params[L.value.params_nested]?(_e(),Ht(ar,{key:0},[L.value.mcp_tool?(_e(),Ht("div",DH,[L.value.mcp_tool?Wa((_e(),at(Te,{key:0,ref_key:"dynamicsFormRef",ref:v,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[6]||(V[6]=Xt(()=>{},["prevent"]))},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(L.value.tool_form_field,He=>(_e(),at(be,{key:He.field,required:He.required},{label:P(()=>[K("div",IH,[K("div",null,[He.label.attrs.tooltip?(_e(),at(Ux,{key:0,label:He.label,tooltip:He.label.attrs.tooltip},null,8,["label","tooltip"])):(_e(),Ht("span",LH,de(He.label.label),1)),He.required?(_e(),Ht("span",$H,"*")):pn("",!0)]),k(H,{teleported:!1,modelValue:He.source,"onUpdate:modelValue":Qt=>He.source=Qt,size:"small",style:{width:"85px"},onChange:Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=""},{default:P(()=>[k(z,{label:B.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{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"?(_e(),at(tt,{key:0,modelValue:L.value.tool_params[L.value.params_nested][He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="NumberInput"?(_e(),at(Be,{key:1,modelValue:L.value.tool_params[L.value.params_nested][He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="SwitchInput"?(_e(),at(dt,{key:2,modelValue:L.value.tool_params[L.value.params_nested][He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="JsonInput"?(_e(),at(tt,{key:3,modelValue:L.value.tool_params[L.value.params_nested][He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=Qt,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):pn("",!0),He.source==="referencing"?(_e(),at(oo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.variable.placeholder"),modelValue:L.value.tool_params[L.value.params_nested][He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[L.value.params_nested][He.label.label]=Qt},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):pn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[St,f.value]]):pn("",!0)])):(_e(),Ht("div",jH,[k(rt,{type:"info"},{default:P(()=>[et(de(B.$t("common.noData")),1)]),_:1})]))],64)):(_e(),Ht(ar,{key:1},[L.value.mcp_tool?(_e(),Ht("div",BH,[L.value.mcp_tool?Wa((_e(),at(Te,{key:0,ref_key:"dynamicsFormRef",ref:v,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[7]||(V[7]=Xt(()=>{},["prevent"]))},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(L.value.tool_form_field,He=>(_e(),at(be,{key:He.field,required:He.required},{label:P(()=>[K("div",VH,[K("div",null,[He.label.attrs.tooltip?(_e(),at(Ux,{key:0,label:He.label,tooltip:He.label.attrs.tooltip},null,8,["label","tooltip"])):(_e(),Ht("span",UH,de(He.label.label),1)),He.required?(_e(),Ht("span",WH,"*")):pn("",!0)]),k(H,{teleported:!1,modelValue:He.source,"onUpdate:modelValue":Qt=>He.source=Qt,size:"small",style:{width:"85px"},onChange:Qt=>L.value.tool_params[He.label.label]=""},{default:P(()=>[k(z,{label:B.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{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"?(_e(),at(tt,{key:0,modelValue:L.value.tool_params[He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="NumberInput"?(_e(),at(Be,{key:1,modelValue:L.value.tool_params[He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="SwitchInput"?(_e(),at(dt,{key:2,modelValue:L.value.tool_params[He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[He.label.label]=Qt},null,8,["modelValue","onUpdate:modelValue"])):He.source==="custom"&&He.input_type==="JsonInput"?(_e(),at(tt,{key:3,modelValue:L.value.tool_params[He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[He.label.label]=Qt,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):pn("",!0),He.source==="referencing"?(_e(),at(oo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.variable.placeholder"),modelValue:L.value.tool_params[He.label.label],"onUpdate:modelValue":Qt=>L.value.tool_params[He.label.label]=Qt},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):pn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[St,f.value]]):pn("",!0)])):(_e(),Ht("div",FH,[k(rt,{type:"info"},{default:P(()=>[et(de(B.$t("common.noData")),1)]),_:1})]))],64)),k(SH,{ref_key:"mcpServerInputDialogRef",ref:T,onRefresh:R},null,512)]),_:1},8,["nodeModel"])}}});class HH extends ho{constructor(t){super(t,zH)}}const XH={type:"mcp-node",model:vo,view:HH},GN=Object.freeze(Object.defineProperty({__proto__:null,default:XH},Symbol.toStringTag,{value:"Module"})),qH={class:"dialog-footer"},YH=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=je(),c=je(!1),v=je(!1),f=je(null),_=je({field:"",label:"",parameter_type:"",desc:""}),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"}]}),b=je(!1),x=(E,T)=>{E&&(_.value=me.cloneDeep(E),v.value=!0,f.value=T),b.value=!0},A=()=>{b.value=!1,v.value=!1,f.value=null,_.value={field:"",label:""}},S=async E=>{E&&await E.validate(T=>{T&&a("refresh",_.value,f.value)})};return t({open:x,close:A}),(E,T)=>{const I=J("el-input"),R=J("el-form-item"),U=J("el-option"),L=J("el-select"),D=J("el-form"),W=J("el-button"),Y=J("el-dialog");return _e(),at(Y,{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":A,"append-to-body":""},{footer:P(()=>[K("span",qH,[k(W,{onClick:Xt(A,["prevent"])},{default:P(()=>[et(de(E.$t("common.cancel")),1)]),_:1}),k(W,{type:"primary",onClick:T[4]||(T[4]=B=>S(s.value)),loading:c.value},{default:P(()=>[et(de(E.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(D,{"label-position":"top",ref_key:"fieldFormRef",ref:s,rules:g,model:_.value,"require-asterisk-position":"right"},{default:P(()=>[k(R,{label:E.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:g.field},{default:P(()=>[k(I,{modelValue:_.value.field,"onUpdate:modelValue":T[0]||(T[0]=B=>_.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:g.label},{default:P(()=>[k(I,{modelValue:_.value.label,"onUpdate:modelValue":T[1]||(T[1]=B=>_.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:g.label},{default:P(()=>[k(L,{modelValue:_.value.parameter_type,"onUpdate:modelValue":T[2]||(T[2]=B=>_.value.parameter_type=B),placeholder:E.$t("common.selectPlaceholder")+E.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:P(()=>[(_e(),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:_.value.desc,"onUpdate:modelValue":T[3]||(T[3]=B=>_.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"])}}}),KH={class:"flex-between w-full"},ZH={class:"break-all lighter"},JH={class:"ml-4",style:{"margin-top":"-4px"}},QH=["title"],eX=["title"],tX={class:"mr-4"},nX=Vn({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je([]);function s(f,_){a.value.open(f,_)}function c(f){r.value.splice(f,1);const _=[{label:yt("common.result"),value:"result"},...r.value.map(g=>({label:g.label,value:g.field}))];me.set(t.nodeModel.properties.config,"fields",_),t.nodeModel.clear_next_node_field(!1)}function v(f,_){for(let b=0;b<r.value.length;b++)if(r.value[b].field===f.field&&_!==b){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(_)?r.value.push(f):r.value.splice(_,1,f),a.value.close();const g=[{label:yt("common.result"),value:"result"},...r.value.map(b=>({label:b.label,value:b.field}))];me.set(t.nodeModel.properties.config,"fields",g),t.nodeModel.clear_next_node_field(!1)}return Ir(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=me.cloneDeep(t.nodeModel.properties.node_data.variable_list)),me.set(t.nodeModel.properties.node_data,"variable_list",r);const f=[{label:yt("common.result"),value:"result"},...r.value.map(_=>({label:_.label,value:_.field}))];me.set(t.nodeModel.properties.config,"fields",f)}),(f,_)=>{var T;const g=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),A=J("el-tag"),S=J("el-tooltip"),E=J("el-table");return _e(),Ht(ar,null,[K("div",KH,[K("h5",ZH,[et(de(f.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),_[1]||(_[1]=K("span",{class:"color-danger"},"*",-1))]),K("span",JH,[k(b,{link:"",type:"primary",onClick:_[0]||(_[0]=I=>s())},{default:P(()=>[k(g,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((T=t.nodeModel.properties.node_data.variable_list)==null?void 0:T.length)>0?(_e(),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})=>[K("span",{title:I.field,class:"ellipsis-1"},de(I.field),9,QH)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:I})=>[K("span",null,[K("span",{title:I.label,class:"ellipsis-1"},de(I.label),9,eX)])]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:P(({row:I})=>[k(A,{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})=>[K("span",tX,[k(S,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:Xt(U=>s(I,R),["stop"])},{default:P(()=>[k(g,{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:U=>c(R)},{default:P(()=>[k(g,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(YH,{ref_key:"ParametersFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),rX={class:"title-decoration-1 mb-8"},oX={class:"flex-between w-full"},iX={class:"flex-between"},aX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=e,a=je(),r=Li(),{params:{id:s}}=r,c=R=>{var U;R&&((U=a.value)==null||U.open(R,s,S.value.model_params_setting))};function v(R){me.set(n.nodeModel.properties.node_data,"model_params_setting",R)}const f=t(),_=je(null),g=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(L=>{_.value=me.groupBy(L==null?void 0:L.data,"provider")})}const A={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},S=$n({get:()=>(n.nodeModel.properties.node_data||me.set(n.nodeModel.properties,"node_data",A),n.nodeModel.properties.node_data),set:R=>{me.set(n.nodeModel.properties,"node_data",R)}}),E=R=>{var U;R?(U=a.value)==null||U.reset_default(R,s):v({})},T=je(),I=async()=>T.value.validate().catch(R=>Promise.reject({node:n.nodeModel,errMessage:R}));return Ir(()=>{x(),me.set(n.nodeModel,"validate",I)}),(R,U)=>{const L=J("AppIcon"),D=J("el-button"),W=J("ModelSelect"),Y=J("el-form-item"),B=J("el-form"),V=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",rX,de(R.$t("views.applicationWorkflow.nodeSetting")),1),k(V,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(B,{onSubmit:U[3]||(U[3]=Xt(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:T,"hide-required-asterisk":""},{default:P(()=>[k(Y,{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(()=>[K("div",oX,[K("div",null,[K("span",null,[et(de(R.$t("views.application.form.aiModel.label")),1),U[4]||(U[4]=K("span",{class:"color-danger ml-4"},"*",-1))])]),k(D,{disabled:!S.value.model_id,type:"primary",link:"",onClick:U[0]||(U[0]=z=>c(S.value.model_id)),onRefreshForm:v},{default:P(()=>[k(L,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(W,{onChange:E,onWheel:g,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":U[1]||(U[1]=z=>S.value.model_id=z),placeholder:R.$t("views.application.form.aiModel.placeholder"),options:_.value,onSubmitModel:x,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(Y,{prop:"input_variable",rules:{message:R.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[K("div",iX,[K("div",null,[et(de(R.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),U[5]||(U[5]=K("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:S.value.input_variable,"onUpdate:modelValue":U[2]||(U[2]=z=>S.value.input_variable=z)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(Y,{prop:"variable_list",rules:{message:R.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(nX,{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 lX extends ho{constructor(t){super(t,aX)}getConfig(t){return t.model.properties.config}}const sX={type:"parameter-extraction-node",model:vo,view:lX},zN=Object.freeze(Object.defineProperty({__proto__:null,default:sX},Symbol.toStringTag,{value:"Module"})),uX={class:"title-decoration-1 mb-8"},cX={class:"flex-between"},dX={class:"flex-between"},fX={class:"flex align-center"},pX={class:"flex align-center"},hX={class:"mr-4"},vX={class:"flex align-center"},mX={class:"mr-4"},yX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=je(),c=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.stopPropagation(),!0),v=D=>{var W;D?(W=s.value)==null||W.reset_default(D,a):x({})};function f(D){me.set(E.nodeModel.properties.node_data,"prompt",D)}function _(D){me.set(E.nodeModel.properties.node_data,"system",D)}const g=`{{${yt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,b={model_id:"",system:yt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:g,dialogue_number:1,is_result:!1};function x(D){me.set(E.nodeModel.properties.node_data,"model_params_setting",D)}const A=D=>{var W;D&&((W=s.value)==null||W.open(D,a,S.value.model_params_setting))},S=$n({get:()=>(E.nodeModel.properties.node_data||me.set(E.nodeModel.properties,"node_data",b),E.nodeModel.properties.node_data),set:D=>{me.set(E.nodeModel.properties,"node_data",D)}}),E=e,T=je(),I=je(null),R=()=>{var D;return(D=T.value)==null?void 0:D.validate().catch(W=>Promise.reject({node:E.nodeModel,errMessage:W}))},U=t();function L(){var W;const D=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(D).then(Y=>{I.value=me.groupBy(Y==null?void 0:Y.data,"provider")})}return Ir(()=>{var D;L(),typeof((D=E.nodeModel.properties.node_data)==null?void 0:D.is_result)>"u"&&vc(E.nodeModel)&&me.set(E.nodeModel.properties.node_data,"is_result",!0),me.set(E.nodeModel,"validate",R)}),(D,W)=>{const Y=J("AppIcon"),B=J("el-button"),V=J("ModelSelect"),z=J("el-form-item"),H=J("el-tooltip"),q=J("MdEditorMagnify"),ee=J("el-input-number"),ue=J("el-switch"),ie=J("el-form"),be=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",uX,de(D.$t("views.applicationWorkflow.nodeSetting")),1),k(be,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(ie,{onSubmit:W[7]||(W[7]=Xt(()=>{},["prevent"])),model:S.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:T,"hide-required-asterisk":""},{default:P(()=>[k(z,{label:D.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:D.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:P(()=>[K("div",cX,[K("div",null,[K("span",null,[et(de(D.$t("views.application.form.aiModel.label")),1),W[8]||(W[8]=K("span",{class:"color-danger"},"*",-1))])]),k(B,{type:"primary",link:"",disabled:!S.value.model_id,onClick:W[0]||(W[0]=De=>A(S.value.model_id)),onRefreshForm:x},{default:P(()=>[k(Y,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(V,{onChange:v,onWheel:c,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=De=>S.value.model_id=De),placeholder:D.$t("views.application.form.aiModel.placeholder"),options:I.value,onSubmitModel:L,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,null,{label:P(()=>[K("div",dX,[K("div",fX,[K("span",null,de(D.$t("views.application.form.roleSettings.label")),1),k(H,{effect:"dark",content:D.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:P(()=>[k(q,{title:D.$t("views.application.form.roleSettings.label"),modelValue:S.value.system,"onUpdate:modelValue":W[2]||(W[2]=De=>S.value.system=De),style:{height:"100px"},onSubmitDialog:_,placeholder:`${_n(yt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${_n(yt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(z,{label:D.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:D.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:P(()=>[K("div",pX,[K("div",hX,[K("span",null,[et(de(D.$t("views.application.form.prompt.label")),1),W[9]||(W[9]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.application.form.prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:c,title:D.$t("views.application.form.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":W[3]||(W[3]=De=>S.value.prompt=De),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(z,{label:D.$t("views.application.form.historyRecord.label")},{default:P(()=>[k(ee,{modelValue:S.value.dialogue_number,"onUpdate:modelValue":W[4]||(W[4]=De=>S.value.dialogue_number=De),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[6]||(W[6]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",vX,[K("div",mX,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ue,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":W[5]||(W[5]=De=>S.value.is_result=De)},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 gX extends ho{constructor(t){super(t,yX)}}const _X={type:"question-node",model:vo,view:gX},HN=Object.freeze(Object.defineProperty({__proto__:null,default:_X},Symbol.toStringTag,{value:"Module"})),bX={class:"flex-between"},wX={class:"flex align-center"},EX={class:"mr-4"},OX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=_=>_.ctrlKey===!0?(_.preventDefault(),!0):(_.stopPropagation(),!0),a={reply_type:"content",content:"",fields:[],is_result:!0},r=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",a),t.nodeModel.properties.node_data),set:_=>{me.set(t.nodeModel.properties,"node_data",_)}});function s(_){me.set(t.nodeModel.properties.node_data,"content",_)}const c=je(),v=je(),f=()=>{var _;return Promise.all([v.value?v.value.validate():Promise.resolve(""),(_=c.value)==null?void 0:_.validate()]).catch(g=>Promise.reject({node:t.nodeModel,errMessage:g}))};return Ir(()=>{var _;typeof((_=t.nodeModel.properties.node_data)==null?void 0:_.is_result)>"u"&&vc(t.nodeModel)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),me.set(t.nodeModel,"validate",f)}),(_,g)=>{const b=J("el-option"),x=J("el-select"),A=J("MdEditorMagnify"),S=J("el-form-item"),E=J("AppIcon"),T=J("el-tooltip"),I=J("el-switch"),R=J("el-form"),U=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(U,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(R,{onSubmit:g[5]||(g[5]=Xt(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:c},{default:P(()=>[k(S,{label:_.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:P(()=>[K("div",bX,[K("span",null,de(_.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),k(x,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":g[0]||(g[0]=L=>r.value.reply_type=L),size:"small",style:{width:"85px"}},{default:P(()=>[k(b,{label:_.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(b,{label:_.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[r.value.reply_type==="content"?(_e(),at(A,{key:0,onWheel:n,title:_.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":g[1]||(g[1]=L=>r.value.content=L),style:{height:"150px"},onSubmitDialog:s},null,8,["title","modelValue"])):(_e(),at(oo,{key:1,ref_key:"nodeCascaderRef",ref:v,nodeModel:e.nodeModel,class:"w-full",placeholder:_.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.fields,"onUpdate:modelValue":g[2]||(g[2]=L=>r.value.fields=L)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),k(S,{label:_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:g[4]||(g[4]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",wX,[K("div",EX,[K("span",null,de(_.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(T,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(_.$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":g[3]||(g[3]=L=>r.value.is_result=L)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class xX extends ho{constructor(t){super(t,OX)}}const SX={type:"reply-node",model:vo,view:xX},XN=Object.freeze(Object.defineProperty({__proto__:null,default:SX},Symbol.toStringTag,{value:"Module"})),AX={class:"flex align-center"},MX={class:"mr-4"},kX={class:"dialog-footer"},TX=Vn({__name:"ParamSettingDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je({top_n:3,similarity:0,max_paragraph_char_number:5e3}),c=je(!1),v=je(!1);Zm(c,g=>{g||(s.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const f=g=>{s.value={...s.value,...me.cloneDeep(g)},c.value=!0},_=()=>{var g;(g=r==null?void 0:r.value)==null||g.validate((b,x)=>{b&&(a("refresh",me.cloneDeep(s.value)),c.value=!1)})};return t({open:f}),(g,b)=>{const x=J("AppIcon"),A=J("el-tooltip"),S=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"),L=J("el-button"),D=J("el-dialog");return _e(),at(D,{"align-center":"",title:g.$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(()=>[K("span",kX,[k(L,{onClick:b[3]||(b[3]=Xt(W=>c.value=!1,["prevent"]))},{default:P(()=>[et(de(g.$t("common.cancel")),1)]),_:1}),k(L,{type:"primary",onClick:b[4]||(b[4]=W=>_()),loading:v.value},{default:P(()=>[et(de(g.$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(()=>[K("div",AX,[K("span",MX,"Score "+de(g.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),k(A,{effect:"dark",content:g.$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(S,{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:g.$t("views.application.dialog.topReferences")},{default:P(()=>[k(S,{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:g.$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"])}}}),NX={class:"flex-between"},PX={class:"flex-between"},CX={class:"w-full"},RX={class:"flex-between"},jX={class:"flex-between"},DX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(),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=je(null),_=()=>{var L;(L=c.value)==null||L.open(x.value.reranker_setting)},g=L=>{const D=me.cloneDeep(s.nodeModel.properties.node_data.reranker_reference_list);D.splice(L,1),me.set(s.nodeModel.properties.node_data,"reranker_reference_list",D)},b=L=>L.ctrlKey===!0?(L.preventDefault(),!0):(L.stopPropagation(),!0),x=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",v),s.nodeModel.properties.node_data),set:L=>{me.set(s.nodeModel.properties,"node_data",L)}});function A(L){me.set(s.nodeModel.properties.node_data,"reranker_setting",L)}const S=t();function E(){var D;const L=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(D=S.value)==null?void 0:D.workspace_id}:{model_type:"RERANKER"};po({type:"model",systemType:r.value}).getSelectModelList(L).then(W=>{f.value=me.groupBy(W==null?void 0:W.data,"provider")})}const T=()=>{const L=me.cloneDeep(s.nodeModel.properties.node_data.reranker_reference_list);L.push([]),me.set(s.nodeModel.properties.node_data,"reranker_reference_list",L)},I=je(),R=je(),U=()=>{var L;return Promise.all([R.value?R.value.validate():Promise.resolve(""),(L=I.value)==null?void 0:L.validate()]).catch(D=>Promise.reject({node:s.nodeModel,errMessage:D}))};return Ir(()=>{E(),x.value.show_knowledge=x.value.show_knowledge?x.value.show_knowledge:!1,me.set(s.nodeModel,"validate",U)}),(L,D)=>{const W=J("AppIcon"),Y=J("el-button"),B=J("el-form-item"),V=J("el-col"),z=J("el-row"),H=J("ModelSelect"),q=J("el-switch"),ee=J("el-form"),ue=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(ue,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(ee,{onSubmit:D[4]||(D[4]=Xt(()=>{},["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:L.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label"),prop:"reranker_reference_list",rules:{type:"array",message:L.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),trigger:"change",required:!0}},{label:P(()=>[K("div",NX,[K("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),D[5]||(D[5]=K("span",{class:"color-danger"},"*",-1))]),k(Y,{onClick:T,link:"",type:"primary"},{default:P(()=>[k(W,{iconName:"app-add-outlined"})]),_:1})])]),default:P(()=>[(_e(!0),Ht(ar,null,Gr(x.value.reranker_reference_list,(ie,be)=>(_e(),at(z,{gutter:8,style:{"margin-bottom":"8px"},key:be,class:"w-full"},{default:P(()=>[k(V,{span:22},{default:P(()=>[k(B,{prop:"reranker_reference_list."+be,rules:{type:"array",required:!0,message:L.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:P(()=>[(_e(),at(oo,{key:be,nodeModel:e.nodeModel,class:"w-full",placeholder:L.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:x.value.reranker_reference_list[be],"onUpdate:modelValue":De=>x.value.reranker_reference_list[be]=De},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),k(V,{span:2},{default:P(()=>[k(Y,{link:"",type:"info",onClick:De=>g(be)},{default:P(()=>[k(W,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),k(B,{label:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:P(()=>[K("div",PX,[K("span",null,de(L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(Y,{type:"primary",link:"",onClick:_},{default:P(()=>[k(W,{iconName:"app-setting"})]),_:1})])]),default:P(()=>[K("div",CX,[k(z,null,{default:P(()=>[k(V,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(" Score "+de(L.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),k(V,{span:12,class:"lighter"},{default:P(()=>{var ie;return[et(de((ie=x.value.reranker_setting.similarity)==null?void 0:ie.toFixed(3)),1)]}),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(L.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),k(V,{span:12,class:"lighter"},{default:P(()=>[et(de(x.value.reranker_setting.top_n),1)]),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),k(V,{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:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),prop:"question_reference_address",rules:{message:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:P(()=>[K("div",RX,[K("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),D[6]||(D[6]=K("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:R,nodeModel:e.nodeModel,class:"w-full",placeholder:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:x.value.question_reference_address,"onUpdate:modelValue":D[0]||(D[0]=ie=>x.value.question_reference_address=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(B,{label:L.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label"),prop:"reranker_model_id",rules:{required:!0,message:L.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),trigger:"change"}},{label:P(()=>[K("div",jX,[K("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),D[7]||(D[7]=K("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(H,{onWheel:b,teleported:!1,modelValue:x.value.reranker_model_id,"onUpdate:modelValue":D[1]||(D[1]=ie=>x.value.reranker_model_id=ie),placeholder:L.$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:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:D[3]||(D[3]=Xt(()=>{},["prevent"]))},{default:P(()=>[k(q,{size:"small",modelValue:x.value.show_knowledge,"onUpdate:modelValue":D[2]||(D[2]=ie=>x.value.show_knowledge=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(TX,{ref_key:"ParamSettingDialogRef",ref:c,onRefresh:A},null,512)]),_:1},8,["nodeModel"])}}}),IX=Kf(DX,[["__scopeId","data-v-298ea2ea"]]);class LX extends ho{constructor(t){super(t,IX)}}const $X={type:"reranker-node",model:vo,view:LX},qN=Object.freeze(Object.defineProperty({__proto__:null,default:$X},Symbol.toStringTag,{value:"Module"})),FX={class:"title-decoration-1 mb-8"},BX={class:"flex-between"},VX={key:0,class:"w-full"},UX={class:"flex align-center",style:{"line-height":"20px"}},WX=["title"],GX={key:1,class:"w-full"},zX={class:"flex-between"},HX={class:"flex align-center"},XX={class:"flex align-center"},qX={class:"w-full"},YX={key:1},KX={class:"flex align-center mb-8"},ZX=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Li(),n=e,a=je(),r=je(),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||me.set(n.nodeModel.properties,"node_data",v),n.nodeModel.properties.node_data),set:L=>{me.set(n.nodeModel.properties,"node_data",L)}}),_=je(),g=je(),b=je([]),x=je(!1);function A(L){const D=n.nodeModel.properties.node_data.knowledge_id_list.filter(W=>W!==L);me.set(n.nodeModel.properties.node_data,"knowledge_id_list",D)}function S(L){me.set(n.nodeModel.properties.node_data,"knowledge_id_list",L.map(D=>D.id)),me.set(n.nodeModel.properties.node_data,"knowledge_list",L),b.value=L}function E(){g.value&&g.value.open(f.value.knowledge_id_list)}function T(){const L=me.cloneDeep(f.value.search_condition_list);L.push({key:"",compare:"contain",value:""}),me.set(f.value,"search_condition_list",L)}function I(L){const D=me.cloneDeep(f.value.search_condition_list);D.splice(L,1),me.set(f.value,"search_condition_list",D)}function R(L){if(L.length===0){me.set(f.value,"knowledge_tags",[]);return}po({type:"knowledge",systemType:c.value}).getAllTags({knowledge_ids:L},{}).then(D=>{me.set(f.value,"knowledge_tags",D.data)})}const U=()=>{var L,D,W;return Promise.all([(L=a.value)==null?void 0:L.validate(),(D=r.value)==null?void 0:D.validate(),(W=_.value)==null?void 0:W.validate()]).catch(Y=>Promise.reject({node:n.nodeModel,errMessage:Y}))};return Ir(()=>{b.value=n.nodeModel.properties.node_data.knowledge_list,me.set(n.nodeModel,"validate",U)}),(L,D)=>{const W=J("el-button"),Y=J("el-option"),B=J("el-select"),V=J("el-text"),z=J("KnowledgeIcon"),H=J("Close"),q=J("el-icon"),ee=J("el-form-item"),ue=J("el-tooltip"),ie=J("el-radio"),be=J("el-radio-group"),De=J("el-col"),Ne=J("el-input"),Ae=J("el-row"),Te=J("el-form"),rt=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",FX,de(L.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Te,{onSubmit:D[8]||(D[8]=Xt(()=>{},["prevent"])),model:f.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:_},{default:P(()=>[k(ee,null,{label:P(()=>[K("div",BX,[K("span",null,de(L.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),K("span",null,[f.value.search_scope_type==="custom"?(_e(),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":D[0]||(D[0]=tt=>f.value.search_scope_type=tt),style:{width:"85px"}},{default:P(()=>[k(Y,{label:L.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(Y,{label:L.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:P(()=>{var tt;return[f.value.search_scope_type==="custom"?(_e(),Ht("div",VX,[((tt=f.value.knowledge_id_list)==null?void 0:tt.length)===0?(_e(),at(V,{key:0,type:"info"},{default:P(()=>[et(de(L.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(_e(!0),Ht(ar,{key:1},Gr(f.value.knowledge_id_list,(Be,dt)=>{var St,He,Qt;return _e(),Ht("div",{key:dt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[K("div",UX,[k(z,{type:(St=_n(cl)(b.value,Be,"id"))==null?void 0:St.type,class:"mr-8",size:20},null,8,["type"]),K("div",{class:"ellipsis",title:(He=_n(cl)(b.value,Be,"id"))==null?void 0:He.name},de((Qt=_n(cl)(b.value,Be,"id"))==null?void 0:Qt.name),9,WX)]),k(W,{text:"",onClick:Fe=>A(Be)},{default:P(()=>[k(q,null,{default:P(()=>[k(H)]),_:1})]),_:1},8,["onClick"])])}),128))])):(_e(),Ht("div",GX,[k(ee,{prop:"search_scope_reference",rules:{message:L.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[K("div",zX,[K("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),D[9]||(D[9]=K("span",{class:"color-danger"},"*",-1))]),K("span",null,[k(B,{teleported:!1,size:"small",modelValue:f.value.search_scope_source,"onUpdate:modelValue":D[1]||(D[1]=Be=>f.value.search_scope_source=Be),style:{width:"95px"},onChange:D[2]||(D[2]=Be=>f.value.search_scope_reference=[])},{default:P(()=>[k(Y,{label:L.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(Y,{label:L.$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:L.$t("views.applicationWorkflow.variable.placeholder"),modelValue:f.value.search_scope_reference,"onUpdate:modelValue":D[3]||(D[3]=Be=>f.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(ee,{label:L.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:P(()=>[k(be,{modelValue:f.value.search_mode,"onUpdate:modelValue":D[4]||(D[4]=tt=>f.value.search_mode=tt)},{default:P(()=>[k(ie,{value:"auto"},{default:P(()=>[K("span",HX,[et(de(L.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),k(ue,{content:L.$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"?(_e(),at(ie,{key:0,value:"custom"},{default:P(()=>[K("span",XX,[et(de(L.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),k(ue,{c:"",content:L.$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"]),K("div",qX,[f.value.search_mode==="auto"?(_e(),at(ee,{key:0,prop:"question_reference",rules:{message:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:P(()=>[K("span",null,[et(de(L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),D[10]||(D[10]=K("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:L.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:f.value.question_reference,"onUpdate:modelValue":D[5]||(D[5]=tt=>f.value.question_reference=tt)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(_e(),Ht("div",YX,[K("div",KX,[k(V,{type:"info",class:"lighter",size:"small"},{default:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),k(B,{modelValue:f.value.search_condition_type,"onUpdate:modelValue":D[6]||(D[6]=tt=>f.value.search_condition_type=tt),size:"small",style:{width:"60px",margin:"0 8px"}},{default:P(()=>[k(Y,{label:L.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(Y,{label:L.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),k(V,{type:"info",class:"lighter",size:"small"},{default:P(()=>[et(de(L.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(_e(!0),Ht(ar,null,Gr(f.value.search_condition_list,(tt,Be)=>(_e(),Ht("div",{key:Be},[k(Ae,{gutter:8,class:"mb-8"},{default:P(()=>[k(De,{span:8},{default:P(()=>[k(B,{modelValue:tt.key,"onUpdate:modelValue":dt=>tt.key=dt,filterable:"",onFocus:D[7]||(D[7]=dt=>R(f.value.knowledge_id_list))},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(f.value.knowledge_tags,dt=>(_e(),at(Y,{key:dt,label:dt.key,value:dt.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(De,{span:7},{default:P(()=>[k(B,{modelValue:tt.compare,"onUpdate:modelValue":dt=>tt.compare=dt},{default:P(()=>[(_e(),Ht(ar,null,Gr(s,dt=>k(Y,{key:dt.value,value:dt.value,label:dt.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(De,{span:8},{default:P(()=>[k(Ne,{modelValue:tt.value,"onUpdate:modelValue":dt=>tt.value=dt,placeholder:L.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),k(De,{span:1},{default:P(()=>[k(W,{link:"",onClick:dt=>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(L.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),k(sk,{ref_key:"AddKnowledgeDialogRef",ref:g,onAddData:S,data:b.value,loading:x.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class JX extends ho{constructor(t){super(t,ZX)}}const QX={type:"search-document-node",model:vo,view:JX},YN=Object.freeze(Object.defineProperty({__proto__:null,default:QX},Symbol.toStringTag,{value:"Module"})),eq={class:"title-decoration-1 mb-8"},tq={class:"flex-between"},nq={key:0,class:"w-full"},rq={class:"flex align-center",style:{"line-height":"20px"}},oq=["title"],iq={key:1,class:"w-full"},aq={class:"flex-between"},lq={class:"flex-between"},sq={class:"w-full"},uq={class:"flex-between"},cq={class:"flex-between"},dq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=je(),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||me.set(t.nodeModel.properties,"node_data",a),t.nodeModel.properties.node_data),set:T=>{me.set(t.nodeModel.properties,"node_data",T)}}),s=je(),c=je(),v=je(),f=je([]),_=je(!1);function g(T){me.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);me.set(t.nodeModel.properties.node_data,"knowledge_id_list",I)}function A(T){me.set(t.nodeModel.properties.node_data,"knowledge_id_list",T.map(I=>I.id)),me.set(t.nodeModel.properties.node_data,"knowledge_list",T),f.value=T}function S(){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:[],me.set(t.nodeModel,"validate",E)}),(T,I)=>{const R=J("el-button"),U=J("el-option"),L=J("el-select"),D=J("el-text"),W=J("KnowledgeIcon"),Y=J("Close"),B=J("el-icon"),V=J("el-form-item"),z=J("el-col"),H=J("el-row"),q=J("el-switch"),ee=J("el-form"),ue=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",eq,de(T.$t("views.applicationWorkflow.nodeSetting")),1),k(ue,{shadow:"never",class:"card-never"},{default:P(()=>[k(ee,{onSubmit:I[7]||(I[7]=Xt(()=>{},["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(V,null,{label:P(()=>[K("div",tq,[K("span",null,de(T.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),K("span",null,[r.value.search_scope_type==="custom"?(_e(),at(R,{key:0,type:"primary",link:"",onClick:S},{default:P(()=>[k(Zp,{iconName:"app-add-outlined"})]),_:1})):pn("",!0),k(L,{teleported:!1,size:"small",modelValue:r.value.search_scope_type,"onUpdate:modelValue":I[0]||(I[0]=ie=>r.value.search_scope_type=ie),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 ie;return[r.value.search_scope_type==="custom"?(_e(),Ht("div",nq,[((ie=r.value.knowledge_id_list)==null?void 0:ie.length)===0?(_e(),at(D,{key:0,type:"info"},{default:P(()=>[et(de(T.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(_e(!0),Ht(ar,{key:1},Gr(r.value.knowledge_id_list,(be,De)=>{var Ne,Ae,Te;return _e(),Ht("div",{key:De,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[K("div",rq,[k(W,{type:(Ne=_n(cl)(f.value,be,"id"))==null?void 0:Ne.type,class:"mr-8",size:20},null,8,["type"]),K("div",{class:"ellipsis",title:(Ae=_n(cl)(f.value,be,"id"))==null?void 0:Ae.name},de((Te=_n(cl)(f.value,be,"id"))==null?void 0:Te.name),9,oq)]),k(R,{text:"",onClick:rt=>x(be)},{default:P(()=>[k(B,null,{default:P(()=>[k(Y)]),_:1})]),_:1},8,["onClick"])])}),128))])):(_e(),Ht("div",iq,[k(V,{prop:"search_scope_reference",rules:{message:T.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:P(()=>[K("div",aq,[K("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),I[8]||(I[8]=K("span",{class:"color-danger"},"*",-1))]),K("span",null,[k(L,{teleported:!1,size:"small",modelValue:r.value.search_scope_source,"onUpdate:modelValue":I[1]||(I[1]=be=>r.value.search_scope_source=be),style:{width:"95px"},onChange:I[2]||(I[2]=be=>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]=be=>r.value.search_scope_reference=be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(V,{label:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:P(()=>[K("div",lq,[K("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(()=>[K("div",sq,[k(H,null,{default:P(()=>[k(z,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:P(()=>[et(de(T.$t(_n(GD)[r.value.knowledge_setting.search_mode])),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:P(()=>{var ie;return[et(de((ie=r.value.knowledge_setting.similarity)==null?void 0:ie.toFixed(3)),1)]}),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.topReferences")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:P(()=>[et(de(r.value.knowledge_setting.top_n),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:P(()=>[et(de(T.$t("views.application.dialog.maxCharacters")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:P(()=>[et(de(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(V,{prop:"question_reference_address",rules:{message:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:P(()=>[K("div",uq,[K("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),I[9]||(I[9]=K("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]=ie=>r.value.question_reference_address=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(V,{prop:"show_knowledge",rules:{message:T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:I[6]||(I[6]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",cq,[K("span",null,[et(de(T.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"))+" ",1),I[10]||(I[10]=K("span",{class:"color-danger"},"*",-1))])])]),default:P(()=>[k(q,{size:"small",modelValue:r.value.show_knowledge,"onUpdate:modelValue":I[5]||(I[5]=ie=>r.value.show_knowledge=ie)},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(tI,{ref_key:"ParamSettingDialogRef",ref:c,onRefresh:g},null,512),k(sk,{ref_key:"AddknowledgeDialogRef",ref:v,onAddData:A,data:f.value,loading:_.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class fq extends ho{constructor(t){super(t,dq)}}const pq={type:"search-knowledge-node",model:vo,view:fq},KN=Object.freeze(Object.defineProperty({__proto__:null,default:pq},Symbol.toStringTag,{value:"Module"})),hq={class:"title-decoration-1 mb-8"},vq={class:"flex-between w-full"},mq={class:"flex-between w-full"},yq={class:"flex align-center"},gq={class:"mr-4"},_q=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=je(),g=()=>{var U;return Promise.all([_.value?_.value.validate():Promise.resolve(""),(U=f.value)==null?void 0:U.validate()]).catch(L=>Promise.reject({node:s.nodeModel,errMessage:L}))},b=U=>U.ctrlKey===!0?(U.preventDefault(),!0):(U.stopPropagation(),!0),x={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},A=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:U=>{me.set(s.nodeModel.properties,"node_data",U)}}),S=()=>{var L;const U=A.value.stt_model_id;if(!U){zf(yt("views.application.form.voiceInput.requiredMessage"));return}(L=v.value)==null||L.open(U,a,A.value.model_params_setting)},E=U=>{me.set(s.nodeModel.properties.node_data,"model_params_setting",U)};function T(U){var L;U?(L=v.value)==null||L.reset_default(U,a):E({})}const I=t();function R(){var L;const U=r.value==="systemManage"?{model_type:"STT",workspace_id:(L=I.value)==null?void 0:L.workspace_id}:{model_type:"STT"};po({type:"model",systemType:r.value}).getSelectModelList(U).then(D=>{c.value=me.groupBy(D==null?void 0:D.data,"provider")})}return Ir(()=>{R(),me.set(s.nodeModel,"validate",g)}),(U,L)=>{const D=J("AppIcon"),W=J("el-button"),Y=J("ModelSelect"),B=J("el-form-item"),V=J("el-tooltip"),z=J("el-switch"),H=J("el-form"),q=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",hq,de(U.$t("views.applicationWorkflow.nodeSetting")),1),k(q,{shadow:"never",class:"card-never"},{default:P(()=>[k(H,{onSubmit:L[4]||(L[4]=Xt(()=>{},["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(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(()=>[K("div",vq,[K("div",null,[K("span",null,[et(de(U.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),L[5]||(L[5]=K("span",{class:"color-danger"},"*",-1))])]),k(W,{type:"primary",link:"",onClick:S,disabled:!A.value.stt_model_id,class:"mr-4"},{default:P(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(Y,{onWheel:b,teleported:!1,onChange:T,modelValue:A.value.stt_model_id,"onUpdate:modelValue":L[0]||(L[0]=ee=>A.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(()=>[K("div",mq,[K("div",null,[K("span",null,[et(de(U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),L[6]||(L[6]=K("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:_,nodeModel:e.nodeModel,class:"w-full",placeholder:U.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:A.value.audio_list,"onUpdate:modelValue":L[1]||(L[1]=ee=>A.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:L[3]||(L[3]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",yq,[K("div",gq,[K("span",null,de(U.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(V,{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(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(z,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":L[2]||(L[2]=ee=>A.value.is_result=ee)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(nI,{ref_key:"STTModeParamSettingDialogRef",ref:v,onRefresh:E},null,512)]),_:1},8,["node-model"])}}});class bq extends ho{constructor(t){super(t,_q)}}const wq={type:"speech-to-text-node",model:vo,view:bq},ZN=Object.freeze(Object.defineProperty({__proto__:null,default:wq},Symbol.toStringTag,{value:"Module"})),Eq={class:"title-decoration-1 mb-8"},Oq={class:"break-all"},xq={class:"title-decoration-1 mb-8"},Sq={class:"break-all"},Aq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=je(!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(g=>g.id==="base-node").map(g=>me.cloneDeep(g.properties.user_input_field_list)).reduce((g,b)=>[...g,...b],[]).map(g=>g.label&&g.label.input_type==="TooltipLabel"?{label:g.label.label,value:g.field||g.variable}:{label:g.label||g.name,value:g.field||g.variable}),_=t.nodeModel.graphModel.nodes.filter(g=>g.id==="base-node").map(g=>me.cloneDeep(g.properties.api_input_field_list)).reduce((g,b)=>[...g,...b],[]).map(g=>({label:g.name||g.variable,value:g.variable}));return[...f,..._]},s=()=>{const f=r();me.set(t.nodeModel.properties.config,"globalFields",[...a,...f])},c=()=>{const f=t.nodeModel.graphModel.nodes.filter(_=>_.id==="base-node").map(_=>me.cloneDeep(_.properties.chat_input_field_list)).reduce((_,g)=>[..._,...g],[]).map(_=>({label:_.label,value:_.field}));me.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=me.cloneDeep(t.nodeModel.properties.config.fields);const _=t.nodeModel.graphModel.nodes.filter(b=>b.id==="base-node").filter(b=>b.properties.node_data.file_upload_enable).map(b=>me.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"),_.length===0){me.set(t.nodeModel.properties.config,"fields",f);return}const g=[];_[0].document&&g.push({label:yt("common.fileUpload.document"),value:"document"}),_[0].image&&g.push({label:yt("common.fileUpload.image"),value:"image"}),_[0].audio&&g.push({label:yt("common.fileUpload.audio"),value:"audio"}),_[0].video&&g.push({label:yt("common.fileUpload.video"),value:"video"}),_[0].other&&g.push({label:yt("common.fileUpload.other"),value:"other"}),me.set(t.nodeModel.properties.config,"fields",[...f,...g])};return t.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",v),Ir(()=>{c(),s(),v()}),(f,_)=>{const g=J("AppIcon"),b=J("el-button"),x=J("el-tooltip");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>{var A;return[K("h5",Eq,de(f.$t("views.applicationWorkflow.variable.global")),1),(_e(!0),Ht(ar,null,Gr(e.nodeModel.properties.config.globalFields,(S,E)=>(_e(),Ht("div",{key:E,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:_[0]||(_[0]=T=>n.value=!0),onMouseleave:_[1]||(_[1]=T=>n.value=!1)},[K("span",Oq,de(S.label)+" "+de("{"+S.value+"}"),1),n.value===!0?(_e(),at(x,{key:0,effect:"dark",content:f.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(b,{link:"",onClick:T=>_n($m)(`{{global.${S.value}}}`),style:{padding:"0"}},{default:P(()=>[k(g,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],32))),128)),(A=e.nodeModel.properties.config.chatFields)!=null&&A.length?(_e(),Ht(ar,{key:0},[K("h5",xq,de(f.$t("views.applicationWorkflow.variable.chat")),1),(_e(!0),Ht(ar,null,Gr(e.nodeModel.properties.config.chatFields||[],(S,E)=>(_e(),Ht("div",{key:E,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:_[2]||(_[2]=T=>n.value=!0),onMouseleave:_[3]||(_[3]=T=>n.value=!1)},[K("span",Sq,de(S.label)+" "+de("{"+S.value+"}"),1),n.value===!0?(_e(),at(x,{key:0,effect:"dark",content:f.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(b,{link:"",onClick:T=>_n($m)(`{{chat.${S.value}}}`),style:{padding:"0"}},{default:P(()=>[k(g,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],32))),128))],64)):pn("",!0)]}),_:1},8,["nodeModel"])}}});class Mq extends ho{constructor(t){super(t,Aq)}}const kq={type:"start-node",model:vo,view:Mq},JN=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-between w-full"},Cq={class:"flex align-center"},Rq={class:"mr-4"},jq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(),v=je(null),f=je(),_=je(),g=()=>{var R;return Promise.all([_.value?_.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:{}},A=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:R=>{me.set(s.nodeModel.properties,"node_data",R)}}),S=t();function E(){var U;const R=r.value==="systemManage"?{model_type:"TTS",workspace_id:(U=S.value)==null?void 0:U.workspace_id}:{model_type:"TTS"};po({type:"model",systemType:r.value}).getSelectModelList(R).then(L=>{v.value=me.groupBy(L==null?void 0:L.data,"provider")})}const T=()=>{var U;const R=A.value.tts_model_id;if(!R){zf(yt("views.application.form.voicePlay.requiredMessage"));return}(U=c.value)==null||U.open(R,a,A.value.model_params_setting)},I=R=>{A.value.model_params_setting=R};return Ir(()=>{E(),me.set(s.nodeModel,"validate",g)}),(R,U)=>{const L=J("AppIcon"),D=J("el-button"),W=J("ModelSelect"),Y=J("el-form-item"),B=J("el-tooltip"),V=J("el-switch"),z=J("el-form"),H=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",Tq,de(R.$t("views.applicationWorkflow.nodeSetting")),1),k(H,{shadow:"never",class:"card-never"},{default:P(()=>[k(z,{onSubmit:U[4]||(U[4]=Xt(()=>{},["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(Y,{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(()=>[K("div",Nq,[K("div",null,[K("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),U[5]||(U[5]=K("span",{class:"color-danger"},"*",-1))])]),k(D,{type:"primary",link:"",onClick:T,disabled:!A.value.tts_model_id,class:"mr-4"},{default:P(()=>[k(L,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(W,{onWheel:b,teleported:!1,modelValue:A.value.tts_model_id,"onUpdate:modelValue":U[0]||(U[0]=q=>A.value.tts_model_id=q),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(Y,{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(()=>[K("div",Pq,[K("div",null,[K("span",null,[et(de(R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),U[6]||(U[6]=K("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:_,nodeModel:e.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:A.value.content_list,"onUpdate:modelValue":U[1]||(U[1]=q=>A.value.content_list=q)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(Y,{label:R.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:U[3]||(U[3]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",Cq,[K("div",Rq,[K("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(L,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(V,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":U[2]||(U[2]=q=>A.value.is_result=q)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(lk,{ref_key:"TTSModeParamSettingDialogRef",ref:c,onRefresh:I},null,512)]),_:1},8,["node-model"])}}});class Dq extends ho{constructor(t){super(t,jq)}}const Iq={type:"text-to-speech-node",model:vo,view:Dq},QN=Object.freeze(Object.defineProperty({__proto__:null,default:Iq},Symbol.toStringTag,{value:"Module"})),Lq={class:"title-decoration-1 mb-8"},$q={class:"flex-between w-full"},Fq={class:"flex align-center"},Bq={class:"mr-4"},Vq={class:"flex align-center"},Uq={class:"mr-4"},Wq={class:"flex align-center"},Gq={class:"mr-4"},zq=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=()=>{var D;return(D=f.value)==null?void 0:D.validate().catch(W=>Promise.reject({node:s.nodeModel,errMessage:W}))},g=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.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},A=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",x),s.nodeModel.properties.node_data),set:D=>{me.set(s.nodeModel.properties,"node_data",D)}}),S=t();function E(){var W;const D=r.value==="systemManage"?{model_type:"TTV",workspace_id:(W=S.value)==null?void 0:W.workspace_id}:{model_type:"TTV"};po({type:"model",systemType:r.value}).getSelectModelList(D).then(Y=>{c.value=me.groupBy(Y==null?void 0:Y.data,"provider")})}const T=()=>{Gf(()=>{var D;A.value.model_id?(D=v.value)==null||D.reset_default(A.value.model_id,a):R({})})},I=D=>{var W;D&&((W=v.value)==null||W.open(D,a,A.value.model_params_setting))};function R(D){me.set(s.nodeModel.properties.node_data,"model_params_setting",D)}function U(D){me.set(s.nodeModel.properties.node_data,"prompt",D)}function L(D){me.set(s.nodeModel.properties.node_data,"negative_prompt",D)}return Ir(()=>{E(),me.set(s.nodeModel,"validate",_)}),(D,W)=>{const Y=J("AppIcon"),B=J("el-button"),V=J("ModelSelect"),z=J("el-form-item"),H=J("el-tooltip"),q=J("MdEditorMagnify"),ee=J("el-switch"),ue=J("el-form"),ie=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",Lq,de(D.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never"},{default:P(()=>[k(ue,{onSubmit:W[6]||(W[6]=Xt(()=>{},["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(z,{label:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:P(()=>[K("div",$q,[K("div",null,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),W[7]||(W[7]=K("span",{class:"color-danger"},"*",-1))])]),k(B,{disabled:!A.value.model_id,type:"primary",link:"",onClick:W[0]||(W[0]=be=>I(A.value.model_id)),onRefreshForm:R},{default:P(()=>[k(Y,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(V,{onChange:T,onWheel:g,onFocus:E,teleported:!1,modelValue:A.value.model_id,"onUpdate:modelValue":W[1]||(W[1]=be=>A.value.model_id=be),placeholder:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:c.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",Fq,[K("div",Bq,[K("span",null,[et(de(D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),W[8]||(W[8]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:A.value.prompt,"onUpdate:modelValue":W[2]||(W[2]=be=>A.value.prompt=be),style:{height:"150px"},onSubmitDialog:U},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:D.$t("common.prompt.placeholder"),trigger:"blur"}},{label:P(()=>[K("div",Vq,[K("div",Uq,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(q,{onWheel:g,title:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:A.value.negative_prompt,"onUpdate:modelValue":W[3]||(W[3]=be=>A.value.negative_prompt=be),placeholder:D.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:L},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:W[5]||(W[5]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",Wq,[K("div",Gq,[K("span",null,de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(H,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(D.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:P(()=>[k(Y,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ee,{size:"small",modelValue:A.value.is_result,"onUpdate:modelValue":W[4]||(W[4]=be=>A.value.is_result=be)},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 Hq extends ho{constructor(t){super(t,zq)}}const Xq={type:"text-to-video-node",model:vo,view:Hq},eP=Object.freeze(Object.defineProperty({__proto__:null,default:Xq},Symbol.toStringTag,{value:"Module"})),qq={class:"title-decoration-1 mb-16"},Yq={class:"lighter mb-8"},Kq={key:0},Zq={class:"flex-between"},Jq={class:"flex align-center"},Qq={class:"mr-4"},eY={key:1,class:"color-danger"},tY={class:"flex align-center"},nY={class:"mr-4"},rY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=Li(),a=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=je(),s={input_field_list:[],is_result:!1},c=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:g=>{me.set(t.nodeModel.properties,"node_data",g)}}),v=je(),f=()=>{var g;return(g=v.value)==null?void 0:g.validate().catch(b=>Promise.reject({node:t.nodeModel,errMessage:b}))},_=()=>{if(!t.nodeModel.properties.node_data.tool_lib_id){me.set(t.nodeModel.properties,"status",500);return}po({type:"tool",systemType:a.value}).getToolById(t.nodeModel.properties.node_data.tool_lib_id).then(g=>{const b=t.nodeModel.properties.node_data.input_field_list,x=g.data.input_field_list.map(A=>{const S=b.find(E=>E.name==A.name);return S&&S.source==A.source?{...A,value:JSON.parse(JSON.stringify(S.value))}:{...A,value:A.source=="reference"?[]:""}});me.set(t.nodeModel.properties.node_data,"input_field_list",x),me.set(t.nodeModel.properties,"status",g.data.is_active?200:500)}).catch(()=>{me.set(t.nodeModel.properties,"status",500)})};return Ir(()=>{var g;typeof((g=t.nodeModel.properties.node_data)==null?void 0:g.is_result)>"u"&&vc(t.nodeModel)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),_(),me.set(t.nodeModel,"validate",f)}),(g,b)=>{const x=J("auto-tooltip"),A=J("AppIcon"),S=J("el-tooltip"),E=J("el-tag"),T=J("el-input"),I=J("el-form-item"),R=J("el-text"),U=J("el-card"),L=J("el-switch"),D=J("el-form");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",qq,de(g.$t("views.applicationWorkflow.nodeSetting")),1),K("h5",Yq,de(g.$t("common.param.inputParam")),1),k(D,{onSubmit:b[2]||(b[2]=Xt(()=>{},["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?(_e(),Ht("div",Kq,[(_e(!0),Ht(ar,null,Gr(c.value.input_field_list,(Y,B)=>(_e(),at(I,{key:Y.name,label:Y.name,prop:"input_field_list."+B+".value",rules:{required:Y.is_required,message:Y.source==="reference"?g.$t("views.tool.form.param.selectPlaceholder"):g.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:P(()=>[K("div",Zq,[K("div",Jq,[K("div",Qq,[k(x,{content:Y.name,style:{"max-width":"130px"}},{default:P(()=>[et(de(Y.name),1)]),_:2},1032,["content"])]),Y.desc?(_e(),at(S,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:P(()=>[et(de(Y.desc),1)]),default:P(()=>[k(A,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):pn("",!0),Y.is_required?(_e(),Ht("span",eY,"*")):pn("",!0),k(E,{type:"info",class:"info-tag ml-4"},{default:P(()=>[et(de(Y.type),1)]),_:2},1024)])])]),default:P(()=>[Y.source==="reference"?(_e(),at(oo,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:g.$t("views.tool.form.param.selectPlaceholder"),modelValue:Y.value,"onUpdate:modelValue":V=>Y.value=V},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(_e(),at(T,{key:1,modelValue:Y.value,"onUpdate:modelValue":V=>Y.value=V,placeholder:g.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(_e(),at(R,{key:1,type:"info"},{default:P(()=>[et(de(g.$t("common.noData")),1)]),_:1}))]}),_:1}),k(I,{label:g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:b[1]||(b[1]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",tY,[K("div",nY,[K("span",null,de(g.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(S,{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(A,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(L,{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 oY extends ho{constructor(t){super(t,rY)}}const iY={type:"tool-lib-node",model:vo,view:oY},tP=Object.freeze(Object.defineProperty({__proto__:null,default:iY},Symbol.toStringTag,{value:"Module"})),aY={class:"title-decoration-1 mb-16"},lY={class:"flex-between"},sY={class:"lighter mb-8"},uY={key:0},cY={class:"flex-between"},dY={class:"flex align-center"},fY={class:"mr-4"},pY={key:1,class:"color-danger"},hY={class:"lighter mb-8"},vY={key:0,class:"mb-8"},mY={class:"flex align-center"},yY={class:"mr-4"},gY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=E=>E.ctrlKey===!0?(E.preventDefault(),!0):(E.stopPropagation(),!0),a=je(),r=je(),s={code:"",input_field_list:[],is_result:!1},c=je(null),v=je(!1),f=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:E=>{me.set(t.nodeModel.properties,"node_data",E)}}),_=je(),g=()=>{var E;return(E=_.value)==null?void 0:E.validate().catch(T=>Promise.reject({node:t.nodeModel,errMessage:T}))};function b(E){me.set(t.nodeModel.properties.node_data,"code",E)}function x(E,T){typeof T<"u"&&(c.value=T),a.value.open(E)}function A(E){const T=me.cloneDeep(t.nodeModel.properties.node_data.input_field_list);T.splice(E,1),me.set(t.nodeModel.properties.node_data,"input_field_list",T)}function S(E){const T=me.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),me.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)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),me.set(t.nodeModel,"validate",g),setTimeout(()=>{v.value=!0},100)}),(E,T)=>{const I=J("AppIcon"),R=J("el-button"),U=J("auto-tooltip"),L=J("el-tooltip"),D=J("el-tag"),W=J("el-input"),Y=J("el-form-item"),B=J("el-text"),V=J("el-card"),z=J("CodemirrorEditor"),H=J("el-switch"),q=J("el-form");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",aY,de(E.$t("views.applicationWorkflow.nodeSetting")),1),K("div",lY,[K("h5",sY,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(q,{onSubmit:T[4]||(T[4]=Xt(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:_,model:f.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:P(()=>[k(V,{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?(_e(),Ht("div",uY,[(_e(!0),Ht(ar,null,Gr(f.value.input_field_list,(ue,ie)=>(_e(),at(Y,{key:ie,label:ue.name,prop:"input_field_list."+ie+".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(()=>[K("div",cY,[K("div",dY,[K("div",fY,[k(U,{content:ue.name,style:{"max-width":"130px"}},{default:P(()=>[et(de(ue.name),1)]),_:2},1032,["content"])]),ue.desc?(_e(),at(L,{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?(_e(),Ht("span",pY,"*")):pn("",!0),k(D,{type:"info",class:"info-tag ml-4"},{default:P(()=>[et(de(ue.type),1)]),_:2},1024)]),K("div",null,[k(R,{text:"",onClick:Xt(be=>x(ue,ie),["stop"])},{default:P(()=>[k(I,{iconName:"app-edit"})]),_:1},8,["onClick"]),k(R,{text:"",onClick:be=>A(ie),style:{"margin-left":"4px !important"}},{default:P(()=>[k(I,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:P(()=>[ue.source==="reference"?(_e(),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":be=>ue.value=be,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(_e(),at(W,{key:1,modelValue:ue.value,"onUpdate:modelValue":be=>ue.value=be,placeholder:E.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(_e(),at(B,{key:1,type:"info"},{default:P(()=>[et(de(E.$t("common.noData")),1)]),_:1}))]}),_:1}),K("h5",hY,de(E.$t("views.tool.form.param.code")),1),v.value?(_e(),Ht("div",vY,[k(z,{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(Y,{label:E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:T[3]||(T[3]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",mY,[K("div",yY,[K("span",null,de(E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(L,{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(H,{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(WI,{ref_key:"FieldFormDialogRef",ref:a,onRefresh:S},null,512)]),_:1},8,["nodeModel"])}}});class _Y extends ho{constructor(t){super(t,gY)}}const bY={type:"tool-node",model:vo,view:_Y},nP=Object.freeze(Object.defineProperty({__proto__:null,default:bY},Symbol.toStringTag,{value:"Module"})),wY={class:"dialog-footer"},EY=Vn({__name:"GroupFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je(null),f=je({field:"",label:""}),_=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"}]}),g=je(!1),b=(S,E)=>{S&&(f.value=me.cloneDeep(S),c.value=!0,v.value=E),g.value=!0},x=()=>{g.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},A=async S=>{S&&await S.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(S,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("el-form"),U=J("el-button"),L=J("el-dialog");return _e(),at(L,{title:c.value?S.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):S.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:g.value,"onUpdate:modelValue":E[3]||(E[3]=D=>g.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[K("span",wY,[k(U,{onClick:Xt(x,["prevent"])},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(U,{type:"primary",onClick:E[2]||(E[2]=D=>A(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:_,model:f.value,"require-asterisk-position":"right"},{default:P(()=>[k(I,{label:S.$t("common.variable"),prop:"field"},{default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=D=>f.value.field=D),maxlength:64,placeholder:S.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(I,{label:S.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=D=>f.value.label=D),maxlength:64,"show-word-limit":"",placeholder:S.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),OY={class:"title-decoration-1 mb-8"},xY={class:"flex-between"},SY={class:"flex-between mb-12"},AY=["title"],MY={class:"flex align-center",style:{"margin-right":"-3px"}},kY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je(),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||me.set(t.nodeModel.properties,"node_data",s),t.nodeModel.properties.node_data),set:I=>{me.set(t.nodeModel.properties,"node_data",I)}}),v=je([]);function f(I,R){let U=null;I&&R!==void 0&&(U={field:I.field,label:I.label}),r.value.open(U,R)}function _(I,R){for(let L=0;L<v.value.length;L++)if(v.value[L].field===I.field&&R!==L){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+I.field);return}[void 0,null].includes(R)?(v.value.push(I),S(I)):(v.value.splice(R,1,I),g(I,R)),r.value.close();const U=[...v.value.map(L=>({label:L.label,value:L.field}))];me.set(t.nodeModel.properties.config,"fields",U)}const g=(I,R)=>{const U=me.cloneDeep(c.value.group_list);U[R].field=I.field,U[R].label=I.label,c.value.group_list=U},b=I=>{const R=me.cloneDeep(c.value.group_list);R.splice(I,1),c.value.group_list=R,v.value.splice(I,1);const U=R.map(L=>({label:L.label,value:L.field}));me.set(t.nodeModel.properties.config,"fields",U)},x=I=>{const R=me.cloneDeep(c.value.group_list);R[I].variable_list.push({v_id:is(),variable:[]}),c.value.group_list=R},A=(I,R)=>{const U=me.cloneDeep(c.value.group_list);U[I].variable_list.splice(R,1),c.value.group_list=U},S=I=>{const R=me.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:L}=I;if(U===void 0||L===void 0)return;const D=me.cloneDeep(t.nodeModel.properties.node_data.group_list[R].variable_list),W={...D[U]},Y={...D[L]};D[L]=W,D[U]=Y,me.set(t.nodeModel.properties.node_data.group_list[R],"variable_list",D)}return Ir(()=>{var R;typeof((R=t.nodeModel.properties.node_data)==null?void 0:R.is_result)>"u"&&vc(t.nodeModel)&&me.set(t.nodeModel.properties.node_data,"is_result",!0),me.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}));me.set(t.nodeModel.properties.config,"fields",I)}),(I,R)=>{const U=J("el-option"),L=J("el-select"),D=J("el-form-item"),W=J("EditPen"),Y=J("el-icon"),B=J("el-button"),V=J("AppIcon"),z=J("el-col"),H=J("el-row"),q=J("el-card"),ee=J("el-form");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",OY,de(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ee,{onSubmit:R[2]||(R[2]=Xt(()=>{},["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(D,{label:I.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"),rules:{required:!0,trigger:"change"}},{label:P(()=>[K("div",xY,[K("div",null,[K("span",null,[et(de(I.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"))+" ",1),R[3]||(R[3]=K("span",{class:"color-danger"},"*",-1))])])])]),default:P(()=>[k(L,{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"]),(_e(!0),Ht(ar,null,Gr(c.value.group_list,(ue,ie)=>(_e(),Ht("div",{key:ue.id,class:"mb-8"},[k(q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[K("div",SY,[K("span",{class:"ellipsis",title:ue.label},de(ue.label),9,AY),K("div",MY,[k(B,{onClick:be=>f(ue,ie),link:""},{default:P(()=>[k(Y,null,{default:P(()=>[k(W)]),_:1})]),_:1},8,["onClick"]),k(B,{onClick:be=>b(ie),link:"",disabled:c.value.group_list.length<=1},{default:P(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),k(_n(pk),{ref_for:!0,ref:"el",modelValue:ue.variable_list,disabled:ue.variable_list.length===1,handle:".handle",animation:150,ghostClass:"ghost",onEnd:be=>T(be,ie)},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(ue.variable_list,(be,De)=>(_e(),Ht("div",{key:be.v_id,class:"drag-card"},[k(H,{class:"handle"},{default:P(()=>[k(z,{span:22,class:"flex"},{default:P(()=>[R[4]||(R[4]=K("img",{src:hk,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),k(D,{prop:`group_list.${ie}.variable_list.${De}.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:be.variable,"onUpdate:modelValue":Ne=>be.variable=Ne},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(z,{span:2},{default:P(()=>[k(B,{link:"",class:"mt-4 ml-4",disabled:ue.variable_list.length<=1,onClick:Ne=>A(ie,De)},{default:P(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),k(B,{onClick:be=>x(ie),type:"primary",size:"large",link:""},{default:P(()=>[k(V,{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(V,{iconName:"app-add-outlined",class:"mr-4"}),et(" "+de(I.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),k(EY,{ref_key:"GroupFieldDialogRef",ref:r,onRefresh:_},null,512)]),_:1},8,["nodeModel"])}}});class TY extends ho{constructor(t){super(t,kY)}getConfig(t){return t.model.properties.config}}const NY={type:"variable-aggregation-node",model:vo,view:TY},rP=Object.freeze(Object.defineProperty({__proto__:null,default:NY},Symbol.toStringTag,{value:"Module"})),PY={class:"flex-between"},CY={class:"flex-between mb-8"},RY={class:"lighter"},jY={key:0,class:"flex w-full"},DY=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("workflowMode"),n=e,a=["string","num","json","bool"],r=S=>S.ctrlKey===!0?(S.preventDefault(),!0):(S.stopPropagation(),!0),s={variable_list:[{id:is(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""}]};je(1);const c=$n({get:()=>(n.nodeModel.properties.node_data||me.set(n.nodeModel.properties,"node_data",s),n.nodeModel.properties.node_data),set:S=>{me.set(n.nodeModel.properties,"node_data",S)}}),v=je(),f=je(),_=je(),g=async()=>{var E;let S=[(E=v.value)==null?void 0:E.validate(),...f.value.map(T=>T.validate())];return _.value&&(S=[...S,...f.value.map(T=>T.validate())]),Promise.all(S).catch(T=>Promise.reject({node:n.nodeModel,errMessage:T}))};function b(){const S=me.cloneDeep(n.nodeModel.properties.node_data.variable_list),E={id:is(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};S.push(E),me.set(n.nodeModel.properties.node_data,"variable_list",S)}function x(S){const E=me.cloneDeep(n.nodeModel.properties.node_data.variable_list);E.splice(S,1),me.set(n.nodeModel.properties.node_data,"variable_list",E)}function A(S){(t==sc.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===S.fields[1]&&(S.name=T.label)}),E.properties.config.chatFields.forEach(T=>{T.value===S.fields[1]&&(S.name=T.label)})),E.id==="loop-start-node"&&E.properties.loop_input_field_list.forEach(T=>{T.field===S.fields[1]&&(S.name=T.label)})})}return Ir(()=>{var S;typeof((S=n.nodeModel.properties.node_data)==null?void 0:S.is_result)>"u"&&vc(n.nodeModel)&&me.set(n.nodeModel.properties.node_data,"is_result",!0),me.set(n.nodeModel,"validate",g)}),(S,E)=>{const T=J("AppIcon"),I=J("el-button"),R=J("el-form-item"),U=J("el-option"),L=J("el-select"),D=J("el-input"),W=J("el-input-number"),Y=J("CodemirrorEditor"),B=J("el-card"),V=J("el-form");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[k(V,{onSubmit:E[0]||(E[0]=Xt(()=>{},["prevent"])),model:c.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:v,"hide-required-asterisk":""},{default:P(()=>[(_e(!0),Ht(ar,null,Gr(c.value.variable_list,(z,H)=>(_e(),at(B,{key:z.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(R,null,{label:P(()=>[K("div",PY,[K("div",null,[et(de(S.$t("common.variable"))+" ",1),E[1]||(E[1]=K("span",{class:"color-danger"},"*",-1))]),c.value.variable_list.length>1?(_e(),at(I,{key:0,text:"",onClick:q=>x(H)},{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:S.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.fields,"onUpdate:modelValue":q=>z.fields=q,global:!0,onChange:q=>A(z)},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),K("div",CY,[K("span",RY,[et(de(S.$t("views.applicationWorkflow.nodes.variableAssignNode.assign")),1),E[2]||(E[2]=K("span",{class:"color-danger"},"*",-1))]),k(L,{teleported:!1,modelValue:z.source,"onUpdate:modelValue":q=>z.source=q,size:"small",style:{width:"85px"}},{default:P(()=>[k(U,{label:S.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(U,{label:S.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),z.source==="custom"?(_e(),Ht("div",jY,[k(L,{modelValue:z.type,"onUpdate:modelValue":q=>z.type=q,style:{"max-width":"85px"},class:"mr-8",onChange:q=>{q==="bool"?c.value.variable_list[H].value=!0:c.value.variable_list[H].value=null}},{default:P(()=>[(_e(),Ht(ar,null,Gr(a,q=>k(U,{key:q,label:q,value:q},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),z.type==="string"?(_e(),at(R,{key:0,prop:"variable_list."+H+".value",rules:{message:_n(yt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(D,{modelValue:z.value,"onUpdate:modelValue":q=>z.value=q,placeholder:S.$t("common.inputPlaceholder"),"show-word-limit":"",clearable:"",onWheel:r},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])):z.type==="num"?(_e(),at(R,{key:1,prop:"variable_list."+H+".value",rules:{message:S.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(W,{modelValue:z.value,"onUpdate:modelValue":q=>z.value=q},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):z.type==="json"?(_e(),at(R,{key:2,class:"w-full",prop:"variable_list."+H+".value",rules:[{message:S.$t("common.inputPlaceholder"),trigger:"blur",required:!0},{validator:(q,ee,ue)=>{try{JSON.parse(ee),ue()}catch{ue(new Error("Invalid JSON format"))}},trigger:"blur"}]},{default:P(()=>[k(Y,{title:"JSON",modelValue:z.value,"onUpdate:modelValue":q=>z.value=q,style:{height:"100px",width:"155px"},onSubmitDialog:q=>c.value.variable_list[H].value=q},null,8,["modelValue","onUpdate:modelValue","onSubmitDialog"])]),_:2},1032,["prop","rules"])):z.type==="bool"?(_e(),at(R,{key:3,prop:"variable_list."+H+".value",rules:{message:S.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:P(()=>[k(L,{modelValue:z.value,"onUpdate:modelValue":q=>z.value=q,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)])):(_e(),at(R,{key:1},{default:P(()=>[k(oo,{ref_for:!0,ref_key:"nodeCascaderRef2",ref:_,nodeModel:e.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.reference,"onUpdate:modelValue":q=>z.reference=q},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(S.$t("common.add")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class IY extends ho{constructor(t){super(t,DY)}}const LY={type:"variable-assign-node",model:vo,view:IY},oP=Object.freeze(Object.defineProperty({__proto__:null,default:LY},Symbol.toStringTag,{value:"Module"})),$Y={class:"flex align-center"},FY={class:"mr-4"},BY={class:"flex align-center"},VY={class:"mr-4"},UY={class:"flex align-center"},WY={class:"mr-4"},GY={class:"dialog-footer"},zY=Vn({__name:"VariableFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const a=n,r=je(),s=je(!1),c=je(!1),v=je(null),f=je({field:"",label:"",expression:""}),_=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"}]}),g=je(!1),b=(S,E)=>{S&&(f.value=me.cloneDeep(S),c.value=!0,v.value=E),g.value=!0},x=()=>{g.value=!1,c.value=!1,v.value=null,f.value={field:"",label:""}},A=async S=>{S&&await S.validate(E=>{E&&a("refresh",f.value,v.value)})};return t({open:b,close:x}),(S,E)=>{const T=J("el-input"),I=J("el-form-item"),R=J("AppIcon"),U=J("el-tooltip"),L=J("el-form"),D=J("el-button"),W=J("el-dialog");return _e(),at(W,{title:c.value?S.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):S.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:g.value,"onUpdate:modelValue":E[4]||(E[4]=Y=>g.value=Y),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":x,"append-to-body":""},{footer:P(()=>[K("span",GY,[k(D,{onClick:Xt(x,["prevent"])},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(D,{type:"primary",onClick:E[3]||(E[3]=Y=>A(r.value)),loading:s.value},{default:P(()=>[et(de(S.$t("common.save")),1)]),_:1},8,["loading"])])]),default:P(()=>[k(L,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:_,model:f.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:P(()=>[k(I,{prop:"field"},{label:P(()=>[K("div",$Y,[K("span",FY,de(S.$t("common.variable")),1),E[5]||(E[5]=K("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(T,{modelValue:f.value.field,"onUpdate:modelValue":E[0]||(E[0]=Y=>f.value.field=Y),maxlength:64,placeholder:S.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),k(I,{prop:"label"},{label:P(()=>[K("div",BY,[K("span",VY,de(S.$t("dynamicsForm.paramForm.name.label")),1),E[6]||(E[6]=K("span",{class:"color-danger"},"*",-1))])]),default:P(()=>[k(T,{modelValue:f.value.label,"onUpdate:modelValue":E[1]||(E[1]=Y=>f.value.label=Y),maxlength:64,"show-word-limit":"",placeholder:S.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),k(I,{prop:"expression"},{label:P(()=>[K("div",UY,[K("span",WY,[et(de(S.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),E[7]||(E[7]=K("span",{class:"color-danger"},"*",-1))]),k(U,{effect:"dark",content:S.$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]=Y=>f.value.expression=Y),maxlength:64,"show-word-limit":"",placeholder:S.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),HY={class:"flex-between w-full"},XY={class:"break-all lighter"},qY={class:"ml-4",style:{"margin-top":"-4px"}},YY=["title"],KY=["title"],ZY={class:"mr-4"},JY=Vn({__name:"VariableFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=je(),a=je(),r=je([]);function s(f,_){a.value.open(f,_)}function c(f){r.value.splice(f,1);const _=[{label:yt("common.result"),value:"result"},...r.value.map(g=>({label:g.label,value:g.field}))];me.set(t.nodeModel.properties.config,"fields",_),t.nodeModel.clear_next_node_field(!1)}function v(f,_){for(let b=0;b<r.value.length;b++)if(r.value[b].field===f.field&&_!==b){ei(yt("views.applicationWorkflow.tip.paramErrorMessage")+f.field);return}[void 0,null].includes(_)?r.value.push(f):r.value.splice(_,1,f),a.value.close();const g=[{label:yt("common.result"),value:"result"},...r.value.map(b=>({label:b.label,value:b.field}))];me.set(t.nodeModel.properties.config,"fields",g),t.nodeModel.clear_next_node_field(!1)}return Ir(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=me.cloneDeep(t.nodeModel.properties.node_data.variable_list)),me.set(t.nodeModel.properties.node_data,"variable_list",r);const f=[{label:yt("common.result"),value:"result"},...r.value.map(_=>({label:_.label,value:_.field}))];me.set(t.nodeModel.properties.config,"fields",f)}),(f,_)=>{var E;const g=J("AppIcon"),b=J("el-button"),x=J("el-table-column"),A=J("el-tooltip"),S=J("el-table");return _e(),Ht(ar,null,[K("div",HY,[K("h5",XY,[et(de(f.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),_[1]||(_[1]=K("span",{class:"color-danger"},"*",-1))]),K("span",qY,[k(b,{link:"",type:"primary",onClick:_[0]||(_[0]=T=>s())},{default:P(()=>[k(g,{iconName:"app-add-outlined"})]),_:1})])]),((E=t.nodeModel.properties.node_data.variable_list)==null?void 0:E.length)>0?(_e(),at(S,{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})=>[K("span",{title:T.field,class:"ellipsis-1"},de(T.field),9,YY)]),_:1},8,["label"]),k(x,{prop:"label",label:f.$t("dynamicsForm.paramForm.name.label")},{default:P(({row:T})=>[K("span",{title:T.label,class:"ellipsis-1"},de(T.label),9,KY)]),_:1},8,["label"]),k(x,{label:f.$t("common.operation"),align:"left",width:"90"},{default:P(({row:T,$index:I})=>[K("span",ZY,[k(A,{effect:"dark",content:f.$t("common.modify"),placement:"top"},{default:P(()=>[k(b,{type:"primary",text:"",onClick:Xt(R=>s(T,I),["stop"])},{default:P(()=>[k(g,{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:R=>c(I)},{default:P(()=>[k(g,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):pn("",!0),k(zY,{ref_key:"VariableFieldDialogRef",ref:a,onRefresh:v},null,512)],64)}}}),QY={class:"title-decoration-1 mb-8"},eK={class:"flex-between"},tK=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={input_variable:[],variable_list:[]},a=$n({get:()=>(t.nodeModel.properties.node_data||me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:c=>{me.set(t.nodeModel.properties,"node_data",c)}}),r=je(),s=async()=>r.value.validate().catch(c=>Promise.reject({node:t.nodeModel,errMessage:c}));return Ir(()=>{me.set(t.nodeModel,"validate",s)}),(c,v)=>{const f=J("el-form-item"),_=J("el-form"),g=J("el-card");return _e(),at(wo,{nodeModel:e.nodeModel},{default:P(()=>[K("h5",QY,de(c.$t("views.applicationWorkflow.nodeSetting")),1),k(g,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:P(()=>[k(_,{onSubmit:v[1]||(v[1]=Xt(()=>{},["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(()=>[K("div",eK,[K("div",null,[et(de(c.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),v[2]||(v[2]=K("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(JY,{ref:"VariableFieldTableRef","node-model":e.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class nK extends ho{constructor(t){super(t,tK)}getConfig(t){return t.model.properties.config}}const rK={type:"variable-splitting-node",model:vo,view:nK},iP=Object.freeze(Object.defineProperty({__proto__:null,default:rK},Symbol.toStringTag,{value:"Module"})),oK={class:"title-decoration-1 mb-8"},iK={class:"flex-between w-full"},aK={class:"flex-between"},lK={class:"flex align-center"},sK={class:"flex align-center"},uK={class:"mr-4"},cK={class:"flex-between"},dK={class:"flex align-center"},fK={class:"mr-4"},pK=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Ga("getApplicationDetail"),n=Li(),{params:{id:a}}=n,r=$n(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=e,c=je(null),v=je(),f=je(),_=je(),g=()=>{var B;return Promise.all([_.value?_.value.validate():Promise.resolve(""),(B=f.value)==null?void 0:B.validate()]).catch(V=>Promise.reject({node:s.nodeModel,errMessage:V}))},b=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),A={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"]},S=$n({get:()=>(s.nodeModel.properties.node_data||me.set(s.nodeModel.properties,"node_data",A),s.nodeModel.properties.node_data),set:B=>{me.set(s.nodeModel.properties,"node_data",B)}}),E=t();function T(){var V;const B=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=E.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};po({type:"model",systemType:r.value}).getSelectModelList(B).then(z=>{c.value=me.groupBy(z==null?void 0:z.data,"provider")})}function I(B){me.set(s.nodeModel.properties.node_data,"system",B)}function R(B){me.set(s.nodeModel.properties.node_data,"prompt",B)}const U=B=>{var V;B&&((V=v.value)==null||V.open(B,a,S.value.model_params_setting))},L=je(),D=B=>{var V;B&&((V=L.value)==null||V.open(B,a))},W=B=>{me.set(s.nodeModel.properties.node_data,"system",B)};function Y(B){me.set(s.nodeModel.properties.node_data,"model_params_setting",B)}return Ir(()=>{T(),me.set(s.nodeModel,"validate",g)}),(B,V)=>{const z=J("AppIcon"),H=J("el-button"),q=J("ModelSelect"),ee=J("el-form-item"),ue=J("el-tooltip"),ie=J("MdEditorMagnify"),be=J("el-option"),De=J("el-select"),Ne=J("el-input-number"),Ae=J("el-switch"),Te=J("el-form"),rt=J("el-card");return _e(),at(wo,{"node-model":e.nodeModel},{default:P(()=>[K("h5",oK,de(B.$t("views.applicationWorkflow.nodeSetting")),1),k(rt,{shadow:"never",class:"card-never"},{default:P(()=>[k(Te,{onSubmit:V[10]||(V[10]=Xt(()=>{},["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(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(()=>[K("div",iK,[K("div",null,[K("span",null,[et(de(_n(yt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),V[11]||(V[11]=K("span",{class:"color-danger"},"*",-1))])]),k(H,{disabled:!S.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=tt=>U(S.value.model_id)),onRefreshForm:Y},{default:P(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:P(()=>[k(q,{onWheel:b,teleported:!1,modelValue:S.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=tt=>S.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(()=>[K("div",aK,[K("div",lK,[K("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(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(H,{type:"primary",link:"",onClick:V[2]||(V[2]=tt=>D(S.value.model_id)),disabled:!S.value.model_id},{default:P(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:P(()=>[k(ie,{title:B.$t("views.application.form.roleSettings.label"),modelValue:S.value.system,"onUpdate:modelValue":V[3]||(V[3]=tt=>S.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(()=>[K("div",sK,[K("div",uK,[K("span",null,[et(de(B.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=K("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(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(ie,{onWheel:b,title:B.$t("views.application.form.prompt.label"),modelValue:S.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=tt=>S.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(()=>[K("div",cK,[K("div",null,de(B.$t("views.application.form.historyRecord.label")),1),k(De,{modelValue:S.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=tt=>S.value.dialogue_type=tt),type:"small",style:{width:"100px"}},{default:P(()=>[k(be,{label:B.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(be,{label:B.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:P(()=>[k(Ne,{modelValue:S.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=tt=>S.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),V[13]||(V[13]=K("span",{class:"color-danger"},"*",-1))]),default:P(()=>[k(oo,{ref_key:"nodeCascaderRef",ref:_,nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:S.value.video_list,"onUpdate:modelValue":V[7]||(V[7]=tt=>S.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:V[9]||(V[9]=Xt(()=>{},["prevent"]))},{label:P(()=>[K("div",dK,[K("div",fK,[K("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(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:P(()=>[k(Ae,{size:"small",modelValue:S.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=tt=>S.value.is_result=tt)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Pd,{ref_key:"AIModeParamSettingDialogRef",ref:v,onRefresh:Y},null,512),k(oE,{onReplace:W,ref_key:"GeneratePromptDialogRef",ref:L},null,512)]),_:1},8,["node-model"])}}});class hK extends ho{constructor(t){super(t,pK)}}const vK={type:"video-understand-node",model:vo,view:hK},aP=Object.freeze(Object.defineProperty({__proto__:null,default:vK},Symbol.toStringTag,{value:"Module"})),lA=Vn({__name:"CustomLine",props:{model:{}},setup(e){const t=e,n=()=>{t.model.graphModel.deleteEdgeById(t.model.id)};return(a,r)=>Wa((_e(),Ht("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=Xt(()=>{},["stop"])),onClick:r[1]||(r[1]=Xt(()=>{},["stop"]))},[(_e(),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]=[K("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),K("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 mK(e,t){const n=e.getBoundingClientRect();return t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom}const yK=32,gK=32;class _K 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");mK(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&&(zg()?hN(this.targetId(),lA,n,this.props.model,a,(s,c)=>({model:s,graph:c})):(this.customLineApp=ik({render:()=>kv(lA,{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(),zg()&&vN(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=yK,customHeight:s=gK}=n.getProperties(),{startPoint:c,endPoint:v,path:f,isAnimation:_,arrowConfig:g}=n,b=n.getEdgeAnimationStyle(),{strokeDasharray:x,stroke:A,strokeDashoffset:S,animationName:E,animationDuration:T,animationIterationCount:I,animationTimingFunction:R,animationDirection:U}=b,L={x:(c.x+v.x-r)/2,y:(c.y+v.y-s)/2,width:r,height:s},D=n.getEdgeStyle(),W={width:r,height:s};return setTimeout(()=>{const Y=document.getElementById(a);Y&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(Y))},0),delete D.stroke,hn.h("g",{},[hn.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),hn.h("path",{d:f,...D,...g,..._?{strokeDasharray:x,stroke:A,style:{strokeDashoffset:S,animationName:E,animationDuration:T,animationIterationCount:I,animationTimingFunction:R,animationDirection:U}}:{}}),hn.h("foreignObject",{...L,y:L.y+5,x:L.x+5,style:{}},[hn.h("div",{id:a,style:{...W},className:"lf-custom-edge-wrapper"})])])}}let bK=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 lP={type:"app-edge",view:_K,model:bK};class wK{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 EK=e=>typeof e=="string",sA=Array.isArray,Zg=e=>typeof e=="number",sP=e=>e!==null&&typeof e=="object",Jg=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=>Jg(n))}if(typeof e=="object"&&Object.keys(e).length){const t=Object.assign({},e);return Object.keys(t).forEach(n=>{t[n]=Jg(t[n])}),t}return e},av=(e,t)=>{const n=e[t];return sP(n)?n.cell:n},uA=(e,t,n)=>{let a;return n?a=n:Zg(e)?a=()=>e:a=()=>t,a},OK=(e,t)=>{if(e!=="next"&&e!=="prev")return t},cA=e=>{e.prev.next=e.next,e.next.prev=e.prev,delete e.next,delete e.prev};let xK=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 cA(n),n}enqueue(t){const n=this.shortcut;t.prev&&t.next&&cA(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,OK)),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 dA(e,t){var n=e.get(t)||0;e.set(t,n+1)}function fA(e,t){var n=e.get(t);n!==void 0&&(n=n-1,n>0?e.set(t,n):e.delete(t))}function uP(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 pA(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 P1(e,t){return uP(e,t.v,t.w,t.name)}function hA(e){return typeof e=="function"}var SK=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})},AK=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})},MK=function(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:SK(t),edges:AK(t),value:t.graph()};return n.value===void 0&&delete n.value,n},kK=function(t){var n=new Wv(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 vA(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 mA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vA(Object(n),!0).forEach(function(a){TK(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vA(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function TK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PK(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 CK(e,t,n){return t&&PK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var RK={compound:!1,multigraph:!1,directed:!0},Wv=(function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};NK(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 hA(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,_=t.parent(f);_;){if(r===_)throw new Error("Setting "+s+" as parent of "+r+" would create a cycle");_=t.parent(_)}s&&t.setNode(s),t.setNode(r),t.removeFromParentsChildList(r),(c=t.parentMap)===null||c===void 0||c.set(r,f);var g=t.childrenMap.get(f);return g.set(r,!0),(v=t.childrenMap)===null||v===void 0||v.set(f,g),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(g){r(g)&&f.setNode(g,t.node(g))}),t.edges().forEach(function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdgeObj(g,t.edge(g))}),v){var _=function(b){for(var x=t.parent(b);x!==void 0&&!f.hasNode(x);)x=t.parent(x);return x};f.nodes().forEach(function(g){f.setParent(g,_(g))})}return f},this.setDefaultEdgeLabel=function(r){return hA(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(P1(t.isDirected(),r))},this.hasEdge=function(r,s,c){return t.edgesLabelsMap.has(P1(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 MK(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=mA(mA({},RK),n);this.compound=a.compound,this.directed=a.directed,this.multigraph=a.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return CK(e,[{key:"setNode",value:function(n,a){var r=this.nodesLabelMap,s=this.defaultNodeLabelFn,c=this.isCompound,v=this.parentMap,f=this.childrenMap,_=this.inEdgesMap,g=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 A;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||(A=f.get(this.GRAPH_NODE))===null||A===void 0||A.set(n,!0)}return[_,g,b,x].forEach(function(S){return S.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,_=this.nodesLabelMap;if(this.isCompound()){var g,b,x;this.removeFromParentsChildList(n),(g=this.parentMap)===null||g===void 0||g.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 A=s.get(n),S=c.get(n);Array.from(A.values()).forEach(function(E){return r(E)}),Array.from(S.values()).forEach(function(E){return r(E)}),_.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=pA(this.isDirected(),n,a,s),_=P1(this.isDirected(),f),g=f.v,b=f.w;if(this.edgesLabelsMap.has(_))return this.edgesLabelsMap.set(_,r),this;if(s!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(g),this.setNode(b),this.edgesLabelsMap.set(_,r||this.defaultEdgeLabelFn(g,b,s)),Object.freeze(f),this.edgesMap.set(_,f);var x=this.predecessorsMap.get(b),A=this.successorsMap.get(g);return dA(x,g),dA(A,b),(c=this.inEdgesMap.get(b))===null||c===void 0||c.set(_,f),(v=this.outEdgesMap.get(g))===null||v===void 0||v.set(_,f),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,a,r){var s=uP(this.isDirected(),n,a,r),c=this.edgesMap.get(s);if(c){var v=pA(this.isDirected(),n,a,r),f=v.v,_=v.w;this.edgesLabelsMap.delete(s),this.edgesMap.delete(s);var g=this.predecessorsMap.get(_),b=this.successorsMap.get(f);fA(g,f),fA(b,_),this.inEdgesMap.get(_).delete(s),this.outEdgesMap.get(f).delete(s),this.edgeCountNum-=1}return this}}]),e})();Wv.fromJSON=kK;function jK(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function DK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var cP=jK(function e(){var t=this;DK(this,e),this.arr=[],this.keyIndice=new Map,this.size=function(){return t.arr.length},this.keys=function(){return t.arr.map(function(n){return n.key})},this.has=function(n){return t.keyIndice.has(n)},this.priority=function(n){var a=t.keyIndice.get(n);if(a!==void 0)return t.arr[a].priority},this.swap=function(n,a){var r=t.arr,s=t.keyIndice,c=[r[n],r[a]],v=c[0],f=c[1];r[n]=f,r[a]=v,s.set(v.key,a),s.set(f.key,n)},this.innerDecrease=function(n){for(var a=t.arr,r=a[n].priority,s,c=n;c!==0;){var v;if(s=c>>1,((v=a[s])===null||v===void 0?void 0:v.priority)<r)break;t.swap(c,s),c=s}},this.heapify=function(n){var a=t.arr,r=n<<1,s=r+1,c=n;r<a.length&&(c=a[r].priority<a[c].priority?r:c,s<a.length&&(c=a[s].priority<a[c].priority?s:c),c!==n&&(t.swap(n,c),t.heapify(c)))},this.min=function(){if(t.size()===0)throw new Error("Queue underflow");return t.arr[0].key},this.add=function(n,a){var r=t.keyIndice,s=t.arr;if(!r.has(n)){var c=s.length;return r.set(n,c),s.push({key:n,priority:a}),t.innerDecrease(c),!0}return!1},this.removeMin=function(){t.swap(0,t.arr.length-1);var n=t.arr.pop();return t.keyIndice.delete(n.key),t.heapify(0),n.key},this.decrease=function(n,a){if(!t.has(n))throw new Error("There's no key named ".concat(n));var r=t.keyIndice.get(n);if(a>t.arr[r].priority)throw new Error("New priority is greater than current priority.Key: ".concat(n," Old: + ").concat(t.arr[r].priority," New: ").concat(a));t.arr[r].priority=a,t.innerDecrease(r)}}),IK=function(t,n){var a=new Wv,r=new Map,s=new cP,c;function v(g){var b=g.v===c?g.w:g.v,x=s.priority(b);if(x!==void 0){var A=n(g);A<x&&(r.set(b,c),s.decrease(b,A))}}if(t.nodeCount()===0)return a;t.nodes().forEach(function(g){s.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),s.decrease(t.nodes()[0],0);for(var f=!1;s.size()>0;){var _;if(c=s.removeMin(),r.has(c))a.setEdge(c,r.get(c));else{if(f)throw new Error("Input graph is not connected: "+t.graph());f=!0}(_=t.nodeEdges(c))===null||_===void 0||_.forEach(v)}return a},LK=function(t){var n=new Set,a=[],r=t.nodes();return r.forEach(function(s){for(var c=[],v=[s];v.length>0;){var f=v.pop();if(!n.has(f)){var _,g;n.add(f),c.push(f),(_=t.successors(f))===null||_===void 0||_.forEach(function(b){return v.push(b)}),(g=t.predecessors(f))===null||g===void 0||g.forEach(function(b){return v.push(b)})}}c.length&&a.push(c)}),a},$K=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))},UE=function(t,n,a){var r=Array.isArray(n)?n:[n],s=function(_){return t.isDirected()?t.successors(_):t.neighbors(_)},c=[],v=[];return r.forEach(function(f){if(t.hasNode(f))$K(t,f,a==="post",v,s,c);else throw new Error("Graph does not have node: "+f)}),c};function FK(e,t){return WK(e)||UK(e,t)||VK(e,t)||BK()}function BK(){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 VK(e,t){if(e){if(typeof e=="string")return yA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yA(e,t)}}function yA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function UK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,s=!1,c,v;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){s=!0,v=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(s)throw v}}return a}}function WK(e){if(Array.isArray(e))return e}var GK=function(){return 1},dP=function(t,n,a,r){return zK(t,n,a||GK,r||function(s){return t.outEdges(s)})},zK=function(t,n,a,r){var s=new Map,c=new cP,v,f,_=function(x){var A=x.v!==v?x.v:x.w,S=s.get(A),E=a(x),T=f.distance+E;if(E<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+x+" Weight: "+E);T<S.distance&&(S.distance=T,S.predecessor=v,c.decrease(A,T))};for(t.nodes().forEach(function(b){var x=b===n?0:Number.POSITIVE_INFINITY;s.set(b,{distance:x}),c.add(b,x)});c.size()>0&&(v=c.removeMin(),f=s.get(v),!(f&&f.distance===Number.POSITIVE_INFINITY));)r(v).forEach(_);var g={};return Array.from(s.entries()).forEach(function(b){var x=FK(b,2),A=x[0],S=x[1];return g[String(A)]=S,g}),g},HK=function(t,n,a){var r={};return t.nodes().forEach(function(s){return r[String(s)]=dP(t,s,n,a),r}),r},fP=function(t){var n=0,a=[],r=new Map,s=[];function c(v){var f,_={onStack:!0,lowlink:n,index:n};if(r.set(v,_),n+=1,a.push(v),(f=t.successors(v))===null||f===void 0||f.forEach(function(A){var S;if(r.has(A)){if(!((S=r.get(A))===null||S===void 0)&&S.onStack){var T=r.get(A);_.lowlink=Math.min(_.lowlink,T.index)}}else{c(A);var E=r.get(A);_.lowlink=Math.min(_.lowlink,E.lowlink)}}),_.lowlink===_.index){var g=[],b;do{b=a.pop();var x=r.get(b);x.onStack=!1,g.push(b)}while(v!==b);s.push(g)}}return t.nodes().forEach(function(v){r.has(v)||c(v)}),s},XK=function(t){return fP(t).filter(function(n){return n.length>1||n.length===1&&t.hasEdge(n[0],n[0])})};function Rw(e){"@babel/helpers - typeof";return Rw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rw(e)}function qK(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function YK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bm(e,t)}function ZK(e){var t=pP();return function(){var a=Vm(e),r;if(t){var s=Vm(this).constructor;r=Reflect.construct(a,arguments,s)}else r=a.apply(this,arguments);return JK(this,r)}}function JK(e,t){if(t&&(Rw(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QK(e)}function QK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jw(e){var t=typeof Map=="function"?new Map:void 0;return jw=function(a){if(a===null||!eZ(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(a))return t.get(a);t.set(a,r)}function r(){return xg(a,arguments,Vm(this).constructor)}return r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Bm(r,a)},jw(e)}function xg(e,t,n){return pP()?xg=Reflect.construct:xg=function(r,s,c){var v=[null];v.push.apply(v,s);var f=Function.bind.apply(r,v),_=new f;return c&&Bm(_,c.prototype),_},xg.apply(null,arguments)}function pP(){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 eZ(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Bm(e,t){return Bm=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},Bm(e,t)}function Vm(e){return Vm=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Vm(e)}var Dw=(function(e){KK(n,e);var t=ZK(n);function n(){return YK(this,n),t.apply(this,arguments)}return qK(n)})(jw(Error));function hP(e){var t=new Set,n=new Set,a=[];function r(s){if(n.has(s))throw new Dw;if(!t.has(s)){var c;n.add(s),t.add(s),(c=e.predecessors(s))===null||c===void 0||c.forEach(r),n.delete(s),a.push(s)}}if(e.sinks().forEach(r),t.size!==e.nodeCount())throw new Dw;return a}var tZ=function(t){try{hP(t)}catch(n){if(n instanceof Dw)return!1;throw n}return!0},nZ=function(t,n){return UE(t,n,"post")},rZ=function(t,n){return UE(t,n,"pre")},oZ=function(){return 1};function iZ(e,t,n){return aZ(e,t||oZ,n||function(a){return e.outEdges(a)})}function aZ(e,t,n){var a={},r=e.nodes();return r.forEach(function(s){var c=String(s);a[c]={},a[c][c]={distance:0},r.forEach(function(v){s!==v&&(a[c][String(v)]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(v){var f=v.v===s?v.w:v.v,_=t(v);a[c][String(f)]={distance:_,predecessor:s}})}),r.forEach(function(s){var c=String(s),v=a[c];r.forEach(function(f){var _=String(f),g=a[_];r.forEach(function(b){var x=String(b),A=g[c],S=v[x],E=g[x],T=A.distance+S.distance;T<E.distance&&(E.distance=T,E.predecessor=S.predecessor)})})}),a}const lZ=Object.freeze(Object.defineProperty({__proto__:null,components:LK,dfs:UE,dijkstra:dP,dijkstraAll:HK,findCycles:XK,floydWarshall:iZ,isAcyclic:tZ,postorder:nZ,preorder:rZ,prim:IK,tarjan:fP,topsort:hP},Symbol.toStringTag,{value:"Module"}));class sZ extends xK{}class uZ extends Wv{}const cZ=()=>1,dZ=(e,t)=>{var n;if(e.nodeCount()<=1)return[];const a=pZ(e,t||cZ);return(n=fZ(a.graph,a.buckets,a.zeroIdx).map(s=>e.outEdges(s.v,s.w)))===null||n===void 0?void 0:n.flat()},fZ=(e,t,n)=>{let a=[];const r=t[t.length-1],s=t[0];let c;for(;e.nodeCount();){for(;c=s.dequeue();)C1(e,t,n,c);for(;c=r.dequeue();)C1(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(C1(e,t,n,c,!0));break}}}return a},C1=(e,t,n,a,r)=>{var s,c;const v=[];return(s=e.inEdges(a.v))===null||s===void 0||s.forEach(f=>{const _=e.edge(f),g=e.node(f.v);r&&v.push({v:f.v,w:f.w,in:0,out:0}),g.out===void 0&&(g.out=0),g.out-=_,Iw(t,n,g)}),(c=e.outEdges(a.v))===null||c===void 0||c.forEach(f=>{const _=e.edge(f),g=f.w,b=e.node(g);b.in===void 0&&(b.in=0),b.in-=_,Iw(t,n,b)}),e.removeNode(a.v),r?v:void 0},pZ=(e,t)=>{const n=new uZ;let a=0,r=0;e.nodes().forEach(f=>{n.setNode(f,{v:f,in:0,out:0})}),e.edges().forEach(f=>{const _=n.edge(f)||0,g=(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+=g),a=Math.max(a,n.node(f.w).in+=g)});const s=[],c=r+a+3;for(let f=0;f<c;f++)s.push(new sZ);const v=a+1;return n.nodes().forEach(f=>{Iw(s,v,n.node(f))}),{buckets:s,zeroIdx:v,graph:n}},Iw=(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)},hZ=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"?dZ(e,t(e)):vZ(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()}`)})},vZ=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},mZ=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)}})},gA={run:hZ,undo:mZ};class Nd extends Wv{}const yZ=(e,t)=>Number(e)-Number(t),Gv=(e,t,n,a)=>{let r;do r=`${a}${Math.random()}`;while(e.hasNode(r));return n.dummy=t,e.setNode(r,n),r},gZ=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},vP=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},_Z=(e,t)=>e==null?void 0:e.reduce((n,a,r)=>(n[a]=t[r],n),{}),_A=(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,_;return Math.abs(s)*c>Math.abs(r)*v?(s<0&&(v=-v),f=v*r/s,_=v):(r<0&&(c=-c),f=c,_=c*s/r),{x:n+f,y:a+_}},Um=e=>{const t=[],n=mP(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 yZ((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},bZ=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)})},wZ=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 _=(((f=e.node(v))===null||f===void 0?void 0:f.rank)||0)-a;r[_]||(r[_]=[]),r[_].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(_=>{const g=e.node(_);g&&(g.rank=g.rank||0,g.rank+=s)}))}},bA=(e,t,n,a)=>{const r={width:0,height:0};return Zg(n)&&Zg(a)&&(r.rank=n,r.order=a),Gv(e,"border",r,t)},mP=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},EZ=(e,t)=>{const n={lhs:[],rhs:[]};return e==null||e.forEach(a=>{t(a)?n.lhs.push(a):n.rhs.push(a)}),n},yP=(e,t)=>{const n=Date.now();try{return t()}finally{console.log(`${e} time: ${Date.now()-n}ms`)}},gP=(e,t)=>t(),WE=(e,t)=>e.reduce((n,a)=>{const r=t(n),s=t(a);return r>s?a:n}),OZ=e=>{e.graph().dummyChains=[],e.edges().forEach(t=>xZ(e,t))},xZ=(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 _=e.graph();let g,b,x;for(x=0,++a;a<s;++x,++a)v.points=[],b={edgeLabel:v,width:0,height:0,edgeObj:t,rank:a},g=Gv(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,g,{weight:v.weight},c),x===0&&(_.dummyChains||(_.dummyChains=[]),_.dummyChains.push(g)),n=g;e.setEdge(n,r,{weight:v.weight},c)},SZ=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)})},wA={run:OZ,undo:SZ},_P=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 _=a(f.w),g=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))},AZ=e=>{var t;const n={};let a;const r=v=>{var f;const _=e.node(v);if(!_)return 0;if(n[v])return _.rank;n[v]=!0;let g;return(f=e.outEdges(v))===null||f===void 0||f.forEach(b=>{const x=r(b.w),A=e.edge(b).minlen,S=x-A;S&&(g===void 0||S<g)&&(g=S)}),g||(g=0),(a===void 0||g<a)&&(a=g),_.rank=g,g};(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 _;const g=e.node(v),b=isNaN(g.layer)?f:g.layer;(g.rank===void 0||g.rank<b)&&(g.rank=b),!s[v]&&(s[v]=!0,(_=e.outEdges(v))===null||_===void 0||_.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,MZ=e=>{const t=new Nd({directed:!1}),n=e.nodes()[0],a=e.nodeCount();t.setNode(n,{});let r,s;for(;kZ(t,e)<a;)r=bP(t,e),s=t.hasNode(r.v)?qf(e,r):-qf(e,r),wP(t,e,s);return t},kZ=(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()},TZ=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(;NZ(t,e)<a;)r=bP(t,e),s=t.hasNode(r.v)?qf(e,r):-qf(e,r),wP(t,e,s);return t},NZ=(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()},bP=(e,t)=>WE(t.edges(),n=>e.hasNode(n.v)!==e.hasNode(n.w)?qf(t,n):1/0),wP=(e,t,n)=>{e.nodes().forEach(a=>{t.node(a).rank||(t.node(a).rank=0),t.node(a).rank+=n})},{preorder:PZ,postorder:CZ}=lZ,RZ=e=>{const t=gZ(e);_P(t);const n=MZ(t);OP(n),EP(n,t);let a,r;for(;a=IZ(n);)r=LZ(n,t,a),$Z(n,t,a,r)},EP=(e,t)=>{let n=CZ(e,e.nodes());n=n==null?void 0:n.slice(0,(n==null?void 0:n.length)-1),n==null||n.forEach(a=>{jZ(e,t,a)})},jZ=(e,t,n)=>{const r=e.node(n).parent;e.edgeFromArgs(n,r).cutvalue=DZ(e,t,n)},DZ=(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(_=>{const g=_.v===n,b=g?_.w:_.v;if(b!==s){const x=g===c,A=t.edge(_).weight;if(f+=x?A:-A,BZ(e,n,b)){const S=e.edgeFromArgs(n,b).cutvalue;f+=x?-S:S}}}),f},OP=(e,t=e.nodes()[0])=>{xP(e,{},1,t)},xP=(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(_=>{t[_]||(v=xP(e,t,v,_,a))}),f.low=c,f.lim=v++,r?f.parent=r:delete f.parent,v},IZ=e=>e.edges().find(t=>e.edge(t).cutvalue<0),LZ=(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 _=t.edges().filter(g=>f===EA(e,e.node(g.v),v)&&f!==EA(e,e.node(g.w),v));return WE(_,g=>qf(t,g))},$Z=(e,t,n,a)=>{const r=n.v,s=n.w;e.removeEdge(r,s),e.setEdge(a.v,a.w,{}),OP(e),EP(e,t),FZ(e,t)},FZ=(e,t)=>{const n=e.nodes().find(r=>{var s;return!(!((s=t.node(r))===null||s===void 0)&&s.parent)});let a=PZ(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)})},BZ=(e,t,n)=>e.hasEdge(t,n),EA=(e,t,n)=>n.low<=t.lim&&t.lim<=n.lim,VZ=e=>{switch(e.graph().ranker){case"network-simplex":WZ(e);break;case"tight-tree":OA(e);break;case"longest-path":UZ(e);break;default:OA(e)}},UZ=_P,OA=e=>{AZ(e),TZ(e)},WZ=e=>{RZ(e)},GZ=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},zZ=(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,_;f=n;do f=e.parent(f),r.push(f);while(f&&(t[f].low>c||v>t[f].lim));for(_=f,f=a;f&&f!==_;)s.push(f),f=e.parent(f);return{lca:_,path:r.concat(s.reverse())}},HZ=e=>{var t;const n=GZ(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 _=zZ(e,n,f.v,f.w),g=_.path,b=_.lca;let x=0,A=g[x],S=!0;for(;c!==f.w;){if(v=e.node(c),S){for(;A!==b&&((r=e.node(A))===null||r===void 0?void 0:r.maxRank)<v.rank;)x++,A=g[x];A===b&&(S=!1)}if(!S){for(;x<g.length-1&&((s=e.node(g[x+1]))===null||s===void 0?void 0:s.minRank)<=v.rank;)x++;A=g[x]}e.setParent(c,A),c=e.successors(c)[0]}})},XZ=e=>{var t;const n=Gv(e,"root",{},"_root"),a=qZ(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=>{SP(e,n,c,v,s,a,f)}),e.graph().nodeRankFactor=c},SP=(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=bA(e,"_bt"),_=bA(e,"_bb"),g=e.node(c);e.setParent(f,c),g.borderTop=f,e.setParent(_,c),g.borderBottom=_,v==null||v.forEach(b=>{SP(e,t,n,a,r,s,b);const x=e.node(b),A=x.borderTop?x.borderTop:b,S=x.borderBottom?x.borderBottom:b,E=x.borderTop?a:2*a,T=A!==S?1:r-s[c]+1;e.setEdge(f,A,{minlen:T,weight:E,nestingEdge:!0}),e.setEdge(S,_,{minlen:T,weight:E,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,f,{weight:0,minlen:r+s[c]})},qZ=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},KZ=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)})},xA={run:XZ,cleanup:KZ},ZZ=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)SA(e,"borderLeft","_bl",a,s,c),SA(e,"borderRight","_br",a,s,c)}};(t=e.children())===null||t===void 0||t.forEach(a=>n(a))},SA=(e,t,n,a,r,s)=>{const c={rank:s,borderType:t,width:0,height:0},v=r[t][s-1],f=Gv(e,"border",c,n);r[t][s]=f,e.setParent(f,a),v&&e.setEdge(v,f,{weight:1})},JZ=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&AP(e)},QZ=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&eJ(e),(n==="lr"||n==="rl")&&(tJ(e),AP(e))},AP=e=>{e.nodes().forEach(t=>{AA(e.node(t))}),e.edges().forEach(t=>{AA(e.edge(t))})},AA=e=>{const t=e.width;e.width=e.height,e.height=t},eJ=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("y")&&R1(a)})},R1=e=>{e!=null&&e.y&&(e.y=-e.y)},tJ=e=>{e.nodes().forEach(t=>{j1(e.node(t))}),e.edges().forEach(t=>{var n;const a=e.edge(t);(n=a.points)===null||n===void 0||n.forEach(r=>j1(r)),a.hasOwnProperty("x")&&j1(a)})},j1=e=>{const t=e.x;e.x=e.y,e.y=t},MA={adjust:JZ,undo:QZ};function nJ(e){return Array.isArray(e)}function Lw(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 kA=(function(e){if(nJ(e))return e.reduce(function(t,n){return Math.min(t,n)},e[0])}),TA=e=>{const t={},n=e.nodes().filter(g=>{var b;return!(!((b=e.children(g))===null||b===void 0)&&b.length)}),a=n.map(g=>e.node(g).rank),r=Lw(a),s=[];for(let g=0;g<r+1;g++)s.push([]);const c=g=>{var b;if(t.hasOwnProperty(g))return;t[g]=!0;const x=e.node(g);isNaN(x.rank)||s[x.rank].push(g),(b=e.successors(g))===null||b===void 0||b.forEach(A=>c(A))},v=n.sort((g,b)=>e.node(g).rank-e.node(b).rank),_=v.filter(g=>e.node(g).fixorder!==void 0).sort((g,b)=>e.node(g).fixorder-e.node(b).fixorder);return _==null||_.forEach(g=>{isNaN(e.node(g).rank)||s[e.node(g).rank].push(g),t[g]=!0}),v==null||v.forEach(c),s},rJ=(e,t,n)=>{const a=_Z(n,n.map((g,b)=>b)),s=t.map(g=>{var b;const x=(b=e.outEdges(g))===null||b===void 0?void 0:b.map(A=>({pos:a[A.w]||0,weight:e.edge(A).weight}));return x==null?void 0:x.sort((A,S)=>A.pos-S.pos)}).flat().filter(g=>g!==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 _=0;return s==null||s.forEach(g=>{if(g){let b=g.pos+c;f[b]+=g.weight;let x=0;for(;b>0;)b%2&&(x+=f[b+1]),b=b-1>>1,f[b]+=g.weight;_+=g.weight*x}}),_},NA=(e,t)=>{let n=0;for(let a=1;a<(t==null?void 0:t.length);a+=1)n+=rJ(e,t[a-1],t[a]);return n},oJ=(e,t,n)=>{const a=iJ(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(_=>{const g=_.v===s?_.w:_.v,b=r.edgeFromArgs(g,s),x=b!==void 0?b.weight:0;r.setEdge(g,s,{weight:e.edge(_).weight+x})}),v.hasOwnProperty("minRank")&&r.setNode(s,{borderLeft:v.borderLeft[t],borderRight:v.borderRight[t]}))}),r},iJ=e=>{let t;for(;e.hasNode(t=`_root${Math.random()}`););return t},aJ=(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}})},lJ=(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}}}),sJ=(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 _=s[v.v];v.barycenter!==void 0&&(_.barycenter=v.barycenter,_.weight=v.weight)}),(n=t.edges())===null||n===void 0||n.forEach(v=>{const f=s[v.v],_=s[v.w];f!==void 0&&_!==void 0&&(_.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 uJ(c)},uJ=e=>{var t,n;const a=[],r=f=>_=>{_.merged||(_.barycenter===void 0||f.barycenter===void 0||_.barycenter>=f.barycenter)&&cJ(f,_)},s=f=>_=>{_.in.push(f),--_.indegree===0&&e.push(_)};for(;e!=null&&e.length;){const f=e.pop();a.push(f),(t=f.in.reverse())===null||t===void 0||t.forEach(_=>r(f)(_)),(n=f.out)===null||n===void 0||n.forEach(_=>s(f)(_))}const c=a.filter(f=>!f.merged),v=["vs","i","barycenter","weight"];return c.map(f=>{const _={};return v==null||v.forEach(g=>{f[g]!==void 0&&(_[g]=f[g])}),_})},cJ=(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},dJ=(e,t,n,a)=>{const r=EZ(e,x=>{const A=x.hasOwnProperty("fixorder")&&!isNaN(x.fixorder);return a?!A&&x.hasOwnProperty("barycenter"):A||x.hasOwnProperty("barycenter")}),s=r.lhs,c=r.rhs.sort((x,A)=>-x.i- -A.i),v=[];let f=0,_=0,g=0;s==null||s.sort(fJ(!!t,!!n)),g=PA(v,c,g),s==null||s.forEach(x=>{var A;g+=(A=x.vs)===null||A===void 0?void 0:A.length,v.push(x.vs),f+=x.barycenter*x.weight,_+=x.weight,g=PA(v,c,g)});const b={vs:v.flat()};return _&&(b.barycenter=f/_,b.weight=_),b},PA=(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},fJ=(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},MP=(e,t,n,a,r,s)=>{var c,v,f,_;let g=e.children(t);const b=e.node(t),x=b?b.borderLeft:void 0,A=b?b.borderRight:void 0,S={};x&&(g=g==null?void 0:g.filter(R=>R!==x&&R!==A));const E=lJ(e,g||[]);E==null||E.forEach(R=>{var U;if(!((U=e.children(R.v))===null||U===void 0)&&U.length){const L=MP(e,R.v,n,a,s);S[R.v]=L,L.hasOwnProperty("barycenter")&&hJ(R,L)}});const T=sJ(E,n);pJ(T,S),(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=dJ(T,a,r,s);if(x&&(I.vs=[x,I.vs,A].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(((_=e.predecessors(A))===null||_===void 0?void 0:_[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},pJ=(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()})},hJ=(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)},vJ=(e,t)=>{const n=mP(e),a=[],r=[];for(let g=1;g<n+1;g++)a.push(g);for(let g=n-1;g>-1;g--)r.push(g);const s=CA(e,a,"inEdges"),c=CA(e,r,"outEdges");let v=TA(e);D1(e,v);let f=Number.POSITIVE_INFINITY,_;for(let g=0,b=0;b<4;++g,++b){RA(g%2?s:c,g%4>=2,!1,t),v=Um(e);const x=NA(e,v);x<f&&(b=0,_=Jg(v),f=x)}v=TA(e),D1(e,v);for(let g=0,b=0;b<4;++g,++b){RA(g%2?s:c,g%4>=2,!0,t),v=Um(e);const x=NA(e,v);x<f&&(b=0,_=Jg(v),f=x)}D1(e,_)},CA=(e,t,n)=>t.map(a=>oJ(e,a,n)),RA=(e,t,n,a)=>{const r=new Nd;e==null||e.forEach(s=>{var c;const v=s.graph().root,f=MP(s,v,r,t,n,a);for(let _=0;_<((c=f.vs)===null||c===void 0?void 0:c.length);_++){const g=s.node(f.vs[_]);g&&(g.order=_)}aJ(s,r,f.vs)})},D1=(e,t)=>{t==null||t.forEach(n=>{n==null||n.forEach((a,r)=>{e.node(a).order=r})})};class mJ extends Wv{}const yJ=(e,t)=>{const n={},a=(r,s)=>{let c=0,v=0;const f=r.length,_=s==null?void 0:s[(s==null?void 0:s.length)-1];return s==null||s.forEach((g,b)=>{var x;const A=_J(e,g),S=A?e.node(A).order:f;(A||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),L=U.order;(L<c||S<L)&&!(U.dummy&&(!((R=e.node(E))===null||R===void 0)&&R.dummy))&&kP(n,I,E)})}),v=b+1,c=S)}),s};return t!=null&&t.length&&t.reduce(a),n},gJ=(e,t)=>{const n={};function a(v,f,_,g,b){var x,A;let S;for(let E=f;E<_;E++)S=v[E],!((x=e.node(S))===null||x===void 0)&&x.dummy&&((A=e.predecessors(S))===null||A===void 0||A.forEach(T=>{const I=e.node(T);I.dummy&&(I.order<g||I.order>b)&&kP(n,T,S)}))}function r(v){return JSON.stringify(v.slice(1))}function s(v,f){const _=r(v);f.get(_)||(a(...v),f.set(_,!0))}const c=(v,f)=>{let _=-1,g,b=0;const x=new Map;return f==null||f.forEach((A,S)=>{var E;if(((E=e.node(A))===null||E===void 0?void 0:E.dummy)==="border"){const T=e.predecessors(A)||[];T.length&&(g=e.node(T[0]).order,s([f,b,S,_,g],x),b=S,_=g)}s([f,b,f.length,g,v.length],x)}),f};return t!=null&&t.length&&t.reduce(c),n},_J=(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)},kP=(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},bJ=(e,t,n)=>{let a=t,r=n;if(a>r){const s=t;a=r,r=s}return!!e[a]},wJ=(e,t,n,a)=>{const r={},s={},c={};return t==null||t.forEach(v=>{v==null||v.forEach((f,_)=>{r[f]=f,s[f]=f,c[f]=_})}),t==null||t.forEach(v=>{let f=-1;v==null||v.forEach(_=>{let g=a(_);if(g.length){g=g.sort((x,A)=>c[x]-c[A]);const b=(g.length-1)/2;for(let x=Math.floor(b),A=Math.ceil(b);x<=A;++x){const S=g[x];s[_]===_&&f<c[S]&&!bJ(n,_,S)&&(s[S]=_,s[_]=r[_]=r[S],f=c[S])}}})}),{root:r,align:s}},EJ=(e,t,n,a,r)=>{var s;const c={},v=OJ(e,t,n,r),f=r?"borderLeft":"borderRight",_=(x,A)=>{let S=v.nodes(),E=S.pop();const T={};for(;E;)T[E]?x(E):(T[E]=!0,S.push(E),S=S.concat(A(E))),E=S.pop()},g=x=>{c[x]=(v.inEdges(x)||[]).reduce((A,S)=>Math.max(A,(c[S.v]||0)+v.edge(S)),0)},b=x=>{const A=(v.outEdges(x)||[]).reduce((E,T)=>Math.min(E,(c[T.w]||0)-v.edge(T)),Number.POSITIVE_INFINITY),S=e.node(x);A!==Number.POSITIVE_INFINITY&&S.borderType!==f&&(c[x]=Math.max(c[x],A))};return _(g,v.predecessors.bind(v)),_(b,v.successors.bind(v)),(s=Object.values(a))===null||s===void 0||s.forEach(x=>{c[x]=c[n[x]]}),c},OJ=(e,t,n,a)=>{const r=new mJ,s=e.graph(),c=MJ(s.nodesep,s.edgesep,a);return t==null||t.forEach(v=>{let f;v==null||v.forEach(_=>{const g=n[_];if(r.setNode(g),f){const b=n[f],x=r.edgeFromArgs(b,g);r.setEdge(b,g,Math.max(c(e,_,f),x||0))}f=_})}),r},xJ=(e,t)=>WE(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=kJ(e,c)/2;r=Math.max(v+f,r),s=Math.min(v-f,s)}),r-s});function SJ(e,t){const n=Object.values(t),a=kA(n),r=Lw(n);["u","d"].forEach(s=>{["l","r"].forEach(c=>{const v=s+c,f=e[v];let _;if(f===t)return;const g=Object.values(f);_=c==="l"?a-kA(g):r-Lw(g),_&&(e[v]={},Object.keys(f).forEach(b=>{e[v][b]=f[b]+_}))})})}const AJ=(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},MJ=(e,t,n)=>(a,r,s)=>{const c=a.node(r),v=a.node(s);let f=0,_;if(f+=c.width/2,c.hasOwnProperty("labelpos"))switch((c.labelpos||"").toLowerCase()){case"l":_=-c.width/2;break;case"r":_=c.width/2;break}if(_&&(f+=n?_:-_),_=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":_=v.width/2;break;case"r":_=-v.width/2;break}return _&&(f+=n?_:-_),_=0,f},kJ=(e,t)=>e.node(t).width||0,TJ=e=>{const t=Um(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})},NJ=e=>{const t=Um(e),n=Object.assign(yJ(e,t),gJ(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),_=wJ(e,r,n,f),g=EJ(e,r,_.root,_.align,v==="r");v==="r"&&Object.keys(g).forEach(b=>g[b]=-g[b]),a[c+v]=g})});const s=xJ(e,a);return s&&SJ(a,s),AJ(a,e.graph().align)},PJ=e=>{var t;const n=vP(e);TJ(n);const a=NJ(n);(t=Object.keys(a))===null||t===void 0||t.forEach(r=>{n.node(r).x=a[r]})},CJ=(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))})},RJ=(e,t)=>{const n=t&&t.debugTiming?yP:gP;n("layout",()=>{t&&!t.keepNodeOrder&&t.prevGraph&&n(" inheritOrder",()=>{DJ(e,t.prevGraph)});const a=n(" buildLayoutGraph",()=>WJ(e));t&&t.edgeLabelSpace===!1||n(" makeSpaceForEdgeLabels",()=>{GJ(a)});try{n(" runLayout",()=>{jJ(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",()=>{IJ(e,a)})})},jJ=(e,t,n)=>{t(" removeSelfEdges",()=>{QJ(e)}),t(" acyclic",()=>{gA.run(e)}),t(" nestingGraph.run",()=>{xA.run(e)}),t(" rank",()=>{VZ(vP(e))}),t(" injectEdgeLabelProxies",()=>{zJ(e)}),t(" removeEmptyRanks",()=>{wZ(e)}),t(" nestingGraph.cleanup",()=>{xA.cleanup(e)}),t(" normalizeRanks",()=>{bZ(e)}),t(" assignRankMinMax",()=>{HJ(e)}),t(" removeEdgeLabelProxies",()=>{XJ(e)}),t(" normalize.run",()=>{wA.run(e)}),t(" parentDummyChains",()=>{HZ(e)}),t(" addBorderSegments",()=>{ZZ(e)}),n&&n.keepNodeOrder&&t(" initDataOrder",()=>{CJ(e,n.nodeOrder)}),t(" order",()=>{vJ(e,n==null?void 0:n.keepNodeOrder)}),t(" insertSelfEdges",()=>{eQ(e)}),t(" adjustCoordinateSystem",()=>{MA.adjust(e)}),t(" position",()=>{PJ(e)}),t(" positionSelfEdges",()=>{tQ(e)}),t(" removeBorderNodes",()=>{JJ(e)}),t(" normalize.undo",()=>{wA.undo(e)}),t(" fixupEdgeLabelCoords",()=>{KJ(e)}),t(" undoCoordinateSystem",()=>{MA.undo(e)}),t(" translateGraph",()=>{qJ(e)}),t(" assignNodeIntersects",()=>{YJ(e)}),t(" reversePoints",()=>{ZJ(e)}),t(" acyclic.undo",()=>{gA.undo(e)})},DJ=(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})},IJ=(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},LJ=["nodesep","edgesep","ranksep","marginx","marginy"],$J={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},I1=["acyclicer","ranker","rankdir","align"],FJ=["width","height","layer","fixorder"],BJ={width:0,height:0},VJ=["minlen","weight","width","height","labeloffset"],UJ={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L1=["labelpos"],WJ=e=>{const t=new Nd({multigraph:!0,compound:!0}),n=F1(e.graph()),a={};return I1==null||I1.forEach(r=>{n[r]!==void 0&&(a[r]=n[r])}),t.setGraph(Object.assign({},$J,$1(n,LJ),a)),e.nodes().forEach(r=>{const s=F1(e.node(r)),c=Object.assign(Object.assign({},BJ),s),v=$1(c,FJ);t.setNode(r,v),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{const s=F1(e.edge(r)),c={};L1==null||L1.forEach(v=>{s[v]!==void 0&&(c[v]=s[v])}),t.setEdgeObj(r,Object.assign({},UJ,$1(s,VJ),c))}),t},GJ=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)})},zJ=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};Gv(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},XJ=e=>{e.nodes().forEach(t=>{const n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})},qJ=e=>{let t,n=0,a,r=0;const s=e.graph(),c=s.marginx||0,v=s.marginy||0,f=_=>{if(!_)return;const g=_.x,b=_.y,x=_.width,A=_.height;!isNaN(g)&&!isNaN(x)&&(t===void 0&&(t=g-x/2),t=Math.min(t,g-x/2),n=Math.max(n,g+x/2)),!isNaN(b)&&!isNaN(A)&&(a===void 0&&(a=b-A/2),a=Math.min(a,b-A/2),r=Math.max(r,b+A/2))};e.nodes().forEach(_=>{f(e.node(_))}),e.edges().forEach(_=>{const g=e.edge(_);g!=null&&g.hasOwnProperty("x")&&f(g)}),t-=c,a-=v,e.nodes().forEach(_=>{const g=e.node(_);g&&(g.x-=t,g.y-=a)}),e.edges().forEach(_=>{var g;const b=e.edge(_);(g=b.points)===null||g===void 0||g.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(_A(a,s)),n.points.push(_A(r,c))})},KJ=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}})},ZJ=e=>{e.edges().forEach(t=>{var n;const a=e.edge(t);a.reversed&&((n=a.points)===null||n===void 0||n.reverse())})},JJ=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]),_=e.node(s.borderRight[((r=s.borderRight)===null||r===void 0?void 0:r.length)-1]);s.width=Math.abs((_==null?void 0:_.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)})},QJ=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)}})},eQ=e=>{const t=Um(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=>{Gv(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})})},tQ=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}})},$1=(e,t)=>{const n={};return t==null||t.forEach(a=>{e[a]!==void 0&&(n[a]=+e[a])}),n},F1=(e={})=>{const t={};return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t},nQ={layout:RJ,util:{time:yP,notime:gP}};class rQ extends wK{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:_,begin:g,radial:b,comboEdges:x=[],vedges:A=[]}=s;if(!c)return;const S=s.edges||[],E=new Nd({multigraph:!0,compound:!0});s.nodeMap={};const T={};c.forEach(q=>{s.nodeMap[q.id]=q,q.comboId&&(T[q.comboId]=T[q.comboId]||[],T[q.comboId].push(q.id))});let I=[];const R={};!((t=s.nodeOrder)===null||t===void 0)&&t.length?(s.nodeOrder.forEach(q=>{R[q]=!0,I.push(s.nodeMap[q])}),c.forEach(q=>{R[q.id]||I.push(q)})):I=c;let U;v?sA(v)?U=()=>v:U=()=>[v,v]:U=q=>q.size?sA(q.size)?q.size:sP(q.size)?[q.size.width||40,q.size.height||40]:[q.size,q.size]:[40,40];const L=uA(s.ranksep,50,s.ranksepFunc),D=uA(s.nodesep,50,s.nodesepFunc);let W=D,Y=L;(f==="LR"||f==="RL")&&(W=L,Y=D),E.setDefaultEdgeLabel(()=>({})),E.setGraph(s);const B={};this.sortByCombo&&_&&_.forEach(q=>{if(B[q.id]=q,q.collapsed){const ee=U(q),ue=Y(q),ie=W(q),be=ee[0]+2*ie,De=ee[1]+2*ue;E.setNode(q.id,{width:be,height:De})}q.parentId&&(B[q.parentId]||E.setNode(q.parentId,{}),E.setParent(q.id,q.parentId))}),I.filter(q=>q.layout!==!1).forEach(q=>{const ee=U(q),ue=Y(q),ie=W(q),be=ee[0]+2*ie,De=ee[1]+2*ue,Ne=q.layer;Zg(Ne)?E.setNode(q.id,{width:be,height:De,layer:Ne}):E.setNode(q.id,{width:be,height:De}),this.sortByCombo&&q.comboId&&(B[q.comboId]||(B[q.comboId]={id:q.comboId},E.setNode(q.comboId,{})),E.setParent(q.id,q.comboId))}),S.forEach(q=>{const ee=av(q,"source"),ue=av(q,"target");this.layoutNode(ee)&&this.layoutNode(ue)&&E.setEdge(ee,ue,{weight:q.weight||1})}),(n=x==null?void 0:x.concat(A||[]))===null||n===void 0||n.forEach(q=>{var ee,ue;const{source:ie,target:be}=q,De=!((ee=B[ie])===null||ee===void 0)&&ee.collapsed?[ie]:T[ie]||[ie],Ne=!((ue=B[be])===null||ue===void 0)&&ue.collapsed?[be]:T[be]||[be];De.forEach(Ae=>{Ne.forEach(Te=>{E.setEdge(Ae,Te,{weight:q.weight||1})})})});let V;!((a=s.preset)===null||a===void 0)&&a.nodes&&(V=new Nd({multigraph:!0,compound:!0}),s.preset.nodes.forEach(q=>{V==null||V.setNode(q.id,q)})),nQ.layout(E,{prevGraph:V,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:!!s.nodeOrder,nodeOrder:s.nodeOrder});const z=[0,0];if(g){let q=1/0,ee=1/0;E.nodes().forEach(ue=>{const ie=E.node(ue);q>ie.x&&(q=ie.x),ee>ie.y&&(ee=ie.y)}),E.edges().forEach(ue=>{var ie;(ie=E.edge(ue).points)===null||ie===void 0||ie.forEach(De=>{q>De.x&&(q=De.x),ee>De.y&&(ee=De.y)})}),z[0]=g[0]-q,z[1]=g[1]-ee}const H=f==="LR"||f==="RL";if(b){const{focusNode:q,ranksep:ee,getRadialPos:ue}=this,ie=EK(q)?q:q==null?void 0:q.id,be=ie?(r=E.node(ie))===null||r===void 0?void 0:r._rank:0,De=[],Ne=H?"y":"x",Ae=H?"height":"width";let Te=1/0,rt=-1/0;E.nodes().forEach(we=>{const Re=E.node(we);if(!s.nodeMap[we])return;const Ye=D(s.nodeMap[we]);if(be===0)De[Re._rank]||(De[Re._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),De[Re._rank].nodes.push(we),De[Re._rank].totalWidth+=Ye*2+Re[Ae],De[Re._rank].maxSize<Math.max(Re.width,Re.height)&&(De[Re._rank].maxSize=Math.max(Re.width,Re.height));else{const Ft=Re._rank-be;if(Ft===0)De[Ft]||(De[Ft]={nodes:[],totalWidth:0,maxSize:-1/0}),De[Ft].nodes.push(we),De[Ft].totalWidth+=Ye*2+Re[Ae],De[Ft].maxSize<Math.max(Re.width,Re.height)&&(De[Ft].maxSize=Math.max(Re.width,Re.height));else{const en=Math.abs(Ft);De[en]||(De[en]={left:[],right:[],totalWidth:0,maxSize:-1/0}),De[en].totalWidth+=Ye*2+Re[Ae],De[en].maxSize<Math.max(Re.width,Re.height)&&(De[en].maxSize=Math.max(Re.width,Re.height)),Ft<0?De[en].left.push(we):De[en].right.push(we)}}const Ot=Re[Ne]-Re[Ae]/2-Ye,bt=Re[Ne]+Re[Ae]/2+Ye;Ot<Te&&(Te=Ot),bt>rt&&(rt=bt)});let tt=ee||50;const Be={},dt=(rt-Te)/.9,St=[(Te+rt-dt)*.5,(Te+rt+dt)*.5],He=(we,Re,Ye=-1/0,Ot=[0,1])=>{let bt=Ye;return we.forEach(Ft=>{const en=E.node(Ft);Be[Ft]=Re;const{x:on,y:Wt}=ue(en[Ne],St,dt,Re,Ot);if(!s.nodeMap[Ft])return;s.nodeMap[Ft].x=on+z[0],s.nodeMap[Ft].y=Wt+z[1],s.nodeMap[Ft]._order=en._order;const nt=L(s.nodeMap[Ft]);bt<nt&&(bt=nt)}),bt};let Qt=!0;const Fe=0;De.forEach(we=>{var Re,Ye,Ot,bt,Ft,en,on;if(!(!((Re=we==null?void 0:we.nodes)===null||Re===void 0)&&Re.length)&&!(!((Ye=we==null?void 0:we.left)===null||Ye===void 0)&&Ye.length)&&!(!((Ot=we==null?void 0:we.right)===null||Ot===void 0)&&Ot.length))return;if(Qt&&we.nodes.length===1){const nt=we.nodes[0];if(!s.nodeMap[nt])return;s.nodeMap[nt].x=z[0],s.nodeMap[nt].y=z[1],Be[we.nodes[0]]=0,tt=L(s.nodeMap[nt]),Qt=!1;return}tt=Math.max(tt,we.totalWidth/(2*Math.PI));let Wt=-1/0;if(be===0||!((bt=we.nodes)===null||bt===void 0)&&bt.length)Wt=He(we.nodes,tt,Wt,[0,1]);else{const nt=((Ft=we.left)===null||Ft===void 0?void 0:Ft.length)/(((en=we.left)===null||en===void 0?void 0:en.length)+((on=we.right)===null||on===void 0?void 0:on.length));Wt=He(we.left,tt,Wt,[0,nt]),Wt=He(we.right,tt,Wt,[nt+.05,1])}tt+=Wt,Qt=!1,Fe-we.maxSize}),E.edges().forEach(we=>{var Re,Ye,Ot;const bt=E.edge(we),Ft=S.findIndex(en=>{const on=av(en,"source"),Wt=av(en,"target");return on===we.v&&Wt===we.w});if(!(Ft<=-1)&&s.edgeLabelSpace&&s.controlPoints&&S[Ft].type!=="loop"){const en=Ne==="x"?"y":"x",on=(Re=bt==null?void 0:bt.points)===null||Re===void 0?void 0:Re.slice(1,bt.points.length-1),Wt=[],nt=(Ye=E.node(we.v))===null||Ye===void 0?void 0:Ye[en],sn=nt-((Ot=E.node(we.w))===null||Ot===void 0?void 0:Ot[en]),We=Be[we.v],yn=We-Be[we.w];on==null||on.forEach(Kn=>{const te=(Kn[en]-nt)/sn*yn+We,Gn=ue(Kn[Ne],St,dt,te);Wt.push({x:Gn.x+z[0],y:Gn.y+z[1]})}),S[Ft].controlPoints=Wt}})}else{const q=new Set,ue=f==="BT"||f==="RL"?(Ne,Ae)=>Ae-Ne:(Ne,Ae)=>Ne-Ae;E.nodes().forEach(Ne=>{const Ae=E.node(Ne);if(!Ae)return;let Te=this.nodeMap[Ne];Te||(Te=_==null?void 0:_.find(rt=>rt.id===Ne)),Te&&(Te.x=Ae.x+z[0],Te.y=Ae.y+z[1],Te._order=Ae._order,q.add(H?Te.x:Te.y))});const ie=Array.from(q).sort(ue),be=H?(Ne,Ae)=>Ne.x!==Ae.x:(Ne,Ae)=>Ne.y!==Ae.y,De=H?(Ne,Ae,Te)=>{const rt=Math.max(Ae.y,Te.y),tt=Math.min(Ae.y,Te.y);return Ne.filter(Be=>Be.y<=rt&&Be.y>=tt)}:(Ne,Ae,Te)=>{const rt=Math.max(Ae.x,Te.x),tt=Math.min(Ae.x,Te.x);return Ne.filter(Be=>Be.x<=rt&&Be.x>=tt)};E.edges().forEach(Ne=>{var Ae;const Te=E.edge(Ne),rt=S.findIndex(tt=>{const Be=av(tt,"source"),dt=av(tt,"target");return Be===Ne.v&&dt===Ne.w});if(!(rt<=-1)&&s.edgeLabelSpace&&s.controlPoints&&S[rt].type!=="loop"){(Ae=Te==null?void 0:Te.points)===null||Ae===void 0||Ae.forEach(dt=>{dt.x+=z[0],dt.y+=z[1]});const tt=s.nodeMap[Ne.v],Be=s.nodeMap[Ne.w];S[rt].controlPoints=oQ(Te==null?void 0:Te.points,tt,Be,ie,H,be,De)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:c,edges:S}}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 oQ=(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:_}=t,{x:g,y:b}=n;if(r&&(f=t.y,_=t.x,g=n.y,b=n.x),b!==_&&f!==g){const x=a.indexOf(_),A=a[x+1];if(A){const T=v[0],I=r?{x:(_+A)/2,y:(T==null?void 0:T.y)||g}:{x:(T==null?void 0:T.x)||g,y:(_+A)/2};(!T||s(T,I))&&v.unshift(I)}const S=a.indexOf(b),E=Math.abs(S-x);if(E===1)v=c(v,t,n),v.length||v.push(r?{x:(_+b)/2,y:f}:{x:f,y:(_+b)/2});else if(E>1){const T=a[S-1];if(T){const I=v[v.length-1],R=r?{x:(b+T)/2,y:(I==null?void 0:I.y)||g}:{x:(I==null?void 0:I.x)||f,y:(b+T)/2};(!I||s(I,R))&&v.push(R)}}}}return v};var jA,DA,IA,LA;(function(e){e[e.META=0]="META",e[e.NODE=1]="NODE",e[e.BRIDGE=2]="BRIDGE"})(jA||(jA={})),(function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE",e[e.UNSPECIFIED=2]="UNSPECIFIED"})(DA||(DA={})),(function(e){e[e.META=0]="META",e[e.CORE=1]="CORE",e[e.BRIDGE=2]="BRIDGE"})(IA||(IA={})),(function(e){e[e.META=0]="META",e[e.OP=1]="OP",e[e.SERIES=2]="SERIES"})(LA||(LA={}));var dg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function GE(e,t){return e(t={exports:{}},t.exports),t.exports}var iQ=function(){this.__data__=[],this.size=0},zv=function(e,t){return e===t||e!=e&&t!=t},M_=function(e,t){for(var n=e.length;n--;)if(zv(e[n][0],t))return n;return-1},aQ=Array.prototype.splice,lQ=function(e){var t=this.__data__,n=M_(t,e);return!(n<0)&&(n==t.length-1?t.pop():aQ.call(t,n,1),--this.size,!0)},sQ=function(e){var t=this.__data__,n=M_(t,e);return n<0?void 0:t[n][1]},uQ=function(e){return M_(this.__data__,e)>-1},cQ=function(e,t){var n=this.__data__,a=M_(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=iQ,cv.prototype.delete=lQ,cv.prototype.get=sQ,cv.prototype.has=uQ,cv.prototype.set=cQ;var k_=cv,dQ=function(){this.__data__=new k_,this.size=0},fQ=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},pQ=function(e){return this.__data__.get(e)},hQ=function(e){return this.__data__.has(e)},TP=typeof dg=="object"&&dg&&dg.Object===Object&&dg,vQ=typeof self=="object"&&self&&self.Object===Object&&self,Su=TP||vQ||Function("return this")(),Ls=Su.Symbol,NP=Object.prototype,mQ=NP.hasOwnProperty,yQ=NP.toString,ym=Ls?Ls.toStringTag:void 0,gQ=function(e){var t=mQ.call(e,ym),n=e[ym];try{e[ym]=void 0;var a=!0}catch{}var r=yQ.call(e);return a&&(t?e[ym]=n:delete e[ym]),r},_Q=Object.prototype.toString,bQ=function(e){return _Q.call(e)},$A=Ls?Ls.toStringTag:void 0,ep=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":$A&&$A in Object(e)?gQ(e):bQ(e)},jl=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},FA,ny=function(e){if(!jl(e))return!1;var t=ep(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},B1=Su["__core-js_shared__"],BA=(FA=/[^.]+$/.exec(B1&&B1.keys&&B1.keys.IE_PROTO||""))?"Symbol(src)_1."+FA:"",wQ=function(e){return!!BA&&BA in e},EQ=Function.prototype.toString,ch=function(e){if(e!=null){try{return EQ.call(e)}catch{}try{return e+""}catch{}}return""},OQ=/^\[object .+?Constructor\]$/,xQ=Function.prototype,SQ=Object.prototype,AQ=xQ.toString,MQ=SQ.hasOwnProperty,kQ=RegExp("^"+AQ.call(MQ).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),TQ=function(e){return!(!jl(e)||wQ(e))&&(ny(e)?kQ:OQ).test(ch(e))},NQ=function(e,t){return e==null?void 0:e[t]},dh=function(e,t){var n=NQ(e,t);return TQ(n)?n:void 0},Wm=dh(Su,"Map"),Gm=dh(Object,"create"),PQ=function(){this.__data__=Gm?Gm(null):{},this.size=0},CQ=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},RQ=Object.prototype.hasOwnProperty,jQ=function(e){var t=this.__data__;if(Gm){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return RQ.call(t,e)?t[e]:void 0},DQ=Object.prototype.hasOwnProperty,IQ=function(e){var t=this.__data__;return Gm?t[e]!==void 0:DQ.call(t,e)},LQ=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Gm&&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=PQ,dv.prototype.delete=CQ,dv.prototype.get=jQ,dv.prototype.has=IQ,dv.prototype.set=LQ;var VA=dv,$Q=function(){this.size=0,this.__data__={hash:new VA,map:new(Wm||k_),string:new VA}},FQ=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},T_=function(e,t){var n=e.__data__;return FQ(t)?n[typeof t=="string"?"string":"hash"]:n.map},BQ=function(e){var t=T_(this,e).delete(e);return this.size-=t?1:0,t},VQ=function(e){return T_(this,e).get(e)},UQ=function(e){return T_(this,e).has(e)},WQ=function(e,t){var n=T_(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=$Q,fv.prototype.delete=BQ,fv.prototype.get=VQ,fv.prototype.has=UQ,fv.prototype.set=WQ;var N_=fv,GQ=function(e,t){var n=this.__data__;if(n instanceof k_){var a=n.__data__;if(!Wm||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new N_(a)}return n.set(e,t),this.size=n.size,this};function pv(e){var t=this.__data__=new k_(e);this.size=t.size}pv.prototype.clear=dQ,pv.prototype.delete=fQ,pv.prototype.get=pQ,pv.prototype.has=hQ,pv.prototype.set=GQ;var Ev=pv,zE=function(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e},Qg=(function(){try{var e=dh(Object,"defineProperty");return e({},"",{}),e}catch{}})(),P_=function(e,t,n){t=="__proto__"&&Qg?Qg(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},zQ=Object.prototype.hasOwnProperty,C_=function(e,t,n){var a=e[t];zQ.call(e,t)&&zv(a,n)&&(n!==void 0||t in e)||P_(e,t,n)},ry=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?P_(n,v,f):C_(n,v,f)}return n},HQ=function(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a},xu=function(e){return e!=null&&typeof e=="object"},UA=function(e){return xu(e)&&ep(e)=="[object Arguments]"},PP=Object.prototype,XQ=PP.hasOwnProperty,qQ=PP.propertyIsEnumerable,Pv=UA((function(){return arguments})())?UA:function(e){return xu(e)&&XQ.call(e,"callee")&&!qQ.call(e,"callee")},Ci=Array.isArray,YQ=function(){return!1},th=GE((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n?Su.Buffer:void 0,s=(r?r.isBuffer:void 0)||YQ;e.exports=s})),KQ=/^(?:0|[1-9]\d*)$/,R_=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&KQ.test(e))&&e>-1&&e%1==0&&e<t},HE=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 ZQ=function(e){return xu(e)&&HE(e.length)&&!!ai[ep(e)]},j_=function(e){return function(t){return e(t)}},Cv=GE((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n&&TP.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})),WA=Cv&&Cv.isTypedArray,oy=WA?j_(WA):ZQ,JQ=Object.prototype.hasOwnProperty,CP=function(e,t){var n=Ci(e),a=!n&&Pv(e),r=!n&&!a&&th(e),s=!n&&!a&&!r&&oy(e),c=n||a||r||s,v=c?HQ(e.length,String):[],f=v.length;for(var _ in e)!t&&!JQ.call(e,_)||c&&(_=="length"||r&&(_=="offset"||_=="parent")||s&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||R_(_,f))||v.push(_);return v},QQ=Object.prototype,D_=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||QQ)},RP=function(e,t){return function(n){return e(t(n))}},eee=RP(Object.keys,Object),tee=Object.prototype.hasOwnProperty,XE=function(e){if(!D_(e))return eee(e);var t=[];for(var n in Object(e))tee.call(e,n)&&n!="constructor"&&t.push(n);return t},jd=function(e){return e!=null&&HE(e.length)&&!ny(e)},tp=function(e){return jd(e)?CP(e):XE(e)},nee=function(e,t){return e&&ry(t,tp(t),e)},ree=function(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t},oee=Object.prototype.hasOwnProperty,iee=function(e){if(!jl(e))return ree(e);var t=D_(e),n=[];for(var a in e)(a!="constructor"||!t&&oee.call(e,a))&&n.push(a);return n},fh=function(e){return jd(e)?CP(e,!0):iee(e)},aee=function(e,t){return e&&ry(t,fh(t),e)},jP=GE((function(e,t){var n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,r=a&&a.exports===n?Su.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(c,v){if(v)return c.slice();var f=c.length,_=s?s(f):new c.constructor(f);return c.copy(_),_}})),DP=function(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t},IP=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},LP=function(){return[]},lee=Object.prototype.propertyIsEnumerable,GA=Object.getOwnPropertySymbols,qE=GA?function(e){return e==null?[]:(e=Object(e),IP(GA(e),(function(t){return lee.call(e,t)})))}:LP,see=function(e,t){return ry(e,qE(e),t)},YE=function(e,t){for(var n=-1,a=t.length,r=e.length;++n<a;)e[r+n]=t[n];return e},I_=RP(Object.getPrototypeOf,Object),$P=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)YE(t,qE(e)),e=I_(e);return t}:LP,uee=function(e,t){return ry(e,$P(e),t)},FP=function(e,t,n){var a=t(e);return Ci(e)?a:YE(a,n(e))},$w=function(e){return FP(e,tp,qE)},cee=function(e){return FP(e,fh,$P)},Fw=dh(Su,"DataView"),Bw=dh(Su,"Promise"),Ov=dh(Su,"Set"),Vw=dh(Su,"WeakMap"),dee=ch(Fw),fee=ch(Wm),pee=ch(Bw),hee=ch(Ov),vee=ch(Vw),Kp=ep;(Fw&&Kp(new Fw(new ArrayBuffer(1)))!="[object DataView]"||Wm&&Kp(new Wm)!="[object Map]"||Bw&&Kp(Bw.resolve())!="[object Promise]"||Ov&&Kp(new Ov)!="[object Set]"||Vw&&Kp(new Vw)!="[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 dee:return"[object DataView]";case fee:return"[object Map]";case pee:return"[object Promise]";case hee:return"[object Set]";case vee:return"[object WeakMap]"}return t});var nh=Kp,mee=Object.prototype.hasOwnProperty,yee=function(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&mee.call(e,"index")&&(n.index=e.index,n.input=e.input),n},e_=Su.Uint8Array,KE=function(e){var t=new e.constructor(e.byteLength);return new e_(t).set(new e_(e)),t},gee=function(e,t){var n=t?KE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},_ee=/\w*$/,bee=function(e){var t=new e.constructor(e.source,_ee.exec(e));return t.lastIndex=e.lastIndex,t},zA=Ls?Ls.prototype:void 0,HA=zA?zA.valueOf:void 0,wee=function(e){return HA?Object(HA.call(e)):{}},BP=function(e,t){var n=t?KE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},Eee=function(e,t,n){var a=e.constructor;switch(t){case"[object ArrayBuffer]":return KE(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return gee(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 BP(e,n);case"[object Map]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return bee(e);case"[object Set]":return new a;case"[object Symbol]":return wee(e)}},XA=Object.create,VP=(function(){function e(){}return function(t){if(!jl(t))return{};if(XA)return XA(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),UP=function(e){return typeof e.constructor!="function"||D_(e)?{}:VP(I_(e))},Oee=function(e){return xu(e)&&nh(e)=="[object Map]"},qA=Cv&&Cv.isMap,xee=qA?j_(qA):Oee,See=function(e){return xu(e)&&nh(e)=="[object Set]"},YA=Cv&&Cv.isSet,Aee=YA?j_(YA):See,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 WP=function e(t,n,a,r,s,c){var v,f=1&n,_=2&n,g=4&n;if(v!==void 0)return v;if(!jl(t))return t;var b=Ci(t);if(b){if(v=yee(t),!f)return DP(t,v)}else{var x=nh(t),A=x=="[object Function]"||x=="[object GeneratorFunction]";if(th(t))return jP(t,f);if(x=="[object Object]"||x=="[object Arguments]"||A&&!s){if(v=_||A?{}:UP(t),!f)return _?uee(t,aee(v,t)):see(t,nee(v,t))}else{if(!Qo[x])return s?t:{};v=Eee(t,x,f)}}c||(c=new Ev);var S=c.get(t);if(S)return S;c.set(t,v),Aee(t)?t.forEach((function(T){v.add(e(T,n,a,T,t,c))})):xee(t)&&t.forEach((function(T,I){v.set(I,e(T,n,a,I,t,c))}));var E=b?void 0:(g?_?cee:$w:_?fh:tp)(t);return zE(E||t,(function(T,I){E&&(T=t[I=T]),C_(v,I,e(T,n,a,I,t,c))})),v},Mee=function(e){return WP(e,4)},ZE=function(e){return function(){return e}},JE=(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}})(),QE=function(e,t){return e&&JE(e,t,tp)},L_=(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}})(QE),ph=function(e){return e},GP=function(e){return typeof e=="function"?e:ph},zP=function(e,t){return(Ci(e)?zE:L_)(e,GP(t))},HP=zP,kee=function(e,t){var n=[];return L_(e,(function(a,r,s){t(a,r,s)&&n.push(a)})),n},Tee=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nee=function(e){return this.__data__.has(e)};function Sg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new N_;++t<n;)this.add(e[t])}Sg.prototype.add=Sg.prototype.push=Tee,Sg.prototype.has=Nee;var XP=Sg,Pee=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},qP=function(e,t){return e.has(t)},YP=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 _=s.get(e),g=s.get(t);if(_&&g)return _==t&&g==e;var b=-1,x=!0,A=2&n?new XP:void 0;for(s.set(e,t),s.set(t,e);++b<v;){var S=e[b],E=t[b];if(a)var T=c?a(E,S,b,t,e,s):a(S,E,b,e,t,s);if(T!==void 0){if(T)continue;x=!1;break}if(A){if(!Pee(t,(function(I,R){if(!qP(A,R)&&(S===I||r(S,I,n,a,s)))return A.push(R)}))){x=!1;break}}else if(S!==E&&!r(S,E,n,a,s)){x=!1;break}}return s.delete(e),s.delete(t),x},Cee=function(e){var t=-1,n=Array(e.size);return e.forEach((function(a,r){n[++t]=[r,a]})),n},e2=function(e){var t=-1,n=Array(e.size);return e.forEach((function(a){n[++t]=a})),n},KA=Ls?Ls.prototype:void 0,V1=KA?KA.valueOf:void 0,Ree=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 e_(e),new e_(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return zv(+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=Cee;case"[object Set]":var f=1&a;if(v||(v=e2),e.size!=t.size&&!f)return!1;var _=c.get(e);if(_)return _==t;a|=2,c.set(e,t);var g=YP(v(e),v(t),a,r,s,c);return c.delete(e),g;case"[object Symbol]":if(V1)return V1.call(e)==V1.call(t)}return!1},jee=Object.prototype.hasOwnProperty,Dee=function(e,t,n,a,r,s){var c=1&n,v=$w(e),f=v.length;if(f!=$w(t).length&&!c)return!1;for(var _=f;_--;){var g=v[_];if(!(c?g in t:jee.call(t,g)))return!1}var b=s.get(e),x=s.get(t);if(b&&x)return b==t&&x==e;var A=!0;s.set(e,t),s.set(t,e);for(var S=c;++_<f;){var E=e[g=v[_]],T=t[g];if(a)var I=c?a(T,E,g,t,e,s):a(E,T,g,e,t,s);if(!(I===void 0?E===T||r(E,T,n,a,s):I)){A=!1;break}S||(S=g=="constructor")}if(A&&!S){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||(A=!1)}return s.delete(e),s.delete(t),A},ZA=Object.prototype.hasOwnProperty,Iee=function(e,t,n,a,r,s){var c=Ci(e),v=Ci(t),f=c?"[object Array]":nh(e),_=v?"[object Array]":nh(t),g=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",b=(_=_=="[object Arguments]"?"[object Object]":_)=="[object Object]",x=f==_;if(x&&th(e)){if(!th(t))return!1;c=!0,g=!1}if(x&&!g)return s||(s=new Ev),c||oy(e)?YP(e,t,n,a,r,s):Ree(e,t,f,n,a,r,s);if(!(1&n)){var A=g&&ZA.call(e,"__wrapped__"),S=b&&ZA.call(t,"__wrapped__");if(A||S){var E=A?e.value():e,T=S?t.value():t;return s||(s=new Ev),r(E,T,n,a,s)}}return!!x&&(s||(s=new Ev),Dee(e,t,n,a,r,s))},KP=function e(t,n,a,r,s){return t===n||(t==null||n==null||!xu(t)&&!xu(n)?t!=t&&n!=n:Iee(t,n,a,r,e,s))},Lee=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],_=c[1];if(c[2]){if(f===void 0&&!(v in e))return!1}else{var g=new Ev,b;if(!(b===void 0?KP(_,f,3,a,g):b))return!1}}return!0},ZP=function(e){return e==e&&!jl(e)},$ee=function(e){for(var t=tp(e),n=t.length;n--;){var a=t[n],r=e[a];t[n]=[a,r,ZP(r)]}return t},JP=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},Fee=function(e){var t=$ee(e);return t.length==1&&t[0][2]?JP(t[0][0],t[0][1]):function(n){return n===e||Lee(n,e,t)}},rh=function(e){return typeof e=="symbol"||xu(e)&&ep(e)=="[object Symbol]"},Bee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vee=/^\w*$/,t2=function(e,t){if(Ci(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!rh(e))||Vee.test(e)||!Bee.test(e)||t!=null&&e in Object(t)};function n2(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(n2.Cache||N_),n}n2.Cache=N_;var Uee=n2,Wee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gee=/\\(\\)?/g,zee=(function(e){var t=Uee(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(Wee,(function(n,a,r,s){t.push(r?s.replace(Gee,"$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},JA=Ls?Ls.prototype:void 0,QA=JA?JA.toString:void 0,Hee=function e(t){if(typeof t=="string")return t;if(Ci(t))return xv(t,e)+"";if(rh(t))return QA?QA.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},QP=function(e){return e==null?"":Hee(e)},$_=function(e,t){return Ci(e)?e:t2(e,t)?[e]:zee(QP(e))},iy=function(e){if(typeof e=="string"||rh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},F_=function(e,t){for(var n=0,a=(t=$_(t,e)).length;e!=null&&n<a;)e=e[iy(t[n++])];return n&&n==a?e:void 0},Xee=function(e,t,n){var a=e==null?void 0:F_(e,t);return a===void 0?n:a},qee=function(e,t){return e!=null&&t in Object(e)},eC=function(e,t,n){for(var a=-1,r=(t=$_(t,e)).length,s=!1;++a<r;){var c=iy(t[a]);if(!(s=e!=null&&n(e,c)))break;e=e[c]}return s||++a!=r?s:!!(r=e==null?0:e.length)&&HE(r)&&R_(c,r)&&(Ci(e)||Pv(e))},tC=function(e,t){return e!=null&&eC(e,t,qee)},Yee=function(e,t){return t2(e)&&ZP(t)?JP(iy(e),t):function(n){var a=Xee(n,e);return a===void 0&&a===t?tC(n,e):KP(t,a,3)}},nC=function(e){return function(t){return t==null?void 0:t[e]}},Kee=function(e){return function(t){return F_(t,e)}},Zee=function(e){return t2(e)?nC(iy(e)):Kee(e)},Dd=function(e){return typeof e=="function"?e:e==null?ph:typeof e=="object"?Ci(e)?Yee(e[0],e[1]):Fee(e):Zee(e)},rC=function(e,t){return(Ci(e)?IP:kee)(e,Dd(t))},Jee=Object.prototype.hasOwnProperty,Qee=function(e,t){return e!=null&&Jee.call(e,t)},oC=function(e,t){return e!=null&&eC(e,t,Qee)},ete=Object.prototype.hasOwnProperty,tte=function(e){if(e==null)return!0;if(jd(e)&&(Ci(e)||typeof e=="string"||typeof e.splice=="function"||th(e)||oy(e)||Pv(e)))return!e.length;var t=nh(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(D_(e))return!XE(e).length;for(var n in e)if(ete.call(e,n))return!1;return!0},iC=function(e){return e===void 0},aC=function(e,t){var n=-1,a=jd(e)?Array(e.length):[];return L_(e,(function(r,s,c){a[++n]=t(r,s,c)})),a},lC=function(e,t){return(Ci(e)?xv:aC)(e,Dd(t))},nte=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},rte=function(e,t,n,a,r){return r(e,(function(s,c,v){n=a?(a=!1,s):t(n,s,c,v)})),n},sC=function(e,t,n){var a=Ci(e)?nte:rte,r=arguments.length<3;return a(e,Dd(t),n,r,L_)},ote=function(e){return typeof e=="string"||!Ci(e)&&xu(e)&&ep(e)=="[object String]"},ite=nC("length"),ate=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),lte=function(e){return ate.test(e)},ste="[\\ud800-\\udfff]",Uw="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ww="\\ud83c[\\udffb-\\udfff]",uC="[^\\ud800-\\udfff]",cC="(?:\\ud83c[\\udde6-\\uddff]){2}",dC="[\\ud800-\\udbff][\\udc00-\\udfff]",eM="(?:"+Uw+"|"+Ww+")?",ute="[\\ufe0e\\ufe0f]?"+eM+("(?:\\u200d(?:"+[uC,cC,dC].join("|")+")[\\ufe0e\\ufe0f]?"+eM+")*"),cte="(?:"+[uC+Uw+"?",Uw,cC,dC,ste].join("|")+")",tM=RegExp(Ww+"(?="+Ww+")|"+cte+ute,"g"),dte=function(e){for(var t=tM.lastIndex=0;tM.test(e);)++t;return t},fte=function(e){return lte(e)?dte(e):ite(e)},pte=function(e){if(e==null)return 0;if(jd(e))return ote(e)?fte(e):e.length;var t=nh(e);return t=="[object Map]"||t=="[object Set]"?e.size:XE(e).length},hte=function(e,t,n){var a=Ci(e),r=a||th(e)||oy(e);if(t=Dd(t),n==null){var s=e&&e.constructor;n=r?a?new s:[]:jl(e)&&ny(s)?VP(I_(e)):{}}return(r?zE:QE)(e,(function(c,v,f){return t(n,c,v,f)})),n},nM=Ls?Ls.isConcatSpreadable:void 0,vte=function(e){return Ci(e)||Pv(e)||!!(nM&&e&&e[nM])},r2=function(t,n,a,r,s){var c=-1,v=t.length;for(a||(a=vte),s||(s=[]);++c<v;){var f=t[c];a(f)?YE(s,f):r||(s[s.length]=f)}return s},mte=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)},rM=Math.max,fC=function(e,t,n){return t=rM(t===void 0?e.length-1:t,0),function(){for(var a=arguments,r=-1,s=rM(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),mte(e,this,v)}},yte=Qg?function(e,t){return Qg(e,"toString",{configurable:!0,enumerable:!1,value:ZE(t),writable:!0})}:ph,gte=Date.now,pC=(function(e){var t=0,n=0;return function(){var a=gte(),r=16-(a-n);if(n=a,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}})(yte),B_=function(e,t){return pC(fC(e,t,ph),e+"")},hC=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},_te=function(e){return e!=e},bte=function(e,t,n){for(var a=n-1,r=e.length;++a<r;)if(e[a]===t)return a;return-1},wte=function(e,t,n){return t==t?bte(e,t,n):hC(e,_te,n)},Ete=function(e,t){return!!(e!=null&&e.length)&&wte(e,t,0)>-1},Ote=function(){},xte=Ov&&1/e2(new Ov([,-0]))[1]==1/0?function(e){return new Ov(e)}:Ote,Ste=function(e,t,n){var a=-1,r=Ete,s=e.length,c=!0,v=[],f=v;if(s>=200){var _=xte(e);if(_)return e2(_);c=!1,r=qP,f=new XP}else f=v;e:for(;++a<s;){var g=e[a],b=g;if(g=g!==0?g:0,c&&b==b){for(var x=f.length;x--;)if(f[x]===b)continue e;v.push(g)}else r(f,b,n)||(f!==v&&f.push(b),v.push(g))}return v},vC=function(e){return xu(e)&&jd(e)},Ate=B_((function(e){return Ste(r2(e,1,vC,!0))})),Mte=function(e,t){return xv(t,(function(n){return e[n]}))},t_,mC=function(e){return e==null?[]:Mte(e,tp(e))};try{t_={clone:Mee,constant:ZE,each:HP,filter:rC,has:oC,isArray:Ci,isEmpty:tte,isFunction:ny,isUndefined:iC,keys:tp,map:lC,reduce:sC,size:pte,transform:hte,union:Ate,values:mC}}catch{}t_||(t_=window._);var kn=t_,o2=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 oM(e,t){e[t]?e[t]++:e[t]=1}function iM(e,t){--e[t]||delete e[t]}function xm(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 kte(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 U1(e,t){return xm(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=xm(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=kte(this._isDirected,e,t,n);return e=v.v,t=v.w,Object.freeze(v),this._edgeObjs[c]=v,oM(this._preds[t],e),oM(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?U1(this._isDirected,arguments[0]):xm(this._isDirected,e,t,n);return this._edgeLabels[a]},Hr.prototype.hasEdge=function(e,t,n){var a=arguments.length===1?U1(this._isDirected,arguments[0]):xm(this._isDirected,e,t,n);return kn.has(this._edgeLabels,a)},Hr.prototype.removeEdge=function(e,t,n){var a=arguments.length===1?U1(this._isDirected,arguments[0]):xm(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],iM(this._preds[t],e),iM(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 aM={Graph:o2,version:"2.1.8"},Tte={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Nte(e),edges:Pte(e)};return kn.isUndefined(e.graph())||(t.value=kn.clone(e.graph())),t},read:function(e){var t=new o2(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 Nte(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 Pte(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 Cte=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},yC=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 gC=function(e,t,n,a){return(function(r,s,c,v){var f,_,g={},b=new yC,x=function(A){var S=A.v!==f?A.v:A.w,E=g[S],T=c(A),I=_.distance+T;if(T<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+A+" Weight: "+T);I<E.distance&&(E.distance=I,E.predecessor=f,b.decrease(S,I))};for(r.nodes().forEach((function(A){var S=A===s?0:Number.POSITIVE_INFINITY;g[A]={distance:S},b.add(A,S)}));b.size()>0&&(f=b.removeMin(),(_=g[f]).distance!==Number.POSITIVE_INFINITY);)v(f).forEach(x);return g})(e,String(t),n||Rte,a||function(r){return e.outEdges(r)})},Rte=kn.constant(1),jte=function(e,t,n){return kn.transform(e.nodes(),(function(a,r){a[r]=gC(e,r,t,n)}),{})},_C=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(g){kn.has(a,g)?a[g].onStack&&(v.lowlink=Math.min(v.lowlink,a[g].index)):(s(g),v.lowlink=Math.min(v.lowlink,a[g].lowlink))})),v.lowlink===v.index){var f,_=[];do f=n.pop(),a[f].onStack=!1,_.push(f);while(c!==f);r.push(_)}}return e.nodes().forEach((function(c){kn.has(a,c)||s(c)})),r},Dte=function(e){return kn.filter(_C(e),(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])}))},Ite=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(_){f!==_&&(c[f][_]={distance:Number.POSITIVE_INFINITY})})),s(f).forEach((function(_){var g=_.v===f?_.w:_.v,b=r(_);c[f][g]={distance:b,predecessor:f}}))})),v.forEach((function(f){var _=c[f];v.forEach((function(g){var b=c[g];v.forEach((function(x){var A=b[f],S=_[x],E=b[x],T=A.distance+S.distance;T<E.distance&&(E.distance=T,E.predecessor=S.predecessor)}))}))})),c})(e,t||Lte,n||function(a){return e.outEdges(a)})},Lte=kn.constant(1),W1=bC;function bC(e){var t={},n={},a=[];if(kn.each(e.sinks(),(function r(s){if(kn.has(n,s))throw new n_;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 n_;return a}function n_(){}bC.CycleException=n_,n_.prototype=new Error;var lM=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);wC(e,c,n==="post",s,a,r)})),r};function wC(e,t,n,a,r,s){kn.has(a,t)||(a[t]=!0,n||s.push(t),kn.each(r(t),(function(c){wC(e,c,n,a,r,s)})),n&&s.push(t))}var r_,$te={Graph:aM.Graph,json:Tte,alg:{components:Cte,dijkstra:gC,dijkstraAll:jte,findCycles:Dte,floydWarshall:Ite,isAcyclic:function(e){try{W1(e)}catch(t){if(t instanceof W1.CycleException)return!1;throw t}return!0},postorder:function(e,t){return lM(e,t,"post")},preorder:function(e,t){return lM(e,t,"pre")},prim:function(e,t){var n,a=new o2,r={},s=new yC;function c(f){var _=f.v===n?f.w:f.v,g=s.priority(_);if(g!==void 0){var b=t(f);b<g&&(r[_]=n,s.decrease(_,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:_C,topsort:W1},version:aM.version};try{r_=$te}catch{}r_||(r_=window.graphlib);var yc=r_,Fte=function(e){return WP(e,5)},zm=function(e,t,n){if(!jl(n))return!1;var a=typeof t;return!!(a=="number"?jd(n)&&R_(t,n.length):a=="string"&&t in n)&&zv(n[t],e)},EC=Object.prototype,Bte=EC.hasOwnProperty,Vte=B_((function(e,t){e=Object(e);var n=-1,a=t.length,r=a>2?t[2]:void 0;for(r&&zm(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 _=c[v],g=e[_];(g===void 0||zv(g,EC[_])&&!Bte.call(e,_))&&(e[_]=s[_])}return e})),Ute=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}},Wte=/^\s+|\s+$/g,Gte=/^[-+]0x[0-9a-f]+$/i,zte=/^0b[01]+$/i,Hte=/^0o[0-7]+$/i,Xte=parseInt,qte=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(Wte,"");var n=zte.test(e);return n||Hte.test(e)?Xte(e.slice(2),n?2:8):Gte.test(e)?NaN:+e},Ag=function(e){return e?(e=qte(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},Yte=function(e){var t=Ag(e),n=t%1;return t==t?n?t-n:t:0},Kte=Math.max,Zte=Ute((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=Kte(a+r,0)),hC(e,Dd(t),r)})),OC=function(e){return e!=null&&e.length?r2(e):[]},Jte=function(e,t){return e==null?e:JE(e,GP(t),fh)},Qte=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0},ene=function(e,t){var n={};return t=Dd(t),QE(e,(function(a,r,s){P_(n,r,t(a,r,s))})),n},i2=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},tne=function(e,t){return e>t},nne=function(e){return e&&e.length?i2(e,ph,tne):void 0},Gw=function(e,t,n){(n!==void 0&&!zv(e[t],n)||n===void 0&&!(t in e))&&P_(e,t,n)},rne=Function.prototype,one=Object.prototype,xC=rne.toString,ine=one.hasOwnProperty,ane=xC.call(Object),lne=function(e){if(!xu(e)||ep(e)!="[object Object]")return!1;var t=I_(e);if(t===null)return!0;var n=ine.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&xC.call(n)==ane},sM=function(e,t){if((t!=="constructor"||typeof e[t]!="function")&&t!="__proto__")return e[t]},sne=function(e){return ry(e,fh(e))},une=function(e,t,n,a,r,s,c){var v=sM(e,n),f=sM(t,n),_=c.get(f);if(_)Gw(e,n,_);else{var g=void 0,b=g===void 0;if(b){var x=Ci(f),A=!x&&th(f),S=!x&&!A&&oy(f);g=f,x||A||S?Ci(v)?g=v:vC(v)?g=DP(v):A?(b=!1,g=jP(f,!0)):S?(b=!1,g=BP(f,!0)):g=[]:lne(f)||Pv(f)?(g=v,Pv(v)?g=sne(v):jl(v)&&!ny(v)||(g=UP(f))):b=!1}b&&(c.set(f,g),r(g,f,a,s,c),c.delete(f)),Gw(e,n,g)}},cne=function e(t,n,a,r,s){t!==n&&JE(n,(function(c,v){if(s||(s=new Ev),jl(c))une(t,n,v,a,e,r,s);else{var f=void 0;f===void 0&&(f=c),Gw(t,v,f)}}),fh)},dne=(function(e){return B_((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&&zm(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){cne(e,t,n)})),SC=function(e,t){return e<t},fne=function(e){return e&&e.length?i2(e,ph,SC):void 0},pne=function(e,t){return e&&e.length?i2(e,Dd(t),SC):void 0},hne=function(){return Su.Date.now()},vne=function(e,t,n,a){if(!jl(e))return e;for(var r=-1,s=(t=$_(t,e)).length,c=s-1,v=e;v!=null&&++r<s;){var f=iy(t[r]),_=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(r!=c){var g=v[f];(_=void 0)==void 0&&(_=jl(g)?g:R_(t[r+1])?[]:{})}C_(v,f,_),v=v[f]}return e},mne=function(e,t,n){for(var a=-1,r=t.length,s={};++a<r;){var c=t[a],v=F_(e,c);n(v,c)&&vne(s,$_(c,e),v)}return s},yne=function(e,t){return mne(e,t,(function(n,a){return tC(e,a)}))},gne=(function(e){return pC(fC(e,void 0,OC),e+"")})((function(e,t){return e==null?{}:yne(e,t)})),_ne=Math.ceil,bne=Math.max,wne=function(e,t,n,a){for(var r=-1,s=bne(_ne((t-e)/(n||1)),0),c=Array(s);s--;)c[++r]=e,e+=n;return c},Ene=(function(e){return function(t,n,a){return a&&typeof a!="number"&&zm(t,n,a)&&(n=a=void 0),t=Ag(t),n===void 0?(n=t,t=0):n=Ag(n),a=a===void 0?t<n?1:-1:Ag(a),wne(t,n,a)}})(),One=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},xne=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,_=rh(t);if(!v&&!_&&!s&&e>t||s&&c&&f&&!v&&!_||a&&c&&f||!n&&f||!r)return 1;if(!a&&!s&&!_&&e<t||_&&n&&r&&!a&&!s||v&&n&&r||!c&&r||!f)return-1}return 0},Sne=function(e,t,n){for(var a=-1,r=e.criteria,s=t.criteria,c=r.length,v=n.length;++a<c;){var f=xne(r[a],s[a]);if(f)return a>=v?f:f*(n[a]=="desc"?-1:1)}return e.index-t.index},Ane=function(e,t,n){t=t.length?xv(t,(function(s){return Ci(s)?function(c){return F_(c,s.length===1?s[0]:s)}:s})):[ph];var a=-1;t=xv(t,j_(Dd));var r=aC(e,(function(s,c,v){return{criteria:xv(t,(function(f){return f(s)})),index:++a,value:s}}));return One(r,(function(s,c){return Sne(s,c,n)}))},Mne=B_((function(e,t){if(e==null)return[];var n=t.length;return n>1&&zm(e,t[0],t[1])?t=[]:n>2&&zm(t[0],t[1],t[2])&&(t=[t[0]]),Ane(e,r2(t),[])})),kne=0,Tne=function(e){var t=++kne;return QP(e)+t},Nne=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},o_,Pne=function(e,t){return Nne(e||[],t||[],C_)};try{o_={cloneDeep:Fte,constant:ZE,defaults:Vte,each:HP,filter:rC,find:Zte,flatten:OC,forEach:zP,forIn:Jte,has:oC,isUndefined:iC,last:Qte,map:lC,mapValues:ene,max:nne,merge:dne,min:fne,minBy:pne,now:hne,pick:gne,range:Ene,reduce:sC,sortBy:Mne,uniqueId:Tne,values:mC,zipObject:Pne}}catch{}o_||(o_=window._);var Cne=o_;yc.Graph;Cne.constant(1);yc.Graph;yc.Graph;yc.alg.preorder;yc.alg.postorder;yc.Graph;yc.Graph;yc.Graph;yc.Graph;yc.Graph;var G1,uM;function Rne(){if(uM)return G1;uM=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return G1=t,G1}var z1,cM;function jne(){if(cM)return z1;cM=1;var e=tE(),t=Rne(),n=nE(),a="[object Arguments]",r="[object Array]",s="[object Boolean]",c="[object Date]",v="[object Error]",f="[object Function]",_="[object Map]",g="[object Number]",b="[object Object]",x="[object RegExp]",A="[object Set]",S="[object String]",E="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",R="[object Float32Array]",U="[object Float64Array]",L="[object Int8Array]",D="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",B="[object Uint8ClampedArray]",V="[object Uint16Array]",z="[object Uint32Array]",H={};H[R]=H[U]=H[L]=H[D]=H[W]=H[Y]=H[B]=H[V]=H[z]=!0,H[a]=H[r]=H[T]=H[s]=H[I]=H[c]=H[v]=H[f]=H[_]=H[g]=H[b]=H[x]=H[A]=H[S]=H[E]=!1;function q(ee){return n(ee)&&t(ee.length)&&!!H[e(ee)]}return z1=q,z1}var H1,dM;function Dne(){if(dM)return H1;dM=1;function e(t){return function(n){return t(n)}}return H1=e,H1}var Sm={exports:{}};Sm.exports;var fM;function Ine(){return fM||(fM=1,(function(e,t){var n=zD(),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})(Sm,Sm.exports)),Sm.exports}var X1,pM;function Lne(){if(pM)return X1;pM=1;var e=jne(),t=Dne(),n=Ine(),a=n&&n.isTypedArray,r=a?t(a):e;return X1=r,X1}Lne();var q1,hM;function $ne(){if(hM)return q1;hM=1;var e=tE(),t=nE(),n="[object Number]";function a(r){return typeof r=="number"||t(r)&&e(r)==n}return q1=a,q1}$ne();var Y1={exports:{}},K1={exports:{}},vM;function AC(){return vM||(vM=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})(K1)),K1.exports}var Z1={exports:{}},J1={exports:{}},mM;function MC(){return mM||(mM=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(A,S){t(f,A,function(E){return this._invoke(A,S,E)})}_?c?c(f,_,{value:g,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})(J1)),J1.exports}var yM;function kC(){return yM||(yM=1,(function(e){var t=MC();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 L=I&&I.prototype instanceof g?I:g,D=Object.create(L.prototype);return t(D,"_invoke",(function(W,Y,B){var V,z,H,q=0,ee=B||[],ue=!1,ie={p:0,n:0,v:a,a:be,f:be.bind(a,4),d:function(Ne,Ae){return V=Ne,z=0,H=a,ie.n=Ae,_}};function be(De,Ne){for(z=De,H=Ne,r=0;!ue&&q&&!Ae&&r<ee.length;r++){var Ae,Te=ee[r],rt=ie.p,tt=Te[2];De>3?(Ae=tt===Ne)&&(H=Te[(z=Te[4])?5:(z=3,3)],Te[4]=Te[5]=a):Te[0]<=rt&&((Ae=De<2&&rt<Te[1])?(z=0,ie.v=Ne,ie.n=Te[1]):rt<tt&&(Ae=De<3||Te[0]>Ne||Ne>tt)&&(Te[4]=De,Te[5]=Ne,ie.n=tt,z=0))}if(Ae||De>1)return _;throw ue=!0,Ne}return function(De,Ne,Ae){if(q>1)throw TypeError("Generator is already running");for(ue&&Ne===1&&be(Ne,Ae),z=Ne,H=Ae;(r=z<2?a:H)||!ue;){V||(z?z<3?(z>1&&(ie.n=-1),be(z,H)):ie.n=H:ie.v=H);try{if(q=2,V){if(z||(De="next"),r=V[De]){if(!(r=r.call(V,H)))throw TypeError("iterator result is not an object");if(!r.done)return r;H=r.value,z<2&&(z=0)}else z===1&&(r=V.return)&&r.call(V),z<2&&(H=TypeError("The iterator does not provide a '"+De+"' method"),z=1);V=a}else if((r=(ue=ie.n<0)?H:W.call(Y,ie))!==_)break}catch(Te){V=a,z=1,H=Te}finally{q=1}}return{value:r,done:ue}}})(T,R,U),!0),D}var _={};function g(){}function b(){}function x(){}r=Object.getPrototypeOf;var A=[][c]?r(r([][c]())):(t(r={},c,function(){return this}),r),S=x.prototype=g.prototype=Object.create(A);function E(T){return Object.setPrototypeOf?Object.setPrototypeOf(T,x):(T.__proto__=x,t(T,v,"GeneratorFunction")),T.prototype=Object.create(S),T}return b.prototype=x,t(S,"constructor",x),t(x,"constructor",b),b.displayName="GeneratorFunction",t(x,v,"GeneratorFunction"),t(S),t(S,v,"Generator"),t(S,c,function(){return this}),t(S,"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})(Z1)),Z1.exports}var Q1={exports:{}},ew={exports:{}},tw={exports:{}},gM;function TC(){return gM||(gM=1,(function(e){var t=AC(),n=MC();function a(r,s){function c(f,_,g,b){try{var x=r[f](_),A=x.value;return A instanceof t?s.resolve(A.v).then(function(S){c("next",S,g,b)},function(S){c("throw",S,g,b)}):s.resolve(A).then(function(S){x.value=S,g(x)},function(S){return c("throw",S,g,b)})}catch(S){b(S)}}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,A){c(f,g,x,A)})}return v=v?v.then(b,b):b()},!0)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(tw)),tw.exports}var _M;function NC(){return _M||(_M=1,(function(e){var t=kC(),n=TC();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})(ew)),ew.exports}var bM;function Fne(){return bM||(bM=1,(function(e){var t=NC();function n(a,r,s,c,v){var f=t(a,r,s,c,v);return f.next().then(function(_){return _.done?_.value:f.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Q1)),Q1.exports}var nw={exports:{}},wM;function Bne(){return wM||(wM=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})(nw)),nw.exports}var rw={exports:{}},ow={exports:{}},EM;function Vne(){return EM||(EM=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})(ow)),ow.exports}var OM;function Une(){return OM||(OM=1,(function(e){var t=Vne().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})(rw)),rw.exports}var xM;function Wne(){return xM||(xM=1,(function(e){var t=AC(),n=kC(),a=Fne(),r=NC(),s=TC(),c=Bne(),v=Une();function f(){var _=n(),g=_.m(f),b=(Object.getPrototypeOf?Object.getPrototypeOf(g):g.__proto__).constructor;function x(E){var T=typeof E=="function"&&E.constructor;return!!T&&(T===b||(T.displayName||T.name)==="GeneratorFunction")}var A={throw:1,return:2,break:3,continue:3};function S(E){var T,I;return function(R){T||(T={stop:function(){return I(R.a,2)},catch:function(){return R.v},abrupt:function(L,D){return I(R.a,A[L],D)},delegateYield:function(L,D,W){return T.resultName=D,I(R.d,v(L),W)},finish:function(L){return I(R.f,L)}},I=function(L,D,W){R.p=T.prev,R.n=T.next;try{return L(D,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,L){return _.w(S(I),R,U,L&&L.reverse())},isGeneratorFunction:x,mark:_.m,awrap:function(I,R){return new t(I,R)},AsyncIterator:s,async:function(I,R,U,L,D){return(x(R)?r:a)(S(I),R,U,L,D)},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})(Y1)),Y1.exports}var iw,SM;function Gne(){if(SM)return iw;SM=1;var e=Wne()();iw=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return iw}Gne();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 AM;(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>[]"})(AM||(AM={}));var MM;(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"})(MM||(MM={}));var kM;(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"})(kM||(kM={}));var TM;(function(e){e.GLSL100="GLSL100",e.GLSL450="GLSL450",e.WGSL="WGSL"})(TM||(TM={}));var Mg={exports:{}},zne=Mg.exports,NM;function Hne(){return NM||(NM=1,(function(e,t){(function(n,a){e.exports=a()})(zne,(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),st=0;st<Oe.length;++st)G[Oe[st]]=se[Oe[st]];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,se,Oe){G in se||c("unknown parameter ("+G+")"+f(Oe)+". possible values: "+Object.keys(se).join())}function g(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 A(G,se){G>=0&&(G|0)===G||c("invalid parameter type, ("+G+")"+f(se)+". must be a nonnegative integer")}function S(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 L(G,se,Oe){this.file=G,this.line=se,this.message=Oe}function D(){var G=new Error,se=(G.stack||G).toString(),Oe=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(se);if(Oe)return Oe[1];var st=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(se);return st?st[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 st=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(se);return st?st[1]:"unknown"}function Y(G,se){var Oe=G.split(`
`),st=1,gt=0,ot={unknown:new R,0:new R};ot.unknown.name=ot[0].name=se||D(),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&&(st=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(st++,Rt))}return Object.keys(ot).forEach(function(Zt){var Gt=ot[Zt];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 st=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Oe);st?se.push(new L(st[1]|0,st[2]|0,st[3].trim())):Oe.length>0&&se.push(new L("unknown",0,Oe))}}),se}function V(G,se){se.forEach(function(Oe){var st=G[Oe.file];if(st){var gt=st.index[Oe.line];if(gt){gt.errors.push(Oe),st.hasErrors=!0;return}}G.unknown.hasErrors=!0,G.unknown.lines[0].errors.push(Oe)})}function z(G,se,Oe,st,gt){if(!G.getShaderParameter(se,G.COMPILE_STATUS)){var ot=G.getShaderInfoLog(se),mt=st===G.FRAGMENT_SHADER?"fragment":"vertex";De(Oe,"string",mt+" shader source must be a string",gt);var Rt=Y(Oe,gt),Bt=B(ot);V(Rt,Bt),Object.keys(Rt).forEach(function(jt){var ht=Rt[jt];if(!ht.hasErrors)return;var Zt=[""],Gt=[""];function Dt(At,Ze){Zt.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,nn=/^\s*'(.*)'\s*:\s*(.*)$/.exec($t);if(nn){var kt=nn[1];switch($t=nn[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]=Zt.join("%c"),console.log.apply(console,Gt)):console.log(Zt.join(""))}),v.raise("Error compiling "+mt+" shader, "+Rt[0].name)}}function H(G,se,Oe,st,gt){if(!G.getProgramParameter(se,G.LINK_STATUS)){var ot=G.getProgramInfoLog(se),mt=Y(Oe,gt),Rt=Y(st,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 q(G){G._commandRef=D()}function ee(G,se,Oe,st){q(G);function gt(Bt){return Bt?st.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[st.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||D())+(Oe==="unknown"?"":" called from "+Oe))}function ie(G,se,Oe){G||ue(se,Oe||D())}function be(G,se,Oe,st){G in se||ue("unknown parameter ("+G+")"+f(Oe)+". possible values: "+Object.keys(se).join(),st||D())}function De(G,se,Oe,st){b(G,se)||ue("invalid parameter type"+f(Oe)+". expected "+se+", got "+typeof G,st||D())}function Ne(G){G()}function Ae(G,se,Oe){G.texture?S(G.texture._texture.internalformat,se,"unsupported texture format for attachment"):S(G.renderbuffer._renderbuffer.format,Oe,"unsupported renderbuffer format for attachment")}var Te=33071,rt=9728,tt=9984,Be=9985,dt=9986,St=9987,He=5120,Qt=5121,Fe=5122,we=5123,Re=5124,Ye=5125,Ot=5126,bt=32819,Ft=32820,en=33635,on=34042,Wt=36193,nt={};nt[He]=nt[Qt]=1,nt[Fe]=nt[we]=nt[Wt]=nt[en]=nt[bt]=nt[Ft]=2,nt[Re]=nt[Ye]=nt[Ot]=nt[on]=4;function sn(G,se){return G===Ft||G===bt||G===en?2:G===on?4:nt[G]*se}function We(G){return!(G&G-1)&&!!G}function yn(G,se,Oe){var st,gt=se.width,ot=se.height,mt=se.channels;v(gt>0&&gt<=Oe.maxTextureSize&&ot>0&&ot<=Oe.maxTextureSize,"invalid texture shape"),(G.wrapS!==Te||G.wrapT!==Te)&&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!==dt&&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(st=0;st<16;++st)if(Rt[st]){var Bt=gt>>st,jt=ot>>st;v(se.mipmask&1<<st,"missing mipmap data");var ht=Rt[st];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 Zt=Math.ceil(sn(ht.type,mt)*Bt/ht.unpackAlignment)*ht.unpackAlignment;v(ht.data.byteLength===Zt*jt,"invalid data for image, buffer size is inconsistent with image format")}else ht.element||ht.copy}else G.genMipmaps||v((se.mipmask&1<<st)===0,"extra mipmap data");se.compressed&&v(!G.genMipmaps,"mipmap generation for compressed images not supported")}function Kn(G,se,Oe,st){var gt=G.width,ot=G.height,mt=G.channels;v(gt>0&&gt<=st.maxTextureSize&&ot>0&&ot<=st.maxTextureSize,"invalid texture shape"),v(gt===ot,"cube map must be square"),v(se.wrapS===Te&&se.wrapT===Te,"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 Zt=jt[ht];if(Zt){var Gt=gt>>ht,Dt=ot>>ht;v(Bt.mipmask&1<<ht,"missing mipmap data"),v(Zt.width===Gt&&Zt.height===Dt,"invalid shape for mip images"),v(Zt.format===G.format&&Zt.internalformat===G.internalformat&&Zt.type===G.type,"incompatible type for mip image"),Zt.compressed||(Zt.data?v(Zt.data.byteLength===Gt*Dt*Math.max(sn(Zt.type,mt),Zt.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Zt.element||Zt.copy)}}}}var te=a(v,{optional:Ne,raise:c,commandRaise:ue,command:ie,parameter:_,commandParameter:be,constructor:T,type:x,commandType:De,isTypedArray:g,nni:A,oneOf:S,shaderError:z,linkError:H,callSite:W,saveCommandRef:q,saveDrawInfo:ee,framebufferFormat:Ae,guessCommand:D,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 st=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(G);if(st)return Se(G.substr(0,st.index)).concat(Se(st[1])).concat(Se(G.substr(st.index+st[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 lt(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,st)=>an(Oe,se+"["+st+"]")));if(G instanceof jn)return G;te(!1,"invalid option type in uniform "+se)}var tn={DynamicVariable:jn,define:$e,isDynamic:lt,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 st=G[Oe];return st||(st=G[Oe]=se.length,se.push(Oe),st)},str:function(Oe){return se[Oe]}}}function Ei(G,se,Oe){var st=document.createElement("canvas");a(st.style,{border:0,margin:0,padding:0,top:0,left:0}),G.appendChild(st),G===document.body&&(st.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}st.width=Oe*Rt,st.height=Oe*Bt,a(st.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(st)}return gt(),{canvas:st,onDestroy:mt}}function Yo(G,se){function Oe(st){try{return G.getContext(st,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,st,gt,ot,mt={},Rt=[],Bt=[],jt=typeof window>"u"?1:window.devicePixelRatio,ht=!1,Zt=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&&(st=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"),Zt=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:st=Oe),!ot){if(!gt){te(typeof document<"u","must manually specify webgl context outside of DOM environments");var Dt=Ei(st||document.body,Zt,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:st,extensions:Rt,optionalExtensions:Bt,pixelRatio:jt,profile:ht,onDone:Zt,onDestroy:Gt}:(Gt(),Zt("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function to(G,se){var Oe={};function st(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(!st(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(st),{extensions:Oe,restore:function(){Object.keys(Oe).forEach(function(mt){if(Oe[mt]&&!st(mt))throw new Error("(regl): error restoring extension "+mt)})}}}function Lr(G,se){for(var Oe=Array(G),st=0;st<G;++st)Oe[st]=se(st);return Oe}var ml=5120,za=5121,yl=5122,as=5123,np=5124,gc=5125,ha=5126;function $s(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=$s(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 st(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 ha: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:st,freeType:gt}}var Eo=Id();Eo.zero=Id();var _c=3408,Ki=3410,oa=3411,Au=3412,Na=3413,va=3414,Pa=3415,bc=33901,wc=33902,Ld=3379,Fs=3386,$d=34921,Ec=36347,rp=36348,Il=35661,Fd=35660,gl=34930,Oc=36349,Mu=34076,xc=34024,Sc=7936,op=7937,Bd=7938,Kr=35724,Xr=34047,Vd=36063,ls=34852,ma=3553,ku=34067,Ud=34069,Uo=33984,Ll=6408,$l=5126,Tu=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 st=1,gt=1;se.webgl_draw_buffers&&(st=G.getParameter(ls),gt=G.getParameter(Vd));var ot=!!se.oes_texture_float;if(ot){var mt=G.createTexture();G.bindTexture(ma,mt),G.texImage2D(ma,0,Ll,1,1,0,Ll,$l,null);var Rt=G.createFramebuffer();if(G.bindFramebuffer(ss,Rt),G.framebufferTexture2D(ss,Ac,ma,mt,0),G.bindTexture(ma,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 Zt=G.createTexture(),Gt=Eo.allocType(Tu,36);G.activeTexture(Uo),G.bindTexture(ku,Zt),G.texImage2D(Ud,0,Ll,3,3,0,Ll,Tu,Gt),Eo.freeType(Gt),G.bindTexture(ku,null),G.deleteTexture(Zt),ht=!G.getError()}return{colorBits:[G.getParameter(Ki),G.getParameter(oa),G.getParameter(Au),G.getParameter(Na)],depthBits:G.getParameter(va),stencilBits:G.getParameter(Pa),subpixelBits:G.getParameter(_c),extensions:Object.keys(se).filter(function(Dt){return!!se[Dt]}),maxAnisotropic:Oe,maxDrawbuffers:st,maxColorAttachments:gt,pointSizeDims:G.getParameter(bc),lineWidthDims:G.getParameter(wc),maxViewportDims:G.getParameter(Fs),maxCombinedTextureUnits:G.getParameter(Il),maxCubeMapSize:G.getParameter(Mu),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]})},ya={shape:Bi,flatten:zd};function lo(G,se,Oe){for(var st=0;st<se;++st)Oe[st]=G[st]}function ip(G,se,Oe,st){for(var gt=0,ot=0;ot<se;++ot)for(var mt=G[ot],Rt=0;Rt<Oe;++Rt)st[gt++]=mt[Rt]}function Fi(G,se,Oe,st,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],Zt=0;Zt<st;++Zt)gt[mt++]=ht[Zt]}function Gd(G,se,Oe,st,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,st,gt),gt+=ot}else for(mt=0;mt<Rt;++mt)Gd(G[mt],se,Oe+1,st,gt),gt+=ot}function zd(G,se,Oe,st){var gt=1;if(se.length)for(var ot=0;ot<se.length;++ot)gt*=se[ot];else gt=0;var mt=st||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,Nu=5121,Hd=5123,Tc=5125,Pu=5126,Ha=5126,Vi={int8:kc,int16:Vr,int32:ui,uint8:Nu,uint16:Hd,uint32:Tc,float:Pu,float32:Ha},us=35048,Ji=35040,ga={dynamic:us,stream:Ji,static:35044},Cr=ya.flatten,Ui=ya.shape,Ca=35044,mi=35040,cs=5121,Fl=5126,Ra=[];Ra[5120]=1,Ra[5122]=2,Ra[5124]=4,Ra[5121]=1,Ra[5123]=2,Ra[5125]=4,Ra[5126]=4;function mo(G){return Zi[Object.prototype.toString.call(G)]|0}function Bs(G,se){for(var Oe=0;Oe<se.length;++Oe)G[Oe]=se[Oe]}function Xa(G,se,Oe,st,gt,ot,mt){for(var Rt=0,Bt=0;Bt<Oe;++Bt)for(var jt=0;jt<st;++jt)G[Rt++]=se[gt*Bt+ot*jt+mt]}function _a(G,se,Oe,st){var gt=0,ot={};function mt(Ze){this.id=gt++,this.buffer=G.createBuffer(),this.type=Ze,this.usage=Ca,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(),Zt($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 Zt(Ze,pt,$t,nn,kt,ln){var Nt;if(Ze.usage=$t,Array.isArray(pt)){if(Ze.dtype=nn||Fl,pt.length>0){var Yt;if(Array.isArray(pt[0])){Nt=Ui(pt);for(var Tt=1,Jt=1;Jt<Nt.length;++Jt)Tt*=Nt[Jt];Ze.dimension=Tt,Yt=Cr(pt,Nt,Ze.dtype),ht(Ze,Yt,$t),ln?Ze.persistentData=Yt:Eo.freeType(Yt)}else if(typeof pt[0]=="number"){Ze.dimension=kt;var Cn=Eo.allocType(Ze.dtype,pt.length);Bs(Cn,pt),ht(Ze,Cn,$t),ln?Ze.persistentData=Cn:Eo.freeType(Cn)}else n(pt[0])?(Ze.dimension=pt[0].length,Ze.dtype=nn||mo(pt[0])||Fl,Yt=Cr(pt,[pt.length,pt[0].length],Ze.dtype),ht(Ze,Yt,$t),ln?Ze.persistentData=Yt:Eo.freeType(Yt)):te.raise("invalid buffer data")}}else if(n(pt))Ze.dtype=nn||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=nn||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--,st(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,nn){se.bufferCount++;var kt=new mt(pt);ot[kt.id]=kt;function ln(Tt){var Jt=Ca,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,ga,"invalid buffer usage"),Jt=ga[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?Zt(kt,Cn,Jt,It,Pt,nn):(Hn&&G.bufferData(kt.type,Hn,Jt),kt.dtype=It||cs,kt.usage=Jt,kt.dimension=Pt,kt.byteLength=Hn),Oe.profile&&(kt.stats.size=kt.byteLength*Ra[kt.dtype]),ln}function Nt(Tt,Jt){te(Jt+Tt.byteLength<=kt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Tt.byteLength+" starting from offset "+Jt+" to a buffer of size "+kt.byteLength),G.bufferSubData(kt.type,Jt,Tt)}function Yt(Tt,Jt){var Cn=(Jt||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);Bs(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=Yt,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:Zt}}var Nc=0,ap=0,Pc=1,Ko=1,Vs=4,qa=4,ni={points:Nc,point:ap,lines:Pc,line:Ko,triangles:Vs,triangle:qa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Cc=0,ia=1,ba=4,Cu=5120,Wi=5121,Qi=5122,ci=5123,aa=5124,ji=5125,vt=34963,Vt=35040,Ut=35044;function bn(G,se,Oe,st){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=ba,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)),Zt(Ze,At,Vt,-1,-1,0,0),Ze}function ht(At){Bt.push(At)}function Zt(At,Ze,pt,$t,nn,kt,ln){At.buffer.bind();var Nt;if(Ze){var Yt=ln;!ln&&(!n(Ze)||$i(Ze)&&!n(Ze.data))&&(Yt=se.oes_element_index_uint?ji:ci),Oe._initBuffer(At.buffer,Ze,pt,Yt,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 Cu: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=nn;Tt<0&&(Tt=At.buffer.byteLength,Nt===ci?Tt>>=1:Nt===ji&&(Tt>>=2)),At.vertCount=Tt;var Jt=$t;if($t<0){Jt=ba;var Cn=At.buffer.dimension;Cn===1&&(Jt=Cc),Cn===2&&(Jt=ia),Cn===3&&(Jt=ba)}At.primType=Jt}function Gt(At){st.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);st.elementsCount++;function nn(kt){if(!kt)pt(),$t.primType=ba,$t.vertCount=0,$t.type=Wi;else if(typeof kt=="number")pt(kt),$t.primType=ba,$t.vertCount=kt|0,$t.type=Wi;else{var ln=null,Nt=Ut,Yt=-1,Tt=-1,Jt=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,ga,"invalid element buffer usage"),Nt=ga[kt.usage]),"primitive"in kt&&(te.parameter(kt.primitive,ni,"invalid element buffer primitive"),Yt=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?Jt=kt.length|0:(Jt=Tt,Cn===ci||Cn===Qi?Jt*=2:(Cn===ji||Cn===aa)&&(Jt*=4))),Zt($t,ln,Nt,Yt,Tt,Jt,Cn)}return nn}return nn(At),nn._reglType="elements",nn._elements=$t,nn.subdata=function(kt,ln){return pt.subdata(kt,ln),nn},nn.destroy=function(){Gt($t)},nn}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 st=Rr[0],gt=st>>>31<<15,ot=(st<<1>>>24)-127,mt=st>>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 X=function(G){return!(G&G-1)&&!!G},ae=34467,Ee=3553,Ke=34067,wt=34069,Kt=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,Us=35986,hh=35987,vh=34798,lp=35840,Rc=35841,Ws=35842,Xd=35843,mh=36196,Gs=5121,jc=5123,qd=5125,Wo=5126,Gi=10242,Yd=10243,Kd=10497,Ru=33071,Hv=33648,ju=10240,Du=10241,Dc=9728,zs=9729,ps=9984,Iu=9985,Ic=9986,hs=9987,Xv=33170,Lc=4352,qv=4353,Yv=4354,yh=34046,Zd=3317,Di=37440,gh=37441,le=37443,Hs=37444,Ul=33984,ja=[ps,Ic,Iu,hs],jr=[0,vn,qr,Or,Kt],xi={};xi[vn]=xi[Sn]=xi[Bl]=1,xi[ds]=xi[qr]=2,xi[Or]=xi[Ya]=3,xi[Kt]=xi[fs]=4;function Ur(G){return"[object "+G+"]"}var Ja=Ur("HTMLCanvasElement"),Wl=Ur("OffscreenCanvas"),wa=Ur("CanvasRenderingContext2D"),Jd=Ur("ImageBitmap"),Qd=Ur("HTMLImageElement"),sp=Ur("HTMLVideoElement"),_h=Object.keys(Zi).concat([Ja,Wl,wa,Jd,Qd,sp]),Gl=[];Gl[Gs]=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[Us]=.5,Go[hh]=1,Go[vh]=1,Go[lp]=.5,Go[Rc]=.25,Go[Ws]=.5,Go[Xd]=.25,Go[mh]=.5;function Lu(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)===wa}function Ea(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:Lu(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 Gs:case jc:case qd:case Wo:var st=Eo.allocType(G.type,Oe);st.set(se),G.data=st;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,st,gt,ot){for(var mt=G.width,Rt=G.height,Bt=G.channels,jt=mt*Rt*Bt,ht=fp(G,jt),Zt=0,Gt=0;Gt<Rt;++Gt)for(var Dt=0;Dt<mt;++Dt)for(var At=0;At<Bt;++At)ht[Zt++]=se[Oe*Dt+st*Gt+gt*At+ot];zo(G,ht)}function oi(G,se,Oe,st,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*st}function Mr(G,se,Oe,st,gt,ot,mt){var Rt={"don't care":Lc,"dont care":Lc,nice:Yv,fast:qv},Bt={repeat:Kd,clamp:Ru,mirror:Hv},jt={nearest:Dc,linear:zs},ht=a({mipmap:hs,"nearest mipmap nearest":ps,"linear mipmap nearest":Iu,"nearest mipmap linear":Ic,"linear mipmap linear":hs},jt),Zt={none:0,browser:Hs},Gt={uint8:Gs,rgba4:To,rgb565:_l,"rgb5 a1":ea},Dt={alpha:Sn,luminance:vn,"luminance alpha":qr,rgb:Or,rgba:Kt,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":Us,"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":Ws,"rgba pvrtc 2bppv1":Xd}),se.webgl_compressed_texture_etc1&&(At["rgb etc1"]=mh);var Ze=Array.prototype.slice.call(G.getParameter(ae));Object.keys(At).forEach(function(ye){var ut=At[ye];Ze.indexOf(ut)>=0&&(Dt[ye]=ut)});var pt=Object.keys(Dt);Oe.textureFormats=pt;var $t=[];Object.keys(Dt).forEach(function(ye){var ut=Dt[ye];$t[ut]=ye});var nn=[];Object.keys(Gt).forEach(function(ye){var ut=Gt[ye];nn[ut]=ye});var kt=[];Object.keys(jt).forEach(function(ye){var ut=jt[ye];kt[ut]=ye});var ln=[];Object.keys(ht).forEach(function(ye){var ut=ht[ye];ln[ut]=ye});var Nt=[];Object.keys(Bt).forEach(function(ye){var ut=Bt[ye];Nt[ut]=ye});var Yt=pt.reduce(function(ye,ut){var it=Dt[ut];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||ut.indexOf("rgba")>=0?ye[it]=Kt:ye[it]=Or,ye},{});function Tt(){this.internalformat=Kt,this.format=Kt,this.type=Gs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Hs,this.width=0,this.height=0,this.channels=0}function Jt(ye,ut){ye.internalformat=ut.internalformat,ye.format=ut.format,ye.type=ut.type,ye.compressed=ut.compressed,ye.premultiplyAlpha=ut.premultiplyAlpha,ye.flipY=ut.flipY,ye.unpackAlignment=ut.unpackAlignment,ye.colorSpace=ut.colorSpace,ye.width=ut.width,ye.height=ut.height,ye.channels=ut.channels}function Cn(ye,ut){if(!(typeof ut!="object"||!ut)){if("premultiplyAlpha"in ut&&(te.type(ut.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),ye.premultiplyAlpha=ut.premultiplyAlpha),"flipY"in ut&&(te.type(ut.flipY,"boolean","invalid texture flip"),ye.flipY=ut.flipY),"alignment"in ut&&(te.oneOf(ut.alignment,[1,2,4,8],"invalid texture unpack alignment"),ye.unpackAlignment=ut.alignment),"colorSpace"in ut&&(te.parameter(ut.colorSpace,Zt,"invalid colorSpace"),ye.colorSpace=Zt[ut.colorSpace]),"type"in ut){var it=ut.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 ut?(te(Array.isArray(ut.shape)&&ut.shape.length>=2,"shape must be an array"),dn=ut.shape[0],hr=ut.shape[1],ut.shape.length===3&&(he=ut.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 ut&&(dn=hr=ut.radius,te(dn>=0&&dn<=Oe.maxTextureSize,"invalid radius")),"width"in ut&&(dn=ut.width,te(dn>=0&&dn<=Oe.maxTextureSize,"invalid width")),"height"in ut&&(hr=ut.height,te(hr>=0&&hr<=Oe.maxTextureSize,"invalid height")),"channels"in ut&&(he=ut.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 ut){var Ge=ut.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=Yt[Je],Ge in Gt&&("type"in ut||(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,ut){var it=null;if(el(ut)?it=ut:ut&&(te.type(ut,"object","invalid pixel data type"),Cn(ye,ut),"x"in ut&&(ye.xOffset=ut.x|0),"y"in ut&&(ye.yOffset=ut.y|0),el(ut.data)&&(it=ut.data)),te(!ye.compressed||it instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),ut.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 ut)&&ye.type===Gs&&(ye.type=Oo(it));else if(Lu(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===Gs&&(ye.type=Oo(he));var oe=it.shape,Pe=it.stride,Ge,Je,Ie,Ce,Ve,pe;oe.length===3?(Ie=oe[2],pe=Pe[2]):(te(oe.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ie=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=Ie,ye.format=ye.internalformat=jr[Ie],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(Ea(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 Me=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=ya.shape(it),p=1,y=0;y<Xe.length;++y)p*=Xe[y];var O=fp(ye,p);ya.flatten(it,Xe,"",O),zo(ye,O),ye.alignment=1,ye.width=Me,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,ut,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(ut,it,oe,oe,Pe,dn):ye.compressed?G.compressedTexImage2D(ut,it,he,Ge,Je,0,hr):ye.needsCopy?(st(),G.copyTexImage2D(ut,it,oe,ye.xOffset,ye.yOffset,Ge,Je,0)):G.texImage2D(ut,it,oe,Ge,Je,0,oe,Pe,hr||null)}function Ln(ye,ut,it,dn,hr){var he=ye.element,oe=ye.data,Pe=ye.internalformat,Ge=ye.format,Je=ye.type,Ie=ye.width,Ce=ye.height;Hn(ye),he?G.texSubImage2D(ut,hr,it,dn,Ge,Je,he):ye.compressed?G.compressedTexSubImage2D(ut,hr,it,dn,Pe,Ie,Ce,oe):ye.needsCopy?(st(),G.copyTexSubImage2D(ut,hr,it,dn,ye.xOffset,ye.yOffset,Ie,Ce)):G.texSubImage2D(ut,hr,it,dn,Ie,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,ut,it){var dn=ye.images[0]=mn();ye.mipmask=1,dn.width=ye.width=ut,dn.height=ye.height=it,dn.channels=ye.channels=4}function Er(ye,ut){var it=null;if(el(ut))it=ye.images[0]=mn(),Jt(it,ye),Pt(it,ut),ye.mipmask=1;else if(Cn(ye,ut),Array.isArray(ut.mipmap))for(var dn=ut.mipmap,hr=0;hr<dn.length;++hr)it=ye.images[hr]=mn(),Jt(it,ye),it.width>>=hr,it.height>>=hr,Pt(it,dn[hr]),ye.mipmask|=1<<hr;else it=ye.images[0]=mn(),Jt(it,ye),Pt(it,ut),ye.mipmask=1;Jt(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,ut){for(var it=ye.images,dn=0;dn<it.length;++dn){if(!it[dn])return;Mt(it[dn],ut,dn)}}var Ro=[];function ir(){var ye=Ro.pop()||new Xn;Tt.call(ye),ye.mipmask=0;for(var ut=0;ut<16;++ut)ye.images[ut]=null;return ye}function Zo(ye){for(var ut=ye.images,it=0;it<ut.length;++it)ut[it]&&cr(ut[it]),ut[it]=null;Ro.push(ye)}function so(){this.minFilter=Dc,this.magFilter=Dc,this.wrapS=Ru,this.wrapT=Ru,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Lc}function Fo(ye,ut){if("min"in ut){var it=ut.min;te.parameter(it,ht),ye.minFilter=ht[it],ja.indexOf(ye.minFilter)>=0&&!("faces"in ut)&&(ye.genMipmaps=!0)}if("mag"in ut){var dn=ut.mag;te.parameter(dn,jt),ye.magFilter=jt[dn]}var hr=ye.wrapS,he=ye.wrapT;if("wrap"in ut){var oe=ut.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 ut){var Pe=ut.wrapS;te.parameter(Pe,Bt),hr=Bt[Pe]}if("wrapT"in ut){var Ge=ut.wrapT;te.parameter(Ge,Bt),he=Bt[Ge]}}if(ye.wrapS=hr,ye.wrapT=he,"anisotropic"in ut){var Je=ut.anisotropic;te(typeof Je=="number"&&Je>=1&&Je<=Oe.maxAnisotropic,"aniso samples must be between 1 and "),ye.anisotropic=ut.anisotropic}if("mipmap"in ut){var Ie=!1;switch(typeof ut.mipmap){case"string":te.parameter(ut.mipmap,Rt,"invalid mipmap hint"),ye.mipmapHint=Rt[ut.mipmap],ye.genMipmaps=!0,Ie=!0;break;case"boolean":Ie=ye.genMipmaps=ut.mipmap;break;case"object":te(Array.isArray(ut.mipmap),"invalid mipmap type"),ye.genMipmaps=!1,Ie=!0;break;default:te.raise("invalid mipmap type")}Ie&&!("min"in ut)&&(ye.minFilter=ps)}}function qo(ye,ut){G.texParameteri(ut,Du,ye.minFilter),G.texParameteri(ut,ju,ye.magFilter),G.texParameteri(ut,Gi,ye.wrapS),G.texParameteri(ut,Yd,ye.wrapT),se.ext_texture_filter_anisotropic&&G.texParameteri(ut,yh,ye.anisotropic),ye.genMipmaps&&(G.hint(Xv,ye.mipmapHint),G.generateMipmap(ut))}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=Kt,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 ut=ye.texture;te(ut,"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(ut),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 ut=ye.unit;if(ut<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,ut=it;break}ut>=Jo&&te.raise("insufficient number of texture units"),mt.profile&&ot.maxTextureUnits<ut+1&&(ot.maxTextureUnits=ut+1),ye.unit=ut,G.activeTexture(Ul+ut),G.bindTexture(ye.target,ye.texture)}return ut},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&In(this)}});function mr(ye,ut){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,Jt(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=nn[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 Ie=Pe|0,Ce=Ge|0,Ve=Je|0,pe=mn();return Jt(pe,it),pe.width=0,pe.height=0,Pt(pe,oe),pe.width=pe.width||(it.width>>Ve)-Ie,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(Ie>=0&&Ce>=0&&Ie+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,Ie,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 Ie=0;it.mipmask>>Ie;++Ie){var Ce=Ge>>Ie,Ve=Je>>Ie;if(!Ce||!Ve)break;G.texImage2D(Ee,Ie,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,ut),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,ut,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,Me,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],Me),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"),Jt(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(Jt(oe,Pe[0]),Oe.npotTextureCube||te(X(oe.width)&&X(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=nn[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,Me,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=Me|0,p=fe|0,y=mn();return Jt(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 Ie(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 Me=0;oe.mipmask>>Me;++Me)G.texImage2D(wt+pe,Me,oe.format,Ve>>Me,Ve>>Me,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,ut,it,dn,hr,he),Ge.subimage=Je,Ge.resize=Ie,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(ut){ye+=fi[ut].stats.size}),ye});function kl(){for(var ye=0;ye<Jo;++ye){var ut=go[ye];ut&&(ut.bindCount=0,ut.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 ut=go[ye];ut&&(ut.bindCount=0,ut.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 $u=function(G,se,Oe,st,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],st.renderbufferCount--}function Zt(Dt,At){var Ze=new jt(G.createRenderbuffer());Bt[Ze.id]=Ze,st.renderbufferCount++;function pt(nn,kt){var ln=0,Nt=0,Yt=Dn;if(typeof nn=="object"&&nn){var Tt=nn;if("shape"in Tt){var Jt=Tt.shape;te(Array.isArray(Jt)&&Jt.length>=2,"invalid renderbuffer shape"),ln=Jt[0]|0,Nt=Jt[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"),Yt=ot[Tt.format])}else typeof nn=="number"?(ln=nn|0,typeof kt=="number"?Nt=kt|0:Nt=ln):nn?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&&Yt===Ze.format))return pt.width=Ze.width=ln,pt.height=Ze.height=Nt,Ze.format=Yt,G.bindRenderbuffer(co,Ze.renderbuffer),G.renderbufferStorage(co,Yt,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(nn,kt){var ln=nn|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&&(st.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:Zt,clear:function(){si(Bt).forEach(ht)},restore:Gt}},Da=36160,ms=36161,Hl=3553,Ia=34069,wh=36064,Ol=36096,Oa=36128,vp=33306,mp=36053,nf=36054,Eh=36055,Oh=36057,xh=36061,rf=36193,yp=5121,gp=5126,Vc=6407,kr=6408,Kv=6402,_p=[Vc,kr],Xs=[];Xs[kr]=4,Xs[Vc]=3;var Uc=[];Uc[yp]=1,Uc[gp]=4,Uc[rf]=2;var Zv=32854,Sh=32855,xa=36194,Jv=33189,Wc=36168,of=34041,bp=35907,Ah=34836,sa=34842,ys=34843,af=[Zv,Sh,xa,bp,sa,ys,Ah],qs={};qs[mp]="complete",qs[nf]="incomplete attachment",qs[Oh]="incomplete dimensions",qs[Eh]="incomplete, missing attachment",qs[xh]="unsupported";function lf(G,se,Oe,st,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 Zt(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(Da,It,Pt.target,Pt.texture._texture.texture,0):G.framebufferRenderbuffer(Da,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>=Ia&&Pt<Ia+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=st.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 nn=0,kt={};function ln(){this.id=nn++,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(Zt),Zt(It.depthAttachment),Zt(It.stencilAttachment),Zt(It.depthStencilAttachment)}function Yt(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(Da,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(Da,wh+Pt,Hl,null,0);G.framebufferTexture2D(Da,vp,Hl,null,0),G.framebufferTexture2D(Da,Ol,Hl,null,0),G.framebufferTexture2D(Da,Oa,Hl,null,0),Dt(Ol,It.depthAttachment),Dt(Oa,It.stencilAttachment),Dt(vp,It.depthStencilAttachment);var Ln=G.checkFramebufferStatus(Da);!G.isContextLost()&&Ln!==mp&&te.raise("framebuffer configuration not supported, status = "+qs[Ln]),G.bindFramebuffer(Da,mt.next?mt.next.framebuffer:null),mt.cur=mt.next,G.getError()}function Jt(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=Xs[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===Kv||In.renderbuffer&&In.renderbuffer._renderbuffer.format===Jv,"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(){Yt(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]=st.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:Ia,data:so[mn]}}for(mn=0;mn<6;++mn){for(var ii=0;ii<so.length;++ii)cr.color[ii].target=Ia+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]=Jt(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:Jt,createCube:Cn,clear:function(){si(kt).forEach(Yt)},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,st,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:Zt,setVAO:Gt()?Ze:pt,clear:Gt()?$t:function(){}};function Zt(Nt){for(var Yt=0;Yt<mt.length;++Yt){var Tt=mt[Yt];Tt.buffer===Nt&&(G.disableVertexAttribArray(Yt),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 Yt=Gt();Nt?Yt.bindVertexArrayOES(Nt.vao):Yt.bindVertexArrayOES(null),ht.currentVAO=Nt}}function pt(Nt){if(Nt!==ht.currentVAO){if(Nt)Nt.bindAttrs();else for(var Yt=Dt(),Tt=0;Tt<mt.length;++Tt){var Jt=mt[Tt];Jt.buffer?(G.enableVertexAttribArray(Tt),G.vertexAttribPointer(Tt,Jt.size,Jt.type,Jt.normalized,Jt.stride,Jt.offfset),Yt&&Jt.divisor&&Yt.vertexAttribDivisorANGLE(Tt,Jt.divisor)):(G.disableVertexAttribArray(Tt),G.vertexAttrib4f(Tt,Jt.x,Jt.y,Jt.z,Jt.w))}ht.currentVAO=Nt}}function $t(){si(jt).forEach(function(Nt){Nt.destroy()})}function nn(){this.id=++Bt,this.attributes=[];var Nt=Gt();Nt?this.vao=Nt.createVertexArrayOES():this.vao=null,jt[this.id]=this,this.buffers=[]}nn.prototype.bindAttrs=function(){for(var Nt=Dt(),Yt=this.attributes,Tt=0;Tt<Yt.length;++Tt){var Jt=Yt[Tt];Jt.buffer?(G.enableVertexAttribArray(Tt),G.bindBuffer(sf,Jt.buffer.buffer),G.vertexAttribPointer(Tt,Jt.size,Jt.type,Jt.normalized,Jt.stride,Jt.offset),Nt&&Jt.divisor&&Nt.vertexAttribDivisorANGLE(Tt,Jt.divisor)):(G.disableVertexAttribArray(Tt),G.vertexAttrib4f(Tt,Jt.x,Jt.y,Jt.z,Jt.w))}for(var Cn=Yt.length;Cn<ot;++Cn)G.disableVertexAttribArray(Cn)},nn.prototype.refresh=function(){var Nt=Gt();Nt&&(Nt.bindVertexArrayOES(this.vao),this.bindAttrs(),ht.currentVAO=this)},nn.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],st.vaoCount-=1)};function kt(){var Nt=Gt();Nt&&si(jt).forEach(function(Yt){Yt.refresh()})}function ln(Nt){var Yt=new nn;st.vaoCount+=1;function Tt(Jt){te(Array.isArray(Jt),"arguments to vertex array constructor must be an array"),te(Jt.length<ot,"too many attributes"),te(Jt.length>0,"must specify at least one attribute");var Cn={},Hn=Yt.attributes;Hn.length=Jt.length;for(var It=0;It<Jt.length;++It){var Pt=Jt[It],Mt=Hn[It]=new Gc,Ln=Pt.data||Pt;if(Array.isArray(Ln)||n(Ln)||$i(Ln)){var or;Yt.buffers[It]&&(or=Yt.buffers[It],n(Ln)&&or._buffer.byteLength>=Ln.byteLength?or.subdata(Ln):(or.destroy(),Yt.buffers[It]=null)),Yt.buffers[It]||(or=Yt.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<Yt.buffers.length;++mn)!Cn[mn]&&Yt.buffers[mn]&&(Yt.buffers[mn].destroy(),Yt.buffers[mn]=null);return Yt.refresh(),Tt}return Tt.destroy=function(){for(var Jt=0;Jt<Yt.buffers.length;++Jt)Yt.buffers[Jt]&&Yt.buffers[Jt].destroy();Yt.buffers.length=0,Yt.destroy()},Tt._vao=Yt,Tt._reglType="vao",Tt(Nt)}return ht}var cf=35632,Yr=35633,Qv=35718,no=35721;function df(G,se,Oe,st){var gt={},ot={};function mt(Ze,pt,$t,nn){this.name=Ze,this.id=pt,this.location=$t,this.info=nn}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 nn=Ze===cf?gt:ot,kt=nn[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),nn[pt]=kt}return kt}var jt={},ht=[],Zt=0;function Gt(Ze,pt){this.id=Zt++,this.fragId=Ze,this.vertId=pt,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,st.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Dt(Ze,pt,$t){var nn,kt,ln=Bt(cf,Ze.fragId),Nt=Bt(Yr,Ze.vertId),Yt=Ze.program=G.createProgram();if(G.attachShader(Yt,ln),G.attachShader(Yt,Nt),$t)for(nn=0;nn<$t.length;++nn){var Tt=$t[nn];G.bindAttribLocation(Yt,Tt[0],Tt[1])}G.linkProgram(Yt),te.linkError(G,Yt,se.str(Ze.fragId),se.str(Ze.vertId),pt);var Jt=G.getProgramParameter(Yt,Qv);st.profile&&(Ze.stats.uniformsCount=Jt);var Cn=Ze.uniforms;for(nn=0;nn<Jt;++nn)if(kt=G.getActiveUniform(Yt,nn),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(Yt,It),kt))}else Rt(Cn,new mt(kt.name,se.id(kt.name),G.getUniformLocation(Yt,kt.name),kt));var Pt=G.getProgramParameter(Yt,no);st.profile&&(Ze.stats.attributesCount=Pt);var Mt=Ze.attributes;for(nn=0;nn<Pt;++nn)kt=G.getActiveAttrib(Yt,nn),kt&&Rt(Mt,new mt(kt.name,se.id(kt.name),G.getAttribLocation(Yt,kt.name),kt))}st.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,nn){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++,!nn))return ln;var Nt=new Gt(pt,Ze);return Oe.shaderCount++,Dt(Nt,$t,nn),ln||(kt[Ze]=Nt),ht.push(Nt),a(Nt,{destroy:function(){if(Nt.refCount--,Nt.refCount<=0){G.deleteProgram(Nt.program);var Yt=ht.indexOf(Nt);ht.splice(Yt,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,Ys=5121,kh=3333,Fu=5126;function Th(G,se,Oe,st,gt,ot,mt){function Rt(ht){var Zt;se.next===null?(te(gt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Zt=Ys):(te(se.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Zt=se.next.colorAttachments[0].texture._texture.type,ot.oes_texture_float?(te(Zt===Ys||Zt===Fu,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Zt===Fu&&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(Zt===Ys,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Gt=0,Dt=0,At=st.framebufferWidth,Ze=st.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<st.framebufferWidth,"invalid x offset for regl.read"),te(Dt>=0&&Dt<st.framebufferHeight,"invalid y offset for regl.read"),At=(ht.width||st.framebufferWidth-Gt)|0,Ze=(ht.height||st.framebufferHeight-Dt)|0,pt=ht.data||null),pt&&(Zt===Ys?te(pt instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Zt===Fu&&te(pt instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),te(At>0&&At+Gt<=st.framebufferWidth,"invalid width for read pixels"),te(Ze>0&&Ze+Dt<=st.framebufferHeight,"invalid height for read pixels"),Oe();var $t=At*Ze*4;return pt||(Zt===Ys?pt=new Uint8Array($t):Zt===Fu&&(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,Zt,pt),pt}function Bt(ht){var Zt;return se.setFBO({framebuffer:ht.framebuffer},function(){Zt=Rt(ht)}),Zt}function jt(ht){return!ht||!("framebuffer"in ht)?Rt(ht):Bt(ht)}return jt}function Ks(G){return Array.prototype.slice.call(G)}function yi(G){return Ks(G).join("")}function tl(){var G=0,se=[],Oe=[];function st(Zt){for(var Gt=0;Gt<Oe.length;++Gt)if(Oe[Gt]===Zt)return se[Gt];var Dt="g"+G++;return se.push(Dt),Oe.push(Zt),Dt}function gt(){var Zt=[];function Gt(){Zt.push.apply(Zt,Ks(arguments))}var Dt=[];function At(){var Ze="v"+G++;return Dt.push(Ze),arguments.length>0&&(Zt.push(Ze,"="),Zt.push.apply(Zt,Ks(arguments)),Zt.push(";")),Ze}return a(Gt,{def:At,toString:function(){return yi([Dt.length>0?"var "+Dt.join(",")+";":"",yi(Zt)])}})}function ot(){var Zt=gt(),Gt=gt(),Dt=Zt.toString,At=Gt.toString;function Ze(pt,$t){Gt(pt,$t,"=",Zt.def(pt,$t),";")}return a(function(){Zt.apply(Zt,Ks(arguments))},{def:Zt.def,entry:Zt,exit:Gt,save:Ze,set:function(pt,$t,nn){Ze(pt,$t),Zt(pt,$t,"=",nn,";")},toString:function(){return Dt()+At()}})}function mt(){var Zt=yi(arguments),Gt=ot(),Dt=ot(),At=Gt.toString,Ze=Dt.toString;return a(Gt,{then:function(){return Gt.apply(Gt,Ks(arguments)),this},else:function(){return Dt.apply(Dt,Ks(arguments)),this},toString:function(){var pt=Ze();return pt&&(pt="else{"+pt+"}"),yi(["if(",Zt,"){",At(),"}",pt])}})}var Rt=gt(),Bt={};function jt(Zt,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,nn=Bt[Zt]=a(pt,{arg:At,toString:function(){return yi(["function(",Dt.join(),"){",$t(),"}"])}});return nn}function ht(){var Zt=['"use strict";',Rt,"return {"];Object.keys(Bt).forEach(function(At){Zt.push('"',At,'":',Bt[At].toString(),",")}),Zt.push("}");var Gt=yi(Zt).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),Dt=Function.apply(null,se.concat(Gt));return Dt.apply(null,Oe)}return{global:Rt,link:st,block:gt,proc:jt,scope:ot,cond:mt,compile:ht}}var Xl="xyzw".split(""),Zs=5121,Js=1,Qs=2,ff=0,ql=1,eu=2,pf=3,nl=4,zc=5,Hc=6,Bu="dither",Vu="blend.enable",Uu="blend.color",hf="blend.equation",Wu="blend.func",Ep="depth.enable",vf="depth.func",Nh="depth.range",Op="depth.mask",rl="colorMask",xp="cull.enable",Sp="cull.face",Ap="frontFace",Gu="lineWidth",xl="polygonOffset.enable",Xc="polygonOffset.offset",mf="sample.alpha",yf="sample.enable",gs="sample.coverage",_s="stencil.enable",rr="stencil.mask",zu="stencil.func",qc="stencil.opFront",ol="stencil.opBack",di="scissor.enable",tu="scissor.box",Do="viewport",bs="profile",ta="framebuffer",Yc="vert",Ii="frag",Ho="elements",Sl="primitive",Al="count",gf="offset",Ct="instances",nu="vao",Kc="Width",Zc="Height",ws=ta+Kc,ru=ta+Zc,_f=Do+Kc,Mp=Do+Zc,ou="drawingBuffer",Jc=ou+Kc,bf=ou+Zc,kp=[Wu,hf,zu,qc,ol,gs,Do,tu,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,em=32928,xo=5126,ed=35664,iu=35665,td=35666,Hu=5124,nd=35667,rd=35668,od=35669,au=35670,Yl=35671,gi=35672,Of=35673,id=35674,lu=35675,Xu=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,su=1,Lh=32774,Cp=513,sd=36160,$h=36064,La={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},qu={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,st){this.thisDep=G,this.contextDep=se,this.propDep=Oe,this.append=st}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 st=G.data.length;return new Xi(!0,st>=1,st>=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===eu)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===eu,Oe===ql,se)}}var $a=new Xi(!1,!1,!1,function(){});function tm(G,se,Oe,st,gt,ot,mt,Rt,Bt,jt,ht,Zt,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,nn=Oe.webgl_draw_buffers,kt={dirty:!0,profile:At.profile},ln={},Nt=[],Yt={},Tt={};function Jt(he){return he.replace(".","_")}function Cn(he,oe,Pe){var Ge=Jt(he);Nt.push(he),ln[Ge]=kt[Ge]=!!Pe,Yt[Ge]=oe}function Hn(he,oe,Pe){var Ge=Jt(he);Nt.push(he),Array.isArray(Pe)?(kt[Ge]=Pe.slice(),ln[Ge]=Pe.slice()):kt[Ge]=ln[Ge]=Pe,Tt[Ge]=oe}Cn(Bu,Np),Cn(Vu,Rh),Hn(Uu,"blendColor",[0,0,0,0]),Hn(hf,"blendEquationSeparate",[Lh,Lh]),Hn(Wu,"blendFuncSeparate",[su,Ih,su,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(Gu,Gu,1),Cn(xl,al),Hn(Xc,"polygonOffset",[0,0]),Cn(mf,Os),Cn(yf,em),Hn(gs,"sampleCoverage",[1,!1]),Cn(_s,Ef),Hn(rr,"stencilMask",-1),Hn(zu,"stencilFunc",[Dh,0,-1]),Hn(qc,"stencilOpSeparate",[Hi,xs,xs,xs]),Hn(ol,"stencilOpSeparate",[Wn,xs,xs,xs]),Cn(di,jh),Hn(tu,"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:Zt,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:La,blendEquations:pt,stencilOps:zn,glTypes:Vi,orientationType:qu};te.optional(function(){It.isArrayLike=C}),nn&&(Pt.backBuffer=[Wn],Pt.drawBuffer=Lr(st.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(Me){Je[Me]=Pe.def(Ge,".",Me)}),te.optional(function(){he.CHECK=oe(te),he.commandStr=te.guessCommand(),he.command=oe(he.commandStr),he.assert=function(Me,fe,ze){Me("if(!(",fe,"))",this.CHECK,".commandRaise(",oe(ze),",",this.command,");")},Pt.invalidBlendCombinations=Kl});var Ie=he.next={},Ce=he.current={};Object.keys(Tt).forEach(function(Me){Array.isArray(kt[Me])&&(Ie[Me]=Pe.def(Je.next,".",Me),Ce[Me]=Pe.def(Je.current,".",Me))});var Ve=he.constants={};Object.keys(Pt).forEach(function(Me){Ve[Me]=Pe.def(JSON.stringify(Pt[Me]))}),he.invoke=function(Me,fe){switch(fe.type){case ff:var ze=["this",Je.context,Je.props,he.batchId];return Me.def(oe(fe.data),".call(",ze.slice(0,Math.max(fe.data.length+1,4)),")");case ql:return Me.def(Je.props,fe.data);case eu:return Me.def(Je.context,fe.data);case pf:return Me.def("this",fe.data);case nl:return fe.data.append(he,Me),fe.data.ref;case zc:return fe.data.toString();case Hc:return fe.data.map(function(Xe){return he.invoke(Me,Xe)})}},he.attribCache={};var pe={};return he.scopeAttrib=function(Me){var fe=se.id(Me);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 Ie=Pe[bs];Ge=ua(Ie,function(Ce,Ve){return Ce.invoke(Ve,Ie)})}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),Me=Ce.shared;Ve.set(Me.framebuffer,".next",pe);var fe=Me.context;return Ve.set(fe,"."+ws,pe+".width"),Ve.set(fe,"."+ru,pe+".height"),pe})):Io(function(Ce,Ve){var pe=Ce.shared;Ve.set(pe.framebuffer,".next","null");var Me=pe.context;return Ve.set(Me,"."+ws,Me+"."+Jc),Ve.set(Me,"."+ru,Me+"."+bf),"null"})}else if(ta in Ge){var Ie=Ge[ta];return ua(Ie,function(Ce,Ve){var pe=Ce.invoke(Ve,Ie),Me=Ce.shared,fe=Me.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=Me.context;return Ve.set(Xe,"."+ws,ze+"?"+ze+".width:"+Xe+"."+Jc),Ve.set(Xe,"."+ru,ze+"?"+ze+".height:"+Xe+"."+bf),ze})}else return null}function cr(he,oe,Pe){var Ge=he.static,Je=he.dynamic;function Ie(pe){if(pe in Ge){var Me=Ge[pe];te.commandType(Me,"object","invalid "+pe,Pe.commandStr);var fe=!0,ze=Me.x|0,Xe=Me.y|0,p,y;return"width"in Me?(p=Me.width|0,te.command(p>=0,"invalid "+pe,Pe.commandStr)):fe=!1,"height"in Me?(y=Me.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 Me||(xe=re.def(ve,".",ws,"-",ze));var Ue=y;return"height"in Me||(Ue=re.def(ve,".",ru,"-",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,")"),qt=re.def('"height" in ',ve,"?",ve,".height|0:","(",xe,".",ru,"-",_t,")");return te.optional(function(){Z.assert(re,xt+">=0&&"+qt+">=0","invalid "+pe)}),[Ue,_t,xt,qt]});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,".",ru)]}):null}var Ce=Ie(Do);if(Ce){var Ve=Ce;Ce=new Xi(Ce.thisDep,Ce.contextDep,Ce.propDep,function(pe,Me){var fe=Ve.append(pe,Me),ze=pe.shared.context;return Me.set(ze,"."+_f,fe[2]),Me.set(ze,"."+Mp,fe[3]),fe})}return{viewport:Ce,scissor_box:Ie(tu)}}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,Ie=Object.keys(Je);if(Ie.length>0&&typeof Je[Ie[0]]=="number"){for(var Ce=[],Ve=0;Ve<Ie.length;++Ve)te(typeof Je[Ie[Ve]]=="number","must specify all vertex attribute locations when using vaos"),Ce.push([Je[Ie[Ve]]|0,Ie[Ve]]);return Ce}}return null}function lr(he,oe,Pe){var Ge=he.static,Je=he.dynamic;function Ie(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=Ie(Ii),Ve=Ie(Yc),pe=null,Me;return ll(Ce)&&ll(Ve)?(pe=ht.program(Ve.id,Ce.id,null,Pe),Me=Io(function(fe,ze){return fe.link(pe)})):Me=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:Me,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 Ie=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(Ie)return ll(Ie)?Ie.value?Io(function(Xe,p){return p.def(Xe.ELEMENTS,".primType")}):Io(function(){return ad}):new Xi(Ie.thisDep,Ie.contextDep,Ie.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&&Ie)return Io(function(y,O){return y.OFFSET="0",0});return null}var pe=Ve(gf,!0);function Me(){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(Ie)if(ll(Ie)){if(Ie)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(Ie.thisDep||pe.thisDep,Ie.contextDep||pe.contextDep,Ie.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:Ie,primitive:Ce(),count:Me(),instances:Ve(Ct,!1),offset:pe}}function $o(he,oe){var Pe=he.static,Ge=he.dynamic,Je={};return Nt.forEach(function(Ie){var Ce=Jt(Ie);function Ve(pe,Me){if(Ie in Pe){var fe=pe(Pe[Ie]);Je[Ce]=Io(function(){return fe})}else if(Ie in Ge){var ze=Ge[Ie];Je[Ce]=ua(ze,function(Xe,p){return Me(Xe,p,Xe.invoke(p,ze))})}}switch(Ie){case xp:case Vu:case Bu:case _s:case Ep:case di:case xl:case mf:case yf:case Op:return Ve(function(pe){return te.commandType(pe,"boolean",Ie,oe.commandStr),pe},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,"typeof "+fe+'==="boolean"',"invalid flag "+Ie,pe.commandStr)}),fe});case vf:return Ve(function(pe){return te.commandParameter(pe,Ss,"invalid "+Ie,oe.commandStr),Ss[pe]},function(pe,Me,fe){var ze=pe.constants.compareFuncs;return te.optional(function(){pe.assert(Me,fe+" in "+ze,"invalid "+Ie+", must be one of "+Object.keys(Ss))}),Me.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,Me,fe){te.optional(function(){pe.assert(Me,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=Me.def("+",fe,"[0]"),Xe=Me.def("+",fe,"[1]");return[ze,Xe]});case Wu:return Ve(function(pe){te.commandType(pe,"object","blend.func",oe.commandStr);var Me="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(Me,La,Ce+".srcRGB",oe.commandStr),te.commandParameter(fe,La,Ce+".srcAlpha",oe.commandStr),te.commandParameter(ze,La,Ce+".dstRGB",oe.commandStr),te.commandParameter(Xe,La,Ce+".dstAlpha",oe.commandStr),te.command(Kl.indexOf(Me+", "+ze)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Me+", "+ze+")",oe.commandStr),[La[Me],La[ze],La[fe],La[Xe]]},function(pe,Me,fe){var ze=pe.constants.blendFuncs;te.optional(function(){pe.assert(Me,fe+"&&typeof "+fe+'==="object"',"invalid blend func, must be an object")});function Xe(ve,xe){var Ue=Me.def('"',ve,xe,'" in ',fe,"?",fe,".",ve,xe,":",fe,".",ve);return te.optional(function(){pe.assert(Me,Ue+" in "+ze,"invalid "+Ie+"."+ve+xe+", must be one of "+Object.keys(La))}),Ue}var p=Xe("src","RGB"),y=Xe("dst","RGB");te.optional(function(){var ve=pe.constants.invalidBlendCombinations;pe.assert(Me,ve+".indexOf("+p+'+", "+'+y+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var O=Me.def(ze,"[",p,"]"),$=Me.def(ze,"[",Xe("src","Alpha"),"]"),Z=Me.def(ze,"[",y,"]"),re=Me.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 "+Ie,oe.commandStr),[pt[pe],pt[pe]];if(typeof pe=="object")return te.commandParameter(pe.rgb,pt,Ie+".rgb",oe.commandStr),te.commandParameter(pe.alpha,pt,Ie+".alpha",oe.commandStr),[pt[pe.rgb],pt[pe.alpha]];te.commandRaise("invalid blend.equation",oe.commandStr)},function(pe,Me,fe){var ze=pe.constants.blendEquations,Xe=Me.def(),p=Me.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,Ie,fe),pe.assert(y.else,fe+"&&typeof "+fe+'==="object"',"invalid "+Ie),O(y.else,Ie+".rgb",fe+".rgb"),O(y.else,Ie+".alpha",fe+".alpha")}),y.then(Xe,"=",p,"=",ze,"[",fe,"];"),y.else(Xe,"=",ze,"[",fe,".rgb];",p,"=",ze,"[",fe,".alpha];"),Me(y),[Xe,p]});case Uu:return Ve(function(pe){return te.command(C(pe)&&pe.length===4,"blend.color must be a 4d array",oe.commandStr),Lr(4,function(Me){return+pe[Me]})},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,pe.shared.isArrayLike+"("+fe+")&&"+fe+".length===4","blend.color must be a 4d array")}),Lr(4,function(ze){return Me.def("+",fe,"[",ze,"]")})});case rr:return Ve(function(pe){return te.commandType(pe,"number",Ce,oe.commandStr),pe|0},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,"typeof "+fe+'==="number"',"invalid stencil.mask")}),Me.def(fe,"|0")});case zu:return Ve(function(pe){te.commandType(pe,"object",Ce,oe.commandStr);var Me=pe.cmp||"keep",fe=pe.ref||0,ze="mask"in pe?pe.mask:-1;return te.commandParameter(Me,Ss,Ie+".cmp",oe.commandStr),te.commandType(fe,"number",Ie+".ref",oe.commandStr),te.commandType(ze,"number",Ie+".mask",oe.commandStr),[Ss[Me],fe,ze]},function(pe,Me,fe){var ze=pe.constants.compareFuncs;te.optional(function(){function O(){pe.assert(Me,Array.prototype.join.call(arguments,""),"invalid stencil.func")}O(fe+"&&typeof ",fe,'==="object"'),O('!("cmp" in ',fe,")||(",fe,".cmp in ",ze,")")});var Xe=Me.def('"cmp" in ',fe,"?",ze,"[",fe,".cmp]",":",xs),p=Me.def(fe,".ref|0"),y=Me.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 Me=pe.fail||"keep",fe=pe.zfail||"keep",ze=pe.zpass||"keep";return te.commandParameter(Me,zn,Ie+".fail",oe.commandStr),te.commandParameter(fe,zn,Ie+".zfail",oe.commandStr),te.commandParameter(ze,zn,Ie+".zpass",oe.commandStr),[Ie===ol?Wn:Hi,zn[Me],zn[fe],zn[ze]]},function(pe,Me,fe){var ze=pe.constants.stencilOps;te.optional(function(){pe.assert(Me,fe+"&&typeof "+fe+'==="object"',"invalid "+Ie)});function Xe(p){return te.optional(function(){pe.assert(Me,'!("'+p+'" in '+fe+")||("+fe+"."+p+" in "+ze+")","invalid "+Ie+"."+p+", must be one of "+Object.keys(zn))}),Me.def('"',p,'" in ',fe,"?",ze,"[",fe,".",p,"]:",xs)}return[Ie===ol?Wn:Hi,Xe("fail"),Xe("zfail"),Xe("zpass")]});case Xc:return Ve(function(pe){te.commandType(pe,"object",Ce,oe.commandStr);var Me=pe.factor|0,fe=pe.units|0;return te.commandType(Me,"number",Ce+".factor",oe.commandStr),te.commandType(fe,"number",Ce+".units",oe.commandStr),[Me,fe]},function(pe,Me,fe){te.optional(function(){pe.assert(Me,fe+"&&typeof "+fe+'==="object"',"invalid "+Ie)});var ze=Me.def(fe,".factor|0"),Xe=Me.def(fe,".units|0");return[ze,Xe]});case Sp:return Ve(function(pe){var Me=0;return pe==="front"?Me=Hi:pe==="back"&&(Me=Wn),te.command(!!Me,Ce,oe.commandStr),Me},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,fe+'==="front"||'+fe+'==="back"',"invalid cull.face")}),Me.def(fe,'==="front"?',Hi,":",Wn)});case Gu:return Ve(function(pe){return te.command(typeof pe=="number"&&pe>=st.lineWidthDims[0]&&pe<=st.lineWidthDims[1],"invalid line width, must be a positive number between "+st.lineWidthDims[0]+" and "+st.lineWidthDims[1],oe.commandStr),pe},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,"typeof "+fe+'==="number"&&'+fe+">="+st.lineWidthDims[0]+"&&"+fe+"<="+st.lineWidthDims[1],"invalid line width")}),fe});case Ap:return Ve(function(pe){return te.commandParameter(pe,qu,Ce,oe.commandStr),qu[pe]},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,fe+'==="cw"||'+fe+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Me.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(Me){return!!Me})},function(pe,Me,fe){return te.optional(function(){pe.assert(Me,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 Me="value"in pe?pe.value:1,fe=!!pe.invert;return te.command(typeof Me=="number"&&Me>=0&&Me<=1,"sample.coverage.value must be a number between 0 and 1",oe.commandStr),[Me,fe]},function(pe,Me,fe){te.optional(function(){pe.assert(Me,fe+"&&typeof "+fe+'==="object"',"invalid sample.coverage")});var ze=Me.def('"value" in ',fe,"?+",fe,".value:1"),Xe=Me.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(Ie){var Ce=Pe[Ie],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(Me){return Me.link(Ce)}):pe==="framebuffer"||pe==="framebufferCube"?(te.command(Ce.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Ie+'"',oe.commandStr),Ve=Io(function(Me){return Me.link(Ce.color[0])})):te.commandRaise('invalid data for uniform "'+Ie+'"',oe.commandStr)}else C(Ce)?Ve=Io(function(Me){var fe=Me.global.def("[",Lr(Ce.length,function(ze){return te.command(typeof Ce[ze]=="number"||typeof Ce[ze]=="boolean","invalid uniform "+Ie,Me.commandStr),Ce[ze]}),"]");return fe}):te.commandRaise('invalid or missing data for uniform "'+Ie+'"',oe.commandStr);Ve.value=Ce,Je[Ie]=Ve}),Object.keys(Ge).forEach(function(Ie){var Ce=Ge[Ie];Je[Ie]=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(Ie){var Ce=Pe[Ie],Ve=se.id(Ie),pe=new Ze;if(Zl(Ce))pe.state=Js,pe.buffer=gt.getBuffer(gt.create(Ce,Ml,!1,!0)),pe.type=0;else{var Me=gt.getBuffer(Ce);if(Me)pe.state=Js,pe.buffer=Me,pe.type=0;else if(te.command(typeof Ce=="object"&&Ce,"invalid data for attribute "+Ie,oe.commandStr),"constant"in Ce){var fe=Ce.constant;pe.buffer="null",pe.state=Qs,typeof fe=="number"?pe.x=fe:(te.command(C(fe)&&fe.length>0&&fe.length<=4,"invalid constant for attribute "+Ie,oe.commandStr),Xl.forEach(function(Z,re){re<fe.length&&(pe[Z]=fe[re])}))}else{Zl(Ce.buffer)?Me=gt.getBuffer(gt.create(Ce.buffer,Ml,!1,!0)):Me=gt.getBuffer(Ce.buffer),te.command(!!Me,'missing buffer for attribute "'+Ie+'"',oe.commandStr);var ze=Ce.offset|0;te.command(ze>=0,'invalid offset for attribute "'+Ie+'"',oe.commandStr);var Xe=Ce.stride|0;te.command(Xe>=0&&Xe<256,'invalid stride for attribute "'+Ie+'", 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 "'+Ie+'", 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 "+Ie,oe.commandStr),O=Vi[Ce.type]);var $=Ce.divisor|0;"divisor"in Ce&&(te.command($===0||$t,'cannot specify divisor for attribute "'+Ie+'", instancing not supported',oe.commandStr),te.command($>=0,'invalid divisor for attribute "'+Ie+'"',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 "'+Ie+'" (valid parameters are '+re+")",Z)})}),pe.buffer=Me,pe.state=Js,pe.size=p,pe.normalized=y,pe.type=O||Me.dtype,pe.offset=ze,pe.stride=Xe,pe.divisor=$}}Je[Ie]=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(Ie){var Ce=Ge[Ie];function Ve(pe,Me){var fe=pe.invoke(Me,Ce),ze=pe.shared,Xe=pe.constants,p=ze.isBufferArgs,y=ze.buffer;te.optional(function(){pe.assert(Me,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 "'+Ie+'"')});var O={isStream:Me.def(!1)},$=new Ze;$.state=Js,Object.keys($).forEach(function(xe){O[xe]=Me.def(""+$[xe])});var Z=O.buffer,re=O.type;Me("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,"=",Qs,";","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){Me(O[xe],"=",fe,".",xe,"|0;")}return ve("size"),ve("offset"),ve("stride"),ve("divisor"),Me("}}"),Me.exit("if(",O.isStream,"){",y,".destroyStream(",Z,");","}"),O}Je[Ie]=ua(Ce,Ve)}),Je}function Zo(he,oe){var Pe=he.static,Ge=he.dynamic;if(nu in Pe){var Je=Pe[nu];return Je!==null&&jt.getVAO(Je)===null&&(Je=jt.createVAO(Je)),Io(function(Ce){return Ce.link(jt.getVAO(Je))})}else if(nu in Ge){var Ie=Ge[nu];return ua(Ie,function(Ce,Ve){var pe=Ce.invoke(Ve,Ie);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 Ie=oe[Je];Ge[Je]=Io(function(Ce,Ve){return typeof Ie=="number"||typeof Ie=="boolean"?""+Ie:Ce.link(Ie)})}),Object.keys(Pe).forEach(function(Je){var Ie=Pe[Je];Ge[Je]=ua(Ie,function(Ce,Ve){return Ce.invoke(Ve,Ie)})}),Ge}function Fo(he,oe,Pe,Ge,Je){var Ie=he.static,Ce=he.dynamic;te.optional(function(){var ve=[ta,Yc,Ii,Ho,Sl,gf,Al,Ct,bs,nu].concat(Nt);function xe(Ue){Object.keys(Ue).forEach(function(_t){te.command(ve.indexOf(_t)>=0,'unknown parameter "'+_t+'"',Je.commandStr)})}xe(Ie),xe(Ce)});var Ve=Xn(he,oe),pe=mn(he),Me=cr(he,pe,Je),fe=Er(he,Je),ze=$o(he,Je),Xe=lr(he,Je,Ve);function p(ve){var xe=Me[ve];xe&&(ze[ve]=xe)}p(Do),p(Jt(tu));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,Ie=he.scope();Object.keys(Pe).forEach(function(Ce){oe.save(Je,"."+Ce);var Ve=Pe[Ce],pe=Ve.append(he,oe);Array.isArray(pe)?Ie(Je,".",Ce,"=[",pe.join(),"];"):Ie(Je,".",Ce,"=",pe,";")}),oe(Ie)}function ii(he,oe,Pe,Ge){var Je=he.shared,Ie=Je.gl,Ce=Je.framebuffer,Ve;nn&&(Ve=oe.def(Je.extensions,".webgl_draw_buffers"));var pe=he.constants,Me=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,"){",Ie,".bindFramebuffer(",sd,",",ze,".framebuffer);"),nn&&oe(Ve,".drawBuffersWEBGL(",Me,"[",ze,".colorAttachments.length]);"),oe("}else{",Ie,".bindFramebuffer(",sd,",null);"),nn&&oe(Ve,".drawBuffersWEBGL(",fe,");"),oe("}",Ce,".cur=",ze,";"),Ge||oe("}")}function fi(he,oe,Pe){var Ge=he.shared,Je=Ge.gl,Ie=he.current,Ce=he.next,Ve=Ge.current,pe=Ge.next,Me=he.cond(Ve,".dirty");Nt.forEach(function(fe){var ze=Jt(fe);if(!(ze in Pe.state)){var Xe,p;if(ze in Ce){Xe=Ce[ze],p=Ie[ze];var y=Lr(kt[ze].length,function($){return Me.def(Xe,"[",$,"]")});Me(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=Me.def(pe,".",ze);var O=he.cond(Xe,"!==",Ve,".",ze);Me(O),ze in Yt?O(he.cond(Xe).then(Je,".enable(",Yt[ze],");").else(Je,".disable(",Yt[ze],");"),Ve,".",ze,"=",Xe,";"):O(Je,".",Tt[ze],"(",Xe,");",Ve,".",ze,"=",Xe,";")}}}),Object.keys(Pe.state).length===0&&Me(Ve,".dirty=false;"),oe(Me)}function Jo(he,oe,Pe,Ge){var Je=he.shared,Ie=he.current,Ce=Je.current,Ve=Je.gl;ud(Object.keys(Pe)).forEach(function(pe){var Me=Pe[pe];if(!(Ge&&!Ge(Me))){var fe=Me.append(he,oe);if(Yt[pe]){var ze=Yt[pe];ll(Me)?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=Ie[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 Ie=he.shared,Ce=he.stats,Ve=Ie.current,pe=Ie.timer,Me=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(Me){if(ll(Me)){Me.enable?(p(oe),y(oe.exit),O("true")):O("false");return}$=Me.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 Ie=he.shared;function Ce(pe){switch(pe){case ed:case nd:case Yl:return 2;case iu:case rd:case gi:return 3;case td:case od:case Of:return 4;default:return 1}}function Ve(pe,Me,fe){var ze=Ie.gl,Xe=oe.def(pe,".location"),p=oe.def(Ie.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,"||",Me):Ue=Me,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===Js?re():y===Qs?ve():(oe("if(",y,"===",Js,"){"),re(),oe("}else{"),ve(),oe("}"))}Ge.forEach(function(pe){var Me=pe.name,fe=Pe.attributes[Me],ze;if(fe){if(!Je(fe))return;ze=fe.append(he,oe)}else{if(!Je($a))return;var Xe=he.scopeAttrib(Me);te.optional(function(){he.assert(oe,Xe+".state","missing attribute "+Me)}),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 Ie=he.shared,Ce=Ie.gl,Ve,pe=0;pe<Ge.length;++pe){var Me=Ge[pe],fe=Me.name,ze=Me.info.type,Xe=Pe.uniforms[fe],p=he.link(Me),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===lu||ze===Xu){te.optional(function(){te.command(C($),"invalid matrix for uniform "+fe,he.commandStr),te.command(ze===id&&$.length===4||ze===lu&&$.length===9||ze===Xu&&$.length===16,"invalid length for matrix uniform "+fe,he.commandStr)});var re=he.global.def("new Float32Array(["+Array.prototype.slice.call($)+"])"),ve=2;ze===lu?ve=3:ze===Xu&&(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 iu: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 au:te.commandType($,"boolean","uniform "+fe,he.commandStr),Ve="1i";break;case Hu: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($a))continue;O=oe.def(Ie.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 qt(Lt,rn){he.assert(oe,Lt,'bad data or missing for uniform "'+fe+'". '+rn)}function xn(Lt){te(!Array.isArray(O),"must not specify an array type for uniform"),qt("typeof "+O+'==="'+Lt+'"',"invalid type, expected "+Lt)}function An(Lt,rn){Array.isArray(O)?te(O.length===Lt,"must have length "+Lt):qt(Ie.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"),qt("typeof "+O+'==="function"&&'+O+'._reglType==="texture'+(Lt===wf?"2d":"Cube")+'"',"invalid texture type",he.commandStr)}switch(ze){case Hu: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 iu:An(3);break;case td:An(4);break;case au:xn("boolean");break;case Yl:An(2);break;case gi:An(3);break;case Of:An(4);break;case id:An(4);break;case lu:An(9);break;case Xu: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 Hu:case au: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 iu:Ve="3f",xe=3;break;case td:Ve="4f",xe=4;break;case id:Ve="Matrix2fv";break;case lu:Ve="Matrix3fv";break;case Xu: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(qt){return xt+"["+qt+"]="+O[qt]}),",",xt,")"):oe("false,(Array.isArray(",O,")||",O," instanceof Float32Array)?",O,":(",Lr(_t,function(qt){return xt+"["+qt+"]="+O+"["+qt+"]"}),",",xt,")")}else xe>1?oe(Lr(xe,function(qt){return Array.isArray(O)?O[qt]:O+"["+qt+"]"})):(te(!Array.isArray(O),"uniform value must not be an array"),oe(O));oe(");")}}function In(he,oe,Pe,Ge){var Je=he.shared,Ie=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+")"+Ie+".bindBuffer("+Tp+","+_t+".buffer.buffer);"),_t}function Me(){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=Me();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+"-"+Zs+")>>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(Ie+".drawElements("+[Xe,y,Z,p+"<<(("+Z+"-"+Zs+")>>1)"]+");")}function _t(){Pe(Ie+".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 Ie=Ln(),Ce=Ie.proc("body",Je);return te.optional(function(){Ie.commandStr=oe.commandStr,Ie.command=Ie.link(oe.commandStr)}),$t&&(Ie.instancing=Ce.def(Ie.shared.extensions,".angle_instanced_arrays")),he(Ie,Ce,Pe,Ge),Ie.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("{}"),Ie=Pe.def(Ge,".id"),Ce=Pe.def(Je,"[",Ie,"]");Pe(he.cond(Ce).then(Ce,".call(this,a0);").else(Ce,"=",Je,"[",Ie,"]=",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,Ie=oe.def(),Ce="a0",Ve="a1",pe=oe.def();he.shared.props=pe,he.batchId=Ie;var Me=he.scope(),fe=he.scope();oe(Me.entry,"for(",Ie,"=0;",Ie,"<",Ve,";++",Ie,"){",pe,"=",Ce,"[",Ie,"];",fe,"}",Me.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),");"):Me(he.shared.vao,".setVAO(",Pe.drawVAO.append(he,Me),");"):Me(he.shared.vao,".setVAO(",he.shared.vao,".targetVAO);"):(Me(he.shared.vao,".setVAO(null);"),pi(he,Me,Pe,Ge.attributes,Xe),pi(he,fe,Pe,Ge.attributes,ze)),Tr(he,Me,Pe,Ge.uniforms,Xe),Tr(he,fe,Pe,Ge.uniforms,ze),In(he,Me,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[",Ie,"],",Ie,");")}}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 Ie=oe.framebuffer,Ce=!1;Ie?(Ie.propDep?Ge=Ce=!0:Ie.contextDep&&Ge&&(Ce=!0),Ce||ii(he,Pe,Ie)):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 Me=pe.append(he,Pe);if(Pe(he.shared.gl,".useProgram(",Me,".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(Me,".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)}),"(",Me,");",Xe,".call(this,a0,a1);"))}}Object.keys(oe.state).length>0&&Pe(he.shared.current,".dirty=true;")}function ut(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(Me,fe){Pe.set(he.next[Ce],"["+fe+"]",Me)}):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(Me){Pe.set(pe,"."+Me,Ve[Me])})}),oe.scopeVAO&&Pe.set(Ge.vao,".targetVAO",oe.scopeVAO.append(he,Pe));function Ie(Ce){var Ve=oe.shader[Ce];Ve&&Pe.set(Ge.shader,"."+Ce,Ve.append(he,Pe))}Ie(Yc),Ie(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(tn.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,Ie=Object.keys(Ge),Ce=!1,Ve=!1,pe=!1,Me=he.global.def("{}");Ie.forEach(function(ze){var Xe=Ge[ze];if(tn.isDynamic(Xe)){typeof Xe=="function"&&(Xe=Ge[ze]=tn.unbox(Xe));var p=ua(Xe,null);Ce=Ce||p.thisDep,pe=pe||p.propDep,Ve=Ve||p.contextDep}else{switch(Je(Me,".",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){Ie.forEach(function(p){var y=Ge[p];if(tn.isDynamic(y)){var O=ze.invoke(Xe,y);Xe(Me,".",p,"=",O,";")}})}oe.dynamic[Pe]=new tn.DynamicVariable(nl,{thisDep:Ce,contextDep:Ve,propDep:pe,ref:Me,append:fe}),delete oe.static[Pe]}function hr(he,oe,Pe,Ge,Je){var Ie=Ln();Ie.stats=Ie.link(Je),Object.keys(oe.static).forEach(function(Ve){dn(Ie,oe,Ve)}),kp.forEach(function(Ve){dn(Ie,he,Ve)});var Ce=Fo(he,oe,Pe,Ge,Ie);return _o(Ie,Ce),ut(Ie,Ce),ye(Ie,Ce),a(Ie.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,Ie=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 Me=0;Me<st.maxAttributes;++Me){var fe=Pe.def(Je.attributes,"[",Me,"]"),ze=he.cond(fe,".buffer");ze.then(Ie,".enableVertexAttribArray(",Me,");",Ie,".bindBuffer(",Ml,",",fe,".buffer.buffer);",Ie,".vertexAttribPointer(",Me,",",fe,".size,",fe,".type,",fe,".normalized,",fe,".stride,",fe,".offset);").else(Ie,".disableVertexAttribArray(",Me,");",Ie,".vertexAttrib4f(",Me,",",fe,".x,",fe,".y,",fe,".z,",fe,".w);",fe,".buffer=null;"),Pe(ze),$t&&Pe(pe,".vertexAttribDivisorANGLE(",Me,",",fe,".divisor);")}return Pe(he.shared.vao,".currentVAO=null;",he.shared.vao,".setVAO(",he.shared.vao,".targetVAO);"),Object.keys(Yt).forEach(function(Xe){var p=Yt[Xe],y=Ge.def(Ce,".",Xe),O=he.block();O("if(",y,"){",Ie,".enable(",p,")}else{",Ie,".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(Ie,".",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 uu=34918,wr=34919,Fh=35007,ca=function(G,se){if(!se.ext_disjoint_timer_query)return null;var Oe=[];function st(){return Oe.pop()||se.ext_disjoint_timer_query.createQueryEXT()}function gt($t){Oe.push($t)}var ot=[];function mt($t){var nn=st();se.ext_disjoint_timer_query.beginQueryEXT(Fh,nn),ot.push(nn),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 Zt($t){jt.push($t)}var Gt=[];function Dt($t,nn,kt){var ln=ht();ln.startQueryIndex=$t,ln.endQueryIndex=nn,ln.sum=0,ln.stats=kt,Gt.push(ln)}var At=[],Ze=[];function pt(){var $t,nn,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,nn=0;nn<ot.length;++nn){var Nt=ot[nn];se.ext_disjoint_timer_query.getQueryObjectEXT(Nt,wr)?(ln+=se.ext_disjoint_timer_query.getQueryObjectEXT(Nt,uu),gt(Nt)):ot[$t++]=Nt,At[nn+1]=ln,Ze[nn+1]=$t}for(ot.length=$t,$t=0,nn=0;nn<Gt.length;++nn){var Yt=Gt[nn],Tt=Yt.startQueryIndex,Jt=Yt.endQueryIndex;Yt.sum+=At[Jt]-At[Tt];var Cn=Ze[Tt],Hn=Ze[Jt];Hn===Cn?(Yt.stats.gpuTime+=Yt.sum/1e6,Zt(Yt)):(Yt.startQueryIndex=Cn,Yt.endQueryIndex=Hn,Gt[$t++]=Yt)}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,Sa="webglcontextlost",cu="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,st=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(),Zt=Oe.drawingBufferWidth,Gt=Oe.drawingBufferHeight,Dt={tick:0,time:0,viewportWidth:Zt,viewportHeight:Gt,framebufferWidth:Zt,framebufferHeight:Gt,drawingBufferWidth:Zt,drawingBufferHeight:Gt,pixelRatio:se.pixelRatio},At={},Ze={elements:null,primitive:4,count:-1,offset:0,instances:-1},pt=Mc(Oe,Bt),$t=_a(Oe,Rt,se,kt),nn=uf(Oe,Bt,pt,Rt,$t);function kt(In){return nn.destroyBuffer(In)}var ln=bn(Oe,Bt,$t,Rt),Nt=df(Oe,mt,Rt,se),Yt=Mr(Oe,Bt,pt,function(){Cn.procs.poll()},Dt,Rt,se),Tt=$u(Oe,Bt,pt,Rt,se),Jt=lf(Oe,Bt,pt,Yt,Tt,Rt),Cn=tm(Oe,mt,Bt,pt,$t,ln,Yt,Jt,At,nn,Nt,Ze,Dt,jt,se),Hn=Th(Oe,Jt,Cn.procs.poll,Dt,st,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(),Yt.restore(),Tt.restore(),Jt.restore(),nn.restore(),jt&&jt.restore(),Cn.procs.refresh(),lr(),or.forEach(function(mr){mr()})}Pt&&(Pt.addEventListener(Sa,$o,!1),Pt.addEventListener(cu,Ro,!1));function ir(){Mt.length=0,Er(),Pt&&(Pt.removeEventListener(Sa,$o),Pt.removeEventListener(cu,Ro)),Nt.clear(),Jt.clear(),Tt.clear(),Yt.clear(),ln.clear(),$t.clear(),nn.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 Ie=a({},Je);delete Ie.uniforms,delete Ie.attributes,delete Ie.context,delete Ie.vao,"stencil"in Ie&&Ie.stencil.op&&(Ie.stencil.opBack=Ie.stencil.opFront=Ie.stencil.op,delete Ie.stencil.op);function Ce(Ve){if(Ve in Ie){var pe=Ie[Ve];delete Ie[Ve],Object.keys(pe).forEach(function(Me){Ie[Ve+"."+Me]=pe[Me]})}}return Ce("blend"),Ce("depth"),Ce("cull"),Ce("stencil"),Ce("polygonOffset"),Ce("scissor"),Ce("sample"),"vao"in Je&&(Ie.vao=Je.vao),Ie}function tr(Je,Ie){var Ce={},Ve={};return Object.keys(Je).forEach(function(pe){var Me=Je[pe];if(tn.isDynamic(Me)){Ve[pe]=tn.unbox(Me,pe);return}else if(Ie&&Array.isArray(Me)){for(var fe=0;fe<Me.length;++fe)if(tn.isDynamic(Me[fe])){Ve[pe]=tn.unbox(Me,pe);return}}Ce[pe]=Me}),{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),ut={gpuTime:0,cpuTime:0,count:0},it=Cn.compile(ye,So,kl,_o,ut),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,Ie){var Ce;if(gt&&te.raise("context lost"),typeof Je=="function")return he.call(this,null,Je,0);if(typeof Ie=="function")if(typeof Je=="number")for(Ce=0;Ce<Je;++Ce)he.call(this,null,Ie,Ce);else if(Array.isArray(Je))for(Ce=0;Ce<Je.length;++Ce)he.call(this,Je[Ce],Ie,Ce);else return he.call(this,Je,Ie,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:ut,destroy:function(){it.destroy()}})}var so=Jt.setFBO=Zo({framebuffer:tn.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(){Yt.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:tn.define.bind(null,dd),context:tn.define.bind(null,Lo),this:tn.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:Yt.create2D,cube:Yt.createCube,renderbuffer:Tt.create,framebuffer:Jt.create,framebufferCube:Jt.createCube,vao:nn.createVAO,attributes:st,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}))})(Mg)),Mg.exports}Hne();var xd,gm,Sd,Ns,_m,Lf,bm,fg,rc,qp,Ma,oc,ic,pg;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");gm={},fn(gm,cn.STATIC_DRAW,"static"),fn(gm,cn.DYNAMIC_DRAW,"dynamic"),fn(gm,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");_m={},fn(_m,cn.DONT_CARE,"dont care"),fn(_m,cn.NICEST,"nice"),fn(_m,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");bm={},fn(bm,cn.REPEAT,"repeat"),fn(bm,cn.CLAMP_TO_EDGE,"clamp"),fn(bm,cn.MIRRORED_REPEAT,"mirror");fg={},fn(fg,cn.NONE,"none"),fn(fg,cn.BROWSER_DEFAULT_WEBGL,"browser");rc={},fn(rc,cn.NEVER,"never"),fn(rc,cn.ALWAYS,"always"),fn(rc,cn.LESS,"less"),fn(rc,cn.LEQUAL,"lequal"),fn(rc,cn.GREATER,"greater"),fn(rc,cn.GEQUAL,"gequal"),fn(rc,cn.EQUAL,"equal"),fn(rc,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");Ma={},fn(Ma,cn.ZERO,"zero"),fn(Ma,cn.ONE,"one"),fn(Ma,cn.SRC_COLOR,"src color"),fn(Ma,cn.ONE_MINUS_SRC_COLOR,"one minus src color"),fn(Ma,cn.SRC_ALPHA,"src alpha"),fn(Ma,cn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),fn(Ma,cn.DST_COLOR,"dst color"),fn(Ma,cn.ONE_MINUS_DST_COLOR,"one minus dst color"),fn(Ma,cn.DST_ALPHA,"dst alpha"),fn(Ma,cn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),fn(Ma,cn.CONSTANT_COLOR,"constant color"),fn(Ma,cn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),fn(Ma,cn.CONSTANT_ALPHA,"constant alpha"),fn(Ma,cn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),fn(Ma,cn.SRC_ALPHA_SATURATE,"src alpha saturate");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");ic={},fn(ic,cn.ZERO,"zero"),fn(ic,cn.KEEP,"keep"),fn(ic,cn.REPLACE,"replace"),fn(ic,cn.INVERT,"invert"),fn(ic,cn.INCR,"increment"),fn(ic,cn.DECR,"decrement"),fn(ic,cn.INCR_WRAP,"increment wrap"),fn(ic,cn.DECR_WRAP,"decrement wrap");pg={},fn(pg,cn.FRONT,"front"),fn(pg,cn.BACK,"back");var aw,PM;function Xne(){if(PM)return aw;PM=1;function e(t,n){return function(a){return t(n(a))}}return aw=e,aw}var lw,CM;function qne(){if(CM)return lw;CM=1;var e=Xne(),t=e(Object.getPrototypeOf,Object);return lw=t,lw}var sw,RM;function Yne(){if(RM)return sw;RM=1;var e=tE(),t=qne(),n=nE(),a="[object Object]",r=Function.prototype,s=Object.prototype,c=r.toString,v=s.hasOwnProperty,f=c.call(Object);function _(g){if(!n(g)||e(g)!=a)return!1;var b=t(g);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 sw=_,sw}Yne();class a2{constructor(){fa(this,"lf");fa(this,"option")}render(t){this.lf=t}layout(t={}){var _;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},(_=new rQ(this.option).layout({nodes:n.map(g=>({id:g.id,size:{width:g.width,height:g.height},model:g})),edges:a.map(g=>({source:g.sourceNodeId,target:g.targetNodeId,model:g}))}).nodes)==null||_.forEach(g=>{const{model:b}=g;b.set_position({x:g.x,y:g.y})}),this.lf.fitView()}}fa(a2,"pluginName","dagre");let ac=null;function jM(e,t){return e.x+=t,e.y+=t,e.text&&(e.text.x+=t,e.text.y+=t),e}function DM(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 hg=40;function PC(e,t){const{keyboard:n}=e,{options:{keyboard:a}}=n,r=()=>{var b,x;if(hg=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 ac=null,!0;const g=f.nodes.filter(A=>A.type===nr.Start||A.type===nr.Base);if(g.length>0){ei(((x=(b=g[0])==null?void 0:b.properties)==null?void 0:x.stepName)+yt("views.applicationWorkflow.tip.cannotCopy"));return}return ac=me.cloneDeep(f),ac.nodes.forEach(A=>jM(A,lv)),ac.edges.forEach(A=>DM(A,lv)),zf(yt("views.applicationWorkflow.tip.copyError")),!1},s=()=>{if(!(a!=null&&a.enabled)||t.textEditElement)return!0;if(ac&&(ac.nodes||ac.edges)){e.clearSelectElements();const v=e.addElements(ac,hg);if(!v)return!0;v.nodes.forEach(f=>e.selectElementById(f.id,!0)),v.edges.forEach(f=>e.selectElementById(f.id,!0)),ac.nodes.forEach(f=>jM(f,lv)),ac.edges.forEach(f=>DM(f,lv)),hg=hg+lv}return!1},c=()=>{var _;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(g=>!["loop-edge"].includes(g.type||"")).forEach(g=>e.deleteEdge(g.id));return}const f=v.nodes.filter(g=>["start-node","base-node","loop-body-node","loop-start-node"].includes(g.type));if(f.length>0){ei(`${(_=f[0].properties)==null?void 0:_.stepName}${yt("views.applicationWorkflow.delete.deleteMessage")}`);return}return Jw(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(g=>e.deleteEdge(g.id)),v.nodes.forEach(g=>{g.type==="loop-node"&&e.getNodeOutgoingNode(g.id).forEach(x=>{x.type==="loop-body-node"&&e.deleteNode(x.id)}),e.deleteNode(g.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 Kne={class:"flex-between"},Zne={class:"flex align-center"},Jne={class:"ellipsis-1 break-all"},Qne={class:"title-decoration-1 mb-8 mt-8"},ere=["onMouseenter"],tre={class:"break-all"},nre={class:"dialog-footer"},rre=Vn({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(e){eE("workflowMode",sc.ApplicationLoop);const t=je(),n=je(!1),a=je({title:""}),r=$n({set:S=>{me.set(g.nodeModel.properties,"showNode",S)},get:()=>g.nodeModel.properties.showNode!==void 0?g.nodeModel.properties.showNode:(me.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(E=>{var T;E&&((T=g.nodeModel.graphModel.nodes)!=null&&T.some(I=>I.properties.stepName===a.value.title)?HD.error(yt("views.applicationWorkflow.tip.repeatedNodeError")):(me.set(g.nodeModel.properties,"stepName",a.value.title),n.value=!1,S.resetFields()))})},v=()=>{g.nodeModel.graphModel.clearSelectElements(),me.set(g.nodeModel,"isSelected",!0),me.set(g.nodeModel,"isHovered",!0),g.nodeModel.graphModel.toFront(g.nodeModel.id)},f=je(null),_=je(600),g=e,b=$n(()=>{var S;return g.nodeModel.properties.config.fields?(S=g.nodeModel.properties.config.fields)==null?void 0:S.map(T=>({label:T.label,value:T.value,globeLabel:`{{${g.nodeModel.properties.stepName}.${T.value}}}`,globeValue:`{{context['${g.nodeModel.id}'].${T.value}}}`})):[]}),x=je(!1);function A(){if(x.value=!x.value,x.value){g.nodeModel.graphModel.transformModel.focusOn(g.nodeModel.x,g.nodeModel.y,g.nodeModel.width+window.innerWidth-g.nodeModel.width,g.nodeModel.height-30),_.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(_.value)}else{_.value=600;const S=1920;g.nodeModel.width=S,g.nodeModel.setHeight(_.value)}}return(S,E)=>{var V;const T=J("AppIcon"),I=J("el-button"),R=J("el-alert"),U=J("el-tooltip"),L=J("el-collapse-transition"),D=J("el-input"),W=J("el-form-item"),Y=J("el-form"),B=J("el-dialog");return _e(),Ht("div",{onMousedown:v,class:"workflow-node-container p-16",style:{overflow:"visible"}},[K("div",{class:Cl(["step-container app-card p-16",{isSelected:g.nodeModel.isSelected,error:s.value!==200}]),style:{overflow:"visible",background:"#fff"}},[K("div",null,[K("div",Kne,[K("div",Zne,[(_e(),at(Ng(_n(Pg)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(V=e.nodeModel)==null?void 0:V.properties.node_data},null,8,["item"])),K("h4",Jne,de(e.nodeModel.properties.stepName),1)]),k(I,{link:"",onClick:A},{default:P(()=>[k(T,{iconName:x.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),k(L,null,{default:P(()=>[Wa(K("div",{onMousedown:E[1]||(E[1]=Xt(()=>{},["stop"])),onKeydown:E[2]||(E[2]=Xt(()=>{},["stop"])),onClick:E[3]||(E[3]=Xt(()=>{},["stop"])),class:"mt-16"},[s.value!=200?(_e(),at(R,{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),K("div",{style:nk(`height:${_.value}px`)},[rk(S.$slots,"default",{},void 0,!0)],4),b.value.length>0?(_e(),Ht(ar,{key:1},[K("h5",Qne,de(S.$t("common.param.outputParam")),1),(_e(!0),Ht(ar,null,Gr(b.value,(z,H)=>(_e(),Ht("div",{key:H,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:q=>f.value=H,onMouseleave:E[0]||(E[0]=q=>f.value=null)},[K("span",tre,de(z.label)+" "+de("{"+z.value+"}"),1),f.value===H?(_e(),at(U,{key:0,effect:"dark",content:S.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:P(()=>[k(I,{link:"",onClick:q=>_n($m)(z.globeLabel),style:{padding:"0"}},{default:P(()=>[k(T,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):pn("",!0)],40,ere))),128))],64)):pn("",!0)],544),[[Wf,r.value]])]),_:3})])],2),k(B,{title:S.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":E[8]||(E[8]=z=>n.value=z),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:E[9]||(E[9]=Xt(()=>{},["prevent"]))},{footer:P(()=>[K("span",nre,[k(I,{onClick:E[6]||(E[6]=Xt(z=>n.value=!1,["prevent"]))},{default:P(()=>[et(de(S.$t("common.cancel")),1)]),_:1}),k(I,{type:"primary",onClick:E[7]||(E[7]=z=>c(t.value))},{default:P(()=>[et(de(S.$t("common.save")),1)]),_:1})])]),default:P(()=>[k(Y,{"label-position":"top",ref_key:"titleFormRef",ref:t,model:a.value},{default:P(()=>[k(W,{prop:"title",rules:[{required:!0,message:S.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:P(()=>[k(D,{modelValue:a.value.title,"onUpdate:modelValue":E[4]||(E[4]=z=>a.value.title=z),onBlur:E[5]||(E[5]=z=>a.value.title=a.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),ore=Kf(rre,[["__scopeId","data-v-cdf21a30"]]),ire=[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],are=[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],IM={[sc.Application]:ire,[sc.ApplicationLoop]:are};class zw{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||sc.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=IM[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=IM[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 lre=Vn({__name:"index",props:{nodeModel:{}},setup(e){const t=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":mN,"/src/workflow/nodes/application-node/index.ts":yN,"/src/workflow/nodes/base-node/index.ts":CN,"/src/workflow/nodes/condition-node/index.ts":RN,"/src/workflow/nodes/document-extract-node/index.ts":jN,"/src/workflow/nodes/form-node/index.ts":DN,"/src/workflow/nodes/image-generate/index.ts":IN,"/src/workflow/nodes/image-to-video/index.ts":LN,"/src/workflow/nodes/image-understand/index.ts":$N,"/src/workflow/nodes/intent-classify-node/index.ts":FN,"/src/workflow/nodes/loop-body-node/index.ts":vk,"/src/workflow/nodes/loop-break-node/index.ts":BN,"/src/workflow/nodes/loop-continue-node/index.ts":VN,"/src/workflow/nodes/loop-node/index.ts":UN,"/src/workflow/nodes/loop-start-node/index.ts":WN,"/src/workflow/nodes/mcp-node/index.ts":GN,"/src/workflow/nodes/parameter-extraction-node/index.ts":zN,"/src/workflow/nodes/question-node/index.ts":HN,"/src/workflow/nodes/reply-node/index.ts":XN,"/src/workflow/nodes/reranker-node/index.ts":qN,"/src/workflow/nodes/search-document-node/index.ts":YN,"/src/workflow/nodes/search-knowledge-node/index.ts":KN,"/src/workflow/nodes/speech-to-text-node/index.ts":ZN,"/src/workflow/nodes/start-node/index.ts":JN,"/src/workflow/nodes/text-to-speech-node/index.ts":QN,"/src/workflow/nodes/text-to-video/index.ts":eP,"/src/workflow/nodes/tool-lib-node/index.ts":tP,"/src/workflow/nodes/tool-node/index.ts":nP,"/src/workflow/nodes/variable-aggregation-node/index.ts":rP,"/src/workflow/nodes/variable-assign-node/index.ts":oP,"/src/workflow/nodes/variable-splitting/index.ts":iP,"/src/workflow/nodes/video-understand/index.ts":aP}),n=e,a=je(),r=()=>{const _=new zw(v.value.getGraphData(),sc.ApplicationLoop);return Promise.all(v.value.graphModel.nodes.map(g=>{var b;return(b=g==null?void 0:g.validate)==null?void 0:b.call(g)})).then(()=>{const g=n.nodeModel.properties.loop_node_id,b=n.nodeModel.graphModel.getNodeModelById(g);try{return _.is_loop_valid(),b.properties.node_data.loop_type=="LOOP"&&!_.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(g=>{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),g})},s=()=>{const _=n.nodeModel.properties.loop_node_id,g=n.nodeModel.graphModel.getNodeModelById(_);g.properties.node_data.loop={x:n.nodeModel.x,y:n.nodeModel.y},g.properties.node_data.loop_body=v.value.getGraphData()},c=_=>{const g=n.nodeModel.properties.loop_node_id,b=n.nodeModel.graphModel.getNodeModelById(g);b&&(b.properties.config.fields=_)},v=je(),f=_=>{const g=a.value;if(g){let b=function(x){let A=v.value.graphModel.transformModel.SCALE_X,S=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,A*=n.nodeModel.graphModel.transformModel.SCALE_X,S*=n.nodeModel.graphModel.transformModel.SCALE_Y,E*=n.nodeModel.graphModel.transformModel.SCALE_X,T*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(I-E)/A,(R-T)/S]};v.value=new LT({plugins:[a2],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:g}),v.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),v.value.graphModel.transformModel.HtmlPointToCanvasPoint=b.bind(v.value.graphModel.transformModel),PC(v.value,v.value.graphModel),v.value.graphModel.get_provide=(x,A)=>({getNode:()=>x,getGraph:()=>A,workflowMode:sc.ApplicationLoop}),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),lP]),v.value.setDefaultEdgeType("app-edge"),v.value.render(_||{}),v.value.graphModel.eventCenter.on("delete_edge",x=>{x.forEach(A=>{v.value.deleteEdge(A)})}),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(me.cloneDeep(n.nodeModel.properties.workflow)),me.set(n.nodeModel,"validate",r),me.set(n.nodeModel,"set_loop_body",s)}),ak(()=>{TU(v.value.graphModel.flowId),v.value=null}),(_,g)=>(_e(),at(ore,{nodeModel:e.nodeModel},{default:P(()=>[K("div",{ref_key:"containerRef",ref:a,onWheel:g[0]||(g[0]=Xt(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class sre extends ho{constructor(t){super(t,lre)}getNodeName(){return yt("views.applicationWorkflow.nodes.loopBodyNode.label")}get_up_node_field_list(t,n){const a=this.props.model.properties.loop_node_id;return this.props.graphModel.getNodeModelById(a).get_up_node_field_list(t,n)}}class ure 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 cre={type:"loop-body-node",model:ure,view:sre};class dre 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 fre={type:"loop-edge",view:hn.BezierEdge,model:dre},pre=Vn({__name:"NodeControl",props:{lf:Object||String||null},setup(e){const t=e,n=je(!1);function a(){var g;(g=t.lf)==null||g.zoom(!0,[0,0])}function r(){var g;(g=t.lf)==null||g.zoom(!1,[0,0])}function s(){var g,b,x;(g=t.lf)==null||g.resetZoom(),(b=t.lf)==null||b.resetTranslate(),(x=t.lf)==null||x.fitView()}const c=()=>{var g;(g=t.lf)==null||g.extension.dagre.layout()},v=()=>{var g;(g=t.lf)==null||g.graphModel.nodes.forEach(b=>{b.properties.showNode=!1})},f=()=>{var g;(g=t.lf)==null||g.graphModel.nodes.forEach(b=>{b.properties.showNode=!0})},_=g=>{var x,A,S;const b=document.querySelector(".lf-drag-able");n.value=g,g?(b.style.cursor="default",(x=t.lf)==null||x.openSelectionSelect(),(A=t.lf)==null||A.extension.selectionSelect.setSelectionSense(!0,!1)):(b.style.cursor="pointer",(S=t.lf)==null||S.closeSelectionSelect())};return(g,b)=>{const x=J("Position"),A=J("el-icon"),S=J("el-button"),E=J("AppIcon"),T=J("el-divider"),I=J("ZoomOut"),R=J("el-tooltip"),U=J("ZoomIn"),L=J("el-card");return _e(),at(L,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:P(()=>[k(S,{onClick:b[0]||(b[0]=D=>_(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Cl({"is-drag-active":n.value})},{default:P(()=>[k(A,{size:16},{default:P(()=>[k(x)]),_:1})]),_:1},8,["class"]),k(S,{onClick:b[1]||(b[1]=D=>_(!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(S,{link:"",onClick:r,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:P(()=>[k(A,{size:16,title:g.$t("views.applicationWorkflow.control.zoomOut")},{default:P(()=>[k(I)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{link:"",onClick:a,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:P(()=>[k(A,{size:16,title:g.$t("views.applicationWorkflow.control.zoomIn")},{default:P(()=>[k(U)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{link:"",onClick:s,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:P(()=>[k(E,{iconName:"app-fitview",title:g.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(T,{direction:"vertical"}),k(S,{link:"",onClick:v,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-retract",title:g.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{link:"",onClick:f,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-extend",title:g.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{link:"",onClick:c,style:{border:"none"}},{default:P(()=>[k(R,{effect:"dark",content:g.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:P(()=>[k(E,{style:{"font-size":"16px"},iconName:"app-beautify",title:g.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),hre=Kf(pre,[["__scopeId","data-v-510558f4"]]),vre=Vn({name:"WorkFlow"}),mre=Vn({...vre,props:{data:Object||null},setup(e,{expose:t}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":mN,"./nodes/application-node/index.ts":yN,"./nodes/base-node/index.ts":CN,"./nodes/condition-node/index.ts":RN,"./nodes/document-extract-node/index.ts":jN,"./nodes/form-node/index.ts":DN,"./nodes/image-generate/index.ts":IN,"./nodes/image-to-video/index.ts":LN,"./nodes/image-understand/index.ts":$N,"./nodes/intent-classify-node/index.ts":FN,"./nodes/loop-body-node/index.ts":vk,"./nodes/loop-break-node/index.ts":BN,"./nodes/loop-continue-node/index.ts":VN,"./nodes/loop-node/index.ts":UN,"./nodes/loop-start-node/index.ts":WN,"./nodes/mcp-node/index.ts":GN,"./nodes/parameter-extraction-node/index.ts":zN,"./nodes/question-node/index.ts":HN,"./nodes/reply-node/index.ts":XN,"./nodes/reranker-node/index.ts":qN,"./nodes/search-document-node/index.ts":YN,"./nodes/search-knowledge-node/index.ts":KN,"./nodes/speech-to-text-node/index.ts":ZN,"./nodes/start-node/index.ts":JN,"./nodes/text-to-speech-node/index.ts":QN,"./nodes/text-to-video/index.ts":eP,"./nodes/tool-lib-node/index.ts":tP,"./nodes/tool-node/index.ts":nP,"./nodes/variable-aggregation-node/index.ts":rP,"./nodes/variable-assign-node/index.ts":oP,"./nodes/variable-splitting/index.ts":iP,"./nodes/video-understand/index.ts":aP}),a=PU(),r=je(""),s=je();Ir(()=>{v()}),ak(()=>{NU()});const c=A=>{s.value.render(A)},v=A=>{const S=document.querySelector("#container");S&&(s.value=new LT({plugins:[a2,OU],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:S}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.graphModel.get="sdasdaad",s.value.on("graph:rendered",()=>{r.value=s.value.graphModel.flowId}),PC(s.value,s.value.graphModel),s.value.batchRegister([...Object.keys(n).map(E=>n[E].default),lP,fre]),s.value.setDefaultEdgeType("app-edge"),s.value.render(A||{}),s.value.graphModel.get_provide=(E,T)=>({getNode:()=>E,getGraph:()=>T,workflowMode:sc.Application}),s.value.graphModel.eventCenter.on("delete_edge",E=>{E.forEach(T=>{s.value.deleteEdge(T)})}),s.value.graphModel.eventCenter.on("anchor:drop",E=>{E.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var E;(E=s.value)==null||E.fitView()},500))};return t({onmousedown:A=>{A.type&&s.value.dnd.startDrag({type:A.type,properties:{...A.properties}}),A.callback&&A.callback(s.value)},validate:()=>Promise.all(s.value.graphModel.nodes.map(A=>{var S;return(S=A==null?void 0:A.validate)==null?void 0:S.call(A)})),getGraphData:()=>{const A=s.value.getGraphData();A.nodes.forEach(E=>{E.type==="loop-body-node"&&s.value.getNodeModelById(E.id).set_loop_body()});const S=s.value.getGraphData();return S.nodes=S.nodes.filter(E=>E.type!=="loop-body-node"),S.edges=A.edges.filter(E=>E.type!=="loop-edge"),S},addNode:A=>{s.value.clearSelectElements();const{virtualRectCenterPositionX:S,virtualRectCenterPositionY:E}=s.value.graphModel.getVirtualRectSize(),T=s.value.graphModel.addNode({type:A.type,properties:A.properties,x:S,y:E-s.value.graphModel.height/2});T.isSelected=!0,T.isHovered=!0,s.value.toFront(T.id)},clearGraphData:()=>s.value.clearData(),renderGraphData:v,render:c}),(A,S)=>(_e(),Ht(ar,null,[S[0]||(S[0]=K("div",{className:"workflow-app",id:"container"},null,-1)),s.value?(_e(),at(hre,{key:0,class:"workflow-control",lf:s.value},null,8,["lf"])):pn("",!0),k(_n(a),{"flow-id":r.value},null,8,["flow-id"])],64))}}),yre={class:"workflow-publish-history border-l white-bg"},gre={class:"border-b p-16-24"},_re={class:"list-height pt-0"},bre={class:"p-8 pt-0"},wre={class:"flex-between"},Ere={style:{"max-width":"80%"}},Ore={class:"text-center"},xre=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=je(!1),v=je([]),f=je("");function _(T){f.value=T.id}function g(T){s("click",T)}function b(T){s("refreshVersion",T)}function x(T){T.writeStatus=!0}function A(T){T.writeStatus=!1}function S(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"),L=J("UserFilled"),D=J("el-icon"),W=J("el-avatar"),Y=J("el-text"),B=J("AppIcon"),V=J("el-button"),z=J("el-dropdown-item"),H=J("RefreshLeft"),q=J("el-dropdown-menu"),ee=J("el-dropdown"),ue=J("common-list"),ie=J("el-scrollbar"),be=Mv("loading");return _e(),Ht("div",yre,[K("h4",gre,de(T.$t("views.applicationWorkflow.setting.releaseHistory")),1),K("div",_re,[k(ie,null,{default:P(()=>[K("div",bre,[Wa((_e(),at(ue,{data:v.value,class:"mt-8",onClick:g,onMouseenter:_,onMouseleave:I[1]||(I[1]=De=>f.value="")},{default:P(({row:De,index:Ne})=>[K("div",wre,[K("div",Ere,[K("h5",{class:Cl([Ne===0?"primary":"","flex align-center"])},[k(R,{onChange:Ae=>S(Ae,De),data:De.name||_n(cw)(De.update_time),trigger:"manual",write:De.writeStatus,onClose:Ae=>A(De)},null,8,["onChange","data","write","onClose"]),Ne===0?(_e(),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(Y,{type:"info",class:"color-secondary flex align-center mt-8"},{default:P(()=>[k(W,{size:20,class:"avatar-grey mr-4"},{default:P(()=>[k(D,null,{default:P(()=>[k(L)]),_:1})]),_:1}),et(" "+de(De.publish_user_name),1)]),_:2},1024)]),Wa(K("div",{onClick:I[0]||(I[0]=Xt(()=>{},["stop"]))},[k(ee,{trigger:"click",teleported:!1},{dropdown:P(()=>[k(q,null,{default:P(()=>[k(z,{onClick:Xt(Ae=>x(De),["stop"])},{default:P(()=>[k(B,{iconName:"app-edit",class:"color-secondary"}),et(" "+de(T.$t("common.edit")),1)]),_:1},8,["onClick"]),k(z,{onClick:Ae=>b(De)},{default:P(()=>[k(D,{class:"color-secondary"},{default:P(()=>[k(H)]),_:1}),et(" "+de(T.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:P(()=>[k(V,{text:""},{default:P(()=>[k(B,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Wf,f.value===De.id]])])]),empty:P(()=>[K("div",Ore,[k(Y,{type:"info"},{default:P(()=>[et(de(T.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[be,c.value]])])]),_:1})])])}}}),Sre=Kf(xre,[["__scopeId","data-v-85be1165"]]),Are={class:"application-workflow"},Mre={class:"header border-b flex-between p-12-24 white-bg"},kre={class:"flex align-center"},Tre=["title"],Nre={key:0},Pre={key:0},Cre={key:1},Rre=["href"],jre={class:"ml-4"},Dre={class:"flex-between"},Ire={class:"flex align-center"},Lre={class:"mr-12 ml-24 flex"},$re=["src"],Fre=["title"],Bre={class:"mr-16"},Vre={class:"scrollbar-height"},loe=Vn({__name:"index",setup(e){eE("getApplicationDetail",()=>A);const{theme:t}=ek(),n=XD(),a=Li(),{params:{id:r,from:s}}=a,c=$n(()=>a.path.includes("resource-management")?"systemManage":"workspace"),v=$n(()=>tk.application[c.value]),f=$n(()=>t.isDefaultTheme());let _;const g=je(),b=je(),x=je(!1),A=je(null),S=je(!1),E=je(!1),T=je(!1),I=je(""),R=je(!1),U=je(!1),L=je(!1),D=je({}),W=je(null),Y=je([]),B=$n(()=>Wx(Y.value)?"?"+Wx(Y.value):""),V=$n(()=>{var Ye;return`${window.location.origin}/chat/`+((Ye=A.value)==null?void 0:Ye.access_token)+B.value});function z(){JSON.stringify(W.value)!==JSON.stringify(Be())?Jw(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 H(){L.value||(U.value=!1,L.value=!1)}function q(Ye){Ye&&ue(Ye),U.value=!1,L.value=!1}function ee(Ye){L.value=!0,D.value=Ye,ue(Ye),Re()}function ue(Ye){var Ot;Ye.work_flow.nodes.map(bt=>{bt.properties.noRender=!0}),A.value.work_flow=Ye.work_flow,I.value=Ye==null?void 0:Ye.update_time,(Ot=g.value)==null||Ot.clearGraphData(),Gf(()=>{var bt;(bt=g.value)==null||bt.render(Ye.work_flow)})}function ie(){dt(),R.value&&we(),U.value=!1,L.value=!1}function be(){U.value=!0}function De(Ye){Ye?we():Re(),localStorage.setItem("workflowAutoSave",Ye.toString())}function Ne(Ye){S.value=!1}function Ae(Ye){S.value=!1}function Te(){S.value=!1}const rt=()=>{var Ye;(Ye=g.value)==null||Ye.validate().then(()=>{const Ot=Be(),bt=new zw(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 en,on;A.value.name=Ft.data.name,(on=(en=Ft.data.work_flow)==null?void 0:en.nodes)==null||on.filter(Wt=>Wt.id==="base-node").map(Wt=>{Y.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 en=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=en.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 en,on,Wt,nt;const bt=Ot.node,Ft=Ot.errMessage;if(typeof Ft=="string")ei(((en=Ot.node.properties)==null?void 0:en.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=g.value)==null||Ye.validate().then(()=>{var Ft;const Ot=Be(),bt=new zw(Ot);try{bt.is_valid(),A.value={...A.value,type:"WORK_FLOW",...(Ft=bt.get_base_node())==null?void 0:Ft.properties.node_data,work_flow:Be()},E.value=!0}catch(en){ei(en.toString())}}).catch(Ot=>{var en,on,Wt,nt;const bt=Ot.node,Ft=Ot.errMessage;if(typeof Ft=="string")ei(((en=Ot.node.properties)==null?void 0:en.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=g.value)==null?void 0:Ye.getGraphData()}function dt(){po({type:"application",systemType:c.value}).getApplicationDetail(r).then(Ye=>{var Ot,bt,Ft,en,on;(Ot=Ye.data)==null||Ot.work_flow.nodes.map(Wt=>{Wt.properties.noRender=!0}),A.value=Ye.data,A.value.stt_model_id=Ye.data.stt_model,A.value.tts_model_id=Ye.data.tts_model,A.value.tts_type=Ye.data.tts_type,I.value=(bt=Ye.data)==null?void 0:bt.update_time,(en=(Ft=A.value.work_flow)==null?void 0:Ft.nodes)==null||en.filter(Wt=>Wt.id==="base-node").map(Wt=>{Y.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=>{A.value={...A.value,...Wt.data}}),(on=g.value)==null||on.clearGraphData(),Gf(()=>{var Wt;(Wt=g.value)==null||Wt.render(A.value.work_flow),W.value=Be()}),Od([Nl.IS_EE,Nl.IS_PE],"OR")&&po({type:"application",systemType:c.value}).getApplicationSetting(r).then(Wt=>{A.value={...A.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:Qt()}),Qt=()=>Od([gu.ADMIN,Va.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/overview`:Od([gu.ADMIN,Va.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/access`:Od([gu.ADMIN,Va.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-user`:Od([gu.ADMIN,Va.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",Fe=()=>Od([new If([gu.USER],[Va.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),gu.WORKSPACE_MANAGE.getWorkspaceRole,Va.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Va.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${s}/${r}/WORK_FLOW/overview`:Od([new If([gu.USER],[Va.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"AND"),new If([gu.WORKSPACE_MANAGE.getWorkspaceRole],[Va.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Nl.IS_EE,Nl.IS_PE],"OR"),new If([],[Va.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"OR")],"OR")?`/application/${s}/${r}/WORK_FLOW/access`:Od([new If([gu.USER],[Va.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"AND"),new If([gu.WORKSPACE_MANAGE.getWorkspaceRole],[Va.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Nl.IS_EE,Nl.IS_PE],"OR"),new If([],[Va.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Nl.IS_EE,Nl.IS_PE],"OR")],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-user`:Od([new If([gu.USER],[Va.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Va.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Va.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${s}/${r}/WORK_FLOW/chat-log`:"/application",we=()=>{_=setInterval(()=>{St()},6e4)},Re=()=>{_&&clearInterval(_)};return Ir(()=>{dt();const Ye=localStorage.getItem("workflowAutoSave");R.value=Ye==="true",R.value&&we()}),qD(()=>{var Ye;Re(),(Ye=g.value)==null||Ye.clearGraphData()}),(Ye,Ot)=>{var Se,Qe,$e;const bt=J("back-button"),Ft=J("el-text"),en=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 Wa((_e(),Ht("div",Are,[K("div",Mre,[K("div",kre,[k(bt,{onClick:z}),K("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(Se=A.value)==null?void 0:Se.name},de((Qe=A.value)==null?void 0:Qe.name),9,Tre),U.value&&L.value?(_e(),Ht("div",Nre,[k(Ft,{type:"info",class:"ml-16 color-secondary"},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.info.previewVersion"))+" "+de(D.value.name||_n(cw)(D.value.update_time)),1)]),_:1})])):I.value?(_e(),at(Ft,{key:1,type:"info",class:"ml-16 color-secondary"},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.info.saveTime"))+de(_n(cw)(I.value)),1)]),_:1})):pn("",!0)]),U.value&&L.value?(_e(),Ht("div",Pre,[k(en,{type:"primary",class:"mr-8",onClick:Ot[0]||(Ot[0]=lt=>q())},{default:P(()=>[et(de(Ye.$t("views.applicationWorkflow.setting.restoreVersion")),1)]),_:1}),k(on,{direction:"vertical"}),k(en,{text:"",onClick:ie},{default:P(()=>[k(nt,null,{default:P(()=>[k(Wt)]),_:1})]),_:1})])):(_e(),Ht("div",Cre,[k(en,{onClick:Ot[1]||(Ot[1]=lt=>S.value=!S.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))?(_e(),at(en,{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))?(_e(),at(en,{key:1,onClick:Ot[2]||(Ot[2]=lt=>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))?(_e(),at(en,{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(()=>[K("a",{href:V.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:be},{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),K("div",jre,[k(yn,{size:"small",modelValue:R.value,"onUpdate:modelValue":Ot[4]||(Ot[4]=lt=>R.value=lt),onChange:De},null,8,["modelValue"])])]),_:1})]),_:1})]),default:P(()=>[k(en,{text:"",onClick:Ot[3]||(Ot[3]=Xt(()=>{},["stop"])),class:"ml-8 mt-4"},{default:P(()=>[k(sn,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),k(Gn,null,{default:P(()=>[Wa(k(IT,{show:S.value,id:_n(r),onClickNodes:Ne,onOnmousedown:Ae,workflowRef:g.value},null,8,["show","id","workflowRef"]),[[jn,Te]])]),_:1}),K("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:b},[A.value?(_e(),at(mre,{key:0,ref_key:"workflowRef",ref:g,data:($e=A.value)==null?void 0:$e.work_flow},null,8,["data"])):pn("",!0)],512),k(Gn,null,{default:P(()=>{var lt,an,tn;return[E.value?(_e(),Ht("div",{key:0,class:Cl(["workflow-debug-container",T.value?"enlarge":""])},[K("div",{class:Cl(["workflow-debug-header",f.value?"":"custom-header"])},[K("div",Dre,[K("div",Ire,[K("div",Lre,[_n(uw)((lt=A.value)==null?void 0:lt.icon)?(_e(),at(br,{key:0,shape:"square",size:32,style:{background:"none"}},{default:P(()=>{var Tn;return[K("img",{src:_n(Bf)((Tn=A.value)==null?void 0:Tn.icon),alt:""},null,8,$re)]}),_:1})):(_e(),at(Dr,{key:1,height:"32px"}))]),K("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(an=A.value)==null?void 0:an.name},de(((tn=A.value)==null?void 0:tn.name)||Ye.$t("views.application.form.appName.label")),9,Fre)]),K("div",Bre,[k(en,{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(en,{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),K("div",Vre,[k(zr,{"application-details":A.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):pn("",!0)]}),_:1}),U.value?Wa((_e(),at(Sre,{key:0,onClick:ee,onRefreshVersion:q},null,512)),[[jn,H]]):pn("",!0)])),[[ko,x.value]])}}});export{loe as default};