var p$=Object.defineProperty;var h$=(t,e,n)=>e in t?p$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var hs=(t,e,n)=>h$(t,typeof e!="symbol"?e+"":e,n);import{dr as Pg,eP as Jc,dn as zo,eQ as IN,db as tm,eR as z_,eS as sp,eT as nm,eU as Qy,eV as qu,ef as qd,dc as qa,eW as v$,dd as Kd,ea as hj,eX as m$,eY as H_,eZ as Ju,e6 as SE,e8 as N2,dk as rm,au as Zd,e_ as om,e$ as im,eg as Kg,f0 as P2,di as Yo,f1 as AE,dM as ME,ee as lp,dS as Ri,f2 as kg,dj as Nh,f3 as Zg,f4 as X_,dR as Jd,dh as El,df as _i,f5 as g$,f6 as vj,eE as Qu,ed as js,f7 as y$,f8 as _$,f9 as Jg,fa as TE,fb as mj,dL as am,fc as gj,bL as ec,dg as Y_,at as Ph,dQ as w_,dO as Hv,e9 as b$,ec as FN,eb as w$,as as yj,fd as _j,fe as E$,dm as CE,de as x$,ei as uw,ff as O$,fg as bj,fh as wj,fi as S$,fj as Ej,fk as A$,dp as M$,fl as T$,fm as C$,fn as N$,fo as cw,fp as P$,el as k$,fq as xj,dN as Oj,eh as k2,fr as Sj,fs as R2,ft as R$,dl as q_,fu as Aj,fv as D$,fw as Mj,fx as Tj,fy as j$,fz as L$,fA as I$,em as E_,eC as F$,fB as B$,fC as $$,aw as U$,fD as V$,fE as W$,fF as D2,fG as G$,fH as Cj,fI as z$,fJ as H$,ai as X$,eF as to,fK as Y$,ax as dw,fL as uA,fM as q$,fN as K$,fO as wl,fP as Z$,fQ as J$,av as Xv,fR as Q$,eG as Yv,fS as e7,eD as Vv,fT as Nj,fU as t7,fV as n7,fW as r7,ay as _r,aB as He,aV as K_,aD as ne,aE as Ne,aW as mn,aX as Ir,aH as P,aI as ee,aY as No,aF as bt,aG as j,b2 as Wn,c$ as cA,bX as mh,dw as BN,aJ as _e,bY as j2,aK as ft,b1 as Bn,aS as gn,cf as kh,fX as Qs,aQ as ja,aA as Pj,aO as hr,aP as kj,b6 as bo,b8 as Js,bc as Rj,ch as Eh,cq as fw,fY as pw,bW as u0,aT as oi,aN as Qc,aZ as Me,b7 as Rg,ce as Gl,cF as Dj,cj as x_,c1 as Xi,aC as kt,c0 as L2,aM as Pr,fZ as O_,ci as bl,d5 as Z_,bB as Dg,aU as Rh,f_ as o7,f$ as i7,g0 as jj,g1 as Lj,g2 as a7,g3 as s7,g4 as l7,g5 as u7,g6 as c7,g7 as Go,du as I2,dv as d7,cu as f7,bD as xh,dJ as p7,b3 as Oh,g8 as yu,cJ as h7,g9 as $N,ga as Lv,gb as v7,gc as F2,gd as B2,ge as m7,gf as g7,b4 as Ij,bZ as dA,az as y7,er as UN,cY as _7,bG as Qf,bH as Vl,bI as Ic,bK as Xs,bJ as lh}from"./admin-CVV10WkZ.js";import{t as VN,a as WN,g as b7,i as Qd,n as w7,c as $2,l as c0,d as E7}from"./data-CmtZQ9WV.js";import{_ as dp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-B1HLyRcH.js";import{G as U2,d as x7,e as O7,f as S7,_ as Fj,c as Bj,b as A7,a as M7}from"./ToolDialog.vue_vue_type_style_index_0_lang-Mqox5Ibc.js";import{d as $j,c as sm,v as J_,e as T7,g as Uj,f as C7,a as ri,r as Vj}from"./reduce-B5b7KIXW.js";import{c as N7,a as P7,b as k7,e as Wj,f as Sh,m as R7,d as D7,h as hw}from"./min-C6aCKoU5.js";import{c as V2,b as NE,i as W2,p as Gj,n as G2,a as j7,d as z2,e as L7,f as I7,g as F7,h as B7,u as $7,j as U7,k as V7,l as zj,m as W7,r as G7,o as z7,q as H7,s as X7,t as Xo}from"./uniqBy-C-Npuxsd.js";import{d as Hj,e as Y7,g as q7,h as K7,i as Z7,z as J7,s as Q7,m as e9,a as t9,b as n9,f as r9,c as o9,r as i9,u as a9}from"./zipObject-DNn7XrIH.js";import{l as Xj,_ as Yj}from"./vue-draggable-plus-BVkTPn2t.js";import{_ as s9}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-ov9RwYOC.js";import{_ as Fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const qj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kme}},Symbol.toStringTag,{value:"Module"}));var l9=NaN;function GN(t){return typeof t=="number"?t:Pg(t)?l9:+t}function PE(t,e){return function(n,o){var r;if(n===void 0&&o===void 0)return e;if(n!==void 0&&(r=n),o!==void 0){if(r===void 0)return o;typeof n=="string"||typeof o=="string"?(n=Jc(n),o=Jc(o)):(n=GN(n),o=GN(o)),r=t(n,o)}return r}}var u9=PE(function(t,e){return t+e},0),c9="Expected a function";function d9(t,e){if(typeof e!="function")throw new TypeError(c9);return t=zo(t),function(){if(--t<1)return e.apply(this,arguments)}}var vw=IN&&new IN,Kj=vw?function(t,e){return vw.set(t,e),t}:tm;function S_(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=z_(t.prototype),o=t.apply(n,e);return sp(o)?o:n}}var f9=1;function p9(t,e,n){var o=e&f9,r=S_(t);function i(){var a=this&&this!==nm&&this instanceof i?r:t;return a.apply(o?n:this,arguments)}return i}var h9=Math.max;function Zj(t,e,n,o){for(var r=-1,i=t.length,a=n.length,l=-1,s=e.length,f=h9(i-a,0),h=Array(s+f),v=!o;++l1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(S9,`{ /* [wrapped with `+e+`] */ `)}var M9=1,T9=2,C9=8,N9=16,P9=32,k9=64,R9=128,D9=256,j9=512,L9=[["ary",R9],["bind",M9],["bindKey",T9],["curry",C9],["curryRight",N9],["flip",j9],["partial",P9],["partialRight",k9],["rearg",D9]];function I9(t,e){return Kd(L9,function(n){var o="_."+n[0];e&n[1]&&!hj(t,o)&&t.push(o)}),t.sort()}function tL(t,e,n){var o=e+"";return m$(t,A9(o,I9(O9(o),n)))}var F9=4,B9=8,zN=32,HN=64;function nL(t,e,n,o,r,i,a,l,s,f){var h=e&B9,v=h?a:void 0,b=h?void 0:a,w=h?i:void 0,O=h?void 0:i;e|=h?zN:HN,e&=~(h?HN:zN),e&F9||(e&=-4);var E=[t,e,r,w,v,O,b,l,s,f],S=n.apply(void 0,E);return fA(t)&&eL(S,E),S.placeholder=o,tL(S,t,e)}function Qg(t){var e=t;return e.placeholder}var $9=Math.min;function U9(t,e){for(var n=t.length,o=$9(e.length,n),r=qu(t);o--;){var i=e[o];t[o]=H_(i,n)?r[i]:void 0}return t}var XN="__lodash_placeholder__";function Ah(t,e){for(var n=-1,o=t.length,r=0,i=[];++n1&&C.reverse(),h&&s0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var dU=1,fU=32,DE=Yo(function(t,e,n){var o=dU;if(n.length){var r=Ah(n,Qg(DE));o|=fU}return fp(t,o,e,n,r)});DE.placeholder={};var pU=im(function(t,e){return Kd(e,function(n){n=AE(n),ME(t,n,DE(t[n],t))}),t}),hU=1,vU=2,mU=32,q2=Yo(function(t,e,n){var o=hU|vU;if(n.length){var r=Ah(n,Qg(q2));o|=mU}return fp(e,o,t,n,r)});q2.placeholder={};function Dh(t,e,n){var o=t.length;return n=n===void 0?o:n,!e&&n>=o?t:lp(t,e,n)}var gU="\\ud800-\\udfff",yU="\\u0300-\\u036f",_U="\\ufe20-\\ufe2f",bU="\\u20d0-\\u20ff",wU=yU+_U+bU,EU="\\ufe0e\\ufe0f",xU="\\u200d",OU=RegExp("["+xU+gU+wU+EU+"]");function ey(t){return OU.test(t)}function SU(t){return t.split("")}var aL="\\ud800-\\udfff",AU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",TU="\\u20d0-\\u20ff",CU=AU+MU+TU,NU="\\ufe0e\\ufe0f",PU="["+aL+"]",hA="["+CU+"]",vA="\\ud83c[\\udffb-\\udfff]",kU="(?:"+hA+"|"+vA+")",sL="[^"+aL+"]",lL="(?:\\ud83c[\\udde6-\\uddff]){2}",uL="[\\ud800-\\udbff][\\udc00-\\udfff]",RU="\\u200d",cL=kU+"?",dL="["+NU+"]?",DU="(?:"+RU+"(?:"+[sL,lL,uL].join("|")+")"+dL+cL+")*",jU=dL+cL+DU,LU="(?:"+[sL+hA+"?",hA,lL,uL,PU].join("|")+")",IU=RegExp(vA+"(?="+vA+")|"+LU+jU,"g");function FU(t){return t.match(IU)||[]}function ed(t){return ey(t)?FU(t):SU(t)}function fL(t){return function(e){e=Ri(e);var n=ey(e)?ed(e):void 0,o=n?n[0]:e.charAt(0),r=n?Dh(n,1).join(""):e.slice(1);return o[t]()+r}}var K2=fL("toUpperCase");function pL(t){return K2(Ri(t).toLowerCase())}function Z2(t){return function(e){return t==null?void 0:t[e]}}var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$U=Z2(BU),UU=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,VU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",GU="\\u20d0-\\u20ff",zU=VU+WU+GU,HU="["+zU+"]",XU=RegExp(HU,"g");function hL(t){return t=Ri(t),t&&t.replace(UU,$U).replace(XU,"")}var YU=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qU(t){return t.match(YU)||[]}var KU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZU(t){return KU.test(t)}var vL="\\ud800-\\udfff",JU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",eV="\\u20d0-\\u20ff",tV=JU+QU+eV,mL="\\u2700-\\u27bf",gL="a-z\\xdf-\\xf6\\xf8-\\xff",nV="\\xac\\xb1\\xd7\\xf7",rV="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oV="\\u2000-\\u206f",iV=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yL="A-Z\\xc0-\\xd6\\xd8-\\xde",aV="\\ufe0e\\ufe0f",_L=nV+rV+oV+iV,bL="['’]",nP="["+_L+"]",sV="["+tV+"]",wL="\\d+",lV="["+mL+"]",EL="["+gL+"]",xL="[^"+vL+_L+wL+mL+gL+yL+"]",uV="\\ud83c[\\udffb-\\udfff]",cV="(?:"+sV+"|"+uV+")",dV="[^"+vL+"]",OL="(?:\\ud83c[\\udde6-\\uddff]){2}",SL="[\\ud800-\\udbff][\\udc00-\\udfff]",fg="["+yL+"]",fV="\\u200d",rP="(?:"+EL+"|"+xL+")",pV="(?:"+fg+"|"+xL+")",oP="(?:"+bL+"(?:d|ll|m|re|s|t|ve))?",iP="(?:"+bL+"(?:D|LL|M|RE|S|T|VE))?",AL=cV+"?",ML="["+aV+"]?",hV="(?:"+fV+"(?:"+[dV,OL,SL].join("|")+")"+ML+AL+")*",vV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gV=ML+AL+hV,yV="(?:"+[lV,OL,SL].join("|")+")"+gV,_V=RegExp([fg+"?"+EL+"+"+oP+"(?="+[nP,fg,"$"].join("|")+")",pV+"+"+iP+"(?="+[nP,fg+rP,"$"].join("|")+")",fg+"?"+rP+"+"+oP,fg+"+"+iP,mV,vV,wL,yV].join("|"),"g");function bV(t){return t.match(_V)||[]}function TL(t,e,n){return t=Ri(t),e=n?void 0:e,e===void 0?ZU(t)?bV(t):qU(t):t.match(e)||[]}var wV="['’]",EV=RegExp(wV,"g");function ty(t){return function(e){return $j(TL(hL(e).replace(EV,"")),t,"")}}var xV=ty(function(t,e,n){return e=e.toLowerCase(),t+(n?pL(e):e)}),OV=nm.isFinite,SV=Math.min;function J2(t){var e=Math[t];return function(n,o){if(n=kg(n),o=o==null?0:SV(zo(o),292),o&&OV(n)){var r=(Ri(n)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+o));return r=(Ri(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-o))}return e(n)}}var AV=J2("ceil");function CL(t){var e=ge(t);return e.__chain__=!0,e}var MV=Math.ceil,TV=Math.max;function CV(t,e,n){(n?Nh(t,e,n):e===void 0)?e=1:e=TV(zo(e),0);var o=t==null?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(MV(o/e));r=0&&t.slice(n,r)==e}function lW(t,e){return El(e,function(n){return[n,t[n]]})}function uW(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=[o,o]}),n}var cW="[object Map]",dW="[object Set]";function LL(t){return function(e){var n=TE(e);return n==cW?mj(e):n==dW?uW(e):lW(e,t(e))}}var pp=LL(Zd),fW=LL(rm),pW={"&":"&","<":"<",">":">",'"':""","'":"'"},hW=Z2(pW),IL=/[&<>"']/g,vW=RegExp(IL.source);function FL(t){return t=Ri(t),t&&vW.test(t)?t.replace(IL,hW):t}var BL=/[\\^$.*+?()[\]{}|]/g,mW=RegExp(BL.source);function gW(t){return t=Ri(t),t&&mW.test(t)?t.replace(BL,"\\$&"):t}var yW=4294967295;function $L(t){return t?Jg(zo(t),0,yW):0}function _W(t,e,n,o){var r=t.length;for(n=zo(n),n<0&&(n=-n>r?0:r+n),o=o===void 0||o>r?r:zo(o),o<0&&(o+=r),o=n>o?0:$L(o);n=e}),GW=Math.max,zW=Math.min;function HW(t,e,n){return t>=zW(e,n)&&t=120&&h.length>=120)?new b$(a&&h):void 0}h=t[0];var v=-1,b=l[0];e:for(;++v=-lP&&t<=lP}var MG="[object WeakMap]";function TG(t){return qd(t)&&TE(t)==MG}var CG="[object WeakSet]";function NG(t){return qd(t)&&Kg(t)==CG}var PG=1;function kG(t){return _i(typeof t=="function"?t:Zg(t,PG))}var RG=Array.prototype,DG=RG.join;function jG(t,e){return t==null?"":DG.call(t,e)}var LG=ty(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),IG=V2(function(t,e,n){ME(t,n,e)});function FG(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}var BG=Math.max,$G=Math.min;function UG(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=o;return n!==void 0&&(r=zo(n),r=r<0?BG(o+r,0):$G(r,o-1)),e===e?FG(t,e,r):M$(t,T$,r,!0)}var VG=ty(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),WG=fL("toLowerCase"),GG=IE(P7),zG=IE(function(t,e){return t<=e});function XL(t,e){var n={};return e=_i(e),am(t,function(o,r,i){ME(n,e(o,r,i),o)}),n}var HG=1;function XG(t){return C$(Zg(t,HG))}var YG=1;function qG(t,e){return N$(t,Zg(e,YG))}function KG(t,e){return t&&t.length?k7(t,_i(e),Hj):void 0}function oM(t,e){for(var n,o=-1,r=t.length;++o=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function KL(t,e){var n=t.length;if(n)return e+=e<0?n:0,H_(e,n)?t[e]:void 0}function lz(t,e){return t&&t.length?KL(t,zo(e)):void 0}function uz(t){return t=zo(t),Yo(function(e){return KL(e,t)})}function cz(t,e){return Gj(t,G2(_i(e)))}function dz(t){return iL(2,t)}function fz(t,e,n,o){return t==null?[]:(qa(e)||(e=e==null?[]:[e]),n=o?void 0:n,qa(n)||(n=n==null?[]:[n]),Y7(t,e,n))}function iM(t){return im(function(e){return e=El(e,Hv(_i)),Yo(function(n){var o=this;return t(e,function(r){return Ju(r,o,n)})})})}var pz=iM(El),hz=Yo,vz=Math.min,mz=hz(function(t,e){e=e.length==1&&qa(e[0])?El(e[0],Hv(_i)):El(Jd(e,1),Hv(_i));var n=e.length;return Yo(function(o){for(var r=-1,i=vz(o.length,n);++r_z)return n;do e%2&&(n+=t),e=bz(e/2),e&&(t+=t);while(e);return n}var wz=xj("length"),ZL="\\ud800-\\udfff",Ez="\\u0300-\\u036f",xz="\\ufe20-\\ufe2f",Oz="\\u20d0-\\u20ff",Sz=Ez+xz+Oz,Az="\\ufe0e\\ufe0f",Mz="["+ZL+"]",gA="["+Sz+"]",yA="\\ud83c[\\udffb-\\udfff]",Tz="(?:"+gA+"|"+yA+")",JL="[^"+ZL+"]",QL="(?:\\ud83c[\\udde6-\\uddff]){2}",eI="[\\ud800-\\udbff][\\udc00-\\udfff]",Cz="\\u200d",tI=Tz+"?",nI="["+Az+"]?",Nz="(?:"+Cz+"(?:"+[JL,QL,eI].join("|")+")"+nI+tI+")*",Pz=nI+tI+Nz,kz="(?:"+[JL+gA+"?",gA,QL,eI,Mz].join("|")+")",uP=RegExp(yA+"(?="+yA+")|"+kz+Pz,"g");function Rz(t){for(var e=uP.lastIndex=0;uP.test(t);)++e;return e}function ny(t){return ey(t)?Rz(t):wz(t)}var Dz=Math.ceil;function gw(t,e){e=e===void 0?" ":Jc(e);var n=e.length;if(n<2)return n?mA(e,t):e;var o=mA(e,Dz(t/ny(e)));return ey(e)?Dh(ed(o),0,t).join(""):o.slice(0,t)}var jz=Math.ceil,Lz=Math.floor;function Iz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return gw(Lz(r),n)+t+gw(jz(r),n)}function Fz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o-1;)l!==t&&cP.call(l,s,1),cP.call(t,s,1);return t}function rI(t,e){return t&&t.length&&e&&e.length?sM(t,e):t}var Kz=Yo(rI);function Zz(t,e,n){return t&&t.length&&e&&e.length?sM(t,e,_i(n)):t}function Jz(t,e,n){return t&&t.length&&e&&e.length?sM(t,e,void 0,n):t}var Qz=Array.prototype,eH=Qz.splice;function oI(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;H_(r)?eH.call(t,r,1):Sj(t,r)}}return t}var tH=im(function(t,e){var n=t==null?0:t.length,o=X2(t,e);return oI(t,El(e,function(r){return H_(r,n)?+r:r}).sort(q7)),o}),nH=Math.floor,rH=Math.random;function lM(t,e){return t+nH(rH()*(e-t+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function sH(t,e,n){if(n&&typeof n!="boolean"&&Nh(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=w_(t),e===void 0?(e=t,t=0):e=w_(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=aH();return iH(t+r*(e-t+oH("1e-"+((r+"").length-1))),e)}return lM(t,e)}var lH=K7(!0),uH=256,cH=im(function(t,e){return fp(t,uH,void 0,void 0,void 0,e)});function dH(t,e,n,o){var r=t==null?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function fH(t,e,n){var o=qa(t)?dH:T7,r=arguments.length<3;return o(t,_i(e),n,r,jL)}function pH(t,e){var n=[];if(!(t&&t.length))return n;var o=-1,r=[],i=t.length;for(e=_i(e);++o>>1;function $E(t,e,n){var o=0,r=t==null?o:t.length;if(typeof e=="number"&&e===e&&r<=UH){for(;o>>1,a=t[i];a!==null&&!Pg(a)&&(n?a<=e:a>>0,n?(t=Ri(t),t&&(typeof e=="string"||e!=null&&!z2(e))&&(e=Jc(e),!e&&ey(t))?Dh(ed(t),0,n):t.split(e,n)):[]}var JH="Expected a function",QH=Math.max;function eX(t,e){if(typeof t!="function")throw new TypeError(JH);return e=e==null?0:QH(zo(e),0),Yo(function(n){var o=n[e],r=Dh(n,0,e);return o&&X_(r,o),Ju(t,this,r)})}var tX=ty(function(t,e,n){return t+(n?" ":"")+K2(e)});function nX(t,e,n){return t=Ri(t),n=n==null?0:Jg(zo(n),0,t.length),e=Jc(e),t.slice(n,n+e.length)==e}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=PE(function(t,e){return t-e},0);function sX(t){return t&&t.length?oM(t,tm):0}function lX(t,e){return t&&t.length?oM(t,_i(e)):0}function uX(t){var e=t==null?0:t.length;return e?lp(t,1,e):[]}function cX(t,e,n){return t&&t.length?(e=n||e===void 0?1:zo(e),lp(t,0,e<0?0:e)):[]}function dX(t,e,n){var o=t==null?0:t.length;return o?(e=n||e===void 0?1:zo(e),e=o-e,lp(t,e<0?0:e,o)):[]}function fX(t,e){return t&&t.length?jE(t,_i(e),!1,!0):[]}function pX(t,e){return t&&t.length?jE(t,_i(e)):[]}function hX(t,e){return e(t),t}var sI=Object.prototype,vX=sI.hasOwnProperty;function dP(t,e,n,o){return t===void 0||q_(t,sI[n])&&!vX.call(o,n)?e:t}var mX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gX(t){return"\\"+mX[t]}var lI=/<%=([\s\S]+?)%>/g,yX=/<%-([\s\S]+?)%>/g,_X=/<%([\s\S]+?)%>/g,bA={escape:yX,evaluate:_X,interpolate:lI,variable:"",imports:{_:{escape:FL}}},bX="Invalid `variable` option passed into `_.template`",wX=/\b__p \+= '';/g,EX=/\b(__p \+=) '' \+/g,xX=/(__e\(.*?\)|\b__t\)) \+\n'';/g,OX=/[()=,{}\[\]\/\s]/,SX=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,d0=/($^)/,AX=/['\n\r\u2028\u2029\\]/g,MX=Object.prototype,fP=MX.hasOwnProperty;function TX(t,e,n){var o=bA.imports._.templateSettings||bA;n&&Nh(t,e,n)&&(e=void 0),t=Ri(t),e=pA({},e,o,dP);var r=pA({},e.imports,o.imports,dP),i=Zd(r),a=Uj(r,i),l,s,f=0,h=e.interpolate||d0,v="__p += '",b=RegExp((e.escape||d0).source+"|"+h.source+"|"+(h===lI?SX:d0).source+"|"+(e.evaluate||d0).source+"|$","g"),w=fP.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+` `:"";t.replace(b,function(S,M,C,$,D,k){return C||(C=$),v+=t.slice(f,k).replace(AX,gX),M&&(l=!0,v+=`' + __e(`+M+`) + '`),D&&(s=!0,v+=`'; `+D+`; __p += '`),C&&(v+=`' + ((__t = (`+C+`)) == null ? '' : __t) + '`),f=k+S.length,S}),v+=`'; `;var O=fP.call(e,"variable")&&e.variable;if(!O)v=`with (obj) { `+v+` } `;else if(OX.test(O))throw new Error(bX);v=(s?v.replace(wX,""):v).replace(EX,"$1").replace(xX,"$1;"),v="function("+(O||"obj")+`) { `+(O?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(s?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+v+`return __p }`;var E=oL(function(){return Function(i,w+"return "+v).apply(void 0,a)});if(E.source=v,Y2(E))throw E;return E}function UE(t,e){return e(t)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function PX(t,e){if(t=zo(t),t<1||t>CX)return[];var n=KO,o=NX(t,KO);e=sm(e),t-=KO;for(var r=Aj(o,e);++n-1;);return n}function dI(t,e){for(var n=-1,o=t.length;++n-1;);return n}function BX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return L$(t);if(!t||!(e=Jc(e)))return t;var o=ed(t),r=ed(e),i=dI(o,r),a=cI(o,r)+1;return Dh(o,i,a).join("")}function $X(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.slice(0,I$(t)+1);if(!t||!(e=Jc(e)))return t;var o=ed(t),r=cI(o,ed(e))+1;return Dh(o,0,r).join("")}var UX=/^\s+/;function VX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.replace(UX,"");if(!t||!(e=Jc(e)))return t;var o=ed(t),r=dI(o,ed(e));return Dh(o,r).join("")}var WX=30,GX="...",zX=/\w*$/;function HX(t,e){var n=WX,o=GX;if(sp(e)){var r="separator"in e?e.separator:r;n="length"in e?zo(e.length):n,o="omission"in e?Jc(e.omission):o}t=Ri(t);var i=t.length;if(ey(t)){var a=ed(t);i=a.length}if(n>=i)return t;var l=n-ny(o);if(l<1)return o;var s=a?Dh(a,0,l).join(""):t.slice(0,l);if(r===void 0)return s+o;if(a&&(l+=s.length-l),z2(r)){if(t.slice(l).search(r)){var f,h=s;for(r.global||(r=RegExp(r.source,Ri(zX.exec(r))+"g")),r.lastIndex=0;f=r.exec(h);)var v=f.index;s=s.slice(0,v===void 0?l:v)}}else if(t.indexOf(Jc(r),l)!=l){var b=s.lastIndexOf(r);b>-1&&(s=s.slice(0,b))}return s+o}function XX(t){return rL(t,1)}var YX={"&":"&","<":"<",">":">",""":'"',"'":"'"},qX=Z2(YX),fI=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(fI.source);function ZX(t){return t=Ri(t),t&&KX.test(t)?t.replace(fI,qX):t}var JX=Yo(function(t){var e=Qu(t);return js(e)&&(e=void 0),E_(Jd(t,1,js,!0),_i(e))}),QX=Yo(function(t){var e=Qu(t);return e=typeof e=="function"?e:void 0,E_(Jd(t,1,js,!0),void 0,e)});function eY(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?E_(t,void 0,e):[]}function tY(t,e){return t==null?!0:Sj(t,e)}var nY=Math.max;function cM(t){if(!(t&&t.length))return[];var e=0;return t=Y_(t,function(n){if(js(n))return e=nY(n.length,e),!0}),Aj(e,function(n){return El(t,xj(n))})}function pI(t,e){if(!(t&&t.length))return[];var n=cM(t);return e==null?n:El(n,function(o){return Ju(e,void 0,o)})}function hI(t,e,n,o){return R2(t,e,n(Oj(t,e)),o)}function rY(t,e,n){return t==null?t:hI(t,e,sm(n))}function oY(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:hI(t,e,sm(n),o)}var iY=ty(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function aY(t){return t==null?[]:Uj(t,rm(t))}var sY=Yo(function(t,e){return js(t)?NE(t,e):[]});function lY(t,e){return FE(sm(e),t)}var uY=im(function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(i){return X2(i,t)};return e>1||this.__actions__.length||!(o instanceof $o)||!H_(n)?this.thru(r):(o=o.slice(n,+n+(e?1:0)),o.__actions__.push({func:UE,args:[r],thisArg:void 0}),new tc(o,this.__chain__).thru(function(i){return e&&!i.length&&i.push(void 0),i}))});function cY(){return CL(this)}function dY(){var t=this.__wrapped__;if(t instanceof $o){var e=t;return this.__actions__.length&&(e=new $o(this)),e=e.reverse(),e.__actions__.push({func:UE,args:[_A],thisArg:void 0}),new tc(e,this.__chain__)}return this.thru(_A)}function dM(t,e,n){var o=t.length;if(o<2)return o?E_(t[0]):[];for(var r=-1,i=Array(o);++r1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,pI(t,n)});const mr={chunk:CV,compact:L7,concat:LV,difference:I7,differenceBy:eW,differenceWith:tW,drop:F7,dropRight:B7,dropRightWhile:rW,dropWhile:oW,fill:bW,findIndex:Wj,findLastIndex:gj,flatten:F$,flattenDeep:B$,flattenDepth:MW,fromPairs:$$,head:V7,indexOf:zj,initial:YW,intersection:KW,intersectionBy:ZW,intersectionWith:JW,join:jG,lastIndexOf:UG,nth:lz,pull:Kz,pullAll:rI,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:_A,slice:DH,sortedIndex:VH,sortedIndexBy:WH,sortedIndexOf:GH,sortedLastIndex:zH,sortedLastIndexBy:HH,sortedLastIndexOf:XH,sortedUniq:YH,sortedUniqBy:qH,tail:uX,take:cX,takeRight:dX,takeRightWhile:fX,takeWhile:pX,union:U$,unionBy:JX,unionWith:QX,uniq:$7,uniqBy:U7,uniqWith:eY,unzip:cM,unzipWith:pI,without:sY,xor:fY,xorBy:pY,xorWith:hY,zip:vY,zipObject:J7,zipObjectDeep:mY,zipWith:gY},Di={countBy:zV,every:z7,filter:C7,find:Sh,findLast:EW,flatMap:V$,flatMapDeep:SW,flatMapDepth:AW,forEach:ri,forEachRight:aW,groupBy:W7,includes:H7,invokeMap:sG,keyBy:IG,map:ec,orderBy:fz,partition:zz,reduce:Vj,reduceRight:fH,reject:G7,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X7,sortBy:Q7},yY={now:W$},Ta={after:d9,ary:rL,before:iL,bind:DE,bindKey:q2,curry:Q2,curryRight:eM,debounce:D2,defer:JV,delay:QV,flip:CW,memoize:G$,once:dz,overArgs:mz,partial:FE,partialRight:aM,rearg:cH,rest:gH,spread:eX,throttle:Cj,unary:XX,wrap:lY},Vr={castArray:z$,clone:X$,cloneDeep:to,cloneDeepWith:kV,cloneWith:DV,conformsTo:VV,eq:q_,gt:VW,gte:WW,isArguments:Y$,isArrayBuffer:cG,isArrayLike:CE,isArrayLikeObject:js,isBoolean:mw,isBuffer:Mj,isDate:hG,isElement:vG,isEmpty:dw,isEqual:uA,isEqualWith:mG,isError:Y2,isFinite:yG,isFunction:Ph,isInteger:zL,isLength:q$,isMap:K$,isMatch:_G,isMatchWith:bG,isNaN:EG,isNative:SG,isNil:wl,isNull:Z$,isNumber:HL,isObjectLike:qd,isPlainObject:P2,isRegExp:z2,isSafeInteger:AG,isSet:J$,isString:W2,isSymbol:Pg,isTypedArray:Tj,isUndefined:Xv,isWeakMap:TG,isWeakSet:NG,lt:GG,lte:zG,toArray:qL,toFinite:w_,toLength:$L,toNumber:kg,toPlainObject:H$,toSafeInteger:LX,toString:Ri},Sl={add:u9,ceil:AV,divide:nW,floor:NW,max:e9,maxBy:KG,mean:JG,meanBy:QG,min:R7,minBy:t9,multiply:rz,round:wH,subtract:aX,sum:sX,sumBy:lX},fM={clamp:Q$,inRange:XW,random:sH},io={assign:Xo,assignIn:iU,assignInWith:pA,assignWith:aU,at:sU,create:HV,defaults:D7,defaultsDeep:KV,findKey:wW,findLastKey:xW,forIn:r9,forInRight:FW,forOwn:o9,forOwnRight:BW,functions:$W,functionsIn:UW,get:om,has:hw,hasIn:t7,invert:nG,invertBy:iG,invoke:aG,keysIn:rm,mapKeys:XL,mapValues:n9,merge:Yv,mergeWith:kL,omit:e7,omitBy:cz,pick:Vv,pickBy:Gj,result:yH,set:Nj,setWith:MH,toPairs:pp,toPairsIn:fW,transform:FX,unset:tY,update:rY,updateWith:oY,values:J_,valuesIn:aY},ef={at:uY,chain:CL,commit:jV,next:sz,plant:Hz,reverse:dY,tap:hX,toIterator:kX,value:RX,wrapperChain:cY},pi={camelCase:xV,capitalize:pL,deburr:hL,endsWith:sW,escape:FL,escapeRegExp:gW,kebabCase:LG,lowerCase:VG,lowerFirst:WG,pad:Iz,padEnd:Fz,padStart:Bz,parseInt:Vz,repeat:hH,replace:vH,snakeCase:jH,split:ZH,startCase:tX,startsWith:nX,template:TX,templateSettings:bA,toLower:DX,toUpper:IX,trim:BX,trimEnd:$X,trimStart:VX,truncate:HX,unescape:ZX,upperCase:iY,upperFirst:K2,words:TL},bi={attempt:oL,bindAll:pU,cond:FV,conforms:UV,constant:yj,defaultTo:qV,flow:LW,flowRight:IW,iteratee:kG,matches:XG,matchesProperty:qG,method:ez,methodOf:tz,noop:Qy,nthArg:uz,over:pz,overEvery:gz,overSome:yz,property:n7,propertyOf:Xz,range:i9,rangeRight:lH,stubArray:r7,stubFalse:Ej,stubObject:rX,stubString:oX,stubTrue:iX,times:PX,toPath:jX,uniqueId:a9};function _Y(){var t=new $o(this.__wrapped__);return t.__actions__=qu(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=qu(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=qu(this.__views__),t}function bY(){if(this.__filtered__){var t=new $o(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var wY=Math.max,EY=Math.min;function xY(t,e,n){for(var o=-1,r=n.length;++o * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var TY="4.17.23",CY=2,NY=1,PY=3,vI=4294967295,kY=Array.prototype,RY=Object.prototype,mI=RY.hasOwnProperty,hP=cw?cw.iterator:void 0,DY=Math.max,vP=Math.min,pM=(function(t){return function(e,n,o){if(o==null){var r=sp(n),i=r&&Zd(n),a=i&&i.length&&LE(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}})(nz);ge.after=Ta.after;ge.ary=Ta.ary;ge.assign=io.assign;ge.assignIn=io.assignIn;ge.assignInWith=io.assignInWith;ge.assignWith=io.assignWith;ge.at=io.at;ge.before=Ta.before;ge.bind=Ta.bind;ge.bindAll=bi.bindAll;ge.bindKey=Ta.bindKey;ge.castArray=Vr.castArray;ge.chain=ef.chain;ge.chunk=mr.chunk;ge.compact=mr.compact;ge.concat=mr.concat;ge.cond=bi.cond;ge.conforms=bi.conforms;ge.constant=bi.constant;ge.countBy=Di.countBy;ge.create=io.create;ge.curry=Ta.curry;ge.curryRight=Ta.curryRight;ge.debounce=Ta.debounce;ge.defaults=io.defaults;ge.defaultsDeep=io.defaultsDeep;ge.defer=Ta.defer;ge.delay=Ta.delay;ge.difference=mr.difference;ge.differenceBy=mr.differenceBy;ge.differenceWith=mr.differenceWith;ge.drop=mr.drop;ge.dropRight=mr.dropRight;ge.dropRightWhile=mr.dropRightWhile;ge.dropWhile=mr.dropWhile;ge.fill=mr.fill;ge.filter=Di.filter;ge.flatMap=Di.flatMap;ge.flatMapDeep=Di.flatMapDeep;ge.flatMapDepth=Di.flatMapDepth;ge.flatten=mr.flatten;ge.flattenDeep=mr.flattenDeep;ge.flattenDepth=mr.flattenDepth;ge.flip=Ta.flip;ge.flow=bi.flow;ge.flowRight=bi.flowRight;ge.fromPairs=mr.fromPairs;ge.functions=io.functions;ge.functionsIn=io.functionsIn;ge.groupBy=Di.groupBy;ge.initial=mr.initial;ge.intersection=mr.intersection;ge.intersectionBy=mr.intersectionBy;ge.intersectionWith=mr.intersectionWith;ge.invert=io.invert;ge.invertBy=io.invertBy;ge.invokeMap=Di.invokeMap;ge.iteratee=bi.iteratee;ge.keyBy=Di.keyBy;ge.keys=Zd;ge.keysIn=io.keysIn;ge.map=Di.map;ge.mapKeys=io.mapKeys;ge.mapValues=io.mapValues;ge.matches=bi.matches;ge.matchesProperty=bi.matchesProperty;ge.memoize=Ta.memoize;ge.merge=io.merge;ge.mergeWith=io.mergeWith;ge.method=bi.method;ge.methodOf=bi.methodOf;ge.mixin=pM;ge.negate=G2;ge.nthArg=bi.nthArg;ge.omit=io.omit;ge.omitBy=io.omitBy;ge.once=Ta.once;ge.orderBy=Di.orderBy;ge.over=bi.over;ge.overArgs=Ta.overArgs;ge.overEvery=bi.overEvery;ge.overSome=bi.overSome;ge.partial=Ta.partial;ge.partialRight=Ta.partialRight;ge.partition=Di.partition;ge.pick=io.pick;ge.pickBy=io.pickBy;ge.property=bi.property;ge.propertyOf=bi.propertyOf;ge.pull=mr.pull;ge.pullAll=mr.pullAll;ge.pullAllBy=mr.pullAllBy;ge.pullAllWith=mr.pullAllWith;ge.pullAt=mr.pullAt;ge.range=bi.range;ge.rangeRight=bi.rangeRight;ge.rearg=Ta.rearg;ge.reject=Di.reject;ge.remove=mr.remove;ge.rest=Ta.rest;ge.reverse=mr.reverse;ge.sampleSize=Di.sampleSize;ge.set=io.set;ge.setWith=io.setWith;ge.shuffle=Di.shuffle;ge.slice=mr.slice;ge.sortBy=Di.sortBy;ge.sortedUniq=mr.sortedUniq;ge.sortedUniqBy=mr.sortedUniqBy;ge.split=pi.split;ge.spread=Ta.spread;ge.tail=mr.tail;ge.take=mr.take;ge.takeRight=mr.takeRight;ge.takeRightWhile=mr.takeRightWhile;ge.takeWhile=mr.takeWhile;ge.tap=ef.tap;ge.throttle=Ta.throttle;ge.thru=UE;ge.toArray=Vr.toArray;ge.toPairs=io.toPairs;ge.toPairsIn=io.toPairsIn;ge.toPath=bi.toPath;ge.toPlainObject=Vr.toPlainObject;ge.transform=io.transform;ge.unary=Ta.unary;ge.union=mr.union;ge.unionBy=mr.unionBy;ge.unionWith=mr.unionWith;ge.uniq=mr.uniq;ge.uniqBy=mr.uniqBy;ge.uniqWith=mr.uniqWith;ge.unset=io.unset;ge.unzip=mr.unzip;ge.unzipWith=mr.unzipWith;ge.update=io.update;ge.updateWith=io.updateWith;ge.values=io.values;ge.valuesIn=io.valuesIn;ge.without=mr.without;ge.words=pi.words;ge.wrap=Ta.wrap;ge.xor=mr.xor;ge.xorBy=mr.xorBy;ge.xorWith=mr.xorWith;ge.zip=mr.zip;ge.zipObject=mr.zipObject;ge.zipObjectDeep=mr.zipObjectDeep;ge.zipWith=mr.zipWith;ge.entries=io.toPairs;ge.entriesIn=io.toPairsIn;ge.extend=io.assignIn;ge.extendWith=io.assignInWith;pM(ge,ge);ge.add=Sl.add;ge.attempt=bi.attempt;ge.camelCase=pi.camelCase;ge.capitalize=pi.capitalize;ge.ceil=Sl.ceil;ge.clamp=fM.clamp;ge.clone=Vr.clone;ge.cloneDeep=Vr.cloneDeep;ge.cloneDeepWith=Vr.cloneDeepWith;ge.cloneWith=Vr.cloneWith;ge.conformsTo=Vr.conformsTo;ge.deburr=pi.deburr;ge.defaultTo=bi.defaultTo;ge.divide=Sl.divide;ge.endsWith=pi.endsWith;ge.eq=Vr.eq;ge.escape=pi.escape;ge.escapeRegExp=pi.escapeRegExp;ge.every=Di.every;ge.find=Di.find;ge.findIndex=mr.findIndex;ge.findKey=io.findKey;ge.findLast=Di.findLast;ge.findLastIndex=mr.findLastIndex;ge.findLastKey=io.findLastKey;ge.floor=Sl.floor;ge.forEach=Di.forEach;ge.forEachRight=Di.forEachRight;ge.forIn=io.forIn;ge.forInRight=io.forInRight;ge.forOwn=io.forOwn;ge.forOwnRight=io.forOwnRight;ge.get=io.get;ge.gt=Vr.gt;ge.gte=Vr.gte;ge.has=io.has;ge.hasIn=io.hasIn;ge.head=mr.head;ge.identity=tm;ge.includes=Di.includes;ge.indexOf=mr.indexOf;ge.inRange=fM.inRange;ge.invoke=io.invoke;ge.isArguments=Vr.isArguments;ge.isArray=qa;ge.isArrayBuffer=Vr.isArrayBuffer;ge.isArrayLike=Vr.isArrayLike;ge.isArrayLikeObject=Vr.isArrayLikeObject;ge.isBoolean=Vr.isBoolean;ge.isBuffer=Vr.isBuffer;ge.isDate=Vr.isDate;ge.isElement=Vr.isElement;ge.isEmpty=Vr.isEmpty;ge.isEqual=Vr.isEqual;ge.isEqualWith=Vr.isEqualWith;ge.isError=Vr.isError;ge.isFinite=Vr.isFinite;ge.isFunction=Vr.isFunction;ge.isInteger=Vr.isInteger;ge.isLength=Vr.isLength;ge.isMap=Vr.isMap;ge.isMatch=Vr.isMatch;ge.isMatchWith=Vr.isMatchWith;ge.isNaN=Vr.isNaN;ge.isNative=Vr.isNative;ge.isNil=Vr.isNil;ge.isNull=Vr.isNull;ge.isNumber=Vr.isNumber;ge.isObject=sp;ge.isObjectLike=Vr.isObjectLike;ge.isPlainObject=Vr.isPlainObject;ge.isRegExp=Vr.isRegExp;ge.isSafeInteger=Vr.isSafeInteger;ge.isSet=Vr.isSet;ge.isString=Vr.isString;ge.isSymbol=Vr.isSymbol;ge.isTypedArray=Vr.isTypedArray;ge.isUndefined=Vr.isUndefined;ge.isWeakMap=Vr.isWeakMap;ge.isWeakSet=Vr.isWeakSet;ge.join=mr.join;ge.kebabCase=pi.kebabCase;ge.last=Qu;ge.lastIndexOf=mr.lastIndexOf;ge.lowerCase=pi.lowerCase;ge.lowerFirst=pi.lowerFirst;ge.lt=Vr.lt;ge.lte=Vr.lte;ge.max=Sl.max;ge.maxBy=Sl.maxBy;ge.mean=Sl.mean;ge.meanBy=Sl.meanBy;ge.min=Sl.min;ge.minBy=Sl.minBy;ge.stubArray=bi.stubArray;ge.stubFalse=bi.stubFalse;ge.stubObject=bi.stubObject;ge.stubString=bi.stubString;ge.stubTrue=bi.stubTrue;ge.multiply=Sl.multiply;ge.nth=mr.nth;ge.noop=bi.noop;ge.now=yY.now;ge.pad=pi.pad;ge.padEnd=pi.padEnd;ge.padStart=pi.padStart;ge.parseInt=pi.parseInt;ge.random=fM.random;ge.reduce=Di.reduce;ge.reduceRight=Di.reduceRight;ge.repeat=pi.repeat;ge.replace=pi.replace;ge.result=io.result;ge.round=Sl.round;ge.sample=Di.sample;ge.size=Di.size;ge.snakeCase=pi.snakeCase;ge.some=Di.some;ge.sortedIndex=mr.sortedIndex;ge.sortedIndexBy=mr.sortedIndexBy;ge.sortedIndexOf=mr.sortedIndexOf;ge.sortedLastIndex=mr.sortedLastIndex;ge.sortedLastIndexBy=mr.sortedLastIndexBy;ge.sortedLastIndexOf=mr.sortedLastIndexOf;ge.startCase=pi.startCase;ge.startsWith=pi.startsWith;ge.subtract=Sl.subtract;ge.sum=Sl.sum;ge.sumBy=Sl.sumBy;ge.template=pi.template;ge.times=bi.times;ge.toFinite=Vr.toFinite;ge.toInteger=zo;ge.toLength=Vr.toLength;ge.toLower=pi.toLower;ge.toNumber=Vr.toNumber;ge.toSafeInteger=Vr.toSafeInteger;ge.toString=Vr.toString;ge.toUpper=pi.toUpper;ge.trim=pi.trim;ge.trimEnd=pi.trimEnd;ge.trimStart=pi.trimStart;ge.truncate=pi.truncate;ge.unescape=pi.unescape;ge.uniqueId=bi.uniqueId;ge.upperCase=pi.upperCase;ge.upperFirst=pi.upperFirst;ge.each=Di.forEach;ge.eachRight=Di.forEachRight;ge.first=mr.head;pM(ge,(function(){var t={};return am(ge,function(e,n){mI.call(ge.prototype,n)||(t[n]=e)}),t})(),{chain:!1});ge.VERSION=TY;(ge.templateSettings=pi.templateSettings).imports._=ge;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){ge[t].placeholder=ge});Kd(["drop","take"],function(t,e){$o.prototype[t]=function(n){n=n===void 0?1:DY(zo(n),0);var o=this.__filtered__&&!e?new $o(this):this.clone();return o.__filtered__?o.__takeCount__=vP(n,o.__takeCount__):o.__views__.push({size:vP(n,vI),type:t+(o.__dir__<0?"Right":"")}),o},$o.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});Kd(["filter","map","takeWhile"],function(t,e){var n=e+1,o=n==NY||n==PY;$o.prototype[t]=function(r){var i=this.clone();return i.__iteratees__.push({iteratee:_i(r),type:n}),i.__filtered__=i.__filtered__||o,i}});Kd(["head","last"],function(t,e){var n="take"+(e?"Right":"");$o.prototype[t]=function(){return this[n](1).value()[0]}});Kd(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");$o.prototype[t]=function(){return this.__filtered__?new $o(this):this[n](1)}});$o.prototype.compact=function(){return this.filter(tm)};$o.prototype.find=function(t){return this.filter(t).head()};$o.prototype.findLast=function(t){return this.reverse().find(t)};$o.prototype.invokeMap=Yo(function(t,e){return typeof t=="function"?new $o(this):this.map(function(n){return Q_(n,t,e)})});$o.prototype.reject=function(t){return this.filter(G2(_i(t)))};$o.prototype.slice=function(t,e){t=zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $o(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=zo(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};$o.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};$o.prototype.toArray=function(){return this.take(vI)};am($o.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=ge[o?"take"+(e=="last"?"Right":""):e],i=o||/^find/.test(e);r&&(ge.prototype[e]=function(){var a=this.__wrapped__,l=o?[1]:arguments,s=a instanceof $o,f=l[0],h=s||qa(a),v=function(M){var C=r.apply(ge,X_([M],l));return o&&b?C[0]:C};h&&n&&typeof f=="function"&&f.length!=1&&(s=h=!1);var b=this.__chain__,w=!!this.__actions__.length,O=i&&!b,E=s&&!w;if(!i&&h){a=E?a:new $o(this);var S=t.apply(a,l);return S.__actions__.push({func:UE,args:[v],thisArg:void 0}),new tc(S,b)}return O&&E?t.apply(this,l):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(t){var e=kY[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);ge.prototype[t]=function(){var r=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],r)}return this[n](function(a){return e.apply(qa(a)?a:[],r)})}});am($o.prototype,function(t,e){var n=ge[e];if(n){var o=n.name+"";mI.call(Og,o)||(Og[o]=[]),Og[o].push({name:e,func:n})}});Og[RE(void 0,CY).name]=[{name:"wrapper",func:void 0}];$o.prototype.clone=_Y;$o.prototype.reverse=bY;$o.prototype.value=MY;ge.prototype.at=ef.at;ge.prototype.chain=ef.wrapperChain;ge.prototype.commit=ef.commit;ge.prototype.next=ef.next;ge.prototype.plant=ef.plant;ge.prototype.reverse=ef.reverse;ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=ef.value;ge.prototype.first=ge.prototype.head;hP&&(ge.prototype[hP]=ef.toIterator);const jY="data:image/svg+xml,%3csvg%20width='27'%20height='20'%20viewBox='0%200%2027%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.6667%203.33329H3.66667V16.6666H23.6667V3.33329ZM3.66667%201.66663C2.74619%201.66663%202%202.41282%202%203.33329V16.6666C2%2017.5871%202.74619%2018.3333%203.66667%2018.3333H23.6667C24.5871%2018.3333%2025.3333%2017.5871%2025.3333%2016.6666V3.33329C25.3333%202.41282%2024.5871%201.66663%2023.6667%201.66663H3.66667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2196%206.91331H18.2767L19.4%209.89549L20.4758%206.91331L22.5375%206.83044L19.4%2014.8138L17.3565%2014.8966L18.437%2012.3756L16.2196%206.91331Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1034%207.06327C13.1302%207.04839%2013.1574%207.03404%2013.1848%207.02023C13.5166%206.84295%2013.8759%206.77344%2014.2468%206.77344C14.9611%206.77344%2015.5729%206.97047%2015.9992%207.43635C16.419%207.89521%2016.5934%208.54454%2016.5934%209.3101V12.9168H14.7001V9.4001C14.7001%209.01738%2014.6103%208.80651%2014.5052%208.69229C14.4059%208.58445%2014.2319%208.49677%2013.9067%208.49677C13.7078%208.49677%2013.5468%208.55932%2013.4114%208.69473C13.2534%208.85274%2013.1382%209.08146%2013.1034%209.41091V12.9168H11.2101V6.91344H13.1034V7.06327Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.01665%2012.6833V12.9168H10.83V9.2001C10.83%208.50266%2010.6523%207.90623%2010.247%207.47482L10.2458%207.47354C9.77726%206.97898%209.08554%206.77344%208.26332%206.77344C7.58671%206.77344%206.97894%206.88784%206.50606%207.18452C5.95355%207.51308%205.61381%208.04132%205.48446%208.69979L5.39493%209.15558L6.60828%209.25958C6.45695%209.32645%206.3157%209.40545%206.18578%209.49774C5.6067%209.89006%205.31665%2010.4724%205.31665%2011.1801C5.31665%2011.727%205.52656%2012.1949%205.95194%2012.5464C6.34831%2012.8992%206.87585%2013.0568%207.48332%2013.0568C7.99851%2013.0568%208.45994%2012.9557%208.86073%2012.7671L8.86966%2012.7628C8.91982%2012.7377%208.96882%2012.7112%209.01665%2012.6833ZM7.33362%209.04021C7.60234%208.98907%207.88998%208.96154%208.19236%208.95358L8.93243%208.93444C8.90662%208.77431%208.84911%208.68249%208.7882%208.62627C8.69958%208.54447%208.527%208.46677%208.19332%208.46677C7.90772%208.46677%207.72064%208.51963%207.60769%208.58739L7.60328%208.59004C7.46993%208.66783%207.38847%208.77506%207.35134%208.95452L7.33362%209.04021ZM8.93782%2010.5386L8.28478%2010.5566L8.28191%2010.5567C7.83203%2010.566%207.5658%2010.6502%207.4222%2010.7499C7.3054%2010.831%207.23998%2010.9409%207.23998%2011.1401C7.23998%2011.2037%207.25413%2011.2438%207.32642%2011.2991L7.3313%2011.3029L7.33606%2011.3067C7.40443%2011.3623%207.52395%2011.4134%207.72332%2011.4134C8.07815%2011.4134%208.36218%2011.3062%208.60462%2011.1017C8.80129%2010.9357%208.90794%2010.7499%208.93782%2010.5386Z'%20fill='%23646A73'/%3e%3c/svg%3e",LY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.6667%203.33329H3.33335V16.6666H16.6667V3.33329ZM3.33335%201.66663C2.41288%201.66663%201.66669%202.41282%201.66669%203.33329V16.6666C1.66669%2017.5871%202.41288%2018.3333%203.33335%2018.3333H16.6667C17.5872%2018.3333%2018.3334%2017.5871%2018.3334%2016.6666V3.33329C18.3334%202.41282%2017.5872%201.66663%2016.6667%201.66663H3.33335Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.33%205.83667H15.2233V13.95H13.33V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.83%205.83667H12.7233V13.95H10.83V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.51665%2013.7165V13.95H10.33V10.2333C10.33%209.53587%2010.1523%208.93943%209.747%208.50803L9.7458%208.50675C9.27726%208.01218%208.58554%207.80664%207.76332%207.80664C7.08671%207.80664%206.47894%207.92104%206.00606%208.21772C5.45355%208.54628%205.11381%209.07452%204.98446%209.733L4.89493%2010.1888L6.10828%2010.2928C5.95695%2010.3597%205.8157%2010.4386%205.68578%2010.5309C5.1067%2010.9233%204.81665%2011.5057%204.81665%2012.2133C4.81665%2012.7602%205.02656%2013.2281%205.45194%2013.5796C5.84831%2013.9324%206.37585%2014.09%206.98332%2014.09C7.49851%2014.09%207.95994%2013.9889%208.36073%2013.8003L8.36966%2013.796C8.41982%2013.7709%208.46882%2013.7444%208.51665%2013.7165ZM6.83361%2010.0734C7.10234%2010.0223%207.38998%209.99474%207.69236%209.98678L8.43243%209.96764C8.40662%209.80751%208.3491%209.71569%208.2882%209.65948C8.19958%209.57767%208.027%209.49997%207.69332%209.49997C7.40772%209.49997%207.22064%209.55283%207.10769%209.6206L7.10328%209.62324C6.96993%209.70103%206.88847%209.80826%206.85134%209.98773L6.83361%2010.0734ZM8.43782%2011.5718L7.78478%2011.5898L7.78191%2011.5899C7.33203%2011.5992%207.0658%2011.6834%206.9222%2011.7831C6.8054%2011.8642%206.73998%2011.9741%206.73998%2012.1733C6.73998%2012.2369%206.75413%2012.277%206.82642%2012.3323L6.8313%2012.3361L6.83606%2012.3399C6.90443%2012.3955%207.02395%2012.4466%207.22332%2012.4466C7.57815%2012.4466%207.86218%2012.3394%208.10462%2012.1349C8.30129%2011.9689%208.40794%2011.7831%208.43782%2011.5718Z'%20fill='%23646A73'/%3e%3c/svg%3e",IY={class:"list flex-wrap"},FY=["onClick","onMousedown"],BY=["src"],$Y=["title"],UY={class:"flex-between"},VY={class:"flex align-center"},WY=["src"],GY=["title"],zY={key:0,class:"status-tag",style:{"margin-left":"auto"}},HY=_r({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=t,o=e,r=He(""),i=He([]);function a(l,s){return s.length?l.filter(f=>f.name.toLowerCase().includes(s.toLowerCase())):l}return K_([()=>r.value,()=>n.list],()=>{i.value=a(n.list,r.value)}),(l,s)=>{const f=ne("el-input"),h=ne("el-avatar"),v=ne("el-tag"),b=ne("el-text"),w=ne("el-popover"),O=ne("el-empty");return Ne(),mn(Ir,null,[P(f,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=E=>r.value=E),modelModifiers:{trim:!0},placeholder:l.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),ee("div",IY,[i.value.length?(Ne(!0),mn(Ir,{key:0},No(i.value,E=>(Ne(),bt(w,{key:E.id,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(S=>o("clickNodes",E),["stop"]),onMousedown:gn(S=>o("onmousedown",E),["stop"])},[Wn(cA)(E==null?void 0:E.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(E==null?void 0:E.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,BY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...s[1]||(s[1]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"ml-8 ellipsis",title:E.name},_e(E.name),9,$Y)],40,FY)]),default:j(()=>[ee("div",UY,[ee("div",VY,[Wn(cA)(E==null?void 0:E.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(E==null?void 0:E.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,WY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...s[2]||(s[2]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"font-medium ml-8 break-all",title:E.name},_e(E.name),9,GY)]),E.type?(Ne(),mn("div",zY,[Wn(j2)(E.type)?(Ne(),bt(v,{key:0,class:"warning-tag"},{default:j(()=>[ft(_e(l.$t("views.application.workflow")),1)]),_:1})):(Ne(),bt(v,{key:1,class:"blue-tag"},{default:j(()=>[ft(_e(l.$t("views.application.simple")),1)]),_:1}))])):Bn("",!0)]),P(b,{type:"info",size:"small",class:"mt-4"},{default:j(()=>[ft(_e(E.desc),1)]),_:2},1024)]),_:2},1024))),128)):(Ne(),bt(O,{key:1,description:l.$t("common.noData")},null,8,["description"]))])],64)}}}),mP=kh(HY,[["__scopeId","data-v-deb1c287"]]),XY={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},YY={key:0},qY={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},KY=["onClick","onMousedown"],ZY={class:"lighter"},JY={class:"flex align-center mb-8"},QY={class:"lighter color-text-primary"},eq={key:1,class:"ml-16 mt-8"},tq=_r({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=Qs("workflowMode"),o=ja(),{user:r,folder:i}=Pj(),a=b7(n||Qc.Application),l=He(""),s=t,f=e,h=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),v=hr(()=>kj.tool[h.value]),b=He(!1),w=He("base"),O=hr(()=>{if(!l.value)return a||[];const X=l.value.toLowerCase();return(a||[]).reduce((Y,W)=>{const Q=W.list.filter(J=>J.label.toLowerCase().includes(X));return Q.length&&Y.push({...W,list:Q}),Y},[])});function E(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=s.workflowRef)==null||Q.addNode(X),f("clickNodes",X)}function S(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(j2(Y.type)?(Y.work_flow.nodes[0].properties.node_data.file_upload_setting,X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id}):X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=s.workflowRef)==null||Q.onmousedown(X),f("onmousedown",X)}const M=He([]),C=He([]);async function $(){var Y;const X=await i.asyncGetFolder(u0.TOOL,{},b);M.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})}async function D(){var Y,W,Q,J;const X=await oi({type:"tool",isShared:((Y=i.currentFolder)==null?void 0:Y.id)==="share",systemType:"workspace"}).getToolList({folder_id:((W=i.currentFolder)==null?void 0:W.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});C.value=((Q=X.data)==null?void 0:Q.tools)||X.data||[],C.value=(J=C.value)==null?void 0:J.filter(ie=>ie.is_active)}const k=He([]),B=He([]);function F(){i.asyncGetFolder(u0.APPLICATION,{},b).then(X=>{var Y;k.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})})}async function I(){var Y;const X=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((Y=i.currentFolder)==null?void 0:Y.id)||r.getWorkspaceId()});B.value=X.data.filter(W=>W.resource_type==="application"&&W.id!==s.id&&W.is_publish)}function V(X){i.setCurrentFolder(X),w.value==="tool"?D():I()}async function z(X){console.log(X),X==="tool"?(await $(),D()):X==="application"&&(F(),I())}return bo(()=>{}),(X,Y)=>{const W=ne("search"),Q=ne("el-icon"),J=ne("el-input"),ie=ne("el-text"),Se=ne("el-popover"),Ae=ne("el-scrollbar"),ke=ne("el-tab-pane"),De=ne("folder-tree"),ze=ne("LayoutContainer"),Ye=ne("el-tabs");return Js((Ne(),mn("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:Rj({width:w.value==="base"?"400px":"640px"})},[P(Ye,{modelValue:w.value,"onUpdate:modelValue":Y[5]||(Y[5]=Be=>w.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Js(ee("div",XY,[P(J,{modelValue:l.value,"onUpdate:modelValue":Y[0]||(Y[0]=Be=>l.value=Be),class:"mr-12 ml-12",placeholder:X.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[P(Q,{class:"el-input__icon"},{default:j(()=>[P(W)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Eh,w.value==="base"]]),P(ke,{label:X.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:j(()=>[P(Ae,{height:"400"},{default:j(()=>[O.value.length>0?(Ne(),mn("div",YY,[(Ne(!0),mn(Ir,null,No(O.value,(Be,Je)=>(Ne(),mn(Ir,{key:Je},[P(ie,{type:"info",size:"small",class:"color-secondary ml-12"},{default:j(()=>[ft(_e(Be.label),1)]),_:2},1024),ee("div",qY,[(Ne(!0),mn(Ir,null,No(Be.list,(gt,se)=>(Ne(),bt(Se,{key:se,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(Ze=>E(gt),["stop"]),onMousedown:gn(Ze=>S(gt),["stop"])},[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:20})),ee("div",ZY,_e(gt.label),1)],40,KY)]),default:j(()=>[ee("div",JY,[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:32})),ee("div",QY,_e(gt.label),1)]),P(ie,{type:"info",size:"small",class:"color-secondary lighter"},{default:j(()=>[ft(_e(gt.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(Ne(),mn("div",eq,[P(ie,{type:"info"},{default:j(()=>[ft(_e(X.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),P(ke,{label:X.$t("views.tool.title"),name:"tool"},{default:j(()=>[P(ze,null,{left:j(()=>{var Be;return[P(De,{source:Wn(u0).TOOL,data:M.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,shareTitle:X.$t("views.shared.shared_tool"),showShared:v.value.is_share(),canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey","shareTitle","showShared"])]}),default:j(()=>[P(Ae,{height:"450"},{default:j(()=>[P(mP,{list:C.value,onClickNodes:Y[1]||(Y[1]=Be=>E(Wn(VN),Be,"tool")),onOnmousedown:Y[2]||(Y[2]=Be=>S(Wn(VN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),P(ke,{label:X.$t("views.application.title"),name:"application"},{default:j(()=>[P(ze,null,{left:j(()=>{var Be;return[P(De,{source:Wn(u0).APPLICATION,data:k.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:j(()=>[P(Ae,{height:"450"},{default:j(()=>[P(mP,{list:B.value,onClickNodes:Y[3]||(Y[3]=Be=>E(Wn(WN),Be,"application")),onOnmousedown:Y[4]||(Y[4]=Be=>S(Wn(WN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Eh,t.show]])}}}),gI=kh(tq,[["__scopeId","data-v-a8dfaa84"]]),nq={class:"flex-between"},rq={class:"ellipsis-1 break-all"},oq={key:0,src:jY,alt:""},iq={key:1,src:LY,alt:""},aq={style:{width:"280px"},class:"p-12-16"},sq={class:"mt-8 lighter"},lq={class:"title-decoration-1 mb-8 mt-8"},uq=["onMouseenter"],cq={class:"break-all"},dq={class:"dialog-footer"},fq=_r({__name:"NodeContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",Qc.Application);const e=ja(),{params:{id:n}}=e,o=He({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=He(!1),i=He(),a=He(),l=He(!1),s=He({title:""}),f=hr({set:z=>{Me.set(k.nodeModel.properties,"condition",z)},get:()=>k.nodeModel.properties.condition?k.nodeModel.properties.condition:(Me.set(k.nodeModel.properties,"condition","AND"),!0)}),h=hr({set:z=>{Me.set(k.nodeModel.properties,"showNode",z)},get:()=>k.nodeModel.properties.showNode!==void 0?k.nodeModel.properties.showNode:(Me.set(k.nodeModel.properties,"showNode",!0),!0)}),v=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},b=hr(()=>k.nodeModel.properties.status?k.nodeModel.properties.status:200);function w(){s.value.title=k.nodeModel.properties.stepName,l.value=!0}const O=async z=>{z&&await z.validate(X=>{var Y;X&&((Y=k.nodeModel.graphModel.nodes.filter(W=>W.id!==k.nodeModel.id))!=null&&Y.some(W=>W.properties.stepName===s.value.title)?Xi(kt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(k.nodeModel.properties,"stepName",s.value.title),l.value=!1,z.resetFields()))})},E=z=>{z!=null&&z.shiftKey||k.nodeModel.graphModel.clearSelectElements(),Me.set(k.nodeModel,"isSelected",!k.nodeModel.isSelected),Me.set(k.nodeModel,"isHovered",!k.nodeModel.isSelected),k.nodeModel.graphModel.toFront(k.nodeModel.id)},S=He(null),M=()=>{k.nodeModel.graphModel.clearSelectElements();const z=k.nodeModel.graphModel.cloneNode(k.nodeModel.id);Me.set(z,"isSelected",!0),Me.set(z,"isHovered",!0),k.nodeModel.graphModel.toFront(z.id)},C=()=>{L2(kt("common.tip"),kt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:kt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{k.nodeModel.type===Pr.LoopNode&&k.nodeModel.graphModel.getNodeOutgoingNode(k.nodeModel.id).forEach(X=>{X.type==="loop-body-node"&&k.nodeModel.graphModel.deleteNode(X.id)}),k.nodeModel.graphModel.deleteNode(k.nodeModel.id)}),k.nodeModel.graphModel.eventCenter.emit("delete_node")},$=z=>{z.height&&(k.nodeModel.virtual||(o.value.stepContainerHeight=z.height,k.nodeModel.setHeight(o.value.stepContainerHeight)))};function D(z){var W,Q,J;const X=z.properties.width?z.properties.width:214,Y=k.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((W=i.value)==null?void 0:W.x)+X/2+200,y:((Q=i.value)==null?void 0:Q.y)-z.height});k.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:k.nodeModel.id,sourceAnchorId:(J=i.value)==null?void 0:J.id,targetNodeId:Y.id,targetAnchorId:Y.id+"_left"}),V()}const k=t,B=hr(()=>{var z;return k.nodeModel.properties.config.fields?(z=k.nodeModel.properties.config.fields)==null?void 0:z.map(Y=>({label:Y.label,value:Y.value,globeLabel:`{{${k.nodeModel.properties.stepName}.${Y.value}}}`,globeValue:`{{context['${k.nodeModel.id}'].${Y.value}}}`})):[]});function F(z){return![Pr.Start,Pr.Base,Pr.LoopStartNode.toString()].includes(z)}const I=z=>{r.value=!0,i.value=z},V=()=>{r.value=!1,i.value=void 0};return bo(()=>{Me.set(k.nodeModel,"openNodeMenu",z=>{r.value?V():I(z)})}),(z,X)=>{var le;const Y=ne("ArrowDownBold"),W=ne("el-icon"),Q=ne("el-button"),J=ne("el-option"),ie=ne("el-select"),Se=ne("el-dropdown"),Ae=ne("AppIcon"),ke=ne("el-dropdown-item"),De=ne("el-dropdown-menu"),ze=ne("el-alert"),Ye=ne("el-tooltip"),Be=ne("el-collapse-transition"),Je=ne("el-input"),gt=ne("el-form-item"),se=ne("el-form"),Ze=ne("el-dialog"),pe=Rg("resize");return Ne(),mn("div",{onMousedown:E,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gl(["step-container app-card p-16",{isSelected:k.nodeModel.isSelected,error:b.value!==200}]),style:{overflow:"visible"}},[Js((Ne(),mn("div",null,[ee("div",nq,[ee("div",{class:"flex align-center",onDragstart:X[0]||(X[0]=gn(()=>{},["prevent"])),onDrag:X[1]||(X[1]=gn(()=>{},["prevent"])),onDragover:X[2]||(X[2]=gn(()=>{},["prevent"])),onDragend:X[3]||(X[3]=gn(()=>{},["prevent"])),style:{width:"69%"}},[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(le=t.nodeModel)==null?void 0:le.properties.node_data},null,8,["item"])),ee("h4",rq,_e(t.nodeModel.properties.stepName),1)],32),ee("div",{onMousemove:X[6]||(X[6]=gn(()=>{},["stop"])),onMousedown:X[7]||(X[7]=gn(()=>{},["stop"])),onKeydown:X[8]||(X[8]=gn(()=>{},["stop"])),onClick:X[9]||(X[9]=gn(()=>{},["stop"]))},[P(Q,{text:"",onClick:X[4]||(X[4]=we=>h.value=!h.value)},{default:j(()=>[P(W,{class:Gl(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[P(Y)]),_:1},8,["class"])]),_:1}),F(t.nodeModel.type)?(Ne(),bt(Se,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:j(()=>[ee("div",aq,[ee("h5",null,_e(z.$t("views.applicationWorkflow.condition.title")),1),ee("p",sq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),P(ie,{modelValue:f.value,"onUpdate:modelValue":X[5]||(X[5]=we=>f.value=we),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(J,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),P(J,{label:z.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(z.$t("views.applicationWorkflow.condition.text")),1)])])]),default:j(()=>[P(Q,{text:""},{default:j(()=>[f.value==="OR"?(Ne(),mn("img",oq)):Bn("",!0),f.value==="AND"?(Ne(),mn("img",iq)):Bn("",!0)]),_:1})]),_:1})):Bn("",!0),F(t.nodeModel.type)?(Ne(),bt(Se,{key:1,teleported:!1,trigger:"click"},{dropdown:j(()=>[P(De,{style:{"min-width":"80px"}},{default:j(()=>[P(ke,{onClick:w,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.rename")),1)]),_:1}),P(ke,{onClick:M,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.copy")),1)]),_:1}),P(ke,{onClick:C,class:"border-t p-8"},{default:j(()=>[ft(_e(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:j(()=>[P(Q,{text:""},{default:j(()=>[P(Ae,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):Bn("",!0)],32)]),P(Be,null,{default:j(()=>[Js(ee("div",{onMousedown:X[11]||(X[11]=gn(()=>{},["stop"])),onKeydown:X[12]||(X[12]=gn(()=>{},["stop"])),onClick:X[13]||(X[13]=gn(()=>{},["stop"])),class:"mt-16"},[b.value!=200?(Ne(),bt(ze,{key:0,class:"mb-16",title:k.nodeModel.type==="application-node"?z.$t("views.applicationWorkflow.tip.applicationNodeError"):z.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):Bn("",!0),Dj(z.$slots,"default",{},void 0,!0),B.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",lq,_e(z.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(B.value,(we,$e)=>(Ne(),mn("div",{key:$e,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:rt=>S.value=$e,onMouseleave:X[10]||(X[10]=rt=>S.value=null)},[ee("span",cq,_e(we.label)+" "+_e("{"+we.value+"}"),1),S.value===$e?(Ne(),bt(Ye,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(Q,{link:"",onClick:rt=>Wn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[P(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,uq))),128))],64)):Bn("",!0)],544),[[Eh,h.value]])]),_:3})])),[[pe,$]])],2),P(Be,null,{default:j(()=>[r.value?(Ne(),bt(gI,{key:0,onMousemove:X[14]||(X[14]=gn(()=>{},["stop"])),onMousedown:X[15]||(X[15]=gn(()=>{},["stop"])),onClick:X[16]||(X[16]=gn(()=>{},["stop"])),onWheel:v,show:r.value,id:Wn(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:D},null,8,["show","id"])):Bn("",!0)]),_:1}),P(Ze,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:l.value,"onUpdate:modelValue":X[21]||(X[21]=we=>l.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:X[22]||(X[22]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",dq,[P(Q,{onClick:X[19]||(X[19]=gn(we=>l.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),P(Q,{type:"primary",onClick:X[20]||(X[20]=we=>O(a.value))},{default:j(()=>[ft(_e(z.$t("common.save")),1)]),_:1})])]),default:j(()=>[P(se,{"label-position":"top",ref_key:"titleFormRef",ref:a,model:s.value},{default:j(()=>[P(gt,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[P(Je,{modelValue:s.value.title,"onUpdate:modelValue":X[17]||(X[17]=we=>s.value.title=we),onBlur:X[18]||(X[18]=we=>s.value.title=s.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=kh(fq,[["__scopeId","data-v-4532ca06"]]),pq={class:"title-decoration-1 mb-8"},hq={class:"flex-between w-full"},vq={class:"flex-between"},mq={class:"flex align-center"},gq={class:"flex align-center"},yq={class:"mr-4"},_q={class:"flex-between"},bq={class:"flex-between mb-16"},wq={key:0,class:"w-full mb-16"},Eq={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},xq={class:"flex align-center",style:{"line-height":"20px"}},Oq=["src"],Sq=["title"],Aq={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Mq={class:"flex align-center",style:{"line-height":"20px"}},Tq={class:"ellipsis"},Cq={class:"flex-between mb-16"},Nq={class:"lighter"},Pq={key:2,class:"w-full mb-16"},kq={class:"flex align-center",style:{"line-height":"20px"}},Rq=["src"],Dq=["title"],jq={class:"flex-between"},Lq={class:"mr-4"},Iq={class:"flex"},Fq={class:"flex-between w-full"},Bq={class:"flex align-center"},$q={class:"mr-4"},Uq=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function a(Be){Me.set(b.nodeModel.properties.node_data,"system",Be)}function l(Be){Me.set(b.nodeModel.properties.node_data,"prompt",Be)}const s=Be=>{var Je;Be?(Je=E.value)==null||Je.reset_default(Be,o):V({})},h={model_id:"",system:"",prompt:`${kt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}: {{${kt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}} ${kt("views.problem.title")}: {{${kt("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:"",reasoning_content_end:"",reasoning_content_enable:!1}},v=hr({get:()=>b.nodeModel.properties.node_data?(b.nodeModel.properties.node_data.model_setting||Me.set(b.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"",reasoning_content_end:"",reasoning_content_enable:!1}),b.nodeModel.properties.node_data):(Me.set(b.nodeModel.properties,"node_data",h),b.nodeModel.properties.node_data),set:Be=>{Me.set(b.nodeModel.properties,"node_data",Be)}}),b=t,w=He(),O=He(null),E=He(),S=He(),M=()=>{var Be;return(Be=w.value)==null?void 0:Be.validate().catch(Je=>Promise.reject({node:b.nodeModel,errMessage:Je}))},C=e();function $(){var Je;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(Be).then(gt=>{O.value=Me.groupBy(gt==null?void 0:gt.data,"provider")})}const D=Be=>{var Je;Be&&((Je=E.value)==null||Je.open(Be,o,v.value.model_params_setting))},k=He(),B=Be=>{var Je;Be&&((Je=k.value)==null||Je.open(Be,o))},F=Be=>{Me.set(b.nodeModel.properties.node_data,"system",Be)},I=()=>{var Be;(Be=S.value)==null||Be.open(v.value.model_setting)};function V(Be){Me.set(b.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let Je=Me.cloneDeep(b.nodeModel.properties.node_data.model_setting);Je={...Je,...Be},Me.set(b.nodeModel.properties.node_data,"model_setting",Je)}const X=He();function Y(){const Be={mcp_servers:v.value.mcp_servers,mcp_tool_ids:v.value.mcp_tool_ids,mcp_source:v.value.mcp_source};X.value.open(Be,ze.value)}function W(Be){Me.set(b.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),Me.set(b.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const Q=He();function J(){Q.value.open(v.value.tool_ids)}function ie(Be){Me.set(b.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function Se(Be){const Je=b.nodeModel.properties.node_data.tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"tool_ids",Je)}function Ae(Be){const Je=b.nodeModel.properties.node_data.mcp_tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Je)}const ke=He([]);function De(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ke.value=[...gt.data.shared_tools,...gt.data.tools].filter(se=>se.is_active)})}const ze=He([]);function Ye(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ze.value=[...gt.data.shared_tools,...gt.data.tools].filter(se=>se.is_active)})}return bo(()=>{var Be,Je,gt,se;$(),typeof((Be=b.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&Qd(b.nodeModel)&&Me.set(b.nodeModel.properties.node_data,"is_result",!0),Me.set(b.nodeModel,"validate",M),v.value.dialogue_type||(v.value.dialogue_type="WORKFLOW"),(Je=b.nodeModel.properties.node_data)!=null&&Je.mcp_tool_id&&(Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",[(gt=b.nodeModel.properties.node_data)==null?void 0:gt.mcp_tool_id]),Me.set(b.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((se=b.nodeModel.properties.node_data)==null?void 0:se.mcp_output_enable)===void 0&&Me.set(b.nodeModel.properties.node_data,"mcp_output_enable",!0),De(),Ye()}),(Be,Je)=>{const gt=ne("AppIcon"),se=ne("el-button"),Ze=ne("ModelSelect"),pe=ne("el-form-item"),le=ne("el-tooltip"),we=ne("MdEditorMagnify"),$e=ne("el-option"),rt=ne("el-select"),pt=ne("el-input-number"),Lt=ne("el-switch"),Jt=ne("el-avatar"),en=ne("ToolIcon"),zt=ne("Close"),it=ne("el-icon"),ae=ne("el-form"),re=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pq,_e(Be.$t("views.applicationWorkflow.nodeSetting")),1),P(re,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(ae,{onSubmit:Je[16]||(Je[16]=gn(()=>{},["prevent"])),model:v.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:w,"hide-required-asterisk":""},{default:j(()=>{var je,vt;return[P(pe,{label:Be.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:Be.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hq,[ee("div",null,[ee("span",null,[ft(_e(Be.$t("views.application.form.aiModel.label")),1),Je[17]||(Je[17]=ee("span",{class:"color-danger"},"*",-1))])]),P(se,{disabled:!v.value.model_id,type:"primary",link:"",onClick:Je[0]||(Je[0]=q=>D(v.value.model_id)),onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(Ze,{onChange:s,onWheel:i,teleported:!1,modelValue:v.value.model_id,"onUpdate:modelValue":Je[1]||(Je[1]=q=>v.value.model_id=q),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:O.value,onSubmitModel:$,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(pe,null,{label:j(()=>[ee("div",vq,[ee("div",mq,[ee("span",null,_e(Be.$t("views.application.form.roleSettings.label")),1),P(le,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),P(se,{type:"primary",link:"",onClick:Je[2]||(Je[2]=q=>B(v.value.model_id)),disabled:!v.value.model_id},{default:j(()=>[P(gt,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[P(we,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:v.value.system,"onUpdate:modelValue":Je[3]||(Je[3]=q=>v.value.system=q),style:{height:"100px"},onSubmitDialog:a,placeholder:`${Wn(kt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),P(pe,{label:Be.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:Be.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",gq,[ee("div",yq,[ee("span",null,[ft(_e(Be.$t("views.application.form.prompt.label")),1),Je[18]||(Je[18]=ee("span",{class:"color-danger"},"*",-1))])]),P(le,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(we,{onWheel:i,title:Be.$t("views.application.form.prompt.label"),modelValue:v.value.prompt,"onUpdate:modelValue":Je[4]||(Je[4]=q=>v.value.prompt=q),style:{height:"150px"},onSubmitDialog:l,placeholder:`${Wn(kt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(pe,{label:Be.$t("views.application.form.historyRecord.label")},{label:j(()=>[ee("div",_q,[ee("div",null,_e(Be.$t("views.application.form.historyRecord.label")),1),P(rt,{modelValue:v.value.dialogue_type,"onUpdate:modelValue":Je[5]||(Je[5]=q=>v.value.dialogue_type=q),type:"small",style:{width:"100px"}},{default:j(()=>[P($e,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),P($e,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[P(pt,{modelValue:v.value.dialogue_number,"onUpdate:modelValue":Je[6]||(Je[6]=q=>v.value.dialogue_number=q),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),ee("div",bq,[Je[19]||(Je[19]=ee("div",{class:"lighter"},"MCP",-1)),ee("div",null,[v.value.mcp_enable?(Ne(),bt(se,{key:0,type:"primary",class:"mr-4",link:"",onClick:Y,onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(Lt,{size:"small",modelValue:v.value.mcp_enable,"onUpdate:modelValue":Je[7]||(Je[7]=q=>v.value.mcp_enable=q)},null,8,["modelValue"])])]),((je=v.value.mcp_tool_ids)==null?void 0:je.length)>0?(Ne(),mn("div",wq,[(Ne(!0),mn(Ir,null,No(v.value.mcp_tool_ids,(q,Pt)=>{var Rt,Gt,kn;return Ne(),mn(Ir,{key:Pt},[Wn(bl)(ze.value,q,"id")?(Ne(),mn("div",Eq,[ee("div",xq,[(Rt=Wn(bl)(ze.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bl)(ze.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Oq)]}),_:2},1024)):(Ne(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bl)(ze.value,q,"id"))==null?void 0:Gt.name},_e(((kn=Wn(bl)(ze.value,q,"id"))==null?void 0:kn.name)||Be.$t("common.custom")+" MCP"),9,Sq)]),P(se,{text:"",onClick:qt=>Ae(q)},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1},8,["onClick"])])):Bn("",!0)],64)}),128))])):Bn("",!0),v.value.mcp_servers&&v.value.mcp_servers.length>0?(Ne(),mn("div",Aq,[ee("div",Mq,[P(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Tq,_e(Be.$t("common.custom")+" MCP"),1)]),P(se,{text:"",onClick:Je[8]||(Je[8]=q=>v.value.mcp_servers="")},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1})])):Bn("",!0),ee("div",Cq,[ee("div",Nq,_e(Be.$t("views.tool.title")),1),ee("div",null,[v.value.tool_enable?(Ne(),bt(se,{key:0,type:"primary",class:"mr-4",link:"",onClick:J,onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(Lt,{size:"small",modelValue:v.value.tool_enable,"onUpdate:modelValue":Je[9]||(Je[9]=q=>v.value.tool_enable=q)},null,8,["modelValue"])])]),((vt=v.value.tool_ids)==null?void 0:vt.length)>0?(Ne(),mn("div",Pq,[(Ne(!0),mn(Ir,null,No(v.value.tool_ids,(q,Pt)=>{var Rt,Gt,kn;return Ne(),mn("div",{key:Pt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",kq,[(Rt=Wn(bl)(ke.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bl)(ke.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Rq)]}),_:2},1024)):(Ne(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bl)(ke.value,q,"id"))==null?void 0:Gt.name},_e((kn=Wn(bl)(ke.value,q,"id"))==null?void 0:kn.name),9,Dq)]),P(se,{text:"",onClick:qt=>Se(q)},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1},8,["onClick"])])}),128))])):Bn("",!0),v.value.mcp_enable||v.value.tool_enable?(Ne(),bt(pe,{key:3,onClick:Je[11]||(Je[11]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",jq,[ee("span",Lq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Iq,[P(Lt,{class:"ml-8",size:"small",modelValue:v.value.mcp_output_enable,"onUpdate:modelValue":Je[10]||(Je[10]=q=>v.value.mcp_output_enable=q)},null,8,["modelValue"])])])]),_:1})):Bn("",!0),P(pe,{onClick:Je[13]||(Je[13]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Fq,[ee("div",null,[ee("span",null,_e(Be.$t("views.application.form.reasoningContent.label")),1)]),ee("div",null,[v.value.model_setting.reasoning_content_enable?(Ne(),bt(se,{key:0,type:"primary",link:"",onClick:I,onRefreshForm:V,class:"mr-4"},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(Lt,{size:"small",modelValue:v.value.model_setting.reasoning_content_enable,"onUpdate:modelValue":Je[12]||(Je[12]=q=>v.value.model_setting.reasoning_content_enable=q)},null,8,["modelValue"])])])]),_:1}),P(pe,{onClick:Je[15]||(Je[15]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Bq,[ee("div",$q,[ee("span",null,_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(le,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Lt,{size:"small",modelValue:v.value.is_result,"onUpdate:modelValue":Je[14]||(Je[14]=q=>v.value.is_result=q)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:E,onRefresh:V},null,512),P(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:k},null,512),P(x7,{ref_key:"ReasoningParamSettingDialogRef",ref:S,onRefresh:z},null,512),P(O7,{ref_key:"mcpServersDialogRef",ref:X,onRefresh:W},null,512),P(S7,{ref_key:"toolDialogRef",ref:Q,onRefresh:ie},null,512)]),_:1},8,["nodeModel"])}}});var gP={width:40,height:40},yP={width:40,height:40},_P={width:40,height:40},bP={width:100,height:80},wP={width:100,height:80},VE,xo,yI,Iv,EP,_I,bI,wI,hM,wA,EA,yw={},_w=[],Vq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eb=Array.isArray;function op(t,e){for(var n in e)t[n]=e[n];return t}function vM(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lr(t,e,n){var o,r,i,a={};for(i in e)i=="key"?o=e[i]:i=="ref"?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?VE.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return X0(t,a,o,r,null)}function X0(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++yI,__i:-1,__u:0};return r==null&&xo.vnode!=null&&xo.vnode(i),i}function WE(){return{current:null}}function jg(t){return t.children}function Po(t,e){this.props=t,this.context=e}function Lg(t,e){if(e==null)return t.__?Lg(t.__,t.__i+1):null;for(var n;ee&&Iv.sort(bI),t=Iv.shift(),e=Iv.length,Wq(t);bw.__r=0}function xI(t,e,n,o,r,i,a,l,s,f,h){var v,b,w,O,E,S,M,C=o&&o.__k||_w,$=e.length;for(s=Gq(n,e,C,s,$),v=0;v<$;v++)(w=n.__k[v])!=null&&(b=w.__i!=-1&&C[w.__i]||yw,w.__i=v,S=mM(t,w,b,r,i,a,l,s,f,h),O=w.__e,w.ref&&b.ref!=w.ref&&(b.ref&&gM(b.ref,null,w),h.push(w.ref,w.__c||O,w)),E==null&&O!=null&&(E=O),(M=!!(4&w.__u))||b.__k===w.__k?s=OI(w,s,t,M):typeof w.type=="function"&&S!==void 0?s=S:O&&(s=O.nextSibling),w.__u&=-7);return n.__e=E,s}function Gq(t,e,n,o,r){var i,a,l,s,f,h=n.length,v=h,b=0;for(t.__k=new Array(r),i=0;i0?a=t.__k[i]=X0(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[i]=a,s=i+b,a.__=t,a.__b=t.__b+1,l=null,(f=a.__i=zq(a,n,s,v))!=-1&&(v--,(l=n[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(r>h?b--:rs?b--:b++,a.__u|=4))):t.__k[i]=null;if(v)for(i=0;i(h?1:0)){for(r=n-1,i=n+1;r>=0||i=0?r--:i++])!=null&&(2&f.__u)==0&&l==f.key&&s==f.type)return a}return-1}function OP(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Vq.test(e)?n:n+"px"}function f0(t,e,n,o,r){var i,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||OP(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||OP(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(wI,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=hM,t.addEventListener(e,i?EA:wA,i)):t.removeEventListener(e,i?EA:wA,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function SP(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=hM++;else if(e.t0?t:eb(t)?t.map(AI):op({},t)}function Hq(t,e,n,o,r,i,a,l,s){var f,h,v,b,w,O,E,S=n.props||yw,M=e.props,C=e.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function _g(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function EM(){for(var t=[],e=0;e2&&Ly("box");var n=pg(e);return new zv(t,h0(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ly("array");var n=pg(e);return KK(t,h0(n),n.name)},map:function(t,e){arguments.length>2&&Ly("map");var n=pg(e);return new AM(t,h0(n),n.name)},set:function(t,e){arguments.length>2&&Ly("set");var n=pg(e);return new t3(t,h0(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ly("object");var o=pg(n);if(o.proxy===!1)return NA({},t,e,o);var r=qI(o),i=NA({},void 0,void 0,o),a=XK(i);return KI(a,t,e,r),a},ref:RI,shallow:cK,deep:xM,struct:dK},Ut=fK;Object.keys(AP).forEach(function(t){return Ut[t]=AP[t]});function Ly(t){Qo("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var Sw=PI(!1,function(t,e,n,o,r){var i=n.get,a=n.set,l=r[0]||{};MM(t).addComputedProp(t,e,xw({get:i,set:a,context:t},l))}),pK=Sw({equals:Ig.structural}),Ai=function(e,n,o){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Sw.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=e,r.set=typeof n=="function"?n:r.set,r.name=r.name||e.name||"",new Bg(r)};Ai.struct=pK;var ii;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(ii||(ii={}));var Wd;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Wd||(Wd={}));var Aw=(function(){function t(e){this.cause=e}return t})();function zy(t){return t instanceof Aw}function SA(t){switch(t.dependenciesState){case ii.UP_TO_DATE:return!1;case ii.NOT_TRACKING:case ii.STALE:return!0;case ii.POSSIBLY_STALE:{for(var e=OM(!0),n=sy(),o=t.observing,r=o.length,i=0;i0;yr.computationDepth>0&&e&&Qo(!1),!yr.allowStateChanges&&(e||yr.enforceActions==="strict")&&Qo(!1)}function DI(t,e,n){var o=OM(!0);LI(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++yr.runId;var r=yr.trackingDerivation;yr.trackingDerivation=t;var i;if(yr.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(a){i=new Aw(a)}return yr.trackingDerivation=r,hK(t),e_(o),i}function hK(t){for(var e=t.observing,n=t.observing=t.newObserving,o=ii.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;ao&&(o=l.dependenciesState)}for(n.length=r,t.newObserving=null,i=e.length;i--;){var l=e[i];l.diffValue===0&&BI(l,t),l.diffValue=0}for(;r--;){var l=n[r];l.diffValue===1&&(l.diffValue=0,wK(l,t))}o!==ii.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}function AA(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)BI(e[n],t);t.dependenciesState=ii.NOT_TRACKING}function jI(t){var e=sy();try{return t()}finally{bh(e)}}function sy(){var t=yr.trackingDerivation;return yr.trackingDerivation=null,t}function bh(t){yr.trackingDerivation=t}function OM(t){var e=yr.allowStateReads;return yr.allowStateReads=t,e}function e_(t){yr.allowStateReads=t}function LI(t){if(t.dependenciesState!==ii.UP_TO_DATE){t.dependenciesState=ii.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=ii.UP_TO_DATE}}var Mw=0,vK=1,MP=Object.getOwnPropertyDescriptor(function(){},"name");MP&&MP.configurable;function Gv(t,e,n){var o=function(){return II(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function II(t,e,n,o){var r=mK();try{return e.apply(n,o)}catch(i){throw r.error=i,i}finally{gK(r)}}function mK(t,e,n){var o=Ku(),r=0,i=sy();Yc();var a=HE(!0),l=OM(!0),s={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:l,notifySpy:o,startTime:r,actionId:vK++,parentActionId:Mw};return Mw=s.actionId,s}function gK(t){Mw!==t.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=t.parentActionId,t.error!==void 0&&(yr.suppressReactionErrors=!0),XE(t.prevAllowStateChanges),e_(t.prevAllowStateReads),qc(),bh(t.prevDerivation),yr.suppressReactionErrors=!1}function HE(t){var e=yr.allowStateChanges;return yr.allowStateChanges=t,e}function XE(t){yr.allowStateChanges=t}var zv=(function(t){rK(e,t);function e(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hl()),a===void 0&&(a=Ig.default);var l=t.call(this,r)||this;return l.enhancer=o,l.name=r,l.equals=a,l.hasUnreportedChange=!1,l.value=o(n,void 0,r),l}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){this.value,n=this.prepareNewValue(n),n!==yr.UNCHANGED&&this.setNewValue(n)},e.prototype.prepareNewValue=function(n){if(Fg(this),Gd(this)){var o=zd(this,{object:this,type:"update",newValue:n});if(!o)return yr.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?yr.UNCHANGED:n},e.prototype.setNewValue=function(n){var o=this.value;this.value=n,this.reportChanged(),Kc(this)&&Zc(this,{type:"update",object:this,newValue:n,oldValue:o})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return rb(this,n)},e.prototype.observe=function(n,o){return o&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),ob(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return NI(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ay),yK=jh("ObservableValue",zv),Bg=(function(){function t(e){this.dependenciesState=ii.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ii.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Hl(),this.value=new Aw(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Wd.NONE,Wv(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+Hl(),e.set&&(this.setter=Gv(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Ig.structural:Ig.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){OK(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&Qo("Cycle detected in computation "+this.name+": "+this.derivation),yr.inBatch===0&&this.observers.size===0&&!this.keepAlive?SA(this)&&(this.warnAboutUntrackedRead(),Yc(),this.value=this.computeValue(!1),qc()):(UI(this),SA(this)&&this.trackAndCompute()&&xK(this));var e=this.value;if(zy(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(zy(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Wv(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Wv(!1,!1)},t.prototype.trackAndCompute=function(){var e=this.value,n=this.dependenciesState===ii.NOT_TRACKING,o=this.computeValue(!0),r=n||zy(e)||zy(o)||!this.equals(e,o);return r&&(this.value=o),r},t.prototype.computeValue=function(e){this.isComputing=!0,yr.computationDepth++;var n;if(e)n=DI(this,this.derivation,this.scope);else if(yr.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(o){n=new Aw(o)}return yr.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(AA(this),this.value=void 0)},t.prototype.observe=function(e,n){var o=this,r=!0,i=void 0;return kK(function(){var a=o.get();if(!r||n){var l=sy();e({type:"update",object:o,newValue:a,oldValue:i}),bh(l)}r=!1,i=a})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return NI(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(),$g=jh("ComputedValue",Bg),Y0=(function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t})(),_K={};function MA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_K}var q0=!0,FI=!1,yr=(function(){var t=MA();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(q0=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Y0().version&&(q0=!1),q0?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Y0):(setTimeout(function(){FI||Qo("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Y0)})();function bK(){(yr.pendingReactions.length||yr.inBatch||yr.isRunningReactions)&&Qo("isolateGlobalState should be called before MobX is running any reactions"),FI=!0,q0&&(--MA().__mobxInstanceCount===0&&(MA().__mobxGlobals=void 0),yr=new Y0)}function TA(){return yr}function wK(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function BI(t,e){t.observers.delete(e),t.observers.size===0&&$I(t)}function $I(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,yr.pendingUnobservations.push(t))}function Yc(){yr.inBatch++}function qc(){if(--yr.inBatch===0){GI();for(var t=yr.pendingUnobservations,e=0;e0&&$I(t),!1)}function EK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.isTracing!==Wd.NONE&&VI(e,t),e.onBecomeStale()),e.dependenciesState=ii.STALE}))}function xK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.POSSIBLY_STALE?e.dependenciesState=ii.STALE:e.dependenciesState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.UP_TO_DATE)}))}function OK(t){t.lowestObserverState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.dependenciesState=ii.POSSIBLY_STALE,e.isTracing!==Wd.NONE&&VI(e,t),e.onBecomeStale())}))}function VI(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Wd.BREAK){var n=[];WI(IK(t),n,1),new Function(`debugger; /* Tracing '`+t.name+`' You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update. Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update The stackframe you are looking for is at least ~6-8 stack-frames up. `+(t instanceof Bg?t.derivation.toString().replace(/[*]\//g,"/"):"")+` The dependencies for this derivation are: `+n.join(` `)+` */ `)()}}function WI(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(o){return WI(o,e,n+1)})}var A_=(function(){function t(e,n,o,r){e===void 0&&(e="Reaction@"+Hl()),r===void 0&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=o,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=ii.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Hl(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Wd.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,yr.pendingReactions.push(this),GI())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Yc(),this._isScheduled=!1,SA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ku()}catch(e){this.reportExceptionInDerivation(e)}}qc()}},t.prototype.track=function(e){if(!this.isDisposed){Yc(),this._isRunning=!0;var n=DI(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&AA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),qc()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(yr.disableErrorBoundaries)throw e;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";yr.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(o,e),yr.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Yc(),AA(this),qc()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[eo]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),GK(this,e)},t})(),TP=100,CA=function(t){return t()};function GI(){yr.inBatch>0||yr.isRunningReactions||CA(SK)}function SK(){yr.isRunningReactions=!0;for(var t=yr.pendingReactions,e=0;t.length>0;){++e===TP&&(console.error("Reaction doesn't converge to a stable state after "+TP+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o",e);if(arguments.length===2&&typeof n=="function")return Gv(e,n);if(arguments.length===1&&typeof e=="string")return CP(e);if(r===!0)oy(e,n,Gv(e.name||n,o.value,this));else return CP(n).apply(null,arguments)};Bt.bound=NK;function PK(t,e){var n=typeof t=="string"?t:t.name||"",o=typeof t=="function"?t:e;return II(n,o,this,void 0)}function ZO(t,e,n){oy(t,e,Gv(e,n.bind(t)))}function kK(t,e){e===void 0&&(e=yM);var n=e&&e.name||t.name||"Autorun@"+Hl(),o=!e.scheduler&&!e.delay,r;if(o)r=new A_(n,function(){this.track(l)},e.onError,e.requiresObservable);else{var i=zI(e),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(l)}))},e.onError,e.requiresObservable)}function l(){t(r)}return r.schedule(),r.getDisposer()}var RK=function(t){return t()};function zI(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:RK}function HI(t,e,n){n===void 0&&(n=yM);var o=n.name||"Reaction@"+Hl(),r=Bt(o,n.onError?DK(n.onError,e):e),i=!n.scheduler&&!n.delay,a=zI(n),l=!0,s=!1,f,h=n.compareStructural?Ig.structural:n.equals||Ig.default,v=new A_(o,function(){l||i?b():s||(s=!0,a(b))},n.onError,n.requiresObservable);function b(){if(s=!1,!v.isDisposed){var w=!1;v.track(function(){var O=t(v);w=l||!h(f,O),f=O}),l&&n.fireImmediately&&r(f,v),!l&&w===!0&&r(f,v),l&&(l=!1)}}return v.schedule(),v.getDisposer()}function DK(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function jK(t,e,n){return YI("onBecomeObserved",t,e)}function XI(t,e,n){return YI("onBecomeUnobserved",t,e)}function YI(t,e,n,o){var r=Mh(e),i=n,a=t+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var l=r[t];return typeof l!="function"?Qo(!1):function(){var s=r[a];s&&(s.delete(i),s.size===0&&delete r[a])}}function LK(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,l=t.observableRequiresReaction;if(bK(),e!==void 0){var s=void 0;switch(e){case!0:case"observed":s=!0;break;case!1:case"never":s=!1;break;case"strict":case"always":s="strict";break;default:Qo("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}yr.enforceActions=s,yr.allowStateChanges=!(s===!0||s==="strict")}n!==void 0&&(yr.computedRequiresReaction=!!n),a!==void 0&&(yr.reactionRequiresObservable=!!a),l!==void 0&&(yr.observableRequiresReaction=!!l,yr.allowStateReads=!yr.observableRequiresReaction),o!==void 0&&(yr.computedConfigurable=!!o),r!==void 0&&(r===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),yr.disableErrorBoundaries=!!r),i&&AK(i)}function NA(t,e,n,o){o=pg(o);var r=qI(o);return qv(t),MM(t,o.name,r.enhancer),e&&KI(t,e,n,r),t}function qI(t){return t.defaultDecorator||(t.deep===!1?RI:xM)}function KI(t,e,n,o){var r,i,a,l,s;Yc();try{var a=eK(e);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var s=h.value,v=Object.getOwnPropertyDescriptor(e,s),b=n&&s in n?n[s]:v.get?Sw:o,w=b(t,s,v,!0);w&&Object.defineProperty(t,s,w)}}catch(E){r={error:E}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}finally{qc()}}function IK(t,e){return ZI(Mh(t,e))}function ZI(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Kq(t.observing).map(ZI)),e}function JI(t,e){if(t==null)return!1;if(e!==void 0){if(nd(t)===!1||!t[eo].values.has(e))return!1;var n=Mh(t,e);return $g(n)}return $g(t)}function FK(t){return arguments.length>1?Qo(!1):JI(t)}function NP(t,e){return typeof e!="string"?Qo(!1):JI(t,e)}function BK(t,e){return t==null?!1:nd(t)||!!t[eo]||bM(t)||Tw(t)||$g(t)}function Ug(t){return arguments.length!==1&&Qo(!1),BK(t)}function Vg(t){return nd(t)?t[eo].getKeys():Yl(t)||nc(t)?Array.from(t.keys()):tf(t)?t.map(function(e,n){return n}):Qo(!1)}function $K(t){return nd(t)?Vg(t).map(function(e){return t[e]}):Yl(t)?Vg(t).map(function(e){return t.get(e)}):nc(t)?Array.from(t.values()):tf(t)?t.slice():Qo(!1)}function UK(t){return nd(t)?Vg(t).map(function(e){return[e,t[e]]}):Yl(t)?Vg(t).map(function(e){return[e,t.get(e)]}):nc(t)?Array.from(t.entries()):tf(t)?t.map(function(e,n){return[n,e]}):Qo(!1)}function SM(t,e,n){if(arguments.length===2&&!nc(t)){Yc();var o=e;try{for(var r in o)SM(t,r,o[r])}finally{qc()}return}if(nd(t)){var i=t[eo],a=i.values.get(e);a?i.write(e,n):i.addObservableProp(e,n,i.defaultEnhancer)}else if(Yl(t))t.set(e,n);else if(nc(t))t.add(e);else if(tf(t))typeof e!="number"&&(e=parseInt(e,10)),Wv(e>=0,"Not a valid index: '"+e+"'"),Yc(),e>=t.length&&(t.length=e+1),t[e]=n,qc();else return Qo(!1)}function QI(t,e,n,o){return VK(t,e,n)}function VK(t,e,n){return YE(t).observe(e,n)}var WK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tg(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function ch(t,e,n){if(!e.recurseEverything&&!Ug(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yK(t))return ch(t.get(),e,n);Ug(t)&&Vg(t);var o=e.detectCycles===!0;if(o&&t!==null&&n.has(t))return n.get(t);if(tf(t)||Array.isArray(t)){var r=tg(n,t,[],e),i=t.map(function(w){return ch(w,e,n)});r.length=i.length;for(var a=0,l=i.length;a0}function rb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),TI(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function zd(t,e){var n=sy();try{for(var o=EM(t.interceptors||[]),r=0,i=o.length;r0}function ob(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),TI(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function Zc(t,e){var n=sy(),o=t.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ob(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var o=new Array(e-n),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),arguments.length===1?n=i-e:n==null?n=0:n=Math.max(0,Math.min(n,i-e)),o===void 0&&(o=Ew),Gd(this)){var a=zd(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:o});if(!a)return Ew;n=a.removedCount,o=a.added}o=o.length===0?o:o.map(function(s){return r.enhancer(s,void 0)});var l=this.spliceItemsIntoValues(e,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(e,o,l),this.dehanceValues(l)},t.prototype.spliceItemsIntoValues=function(e,n,o){var r;if(o.length-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[eo];if(e){if(t=0&&n++;break}t=IP(t),e=IP(e);var l=a==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var s=t.constructor,f=e.constructor;if(s!==f&&!(typeof s=="function"&&s instanceof s&&typeof f=="function"&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),o=o||[],r=r||[];for(var h=o.length;h--;)if(o[h]===t)return r[h]===e;if(o.push(t),r.push(e),l){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!PA(t[h],e[h],n-1,o,r))return!1}else{var v=Object.keys(t),b=void 0;if(h=v.length,Object.keys(e).length!==h)return!1;for(;h--;)if(b=v[h],!(oZ(e,b)&&PA(t[b],e[b],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function IP(t){return tf(t)?t.slice():iy(t)||Yl(t)||tb(t)||nc(t)?Array.from(t.entries()):t}function oZ(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Cw(t){return t[Symbol.iterator]=iZ,t}function iZ(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:MK,extras:{getDebugName:rZ},$mobx:eo});function aZ(t){return!(t.prototype&&t.prototype.render)&&!Po.isPrototypeOf(t)}function o3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,o=n===void 0?"":n,r=e.suffix,i=r===void 0?"":r,a=t.displayName||t.name||t.constructor&&t.constructor.name||"";return o+a+i}var FP=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},i3=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a3=(function(){function t(e,n){for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:!1,o=t[e],r=u3[e],i=o?n===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function UP(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":FP(t))!=="object"||(typeof e>"u"?"undefined":FP(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var u3={componentWillMount:function(){var e=this,n=o3(this),o=!1,r=!1;function i(v){var b=this[v],w=wM("reactive "+v);Object.defineProperty(this,v,{configurable:!0,enumerable:!0,get:function(){return w.reportObserved(),b},set:function(E){!r&&UP(b,E)?(b=E,o=!0,w.reportChanged(),o=!1):b=E}})}i.call(this,"props"),i.call(this,"state");var a=this.render.bind(this),l=null,s=!1,f=function(){return l=new A_(n+".render()",function(){if(!s&&(s=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var b=!0;try{r=!0,o||Po.prototype.forceUpdate.call(e),b=!1}finally{r=!1,b&&l.dispose()}}}),l.reactComponent=e,h.$mobx=l,e.render=h,h(e.props,e.state,e.context)},h=function(b,w,O){s=!1;var E=void 0,S=void 0;if(l.track(function(){try{S=uZ(!1,a,b,w,O)}catch(M){E=M}}),E)throw E;return S};this.render=f},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:UP(this.props,e)}};function TM(t){if(arguments.length>1&&BP.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&BP.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aZ(t)){var e,n;return TM((n=e=(function(r){s3(i,r);function i(){return i3(this,i),l3(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return a3(i,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),i})(Po),e.displayName=o3(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var o=t.prototype||t;return cZ(o),t.isMobXReactObserver=!0,t}function cZ(t){$P(t,"componentWillMount",!0),$P(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=u3.shouldComponentUpdate)}var dZ=TM(function(t){var e=t.children;return e[0]()});dZ.displayName="Observer";var fZ=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pZ(t,e){return e={exports:{}},t(e,e.exports),e.exports}pZ(function(t,e){(function(n,o){t.exports=o()})(fZ,(function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,f=s&&s(Object);return function h(v,b,w){if(typeof b!="string"){if(f){var O=s(b);O&&O!==f&&h(v,O,w)}var E=i(b);a&&(E=E.concat(a(b)));for(var S=0;S1?Lr("div",null," ",r," "):r[0]}},{key:"getChildContext",value:function(){var o={},r=this.context.mobxStores;if(r)for(var i in r)o[i]=r[i];for(var a in this.props)!VP[a]&&a!=="suppressChangedStoreWarning"&&(o[a]=this.props[a]);return{mobxStores:o}}},{key:"componentWillReceiveProps",value:function(o){if(Object.keys(o).length!==Object.keys(this.props).length&&WP.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!o.suppressChangedStoreWarning)for(var r in o)!VP[r]&&this.props[r]!==o[r]&&WP.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(Po);if(!Po)throw new Error("mobx-preact requires Preact to be available");var Bd,JO,GP,c3=[],Ds=xo,zP=Ds.__b,HP=Ds.__r,XP=Ds.diffed,YP=Ds.__c,qP=Ds.unmount,KP=Ds.__;function hZ(){for(var t;t=c3.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(K0),e.__h.some(kA),e.__h=[]}catch(n){e.__h=[],Ds.__e(n,t.__v)}}}Ds.__b=function(t){Bd=null,zP&&zP(t)},Ds.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),KP&&KP(t,e)},Ds.__r=function(t){HP&&HP(t);var e=(Bd=t.__c).__H;e&&(JO===Bd?(e.__h=[],Bd.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(K0),e.__h.some(kA),e.__h=[])),JO=Bd},Ds.diffed=function(t){XP&&XP(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(c3.push(e)!==1&&GP===Ds.requestAnimationFrame||((GP=Ds.requestAnimationFrame)||vZ)(hZ)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=Bd=null},Ds.__c=function(t,e){e.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||kA(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Ds.__e(o,n.__v)}}),YP&&YP(t,e)},Ds.unmount=function(t){qP&&qP(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{K0(o)}catch(r){e=r}}),n.__H=void 0,e&&Ds.__e(e,n.__v))};var ZP=typeof requestAnimationFrame=="function";function vZ(t){var e,n=function(){clearTimeout(o),ZP&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);ZP&&(e=requestAnimationFrame(n))}function K0(t){var e=Bd,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Bd=e}function kA(t){var e=Bd;t.__c=t.__(),Bd=e}function mZ(t,e){for(var n in e)t[n]=e[n];return t}function JP(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function QP(t,e){this.props=t,this.context=e}(QP.prototype=new Po).isPureReactComponent=!0,QP.prototype.shouldComponentUpdate=function(t,e){return JP(this.props,t)||JP(this.state,e)};var ek=xo.__b;xo.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ek&&ek(t)};var gZ=xo.__e;xo.__e=function(t,e,n,o){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}gZ(t,e,n,o)};var tk=xo.unmount;function d3(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=mZ({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return d3(o,e,n)})),t}function f3(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return f3(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function QO(){this.__u=0,this.o=null,this.__b=null}function p3(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function g0(){this.i=null,this.l=null}xo.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),tk&&tk(t)},(QO.prototype=new Po).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=p3(o.__v),i=!1,a=function(){i||o.__z||(i=!0,n.__R=null,r?r(s):s())};n.__R=a;var l=n.__P;n.__P=null;var s=function(){if(!--o.__u){if(o.state.__a){var f=o.state.__a;o.__v.__k[0]=f3(f,f.__c.__P,f.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.o.pop();)h.__P=l,h.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},QO.prototype.componentWillUnmount=function(){this.o=[]},QO.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=d3(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Lr(jg,null,t.fallback);return r&&(r.__u&=-33),[Lr(jg,null,e.__a?null:t.children),r]};var nk=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]M.step||Math.abs(M.sumDeltaY)>M.step)){var k=M.sumDeltaX%M.step,B=M.sumDeltaY%M.step,F=M.sumDeltaX-k,I=M.sumDeltaY-B;M.sumDeltaX=k,M.sumDeltaY=B;var V=($=M.model)===null||$===void 0?void 0:$.getData();M.isDragging||((D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_DRAGSTART")],{e:C,data:M.data||V}),M.onDragStart({event:C})),M.isDragging=!0,Promise.resolve().then(function(){var z,X;M.onDragging({deltaX:F,deltaY:I,event:C}),(z=M.eventCenter)===null||z===void 0||z.emit(pr["".concat(M.eventType,"_MOUSEMOVE")],{deltaX:F,deltaY:I,e:C,data:M.data||V}),(X=M.eventCenter)===null||X===void 0||X.emit(pr["".concat(M.eventType,"_DRAG")],{e:C,data:M.data||V})})}},this.handleMouseUp=function(C){var $=window.document;M.isStartDragging=!1,M.isStopPropagation&&C.stopPropagation(),Promise.resolve().then(function(){var D,k,B;$.removeEventListener("mousemove",M.handleMouseMove,!1),$.removeEventListener("mouseup",M.handleMouseUp,!1);var F=(D=M.model)===null||D===void 0?void 0:D.getData();(k=M.eventCenter)===null||k===void 0||k.emit(pr["".concat(M.eventType,"_MOUSEUP")],{e:C,data:M.data||F}),M.isDragging&&(M.isDragging=!1,M.onDragEnd({event:C}),(B=M.eventCenter)===null||B===void 0||B.emit(pr["".concat(M.eventType,"_DROP")],{e:C,data:M.data||F}))})},this.cancelDrag=function(){var C=window==null?void 0:window.document;C.removeEventListener("mousemove",M.handleMouseMove,!1),C.removeEventListener("mouseup",M.handleMouseUp,!1),M.onDragEnd({event:void 0}),M.isDragging=!1},this.destroy=function(){M.isStartDragging&&M.cancelDrag()},this.onDragStart=o,this.onDragging=i,this.onDragEnd=l,this.step=b,this.isStopPropagation=O,this.eventType=f,this.eventCenter=h,this.model=E,this.data=S}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t})(),LZ=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}},IZ=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},FZ=function(t){var e=t.points,n=Kv(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,l=o.height;return{x:r-a/2,y:i-l/2,x1:r+a/2,y1:i+l/2}},BZ=function(t){var e=t.path,n=CM(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,l=o.height;return{x:r-a/2,y:i-l/2,x1:r+a/2,y1:i+l/2}},$Z=function(t){if(t.modelType===_o.LINE_EDGE)return IZ(t);if(t.modelType===_o.POLYLINE_EDGE)return FZ(t);if(t.modelType===_o.BEZIER_EDGE)return BZ(t)},UZ=function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(r===0)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0?{x:i,y:a}:!1},T_=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,l=n.x,s=n.y,f=(s-a)/(l-i),h=a-f*i;return(o>=i&&o<=l||o<=i&&o>=l)&&(r>=a&&r<=s||r<=a&&r>=s)&&Math.abs(r-f*o-h)=e.x?(a.leftX=e.x+f*Math.sin(l+s),a.leftY=e.y-f*Math.cos(l+s),a.rightX=e.x-f*Math.sin(l-s),a.rightY=e.y+f*Math.cos(l-s)):(a.leftX=e.x-f*Math.sin(l+s),a.leftY=e.y+f*Math.cos(l+s),a.rightX=e.x+f*Math.sin(l-s),a.rightY=e.y-f*Math.cos(l-s)):i==="end"&&(n.x>=e.x?(a.leftX=n.x+f*Math.sin(l-s),a.leftY=n.y-f*Math.cos(l-s),a.rightX=n.x-f*Math.sin(l+s),a.rightY=n.y+f*Math.cos(l+s)):(a.leftX=n.x-f*Math.sin(l-s),a.leftY=n.y+f*Math.cos(l-s),a.rightX=n.x+f*Math.sin(l+s),a.rightY=n.y-f*Math.cos(l+s))),a},bg=function(){return bg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yh=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;oo/e.height?ni.HORIZONTAL:ni.VERTICAL},Pw=function(t,e,n){var o=WZ(n,e);return o===ni.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},uk=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},N_=function(t,e){t===void 0&&(t=[]);var n=[],o=[];t.forEach(function(h){n.push(h.x),o.push(h.y)});var r=Math.min.apply(Math,yh([],Xu(n),!1)),i=Math.max.apply(Math,yh([],Xu(n),!1)),a=Math.min.apply(Math,yh([],Xu(o),!1)),l=Math.max.apply(Math,yh([],Xu(o),!1)),s=i-r,f=l-a;return e&&(s+=e,f+=e),{centerX:(r+i)/2,centerY:(a+l)/2,maxX:i,maxY:l,minX:r,minY:a,x:(r+i)/2,y:(a+l)/2,height:f,width:s}},kw=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},_0=function(t,e){var n=t.x,o=t.y;return ne.maxX||oe.maxY},GZ=function(t,e){return et.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},zZ=function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},HZ=function(t,e){return yh(yh([],Xu(GZ(t,e.x)),!1),Xu(zZ(t,e.y)),!1)},DA=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},XZ=function(t,e){var n=-2,o=0;return e.forEach(function(r){r&&(t.x===r.x&&(o+=n),t.y===r.y&&(o+=n))}),o},ck=function(t,e,n,o,r){return DA(t,e)+DA(t,n)+XZ(t,[e,n,o,r])},h3=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&h3(t,e,n,n[o],r+1)},YZ=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Hy=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,l=o.y-n.y,s=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*l),f=(a*(t.y-n.y)-l*(t.x-n.x))/(-a*i+r*l);return s>=0&&s<=1&&f>=0&&f<=1},dk=function(t,e,n){if(n.width===0&&n.height===0)return!1;var o=Xu(kw(n),4),r=o[0],i=o[1],a=o[2],l=o[3];return Hy(t,e,r,i)||Hy(t,e,r,l)||Hy(t,e,i,a)||Hy(t,e,a,l)},qZ=function(t,e,n,o){var r=[];return t.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!dk(i,e,n)&&!dk(i,e,o)&&r.push(i)}),RA(r)},KZ=function(t,e,n,o,r,i,a){var l=[],s=[e],f={},h={},v={};e.id&&(h[e.id]=0,v[e.id]=ck(e,n,e));var b={};t.forEach(function(E){E.id&&(b[E.id]=E)});for(var w=function(){var E,S=1/0;if(s.forEach(function(C){C.id&&v[C.id]=h[C.id])return;f[C.id]=E.id,h[C.id]=D,v[C.id]=h[C.id]+ck(C,n,e,i,a)}})};s.length;){var O=w();if(typeof O=="object")return O.value}return[e,n]},fk=function(t){return gu(t)},v3=function(t){for(var e=1;e2&&(M=v3(M)),RA(M)},ZZ=function(t){if(t.length===1){var e=Xu(t,1),n=e[0];return[n,n]}else{for(var o=t[0],r=t[1],i=Xc(o.x,o.y,r.x,r.y),a=1;ai&&(i=f,o=l,r=s)}return[o,r]}},hk=function(t,e,n){var o=ip(t,n),r=ip(e,n);return o&&r},vk=function(t,e,n){var o=ip(t,n),r=ip(e,n),i=o&&r,a=o||r;return!i&&a},mk=function(t,e,n){for(var o=void 0,r=gu(n),i=kw(r),a=0;a=1&&o<=126||o>=65376&&o<=65439?e+=1:e+=2}return e},QZ=function(t){var e=t.start,n=t.end,o;if(e.x===n.x&&e.y===n.y)o="";else{var r={start:e,end:n,offset:10,verticalLength:5},i=C_(bg(bg({},r),{type:"start"})),a=C_(bg(bg({},r),{type:"end"}));o="M".concat(i.leftX," ").concat(i.leftY,` L`).concat(i.rightX," ").concat(i.rightY,` L`).concat(a.rightX," ").concat(a.rightY,` L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},yk=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=gu(o),l=gu(r),s=Nw(a,i),f=Nw(l,i),h=Pw(s,a,e),v=Pw(f,l,n);return{sNext:h,ePre:v}},CM=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=b0(e[0]),o=b0(e[1]),r=b0(e[2]),i=b0(e[3]);return[n,o,r,i]},b0=function(t){var e=Xu(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],o=e[1];return{x:+n,y:+o}},_k=function(t,e){var n=Xu(t,4),o=n[0],r=n[1],i=n[2],a=n[3],l=WJ(o,r,i,a,e);return[l,t[3]]},g3=function(t,e){for(var n=t.x,o=t.y,r=Kv(e),i=Number.MAX_SAFE_INTEGER,a,l=[],s=0;sr?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},ng=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},w0=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tS=function(t,e,n){var o=eS(t,2),r=o[0],i=o[1],a=eS(e,2),l=a[0],s=a[1],f=eS(n,2),h=f[0],v=f[1];return r>l&&rs&&i=0?r:-r},e})(_3),jA=(function(t){NM(e,t);function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.toString=function(){return"Point"},e})(_3),qE=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),rg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},nS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LA=function(t){var e=t.anchors;return e},Lw=function(t,e){for(var n=e.nodes,o,r=n.length-1;r>=0;r--){var i=n[r],a=uJ(t,i);if(a){var l=i.getTargetAnchor(t);if(l){var s={node:i,anchorIndex:l.index,anchor:l.anchor};(!o||sJ(i,o.node,e))&&(o=s)}}}return o},sJ=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},lJ=function(t,e){for(var n=LA(e),o,r=Number.MAX_SAFE_INTEGER,i=0;i=r.minX-n&&s.x<=r.maxX+n&&s.y>=r.minY-n&&s.y<=r.maxY+n&&(o=!0),o},uJ=function(t,e){return ip(t,e,5)},gu=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},cJ=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]},Ek=function(t,e,n){var o=cJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var l=Xc(t.x,t.y,a.x,a.y);lf.minX&&t.xf.minY&&t.yh.x&&(v=h,b=f);var w={x:t.x,y:t.y};if(v.x===b.x&&e===ni.HORIZONTAL&&(w={x:v.x,y:t.y}),v.y===b.y&&e===ni.VERTICAL&&(w={x:t.x,y:v.y}),v.x!==b.x&&v.y!==b.y){var O=(b.y-v.y)/(b.x-v.x),E=(v.x*b.y-b.x*v.y)/(v.x-b.x);e===ni.HORIZONTAL?w={x:(t.y-E)/O,y:t.y}:e===ni.VERTICAL&&(w={x:t.x,y:O*t.x+E})}var S=T_(w,f,h);if(S){var M=Xc(w.x,w.y,t.x,t.y);Mt.x?r=t.x+n/2:e.xt.y?i=t.y+o/2:e.y1?e.forEach(function(l){var s=document.createElement("div");s.textContent=l,i.appendChild(s)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},Ak=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach(function(i){var a=m3(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},Iw=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let x0;const fJ=new Uint8Array(16);function pJ(){if(!x0&&(x0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!x0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return x0(fJ)}const ks=[];for(let t=0;t<256;++t)ks.push((t+256).toString(16).slice(1));function hJ(t,e=0){return ks[t[e+0]]+ks[t[e+1]]+ks[t[e+2]]+ks[t[e+3]]+"-"+ks[t[e+4]]+ks[t[e+5]]+"-"+ks[t[e+6]]+ks[t[e+7]]+"-"+ks[t[e+8]]+ks[t[e+9]]+"-"+ks[t[e+10]]+ks[t[e+11]]+ks[t[e+12]]+ks[t[e+13]]+ks[t[e+14]]+ks[t[e+15]]}const vJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Mk={randomUUID:vJ};function mJ(t,e,n){if(Mk.randomUUID&&!t)return Mk.randomUUID();t=t||{};const o=t.random||(t.rng||pJ)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,hJ(o)}var wh=function(){return mJ()},t_=new Map,w3=function(t){var e=wh();function n(){t();var r=t_.get(e);if(r){var i=window.requestAnimationFrame(n);t_.set(e,i)}}var o=window.requestAnimationFrame(n);return t_.set(e,o),e},Fw=function(t){var e=t_.get(t);e&&(window.cancelAnimationFrame(e),t_.delete(t))},P_=function(){return P_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function E3(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.value,a=t.fontSize,l=a===void 0?12:a,s=t.fill,f=s===void 0?"currentColor":s,h=t.overflowMode,v=h===void 0?"default":h,b=t.textWidth,w=b===void 0?void 0:b,O=t.model,E={x:n,y:r,fill:f,fontSize:l,textAnchor:"middle",dominantBaseline:"central"};if(ri(pp(t),function(k){var B=gJ(k,2),F=B[0],I=B[1];typeof I!="object"&&(E[F]=I)}),i){var S=String(i).split(/[\r\n]/g),M=S.length;if(v!=="default"){var C=O.BaseType,$=O.modelType;if(C===da.NODE&&$!==_o.TEXT_NODE||C===da.EDGE&&w)return yJ(t)}if(M>1){var D=S.map(function(k,B){var F=l+2,I=(B-(M-1)/2)*F;return $t("tspan",{className:"lf-text-tspan",x:n,y:r+I,children:k})});return $t("text",P_({},E,{children:D}))}return $t("text",P_({},E,{children:i}))}return null}function yJ(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,l=a===void 0?12:a,s=t.lineHeight,f=t.fontFamily,h=f===void 0?"":f,v=t.wrapPadding,b=v===void 0?"0, 0":v,w=t.overflowMode,O=r.width,E=r.height,S=r.textHeight,M=i||O,C=String(o).split(/[\r\n]/g),$=C.length,D=b3({rows:C,style:{fontSize:"".concat(l,"px"),width:"".concat(M,"px"),fontFamily:h,lineHeight:s,padding:b},rowsLength:$,className:"lf-get-text-height"}),k=E>D?E:D;S&&(k=S);var B=w==="ellipsis";return B&&(k=l+2),$t("g",{children:$t("foreignObject",{width:M,height:k,x:e-M/2,y:n-k/2,style:{overflow:"visible",textAlign:"left"},children:$t("div",{className:"lf-node-text-auto-wrap",style:{minHeight:k,width:M,padding:b},children:$t("div",{className:B?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:B?C.join(""):"",style:P_({},t),children:C.map(function(F){return $t("div",{className:"lf-node-text--auto-wrap-inner",children:F})})})})})})}var FA=function(){return FA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Gg(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(pp(t),function(n){var o=_J(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("line",FA({},e))}var BA=function(){return BA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Yu(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,l=t.radius,s=l===void 0?0:l,f=e-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(pp(t),function(b){var w=bJ(b,2),O=w[0],E=w[1];typeof E!="object"&&(v[O]=E)}),i?v.className="lf-basic-shape ".concat(i):v.className="lf-basic-shape",s&&(v.rx=s,v.ry=s),v.x=f,v.y=h,$t("rect",BA({},v))}var $A=function(){return $A=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function k_(t){var e={d:""};return ri(pp(t),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("path",$A({},e))}var UA=function(){return UA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zg(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.r,a=i===void 0?4:i,l=t.className,s={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(f){var h=EJ(f,2),v=h[0],b=h[1];typeof b!="object"&&(s[v]=b)}),l?s.className="lf-basic-shape ".concat(l):s.className="lf-basic-shape",$t("circle",UA({},s))}var VA=function(){return VA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function OJ(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.rx,a=i===void 0?4:i,l=t.ry,s=l===void 0?4:l,f=t.className,h={cx:n,cy:r,rx:a,ry:s,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(v){var b=xJ(v,2),w=b[0],O=b[1];typeof O!="object"&&(h[w]=O)}),f?h.className="lf-basic-shape ".concat(f):h.className="lf-basic-shape",$t("ellipse",VA({},h))}var Bw=function(){return Bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function AJ(t,e){var n=t.map(function(C){return{x:C[0],y:C[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(e),i="",a=0;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function TJ(t){var e=t.className,n={points:"",fill:"none"};return ri(pp(t),function(o){var r=MJ(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(n[i]=a)}),e&&(n.className="".concat(e)),$t("polyline",WA({},n))}var x3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),R_=function(){return R_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ho;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(Ho||(Ho={}));var PJ=(function(t){x3(e,t);function e(n){var o=t.call(this)||this;o.isShiftPressed=!1,o.bindKeyboardEvents=function(){document.addEventListener("keydown",o.handleKeyDown),document.addEventListener("keyup",o.handleKeyUp)},o.handleKeyDown=function(l){l.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(l){l.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var l=o.nodeModel,s=l.id,f=l.anchors,h=o.graphModel.getNodeEdges(s);ri(h,function(v){if(v.sourceNodeId===s){var b=Sh(f,function(w){return w.id===v.sourceAnchorId});b&&v.updateStartPoint({x:b.x,y:b.y})}else if(v.targetNodeId===s){var b=Sh(f,function(O){return O.id===v.targetAnchorId});b&&v.updateEndPoint({x:b.x,y:b.y})}})},o.triggerResizeEvent=function(l,s,f,h,v,b){o.graphModel.eventCenter.emit(pr.NODE_RESIZE,{preData:l,data:s,deltaX:f,deltaY:h,index:v,model:b})},o.recalcResizeInfo=function(l,s,f,h,v){f===void 0&&(f=1),h===void 0&&(h=!1),v===void 0&&(v=!1);var b=to(s),w=b.deltaX,O=b.deltaY,E=b.width,S=b.height,M=b.PCTResizeInfo;if(M){var C=4,$=0,D=0;switch(l){case Ho.LEFT_TOP:D=(w*-1-O)/C;break;case Ho.RIGHT_TOP:D=(w-O)/C;break;case Ho.RIGHT_BOTTOM:D=(w+O)/C;break;case Ho.LEFT_BOTTOM:D=(w*-1+O)/C;break}D!==0&&($=Math.round(D/M.ResizeBasis.basisHeight*1e5)/1e3),M.ResizePCT.widthPCT=Math.max(Math.min(M.ResizePCT.widthPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit),M.ResizePCT.heightPCT=Math.max(Math.min(M.ResizePCT.heightPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit);var k=Math.round(M.ResizePCT.widthPCT*M.ResizeBasis.basisWidth/100),B=Math.round(M.ResizePCT.heightPCT*M.ResizeBasis.basisHeight/100);switch(l){case Ho.LEFT_TOP:w=E-k,O=S-B;break;case Ho.RIGHT_TOP:w=k-E,O=S-B;break;case Ho.RIGHT_BOTTOM:w=k-E,O=B-S;break;case Ho.LEFT_BOTTOM:w=E-k,O=B-S;break}return b}switch(l){case Ho.LEFT_TOP:b.width=h?E:E-w*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_TOP:b.width=h?E:E+w*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_BOTTOM:b.width=h?E:E+w*f,b.height=v?S:S+O*f;break;case Ho.LEFT_BOTTOM:b.width=h?E:E-w*f,b.height=v?S:S+O*f;break}return b},o.resizeNode=function(l){var s=l.deltaX,f=l.deltaY,h=o.index,v=o.props,b=v.model,w=v.graphModel,O=v.x,E=v.y;O3({x:O,y:E,deltaX:s,deltaY:f,index:h,nodeModel:b,graphModel:w,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(l){var s=l.deltaX,f=l.deltaY,h=o.graphModel.transformModel,v=NJ(h.fixDeltaXY(s,f),2),b=v[0],w=v[1];o.resizeNode({deltaX:b,deltaY:w})},o.onDragEnd=function(){var l=o.nodeModel.x,s=o.nodeModel.y;o.nodeModel.moveTo(l,s),o.updateEdgePointByAnchors()};var r=n.index,i=n.model,a=n.graphModel;return o.index=r,o.nodeModel=i,o.graphModel=a,o.dragHandler=new oc({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:a.gridSize}),o.bindKeyboardEvents(),o}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.direction,a=n.model,l=a.getResizeControlStyle(),s=l.width,f=l.height,h=CJ(l,["width","height"]);return $t("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[$t(Yu,R_({className:"lf-resize-control-content",x:o,y:r,width:s??7,height:f??7},h)),$t(Yu,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e})(Po),kJ=(function(t){x3(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=gu(o),a=i.minX,l=i.minY,s=i.maxX,f=i.maxY,h=[{index:Ho.LEFT_TOP,direction:"nw",x:a,y:l},{index:Ho.RIGHT_TOP,direction:"ne",x:s,y:l},{index:Ho.RIGHT_BOTTOM,direction:"se",x:s,y:f},{index:Ho.LEFT_BOTTOM,direction:"sw",x:a,y:f}];return ec(h,function(v){return $t(PJ,R_({},v,{model:o,graphModel:r}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,l=n.getResizeOutlineStyle();return $t(Yu,R_({},l,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e})(Po);function RJ(t,e){var n=t.x,o=t.y,r=e.x,i=e.y,a={x:n+(r-n)/2,y:o+(i-o)/2};return a}function Xy(t,e,n){var o=DJ(n),r=t.x-e.x,i=t.y-e.y,a=r*Math.cos(o)-i*Math.sin(o)+e.x,l=r*Math.sin(o)+i*Math.cos(o)+e.y;return{x:a,y:l}}function DJ(t){return t*Math.PI/180}function jJ(t){return t/Math.PI*180}function LJ(t,e,n,o,r,i,a,l){r===void 0&&(r=!1),i===void 0&&(i=!1);var s={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},f=RJ(s,e),h=Xy(e,f,-o),v=Xy(s,f,-o);if(r){var b=Math.abs(h.x-v.x),w=b-a;f.x>h.x?f.x=f.x+w/2:f.x=f.x-w/2}if(i){var O=Math.abs(h.y-v.y),E=O-l;f.y>h.y?f.y=f.y+E/2:f.y=f.y-E/2}if(r||i){var S=Xy(v,f,o),M=S.x-s.x,C=S.y-s.y;f.x=f.x-M,f.y=f.y-C,v=Xy(s,f,-o),h={x:f.x-(v.x-f.x),y:f.y-(v.y-f.y)}}var $=Math.abs(h.x-v.x),D=Math.abs(h.y-v.y);return r&&($=a),i&&(D=l),{width:$,height:D,center:f}}function IJ(t,e,n,o,r,i,a,l,s){l===void 0&&(l=!1),s===void 0&&(s=!1);var f=e.deltaX,h=e.deltaY,v=e.width,b=e.height,w=jJ(n),O={x:o,y:r},E={x:i,y:a},S=Xy(O,E,w),M={x:S.x+f,y:S.y+h},C=LJ(S,M,E,w,l,s,v,b),$=C.width,D=C.height,k=C.center;return e.width=$*t,e.height=D*t,e.deltaX=(k.x-E.x)*2,e.deltaY=(k.y-E.y)*2,e}var FJ=function(t,e,n,o,r,i,a,l,s,f,h){n===void 0&&(n=1),o===void 0&&(o=!1),r===void 0&&(r=!1),i===void 0&&(i=0),h===void 0&&(h=!1);var v=to(e),b=v.deltaX,w=v.deltaY,O=v.width,E=v.height,S=v.PCTResizeInfo;if(S){var M=4,C=0,$=0;switch(t){case Ho.LEFT_TOP:$=(b*-1-w)/M;break;case Ho.RIGHT_TOP:$=(b-w)/M;break;case Ho.RIGHT_BOTTOM:$=(b+w)/M;break;case Ho.LEFT_BOTTOM:$=(b*-1+w)/M;break}$!==0&&(C=Math.round($/S.ResizeBasis.basisHeight*1e5)/1e3),S.ResizePCT.widthPCT=Math.max(Math.min(S.ResizePCT.widthPCT+C,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit),S.ResizePCT.heightPCT=Math.max(Math.min(S.ResizePCT.heightPCT+C,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit);var D=Math.round(S.ResizePCT.widthPCT*S.ResizeBasis.basisWidth/100),k=Math.round(S.ResizePCT.heightPCT*S.ResizeBasis.basisHeight/100);switch(t){case Ho.LEFT_TOP:b=O-D,w=E-k;break;case Ho.RIGHT_TOP:b=D-O,w=E-k;break;case Ho.RIGHT_BOTTOM:b=D-O,w=k-E;break;case Ho.LEFT_BOTTOM:b=O-D,w=k-E;break}return v}if(i%(2*Math.PI)!==0&&a!==void 0&&l!==void 0)return IJ(n,v,i,a,l,s,f,o,r);if(h){var B=O/E,F=0,I=O,V=E;switch(t){case Ho.LEFT_TOP:F=Math.abs(b)>Math.abs(w)?-b:-w,B>=1?(I=O+F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=E-V;break;case Ho.RIGHT_TOP:F=Math.abs(b)>Math.abs(w)?b:-w,B>=1?(I=O+F,V=I/B):(V=E-F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=E-V;break;case Ho.RIGHT_BOTTOM:F=Math.abs(b)>Math.abs(w)?b:w,B>=1?(I=O+F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=V-E;break;case Ho.LEFT_BOTTOM:F=Math.abs(b)>Math.abs(w)?-b:w,B>=1?(I=O-F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=V-E;break}return v}switch(t){case Ho.LEFT_TOP:v.width=o?O:O-b*n,v.height=r?E:E-w*n;break;case Ho.RIGHT_TOP:v.width=o?O:O+b*n,v.height=r?E:E-w*n;break;case Ho.RIGHT_BOTTOM:v.width=o?O:O+b*n,v.height=r?E:E+w*n;break;case Ho.LEFT_BOTTOM:v.width=o?O:O-b*n,v.height=r?E:E+w*n;break}return v},BJ=function(t,e){var n=t.id,o=t.anchors,r=e.getNodeEdges(n);ri(r,function(i){if(i.sourceNodeId===n){var a=Sh(o,function(l){return l.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===n){var a=Sh(o,function(s){return s.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},$J=function(t,e,n,o,r,i,a){a.eventCenter.emit(pr.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})},O3=function(t){var e=t.x,n=t.y,o=t.deltaX,r=t.deltaY,i=t.index,a=t.nodeModel,l=t.graphModel,s=t.cancelCallback,f=t.forceProportional,h=f===void 0?!1:f,v=a.r,b=a.rx,w=a.ry,O=a.width,E=a.height,S=a.PCTResizeInfo,M=a.minWidth,C=a.minHeight,$=a.maxWidth,D=a.maxHeight,k=a.rotate,B=a.x,F=a.y,I=M===$,V=C===D,z={width:v||b||O,height:v||w||E,deltaX:o,deltaY:r,PCTResizeInfo:S},X=v||b&&w?1/2:1,Y=e,W=n,Q=FJ(i,z,X,I,V,k,Y,W,B,F,h);if(Q.width$||Q.heightD){s==null||s();return}(k%(2*Math.PI)==0||S||Y===void 0||W===void 0)&&(Q.deltaX=I?0:Q.deltaX,Q.deltaY=V?0:Q.deltaY);var J=a.getData(),ie=a.resize(Q);J.x===ie.x&&J.y===ie.y||(BJ(a,l),$J(J,ie,o,r,i,a,l))},UJ=100,VJ={x:1,y:0};function WJ(t,e,n,o,r){for(var i=function(w){if(w<0||w>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-w,3)+3*e.x*w*Math.pow(1-w,2)+3*n.x*Math.pow(w,2)*(1-w)+o.x*Math.pow(w,3),y:t.y*Math.pow(1-w,3)+3*e.y*w*Math.pow(1-w,2)+3*n.y*Math.pow(w,2)*(1-w)+o.y*Math.pow(w,3)}},a=0,l=2,s=o.x,f=o.y,h=o;a=0?o:-o}function Tk(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function XJ(t){return HJ(VJ,t)}function YJ(t){return t*(180/Math.PI)}var S3={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qJ={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},KJ={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},ZJ={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},D_={colorful:ZJ,dark:KJ,radius:qJ,default:S3},JJ={background:"#23272e"},QJ={background:"#fefeff"},GA={background:"#ffffff"},j_={colorful:QJ,dark:JJ,radius:GA,default:GA},eQ={color:"#66676a",thickness:1},tQ={color:"#dadada",thickness:1},zA={color:"#acacac",thickness:1},L_={colorful:tQ,dark:eQ,radius:zA,default:zA},A3=function(t,e){var n=to(S3);return e&&(n=Yv(n,D_[e])),t&&(n=Yv(n,t)),n},nQ=function(t,e){if(D_[t]){console.warn("theme mode ".concat(t," already exists"));return}D_[t]=e,j_[t]=e.background||GA,L_[t]=e.grid||zA},rQ=function(t){delete D_[t],delete j_[t],delete L_[t]},oQ=function(){var t={colorful:{},dark:{},radius:{},default:{}};Xo(D_,t),Xo(j_,t),Xo(L_,t)},iQ=A3,aQ=1e3,sQ=999,I_=function(){return++aQ},lQ=function(){return--sQ},Da=function(){return Da=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},KE=(function(){function t(e,n){var o;this.BaseType=da.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Zu.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=Wo.DEFAULT,this.modelType=_o.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Xo(this,eJ(e));var l=this.graphModel,s=l.overlapMode,f=l.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||I_()),this.setAnchors(),this.initPoints(),this.formatText(e),f.on("overlap:change",function(h){var v=h.overlapMode;n.updateZIndexByOverlap(v,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Da(Da({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Da({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return to(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return to(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?n.stroke:e.stroke;return Da(Da(Da({},e),{fill:r,stroke:r}),o)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return to(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,o){var r,i,a=LA(e);if(o){if(r=Sh(a,function(l){return l.id===o}),r)return r;console.warn("未在节点上找到指定的起点锚点".concat(o,",已使用默认锚点作为起点"))}return a.forEach(function(l){var s=bk(l,n);(i===void 0||s=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},rS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ck=(function(t){uQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return e.prototype.initEdgeData=function(n){this.offset=om(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Fv(Fv(Fv({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,o=0;return this.pointsList.forEach(function(r){var i=r.x,a=r.y;n+=i,o+=a}),{x:n/this.pointsList.length,y:o/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Fv(Fv({},n),{pointsList:o})},e.prototype.getControls=function(){var n=this.startPoint,o=this.endPoint,r=yk({start:n,end:o,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return r},e.prototype.getPath=function(n){var o=rS(n,4),r=o[0],i=o[1],a=o[2],l=o[3];return"M ".concat(r.x," ").concat(r.y,` C `).concat(i.x," ").concat(i.y,`, `).concat(a.x," ").concat(a.y,`, `).concat(l.x," ").concat(l.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),o=n.sNext,r=n.ePre;this.updatePath(o,r)},e.prototype.updatePath=function(n,o){n=to(n),o=to(o);var r={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!n||!o){var a=this.getControls();n=a.sNext,o=a.ePre}this.pointsList=[r,n,o,i],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];i.x+=n,i.y+=o,this.updatePath(i,a)},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];a.x+=n,a.y+=o,this.updatePath(i,a)},e.prototype.updateAdjustAnchor=function(n,o){var r;o==="sNext"?this.pointsList[1]=n:o==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode,l=yk({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),s=l.sNext,f=l.ePre;this.pointsList=[o,s,f,r],this.initPoints()},Uu([Ut],e.prototype,"offset",void 0),Uu([Ut],e.prototype,"path",void 0),Uu([Bt],e.prototype,"initPoints",null),Uu([Bt],e.prototype,"updatePoints",null),Uu([Bt],e.prototype,"updateStartPoint",null),Uu([Bt],e.prototype,"updateEndPoint",null),Uu([Bt],e.prototype,"moveStartPoint",null),Uu([Bt],e.prototype,"moveEndPoint",null),Uu([Bt],e.prototype,"updateAdjustAnchor",null),Uu([Bt],e.prototype,"getAdjustStart",null),Uu([Bt],e.prototype,"getAdjustEnd",null),Uu([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(KE),cQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n_=function(){return n_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},dQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},kk=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=2&&(S[0]={x:n[0].x,y:n[0].y},S[S.length-1]={x:n[n.length-1].x,y:n[n.length-1].y});var $=S.length<2||S.every(function(D,k,B){return k===0?!0:r(B[k-1],B[k])});return $?S:[{x:n[0].x,y:n[0].y},{x:n[n.length-1].x,y:n[n.length-1].y}]},e.prototype.getDefaultOffset=function(){var n=this.getArrowStyle(),o=typeof n.offset=="number"?n.offset:0;return o+5},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return r_(r_(r_({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){var n,o=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!o){var r=this.dbClickPosition,i=r.x,a=r.y;return{x:i,y:a}}var l=Kv(this.points),s=kk(ZZ(l),2),f=s[0],h=s[1];return{x:(f.x+h.x)/2,y:(f.y+h.y)/2}},e.prototype.getAfterAnchor=function(n,o,r){var i,a;return r.forEach(function(l){var s;n===ni.HORIZONTAL?s=Math.abs(o.y-l.y):n===ni.VERTICAL&&(s=Math.abs(o.x-l.x)),(!a||a>s)&&(a=s,i=l)}),i},e.prototype.getCrossPoint=function(n,o,r){var i;return n===ni.HORIZONTAL?i={x:r.x,y:o.y}:n===ni.VERTICAL&&(i={x:o.x,y:r.y}),i},e.prototype.removeCrossPoints=function(n,o,r){var i=r.map(function(M){return M});if(n===1){var a=i[n],l=i[o],s=i[n-1],f=hk(s,a,this.sourceNode);if(f){var h=vk(a,l,this.sourceNode);if(h){var v=mk(a,l,this.sourceNode);v&&(i[n]=v,i.splice(n-1,1),n--,o--)}}else{var b=this.sourceNode.anchors;b.forEach(function(M){if(M.x===s.x&&M.x===a.x||M.y===s.y&&M.y===a.y){var C=Xc(M.x,M.y,a.x,a.y),$=Xc(s.x,s.y,a.x,a.y);C<$&&(i[n-1]=M)}})}}if(o===r.length-2){var w=i[n],O=i[o],E=i[o+1],S=hk(O,E,this.targetNode);if(S){var h=vk(w,O,this.targetNode);if(h){var v=mk(w,O,this.targetNode);v&&(i[o]=v,i.splice(o+1,1))}}else{var b=this.targetNode.anchors;b.forEach(function(C){if(C.x===E.x&&C.x===O.x||C.y===E.y&&C.y===O.y){var $=Xc(C.x,C.y,O.x,O.y),D=Xc(E.x,E.y,O.x,O.y);$0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=pk({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=this.orthogonalizePath(n),this.points=this.pointsList.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o,this.updatePoints()},e.prototype.updatePointsList=function(n,o){this.pointsList.forEach(function(a){a.x+=n,a.y+=o});var r=this.pointsList[0];this.startPoint=Object.assign({},r);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,l=n.startIndex,s=n.endIndex,f=n.direction,h=this.pointsList,v=h;return f===ni.HORIZONTAL?(h[l]={x:i.x,y:i.y+o.y},h[s]={x:a.x,y:a.y+o.y},v=this.pointsList.map(function(b){return b})):f===ni.VERTICAL&&(h[l]={x:i.x+o.x,y:i.y},h[s]={x:a.x+o.x,y:a.y},v=this.pointsList.map(function(b){return b})),this.updatePointsAfterDrag(v),this.draggingPointList=v,!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[l]),end:Xo({},h[s]),startIndex:l,endIndex:s,direction:f}},e.prototype.dragAppend=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,l=n.startIndex,s=n.endIndex,f=n.direction,h=this.pointsList;if(f===ni.HORIZONTAL){h[l]={x:i.x,y:i.y+o.y},h[s]={x:a.x,y:a.y+o.y};var v=this.pointsList.map(function(S){return S});if(l!==0&&s!==this.pointsList.length-1&&(v=this.removeCrossPoints(l,s,v)),l===0){var b={x:i.x,y:i.y+o.y},w=ip(b,this.sourceNode);if(!w){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(s===this.pointsList.length-1){var E={x:a.x,y:a.y+o.y},w=ip(E,this.targetNode);if(!w){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",E,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}else if(f===ni.VERTICAL){h[l]={x:i.x+o.x,y:i.y},h[s]={x:a.x+o.x,y:a.y};var v=this.pointsList.map(function(M){return M});if(l!==0&&s!==this.pointsList.length-1&&(v=this.removeCrossPoints(l,s,v)),l===0){var b={x:i.x+o.x,y:i.y},w=ip(b,this.sourceNode);if(!w){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(s===this.pointsList.length-1){var E={x:a.x+o.x,y:a.y},w=ip(E,this.targetNode);if(!w){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",E,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}return!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[l]),end:Xo({},h[s]),startIndex:l,endIndex:s,direction:f}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=v3(Kv(this.points));this.pointsList=n.map(function(i){return i}),this.draggingPointList=[];var o=n[0];this.startPoint=Xo({},o);var r=n[n.length-1];this.endPoint=Xo({},r)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var o=this.updateCrossPoints(n);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode;this.pointsList=this.orthogonalizePath(pk({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0)),this.initPoints()},Ns([Ut],e.prototype,"offset",void 0),Ns([Ut],e.prototype,"dbClickPosition",void 0),Ns([Bt],e.prototype,"initPoints",null),Ns([Bt],e.prototype,"updatePoints",null),Ns([Bt],e.prototype,"updateStartPoint",null),Ns([Bt],e.prototype,"moveStartPoint",null),Ns([Bt],e.prototype,"updateEndPoint",null),Ns([Bt],e.prototype,"moveEndPoint",null),Ns([Bt],e.prototype,"updatePointsList",null),Ns([Bt],e.prototype,"dragAppendStart",null),Ns([Bt],e.prototype,"dragAppendSimple",null),Ns([Bt],e.prototype,"dragAppend",null),Ns([Bt],e.prototype,"dragAppendEnd",null),Ns([Bt],e.prototype,"updatePointsAfterDrag",null),Ns([Bt],e.prototype,"getAdjustStart",null),Ns([Bt],e.prototype,"getAdjustEnd",null),Ns([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(KE),is=function(){return is=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Rk=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lh=(function(){function t(e,n){var o;this.BaseType=da.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Zu.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=Wo.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=_o.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,o=n.x,r=o===void 0?0:o,i=n.y,a=i===void 0?0:i;this.transform=new Dw(-r,-a).rotate(e).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.formatText(e),Xo(this,dJ(e));var a=this.graphModel,l=a.overlapMode,s=a.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||I_()),s.on("overlap:change",function(f){var h=f.overlapMode;n.updateZIndexByOverlap(h,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,l=i.nodeTextEdit,s=e.x,f=e.y,h=e.text,v={value:"",x:s,y:f,draggable:a,editable:l};h&&(typeof h=="string"?v.value=h:(v=is(is({},v),{x:(n=h.x)!==null&&n!==void 0?n:s,y:(o=h.y)!==null&&o!==void 0?o:f,value:(r=h.value)!==null&&r!==void 0?r:""}),Xv(h.draggable)||(v.draggable=h.draggable),Xv(h.editable)||(v.editable=h.editable))),e.text=v},t.prototype.resize=function(e){var n=e.width,o=e.height,r=e.deltaX,i=e.deltaY,a=this.isAllowResizeNode(r,i,n,o);return a?(this.move(r/2,i/2),this.width=n,this.height=o,this.setProperties({width:n,height:o}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,o=e.y,r=e.value,i=this.properties;Ug(i)&&(i=Gc(i)),wl(i.width)&&(i.width=this.width),wl(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),[vs.INCREASE,vs.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),r&&(a.text={x:n,y:o,value:r}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return Gc(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return is(is({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,o=n===void 0?{}:n;return is(is({},to(e)),to(o))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return to(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return to(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return to(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return to(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return to(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return to(e)},t.prototype.isAllowConnectedAsSource=function(e,n,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,l="",s=0;s0?n.map(function(a,l){return a.length?(a=a,{id:"".concat(o,"_").concat(l),x:r+a[0],y:i+a[1]}):(a=a,is(is({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(l)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return lJ(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,o=n.x,r=n.y,i=n.rotate;return e.forEach(function(a){var l=a.x,s=a.y,f=hQ(new ib([l,s,1]).translate(-o,-r).rotate(i).translate(o,r)[0],2),h=f[0],v=f[1];a.x=h,a.y=v}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!wl(e))for(var n=0;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},$w=(function(t){vQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.CIRCLE_NODE,r.r=50,r.initNodeData(n),r.setAttributes(),r}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.circle,r=this.properties.style,i=r===void 0?{}:r;return o_(o_(o_({},n),to(o)),to(i))},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.r;return[{x:o,y:r-i,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+i,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.deltaX,i=n.deltaY;return this.move(r/2,i/2),this.r=o,this.setProperties({r:o}),this.getData()},oS([Ut],e.prototype,"r",void 0),oS([Ai],e.prototype,"width",null),oS([Ai],e.prototype,"height",null),e})(Lh),mQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},O0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},HA=(function(t){mQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.diamond,r=this.properties.style,i=r===void 0?{}:r;return i_(i_(i_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[[o,r-a],[o+i,r],[o,r+a],[o-i,r]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return ec(this.points,function(n){var o=O0(n,2),r=o[0],i=o[1];return{x:r,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,1),a=i[0];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,2),a=i[1];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return ec(this.points,function(o,r){var i=O0(o,2),a=i[0],l=i[1];return{x:a,y:l,id:"".concat(n.id,"_").concat(r)}})},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},og([Ut],e.prototype,"rx",void 0),og([Ut],e.prototype,"ry",void 0),og([Ai],e.prototype,"points",null),og([Ai],e.prototype,"pointsPosition",null),og([Ai],e.prototype,"width",null),og([Ai],e.prototype,"height",null),e})(Lh),gQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a_=function(){return a_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},XA=(function(t){gQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.ellipse,r=this.properties.style,i=r===void 0?{}:r;return a_(a_(a_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[{x:o,y:r-a,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},S0([Ut],e.prototype,"rx",void 0),S0([Ut],e.prototype,"ry",void 0),S0([Ai],e.prototype,"width",null),S0([Ai],e.prototype,"height",null),e})(Lh),yQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},M0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Uw=(function(t){yQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.points,r=n.width,i=n.height,a=o||this.points;this.points=rJ(a,r,i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.polygon,r=this.properties.style,i=r===void 0?{}:r;return s_(s_(s_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return this.points.map(function(l){return{x:l[0]+o-i/2,y:l[1]+r-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,1),a=i[0];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,2),a=i[1];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=this,r=o.x,i=o.y,a=o.width,l=o.height,s=o.points;return s.map(function(f,h){var v=M0(f,2),b=v[0],w=v[1];return{x:r+b-a/2,y:i+w-l/2,id:"".concat(n.id,"_").concat(h)}})},e.prototype.resize=function(n){var o=this,r=n.width,i=n.height,a=n.deltaX,l=n.deltaY;this.move(a/2,l/2);var s=ec(this.points,function(f){var h=M0(f,2),v=h[0],b=h[1];return[v*r/o.width,b*i/o.height]});return this.points=s,this.properties.points=s,this.getData()},A0([Ut],e.prototype,"points",void 0),A0([Ai],e.prototype,"pointsPosition",null),A0([Ai],e.prototype,"width",null),A0([Ai],e.prototype,"height",null),e})(Lh),_Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l_=function(){return l_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Hg=(function(t){_Q(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.RECT_NODE,r.radius=0,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height,i=n.radius,a=this.getNodeStyle().radius;wl(o)||(this.width=o),wl(r)||(this.height=r),wl(i)||(this.radius=i),wl(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.rect,r=this.properties.style,i=r===void 0?{}:r;return l_(l_(l_({},n),to(o)),to(i))},bQ([Ut],e.prototype,"radius",void 0),e})(Lh),wQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u_=function(){return u_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},EQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},xQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},SQ={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},T0=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],AQ=(function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=Zu.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Zu.TEXT,this.edgeTextMode=Zu.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Xo(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);Xo(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,o=e.textDraggable,r=e.textMode,i=e.textEdit,a=e.adjustEdgeStartAndEnd,l={};if(n===!1&&Xo(l,this.stagedConfig),n===!0&&n!==this.isSilentMode){var s=Vv(SQ,T0);this.stagedConfig=Vv(this,T0),Xo(l,s)}Xv(i)||Xo(l,{nodeTextEdit:i,edgeTextEdit:i}),Xv(o)||Xo(l,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Xo(l,{nodeTextMode:r,edgeTextMode:r}),mw(a)&&Xo(l,{adjustEdgeStart:a,adjustEdgeEnd:a});var f=Vv(e,T0);return Xo(l,f)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return Vv(this,T0)},Jo([Ut],t.prototype,"isSilentMode",void 0),Jo([Ut],t.prototype,"stopZoomGraph",void 0),Jo([Ut],t.prototype,"stopMoveGraph",void 0),Jo([Ut],t.prototype,"stopScrollGraph",void 0),Jo([Ut],t.prototype,"snapGrid",void 0),Jo([Ut],t.prototype,"textMode",void 0),Jo([Ut],t.prototype,"textEdit",void 0),Jo([Ut],t.prototype,"textDraggable",void 0),Jo([Ut],t.prototype,"nodeTextEdit",void 0),Jo([Ut],t.prototype,"nodeTextDraggable",void 0),Jo([Ut],t.prototype,"nodeTextMultiple",void 0),Jo([Ut],t.prototype,"nodeTextVertical",void 0),Jo([Ut],t.prototype,"nodeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextEdit",void 0),Jo([Ut],t.prototype,"edgeTextDraggable",void 0),Jo([Ut],t.prototype,"edgeTextMultiple",void 0),Jo([Ut],t.prototype,"edgeTextVertical",void 0),Jo([Ut],t.prototype,"hideAnchors",void 0),Jo([Ut],t.prototype,"allowRotate",void 0),Jo([Ut],t.prototype,"allowResize",void 0),Jo([Ut],t.prototype,"hoverOutline",void 0),Jo([Ut],t.prototype,"nodeSelectedOutline",void 0),Jo([Ut],t.prototype,"adjustNodePosition",void 0),Jo([Ut],t.prototype,"autoExpand",void 0),Jo([Ut],t.prototype,"adjustEdge",void 0),Jo([Ut],t.prototype,"adjustEdgeMiddle",void 0),Jo([Ut],t.prototype,"adjustEdgeStartAndEnd",void 0),Jo([Ut],t.prototype,"adjustEdgeStart",void 0),Jo([Ut],t.prototype,"adjustEdgeEnd",void 0),Jo([Ut],t.prototype,"edgeSelectedOutline",void 0),Jo([Bt],t.prototype,"updateEditConfig",null),Jo([Bt],t.prototype,"updateTextMode",null),t})(),MQ="*",TQ=(function(){function t(){this._events={}}return t.prototype.on=function(e,n,o){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:n,once:!!o})})},t.prototype.once=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){r=r.trim(),o.on(r,n,!0)})},t.prototype.emit=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[MQ]||[],l=function(s){for(var f=s.length,h=0;h=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},PQ=(function(t){CQ(e,t);function e(n){var o=t.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(l){var s=l.deltaX,f=l.deltaY;o.setState({isDragging:!0});var h=o.props.graphModel,v=h.transformModel,b=h.editConfigModel;b.stopMoveGraph!==!0&&v.translate(s,f)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(l){var s=o.props,f=s.graphModel,h=f.editConfigModel,v=f.transformModel,b=f.gridSize,w=s.graphModel,O=l.deltaX,E=l.deltaY,S=h.stopScrollGraph,M=h.stopZoomGraph;if(!S&&!l.ctrlKey&&!l.metaKey){if(l.preventDefault(),o.stepScrollX+=O,o.stepScrollY+=E,Math.abs(o.stepScrollX)>=b){var C=o.stepScrollX%b,$=o.stepScrollX-C;v.translate(-$*v.SCALE_X,0),o.stepScrollX=C}if(Math.abs(o.stepScrollY)>=b){var D=o.stepScrollY%b,k=o.stepScrollY-D;v.translate(0,-k*v.SCALE_Y),o.stepScrollY=D}return}if(!M){l.preventDefault();var B=w.getPointByClient({x:l.clientX,y:l.clientY}),F=B.canvasOverlayPosition,I=F.x,V=F.y;v.zoom(l.deltaY<0,[I,V])}},o.clickHandler=function(l){var s=l.target;if(s.getAttribute("name")==="canvas-overlay"){var f=o.props.graphModel,h=f.selectElements;if(h.size>0&&f.clearSelectElements(),o.state.isDragging)return;f.eventCenter.emit(pr.BLANK_CLICK,{e:l})}},o.handleContextMenu=function(l){var s=l.target;if(s.getAttribute("name")==="canvas-overlay"){l.preventDefault();var f=o.props.graphModel,h=f.getPointByClient({x:l.clientX,y:l.clientY});f.eventCenter.emit(pr.BLANK_CONTEXTMENU,{e:l,position:h})}},o.mouseDownHandler=function(l){var s=o.props.graphModel,f=s.eventCenter,h=s.editConfigModel,v=s.transformModel.SCALE_X,b=s.gridSize,w=h.adjustEdge,O=h.adjustNodePosition,E=h.stopMoveGraph,S=l.target,M=!w&&!O;(S.getAttribute("name")==="canvas-overlay"||M)&&(E!==!0?(o.stepDrag.setStep(b*v),o.stepDrag.handleMouseDown(l)):f.emit(pr.BLANK_MOUSEDOWN,{e:l}),o.clickHandler(l))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new oc({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),o.state={isDragging:!1},o}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props,i=r.children,a=r.dnd,l=this.state.isDragging;return $t("svg",qA({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:l?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:$t("g",{transform:o,children:i})}))},e=NQ([xl],e),e})(Po),M3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),B_=function(){return B_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lk=(function(t){M3(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,l=i.bezierModel,s=i.type,f=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,h=f.x,v=f.y;l.updateAdjustAnchor({x:h,y:v},s),a.eventCenter.emit(pr.EDGE_ADJUST,{data:l.getData()})},n.onDragEnd=function(){var o=n.props.bezierModel;o.isDragging=!1},n.dragHandler=new oc({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,o=this.props.position,r=o.x,i=o.y,a=this.props.bezierModel,l=a.getEdgeStyle().adjustAnchor;return $t(zg,B_({className:"lf-bezier-adjust-anchor",x:r,y:i},l,{onMouseDown:function(s){n.dragHandler.handleMouseDown(s)}}))},e})(Po),DQ=(function(t){M3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,o){var r=n.path,i=n.id,a=CM(r),l=RQ(a,4),s=l[0],f=l[1],h=l[2],v=l[3],b=n.getEdgeStyle().adjustLine,w=[];return w.push($t(Gg,B_({x1:s.x,y1:s.y,x2:f.x,y2:f.y},b))),w.push($t(Lk,{position:f,bezierModel:n,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),w.push($t(Gg,B_({x1:v.x,y1:v.y,x2:h.x,y2:h.y},b))),w.push($t(Lk,{position:h,bezierModel:n,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),w},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,o=n.edges,r=[],i=0;i=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},IQ=(function(t){jQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return $t("div",{className:"lf-background",children:$t("div",{style:sp(n)?n:{},className:"lf-background-area"})})},e=LQ([xl],e),e})(Po),FQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),BQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Sg=(function(t){FQ(e,t);function e(n){var o=t.call(this,n)||this;return o.id=wh(),o.gridOptions=o.props.graphModel.grid,o}return e.prototype.renderDot=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,l=o??{},s=l.color,f=l.thickness,h=f===void 0?2:f,v=Math.min(Math.max(2,h),i/4),b=a?1:0;return $t("g",{fill:s,opacity:b,children:[$t("circle",{cx:0,cy:0,r:v/2}),$t("circle",{cx:0,cy:i,r:v/2}),$t("circle",{cx:i,cy:0,r:v/2}),$t("circle",{cx:i,cy:i,r:v/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,l=o??{},s=l.color,f=l.thickness,h=f===void 0?1:f,v=Math.min(Math.max(1,h),i/2),b="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),w=a?1:0;return $t("path",{d:b,stroke:s,strokeWidth:v/2,opacity:w,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,o=n.transformModel,r=n.grid;this.gridOptions=r;var i=this.gridOptions,a=i.type,l=i.size,s=l===void 0?1:l,f=o.SCALE_X,h=o.SKEW_Y,v=o.SKEW_X,b=o.SCALE_Y,w=o.TRANSLATE_X,O=o.TRANSLATE_Y,E=[f,h,v,b,w,O].join(","),S="matrix(".concat(E,")");return $t("div",{className:"lf-grid",children:$t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:S,x:"0",y:"0",width:s,height:s,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),$t("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=BQ([xl],e),e})(Po);(function(t){t.defaultProps={size:DZ,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var o=to(t.defaultProps);return typeof n=="number"?Xo(o,{size:n}):typeof n=="boolean"?Xo(o,{visible:n}):Xo(o,n)}t.getGridOptions=e})(Sg||(Sg={}));var $Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),UQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},VQ=(function(t){$Q(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props.children;return $t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:$t("g",{transform:o,children:r})})},e=UQ([xl],e),e})(Po),WQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),dh=function(){return dh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},zQ=(function(t){WQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,o=n.nodes,r=n.editConfigModel,i=r.hoverOutline,a=r.nodeSelectedOutline,l=[];return o.forEach(function(s){if(s.isHovered||s.isSelected){var f=s.isHovered,h=s.isSelected,v=s.x,b=s.y,w=s.width,O=s.height;if(a&&h||i&&f){var E=s.getOutlineStyle()||{},S={};if(Object.keys(E).forEach(function(C){C!=="hover"&&(S[C]=E[C])}),f){var M=E.hover;S=dh(dh({},S),M)}l.push($t(Yu,dh({transform:s.transform,className:"lf-outline-node",x:v,y:b,width:w+10,height:O+10},S)))}}}),l},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,o=n.edges,r=n.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,l=[],s=0;s=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},YQ=(function(t){HQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,o=n??{},r=o.position,i=o.isShowHorizontal,a=o.isShowVertical,l=n==null?void 0:n.getStyle(),s=r??{},f=s.x,h=f===void 0?0:f,v=s.y,b=v===void 0?0:v,w=fh(fh({x1:-1e5,y1:b,x2:1e5,y2:b},l),{stroke:i?l==null?void 0:l.stroke:"none"}),O=fh(fh({x1:h,y1:-1e5,x2:h,y2:1e5},l),{stroke:a?l==null?void 0:l.stroke:"none"});return $t("g",{className:"lf-snapline",children:[$t(Gg,fh({},w)),$t(Gg,fh({},O))]})},e=XQ([xl],e),e})(Po),qQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ZQ=(function(t){qQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,o=n.tool,r=n.graphModel,i=r.textEditElement,a=o.getTools(),l=a.map(function(s){return Lr(s,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=l,l},e.prototype.triggerToolRender=function(){var n=this.props,o=n.tool,r=n.graphModel,i=document.querySelector("#ToolOverlay_".concat(r.flowId)),a=o.getInstance();a.components.forEach(function(l){return l(a,i)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return $t("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=KQ([xl],e),e})(Po),Fc=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ig=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},JQ={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},QQ=(function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var o=n.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,o){var r=ig(e,2),i=r[0],a=r[1];return[i+n/this.SCALE_X,a+o/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof e=="number"?(o=e,r=e):e?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),othis.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(o-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*n[1]),this.SCALE_X=o,this.SCALE_Y=r,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(pr.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,o,r){var i=ig(this.CanvasPointToHtmlPoint([e,n]),2),a=i[0],l=i[1],s=ig([o/2-a,r/2-l],2),f=s[0],h=s[1];this.TRANSLATE_X+=f,this.TRANSLATE_Y+=h,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=ig(Array.isArray(e)&&e.length===4?e:JQ[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},Fc([Ut],t.prototype,"SCALE_X",void 0),Fc([Ut],t.prototype,"SKEW_Y",void 0),Fc([Ut],t.prototype,"SKEW_X",void 0),Fc([Ut],t.prototype,"SCALE_Y",void 0),Fc([Ut],t.prototype,"TRANSLATE_X",void 0),Fc([Ut],t.prototype,"TRANSLATE_Y",void 0),Fc([Ut],t.prototype,"ZOOM_SIZE",void 0),Fc([Bt],t.prototype,"zoom",null),Fc([Bt],t.prototype,"resetZoom",null),Fc([Bt],t.prototype,"translate",null),Fc([Bt],t.prototype,"focusOn",null),t})(),eee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),iS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tee=(function(t){eee(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.parentTransform=o.parentTransform,r}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale();n*=r.scaleX,o*=r.scaleY}else n*=this.parentTransform.SCALE_X,o*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:o}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;n=i*n,o=a*o}return{translateX:n,translateY:o}},e.prototype.HtmlPointToCanvasPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),l=a.scaleX,s=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[(r-h)/l,(i-v)/s]},e.prototype.CanvasPointToHtmlPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),l=a.scaleX,s=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[r*l+h,i*s+v]},e.prototype.moveCanvasPointByHtml=function(n,o,r){var i=iS(n,2),a=i[0],l=i[1],s=this.getCumulativeScale(),f=s.scaleX,h=s.scaleY;return[a+o/f,l+r/h]},e.prototype.fixDeltaXY=function(n,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[n/i,o/a]},e})(QQ),qs=function(){return qs=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},nee=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},os=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hu=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},oee=(function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Bv({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var o=e.x,r=e.y,i=!1,a=!1,l=0;l=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},see=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},lee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fee=(function(t){cee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(o){var r=o.event,i=n.props,a=i.anchorData,l=i.nodeModel,s=i.graphModel;s.selectNodeById(l.id),l.autoToFront&&s.toFront(l.id),s.eventCenter.emit(pr.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:l}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,l=i.nodeModel,s=i.anchorData,f=a.transformModel,h=a.eventCenter,v=a.width,b=a.height,w=a.editConfigModel,O=w.autoExpand,E=w.stopMoveGraph;if(r){var S=r.clientX,M=r.clientY,C=a.getPointByClient({x:S,y:M}),$=C.domOverlayPosition,D=$.x,k=$.y,B=C.canvasOverlayPosition,F=B.x,I=B.y;n.t&&Fw(n.t);var V=[],z=10;D<10?V=[z,0]:D+10>v?V=[-z,0]:k<10?V=[0,z]:k+10>b&&(V=[0,-z]),n.setState({endX:F,endY:I,dragging:!0}),n.moveAnchorEnd(F,I),V.length>0&&!E&&O&&(n.t=w3(function(){var X=dee(V,2),Y=X[0],W=X[1];f.translate(Y,W);var Q=n.state,J=Q.endX,ie=Q.endY;n.setState({endX:J-Y,endY:ie-W}),n.moveAnchorEnd(J-Y,ie-W)})),h.emit(pr.ANCHOR_DRAG,{data:s,e:r,nodeModel:l})}},n.onDragEnd=function(o){var r=o.event;n.t&&Fw(n.t);var i=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,l=a.graphModel,s=a.nodeModel,f=a.anchorData;l.eventCenter.emit(pr.ANCHOR_DRAGEND,{data:f,e:r,nodeModel:s,edgeModel:i??void 0})},n.checkEnd=function(o){var r,i=n.props,a=i.graphModel,l=i.nodeModel,s=i.anchorData,f=s.x,h=s.y,v=s.id,b=n.state,w=b.endX,O=b.endY,E=b.dragging,S=Lw({x:w,y:O},a);if(n.preTargetNode&&n.preTargetNode.state!==Wo.DEFAULT&&n.preTargetNode.setElementState(Wo.DEFAULT),!!E&&S&&S.node){var M=S.node,C=S.anchor.id,$="".concat(l.id,"_").concat(M.id,"_").concat(C,"_").concat(v),D=n.sourceRuleResults.get($)||{},k=D.isAllPass,B=D.msg,F=n.targetRuleResults.get($)||{},I=F.isAllPass,V=F.msg;if(k&&I){M.setElementState(Wo.DEFAULT);var z=a.getNodeModelById(S.node.id),X=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,l.getData(),z==null?void 0:z.getData()),Y=a.addEdge(Fd(Fd({},X),{sourceNodeId:l.id,sourceAnchorId:v,startPoint:{x:f,y:h},targetNodeId:S.node.id,targetAnchorId:S.anchor.id,endPoint:{x:S.anchor.x,y:S.anchor.y}})),W=n.props.anchorData;return a.eventCenter.emit(pr.ANCHOR_DROP,{data:W,e:o,nodeModel:l,edgeModel:Y}),Y}var Q=M.getData();return a.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Q,msg:V||B||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new oc({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,o=n.anchorData,r=n.style,i=n.node,a=i.getAnchorShape(o);if(a)return a;var l=o.x,s=o.y,f=Fd(Fd({},r),r==null?void 0:r.hover);return $t("g",{children:[$t(zg,Fd({className:"lf-node-anchor-hover"},f,{x:l,y:s})),$t(zg,Fd({className:"lf-node-anchor"},r,{x:l,y:s}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,o=n.graphModel,r=o.getAnchorIncomingEdge,i=o.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:r(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,o){var r,i,a=this.props,l=a.graphModel,s=a.nodeModel,f=a.anchorData,h=Lw({x:n,y:o},l);if(h){var v=h.node,b=h.anchor.id;if(this.preTargetNode&&this.preTargetNode!==h.node&&this.preTargetNode.setElementState(Wo.DEFAULT),f.id===b)return;this.preTargetNode=v;var w="".concat(s.id,"_").concat(v.id,"_").concat(b,"_").concat(f.id);if(!this.targetRuleResults.has(w)){var O=h.anchor,E=s.isAllowConnectedAsSource(v,f,O),S=v.isAllowConnectedAsTarget(s,f,O);this.sourceRuleResults.set(w,Iw(E)),this.targetRuleResults.set(w,Iw(S))}var M=((r=this.sourceRuleResults.get(w))!==null&&r!==void 0?r:{}).isAllPass,C=((i=this.targetRuleResults.get(w))!==null&&i!==void 0?i:{}).isAllPass;M&&C?v.setElementState(Wo.ALLOW_CONNECT):v.setElementState(Wo.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Wo.DEFAULT&&this.preTargetNode.setElementState(Wo.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,o=n.startX,r=n.startY,i=n.endX,a=n.endY,l=Xc(o,r,i,a);return l>10},e.prototype.render=function(){var n=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,l=o.endY,s=this.props,f=s.anchorData,h=s.edgeStyle,v=s.nodeModel,b=s.graphModel,w=f.edgeAddable;return $t("g",{className:"lf-anchor",children:[$t("g",{onClick:function(O){O.stopPropagation(),b.eventCenter.emit(pr.ANCHOR_CLICK,{data:f,e:O,nodeModel:v})},onMouseDown:function(O){b.eventCenter.emit(pr.ANCHOR_MOUSEDOWN,{data:f,e:O,nodeModel:v}),w!==!1&&n.dragHandler.handleMouseDown(O)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Fd({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:l}},h)):$t(Gg,Fd({x1:r,y1:i,x2:a,y2:l},h,{"pointer-events":"none"})))]})},e})(Po),pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KA=function(){return KA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},T3=(function(t){gee(e,t);function e(n){var o=t.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,l=a.draggable,s=a.model,f=a.graphModel,h=f.editConfigModel.nodeTextDraggable;(l??h)&&(i.stopPropagation(),o.stepperDrag.model=s,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,l=i.deltaY,s=o.props,f=s.model,h=s.graphModel.transformModel;if(a||l){var v=yee(h.fixDeltaXY(a,l),2),b=v[0],w=v[1];f.moveText(b,w)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,l=i.graphModel.eventCenter,s=i.model;a&&s.setElementState(Wo.TEXT_EDIT),l.emit(pr.TEXT_DBCLICK,{data:s.text,model:s})};var r=n.draggable;return o.stepperDrag=new oc({onDragging:o.onDragging,step:1,eventType:"TEXT",isStopPropagation:r}),o}return e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=o.text,l=a.value,s=a.x,f=a.y,h=a.editable,v=a.draggable,b={x:s,y:f,className:"",value:l},w=o.getTextStyle(),O=i.nodeTextDraggable||v;return $t(E3,JA({},b,w,{className:ZA({"lf-element-text":h,"lf-text-draggable":!h&&O,"lf-text-disabled":!h&&!O}),model:o}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return $t("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e})(Po),_ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uc=function(){return Uc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},bee=(function(t){_ee(e,t);function e(n){var o=t.call(this,n)||this;return o.setHoverOn=function(){o.setState({isHovered:!0})},o.setHoverOff=function(){o.setState({isHovered:!1})},o.state={isHovered:!1},o}return e.prototype.getBackground=function(){var n=this.state.isHovered,o=this.props.model,r=o.text,i=o.getTextStyle(),a=i.background||{};if(n&&i.hover&&i.hover.background&&(a=Uc(Uc({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var l=i.fontSize,s=i.textWidth,f=i.lineHeight,h=i.overflowMode,v=a.wrapPadding,b=r==null?void 0:r.value.split(/[\r\n]/g),w=b.length,O=r.x,E=r.y,S={};if(h==="autoWrap"&&s){var M=b3({rows:b,style:{fontSize:"".concat(l,"px"),width:"".concat(s,"px"),lineHeight:f,padding:v},rowsLength:w,className:"lf-get-text-height"});S=Uc(Uc({},a),{x:O,y:E,width:s,height:M})}else{var C=nJ({rows:b,rowsLength:w,fontSize:l}),$=C.width,D=C.height;if(h==="ellipsis"&&($=s,D=l+2),typeof a.wrapPadding=="string"){var k=a.wrapPadding.split(",").filter(function(ke){return ke.trim()}).map(function(ke){return parseFloat(ke.trim())});if(k.length>0&&k.length<=4){if(k.length===1){var B=C0(k,1),F=B[0];k=[F,F,F,F]}else if(k.length===2){var I=C0(k,2),V=I[0],z=I[1];k=[V,z,V,z]}else if(k.length===3){var X=C0(k,3),Y=X[0],z=X[1],W=X[2];k=[Y,z,W,z]}var Q=C0(k,4),J=Q[0],ie=Q[1],Se=Q[2],Ae=Q[3];$+=ie+Ae,D+=J+Se,O=O+(ie-Ae)/2,E=E+(Se-J)/2}}S=Uc(Uc({},a),{x:O-1,y:E-1,width:$,height:D})}return $t(Yu,Uc({},S))}return null},e.prototype.getShape=function(){var n=this.props.model,o=n.text,r=o.x,i=o.y,a=o.value;if(!a)return null;var l=n.getTextStyle(),s=Uc({x:r,y:i,value:a,model:n,className:"lf-element-text"},l);return $t("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$t(E3,Uc({},s))]})},e})(T3),wee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Vw=function(){return Vw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ih=(function(t){wee(e,t);function e(n){var o=t.call(this)||this;o.onDragStart=function(s){var f=s.event,h=o.props,v=h.model,b=h.graphModel;if(f){var w=b.getPointByClient({x:f.clientX,y:f.clientY}).canvasOverlayPosition,O=w.x,E=w.y;o.moveOffset={dx:v.x-O,dy:v.y-E}}},o.onDragging=function(s){var f,h,v,b,w=s.event,O=o.props,E=O.model,S=O.graphModel,M=S.editConfigModel,C=M.stopMoveGraph,$=M.autoExpand,D=M.snapGrid,k=S.transformModel,B=S.selectNodes,F=S.width,I=S.height,V=S.gridSize;E.isDragging=!0;var z=w,X=z.clientX,Y=z.clientY,W=o.mouseDownPosition,Q=W.x,J=W.y;(X-Q>V||Y-J>V)&&(E.isDragging=!0);var ie=S.getPointByClient({x:X,y:Y}).canvasOverlayPosition,Se=ie.x,Ae=ie.y,ke=N0(k.CanvasPointToHtmlPoint([Se,Ae]),2),De=ke[0],ze=ke[1];if(Se=Se+((h=(f=o.moveOffset)===null||f===void 0?void 0:f.dx)!==null&&h!==void 0?h:0),Ae=Ae+((b=(v=o.moveOffset)===null||v===void 0?void 0:v.dy)!==null&&b!==void 0?b:0),Se=Wg(Se,V,D),Ae=Wg(Ae,V,D),!F||!I){S.moveNode2Coordinate(E.id,Se,Ae);return}var Ye=De<0||ze<0||De>F||ze>I;if(!($&&!C&&Ye)){var Be=N0(k.CanvasPointToHtmlPoint([Se-E.width/2,Ae-E.height/2]),2),Je=Be[0],gt=Be[1],se=N0(k.CanvasPointToHtmlPoint([Se+E.width/2,Ae+E.height/2]),2),Ze=se[0],pe=se[1],le=Math.max(V,20),we=[];Je<0?we=[le,0]:Ze>S.width?we=[-le,0]:gt<0?we=[0,le]:pe>S.height&&(we=[0,-le]),o.t&&Fw(o.t);var $e=B.map(function(rt){return rt.id});$e.indexOf(E.id)===-1&&($e=[E.id]),we.length>0&&!C&&$?o.t=w3(function(){var rt=N0(we,2),pt=rt[0],Lt=rt[1];k.translate(pt??0,Lt??0);var Jt=-(pt??0)/k.SCALE_X,en=-(Lt??0)/k.SCALE_X;S.moveNodes($e,Jt,en)}):S.moveNodes($e,Se-E.x,Ae-E.y)}},o.onDragEnd=function(){o.t&&Fw(o.t);var s=o.props.model;s.isDragging=!1},o.onMouseOut=function(s){kZ()&&o.setHoverOff(s)},o.handleMouseUp=function(){var s=o.props.model;o.mouseUpDrag=s.isDragging},o.handleClick=function(s){var f=o.mouseUpDrag===!1,h=new Date().getTime();if(o.startTime){var v=h-o.startTime,b=o.props,w=b.model,O=b.graphModel;if(!(!f&&v>300)){f||(o.onDragEnd(),o.handleMouseUp());var E=w.getData(),S=O.getPointByClient({x:s.clientX,y:s.clientY}),M={data:E,e:s,position:S,isSelected:!1,isMultiple:!1},C=s.button===2,$=s.detail===2;if(!C){var D=O.editConfigModel,k=y3(s,D);if(M.isMultiple=k,w.isSelected&&!$&&k?(M.isSelected=!1,w.setSelected(!1)):(O.selectNodeById(w.id,k),M.isSelected=!0,D.isSilentMode||o.toFront()),$)D.nodeTextEdit&&w.text.editable&&D.textMode===Zu.TEXT&&(w.setSelected(!1),O.setElementStateById(w.id,Wo.TEXT_EDIT)),O.eventCenter.emit(pr.NODE_DBCLICK,M);else{O.eventCenter.emit(pr.ELEMENT_CLICK,M),O.eventCenter.emit(pr.NODE_CLICK,M);var B=s.currentTarget,F=!wl(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(I){return setTimeout(I,0)};F(function(){B.focus()})}}}}},o.handleContextMenu=function(s){s.preventDefault();var f=o.props,h=f.model,v=f.graphModel,b=v.editConfigModel,w=h.getData(),O=v.getPointByClient({x:s.clientX,y:s.clientY});v.setElementStateById(h.id,Wo.SHOW_MENU,O.domOverlayPosition),h.isSelected||v.selectNodeById(h.id),v.eventCenter.emit(pr.NODE_CONTEXTMENU,{data:w,e:s,position:O}),b.isSilentMode||o.toFront()},o.handleMouseDown=function(s){var f=o.props,h=f.model,v=f.graphModel;o.mouseDownPosition={x:s.clientX,y:s.clientY},o.startTime=new Date().getTime();var b=v.editConfigModel;b.adjustNodePosition&&h.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(s)},o.handleFocus=function(){var s=o.props,f=s.model,h=s.graphModel;h.eventCenter.emit(pr.NODE_FOCUS,{data:f.getData()})},o.handleBlur=function(){if(o.props){var s=o.props,f=s.model,h=s.graphModel;h.eventCenter.emit(pr.NODE_BLUR,{data:f.getData()})}},o.setHoverOn=function(s){var f=o.props,h=f.model,v=f.graphModel;if(!h.isHovered){var b=h.getData();h.setHovered(!0),v.eventCenter.emit(pr.NODE_MOUSEENTER,{data:b,e:s})}},o.setHoverOff=function(s){var f=o.props,h=f.model,v=f.graphModel,b=h.getData();h.isHovered&&(h.setHovered(!1),v.eventCenter.emit(pr.NODE_MOUSELEAVE,{data:b,e:s}))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter,l=n.model;return o.stepDrag=new oc({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:l}),o.modelDisposer=HI(function(){return o.props},function(s){s&&s.model&&o.stepDrag.setModel(s.model)}),o}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.isSelected,l=r.isHitable,s=r.isDragging,f=r.isShowAnchor;return l&&(a||f)&&!s?ec(r.anchors,function(h,v){var b=r.getAnchorLineStyle(h),w=r.getAnchorStyle(h);return $t(fee,{anchorData:h,node:n,style:w,edgeStyle:b,anchorIndex:v,nodeModel:r,graphModel:i,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,l=i.allowRotate,s=o.isSelected,f=o.isHitable,h=o.rotatable,v=o.isHovered,b=l&&h,w=o.getRotateControlStyle();if(!a&&f&&(s||v)&&b)return $t(hee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:w})},e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,l=i.allowResize,s=o.isSelected,f=o.isHitable,h=o.resizable,v=o.isHovered,b=l&&h,w=o.getResizeControlStyle();return!a&&f&&(s||v)&&b?$t(kJ,{style:w,model:o,graphModel:r}):null},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==Zu.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var l=!1;return a.nodeTextDraggable&&r.text.draggable&&(l=!0),$t(T3,{editable:a.nodeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:l})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,o=n.state,r=n.isDragging,i=n.isSelected,a="lf-node";switch(o){case Wo.ALLOW_CONNECT:a+=" lf-node-allow";break;case Wo.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,o=n.model,r=n.graphModel;o.autoToFront&&r.toFront(o.id)},e.prototype.render=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.hideAnchors,l=i.adjustNodePosition,s=i.allowRotate,f=i.allowResize,h=r.gridSize,v=r.transformModel.SCALE_X,b=o.isHitable,w=o.draggable,O=o.transform,E=o.getOuterGAttributes(),S=E.className,M=S===void 0?"":S,C=Eee(E,["className"]),$=$t("g",{className:"lf-node-content",children:[$t("g",{transform:O,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),f&&this.getResizeControl()]}),!a&&this.getAnchors()]}),D;return b?(l&&w&&this.stepDrag.setStep(h*v),D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},C,{children:$}))):D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M)},C,{children:$})),D},e.isObserved=!1,e})(Po),xee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),QA=function(){return QA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Pee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$d;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})($d||($d={}));var Bk=(function(t){kee(e,t);function e(n){var o=t.call(this)||this;o.handleMouseDown=function(s){o.stepDrag&&o.stepDrag.handleMouseDown(s)},o.onDragStart=function(){var s=o.props,f=s.x,h=s.y,v=s.edgeModel,b=v.startPoint,w=v.endPoint,O=v.pointsList;o.oldEdge={startPoint:b,endPoint:w,pointsList:O},o.setState({endX:f,endY:h,dragging:!0})},o.onDragging=function(s){var f=s.deltaX,h=s.deltaY,v=o.state,b=v.endX,w=v.endY,O=o.props,E=O.graphModel,S=O.type,M=E.transformModel,C=E.editConfigModel,$=Dee(M.moveCanvasPointByHtml([b,w],f,h),2),D=$[0],k=$[1];o.setState({endX:D,endY:k,dragging:!0});var B=o.props.edgeModel,F=Lw({x:b,y:w},E);if(F&&F.node&&o.isAllowAdjust(F).pass){var I=B.startPoint,V=B.endPoint,z=B.sourceNode,X=B.targetNode,Y=S===$d.SOURCE?{startPoint:{x:F.anchor.x,y:F.anchor.y},endPoint:{x:V.x,y:V.y},sourceNode:F.node,targetNode:X}:{startPoint:{x:I.x,y:I.y},endPoint:{x:F.anchor.x,y:F.anchor.y},sourceNode:z,targetNode:F.node};B.updateAfterAdjustStartAndEnd(Y)}else S===$d.SOURCE?B.updateStartPoint({x:D,y:k}):B.updateEndPoint({x:D,y:k});B.text.value&&C.adjustEdge&&B.setText(Object.assign({},B.text,B.textPosition))},o.onDragEnd=function(s){var f,h,v,b=s.event;try{o.setState({dragging:!1});var w=o.props,O=w.graphModel,E=w.edgeModel,S=w.type,M=o.state,C=M.endX,$=M.endY,D=M.dragging,k=Lw({x:C,y:$},O);if(!D)return;var B=!1,F=void 0;if(k&&k.node){var I=o.isAllowAdjust(k),V=I.pass,z=I.msg,X=I.newTargetNode;if(V){var Y=E.getData(),W=Y.text,Q=Y.sourceAnchorId,J=Q===void 0?"":Q,ie=Y.targetAnchorId,Se=ie===void 0?"":ie,Ae=Ree(Y,["text","sourceAnchorId","targetAnchorId"]);if(F=Vc(Vc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(W==null?void 0:W.value)||""}),S===$d.SOURCE){var ke=O.getNodeModelById(k.node.id),De=O.getNodeModelById(E.targetNodeId),ze=(f=O.edgeGenerator)===null||f===void 0?void 0:f.call(O,ke==null?void 0:ke.getData(),De==null?void 0:De.getData(),F);F=Vc(Vc({},ze),{sourceNodeId:k.node.id,sourceAnchorId:k.anchor.id,startPoint:{x:k.anchor.x,y:k.anchor.y},targetNodeId:E.targetNodeId,endPoint:Vc({},E.endPoint)}),E.sourceNodeId===k.node.id&&E.sourceAnchorId===k.anchor.id&&(B=!0)}else if(S===$d.TARGET){var ke=O.getNodeModelById(E.sourceNodeId),De=O.getNodeModelById(k.node.id),ze=(h=O.edgeGenerator)===null||h===void 0?void 0:h.call(O,ke==null?void 0:ke.getData(),De==null?void 0:De.getData(),F);F=Vc(Vc({},ze),{sourceNodeId:E.sourceNodeId,startPoint:Vc({},E.startPoint),targetNodeId:k.node.id,targetAnchorId:k.anchor.id,endPoint:{x:k.anchor.x,y:k.anchor.y}}),E.targetNodeId===k.node.id&&E.targetAnchorId===k.anchor.id&&(B=!0)}}else{B=!0;var Ye=X.getData();O.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Ye,msg:z})}}else B=!0;if(B)o.recoveryEdge();else{var Be=E.getData();O.deleteEdgeById(E.id);var Je=O.addEdge(Vc({},F));O.eventCenter.emit(pr.EDGE_EXCHANGE_NODE,{data:{newEdge:Je.getData(),oldEdge:Be}})}(v=o.preTargetNode)===null||v===void 0||v.setElementState(Wo.DEFAULT)}finally{var O=o.props.graphModel;O.eventCenter.emit(pr.ADJUST_POINT_DRAGEND,{e:b,data:o.stepDragData})}},o.recoveryEdge=function(){var s=o.props.edgeModel,f=o.oldEdge,h=f.startPoint,v=f.endPoint,b=f.pointsList;s.updateStartPoint(h),s.updateEndPoint(v),s.modelType!==_o.LINE_EDGE&&(s.pointsList=b??[],s.initPoints())},o.getAdjustPointStyle=function(){var s=o.props.graphModel.theme,f=s.edgeAdjust;return f},o.state={dragging:!1,endX:0,endY:0},o.targetRuleResults=new Map,o.sourceRuleResults=new Map;var r=n.type,i=n.edgeModel,a=n.graphModel,l=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new oc({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:l,data:o.stepDragData}),o}return e.prototype.isAllowAdjust=function(n){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,l=r.targetNode,s=r.sourceAnchorId,f=r.targetAnchorId,h=o.type,v,b,w,O;if(h===$d.SOURCE?(v=n.node,b=l,w=n.anchor,O=l.getAnchorInfo(f)):(v=a,b=n.node,O=n.anchor,w=a.getAnchorInfo(s)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(Wo.DEFAULT),this.preTargetNode=n.node,O.id===w.id)return{pass:!1,msg:"",newTargetNode:b};var E="".concat(v.id,"_").concat(b.id,"_").concat(w.id,"_").concat(O.id);if(!this.targetRuleResults.has(E)){var S=v.isAllowConnectedAsSource(b,w,O,i),M=b.isAllowConnectedAsTarget(v,w,O,i);this.sourceRuleResults.set(E,Iw(S)),this.targetRuleResults.set(E,Iw(M))}var C=this.sourceRuleResults.get(E),$=C.isAllPass,D=C.msg,k=this.targetRuleResults.get(E),B=k.isAllPass,F=k.msg,I=$&&B?Wo.ALLOW_CONNECT:Wo.NOT_ALLOW_CONNECT;return h===$d.SOURCE?v.setElementState(I):b.setElementState(I),{pass:$&&B,msg:F||D,newTargetNode:b}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.getAdjustPointShape,a=n.edgeModel,l=this.state.dragging;return $t("g",{pointerEvents:l?"none":"",onMouseDown:this.handleMouseDown,children:l?"":i(o,r,a)})},e})(Po),jee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s2=function(){return s2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ZE=(function(t){Lee(e,t);function e(){var n=t.call(this)||this;return n.textRef=WE(),n.handleHover=function(o,r){var i=n.props,a=i.model,l=i.graphModel.eventCenter;a.setHovered(o);var s=o?pr.EDGE_MOUSEENTER:pr.EDGE_MOUSELEAVE,f=a.getData();l.emit(s,{data:f,e:r})},n.setHoverOn=function(o){var r=n.props.model.isHovered;r||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,o))},n.setHoverOff=function(o){var r=n.props.model.isHovered;r&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,o))},n.handleContextMenu=function(o){o.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,i=r.model,a=r.graphModel,l=a.editConfigModel,s=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,Wo.SHOW_MENU,s.domOverlayPosition),l.isSilentMode||n.toFront(),i.isSelected||a.selectEdgeById(i.id);var f=i==null?void 0:i.getData();a.eventCenter.emit(pr.EDGE_CONTEXTMENU,{data:f,e:o,position:s})},n.handleMouseDown=function(o){o.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var o=n.props.model;n.mouseUpDrag=o.isDragging},n.handleClick=function(o){if(n.startTime&&!n.mouseUpDrag){var r=o.button===2;if(!r){var i=o.detail===2,a=n.props,l=a.model,s=a.graphModel,f=l==null?void 0:l.getData(),h=s.getPointByClient({x:o.clientX,y:o.clientY});if(i){var v=s.editConfigModel,b=s.textEditElement,w=l.id,O=l.text,E=l.modelType;if(b&&b.id===w&&s.setElementStateById(w,Wo.DEFAULT),v.edgeTextEdit&&O.editable&&(l.setSelected(!1),s.setElementStateById(w,Wo.TEXT_EDIT)),E===_o.POLYLINE_EDGE){var S=l,M=s.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,C=M.x,$=M.y;S.dbClickPosition=g3({x:C,y:$},S.points)}s.eventCenter.emit(pr.EDGE_DBCLICK,{data:f,e:o,position:h})}else{s.eventCenter.emit(pr.ELEMENT_CLICK,{data:f,e:o,position:h}),s.eventCenter.emit(pr.EDGE_CLICK,{data:f,e:o,position:h});var D=o.currentTarget,k=!wl(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(F){return setTimeout(F,0)};k(function(){D.focus()})}var B=s.editConfigModel;s.selectEdgeById(l.id,y3(o,B)),B.isSilentMode||n.toFront()}}},n.handleFocus=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_FOCUS,{data:r.getData()})},n.handleBlur=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_BLUR,{data:r.getData()})},n}return e.prototype.getShape=function(){return $t("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==Zu.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var l=!1;return a.edgeTextDraggable&&r.text.draggable&&(l=!0),$t(bee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:l})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isSelected,a=this.state.hover;return{start:o,end:r,hover:a,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint;return[o,r]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,o=n.id,r=n.getArrowStyle(),i=r.refY,a=i===void 0?0:i,l=r.refX,s=l===void 0?2:l,f=Iee(this.getLastTwoPoints(),2),h=f[0],v=f[1],b="auto";if(h&&v){var w=v.x-h.x,O=v.y-h.y;if(w!==0||O!==0){var E=YJ(XJ({x:w,y:O}));Number.isFinite(E)&&!Number.isNaN(E)&&(b=E)}}return $t("g",{children:$t("defs",{children:[$t("marker",{id:"marker-start-".concat(o),refX:-s,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$t("marker",{id:"marker-end-".concat(o),refX:s,refY:a,overflow:"visible",orient:b,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,l=o.strokeWidth,s=o.offset,f=s===void 0?10:s,h=o.verticalLength,v=o.strokeLinecap,b=o.strokeLinejoin,w=o.transform,O="";switch(n){case"solid":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(3*f/4,",-").concat(h," Z");break;case"hollow":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(-f/4,",0 L").concat(3*f/4,",-").concat(h," L").concat(-f/4,",0 Z");break;case"diamond":O="M".concat(-f/2,",0 L0,").concat(h," L").concat(f/2,",0 L0,-").concat(h," L").concat(-f/2,",0 Z");break;case"circle":O="M".concat(-f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(-f/2,",0 Z");break;default:O="";break}return $t("path",{d:O,stroke:r,fill:a,strokeWidth:l,strokeLinecap:v,strokeLinejoin:b,transform:w})},e.prototype.getStartArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,l=o.verticalLength,s=o.startArrowType,f=s===void 0?"none":s,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:l,strokeLinecap:h,strokeLinejoin:v})},e.prototype.getEndArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,l=o.verticalLength,s=o.endArrowType,f=s===void 0?"solid":s,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:l,strokeLinecap:h,strokeLinejoin:v,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zg,d_({className:"lf-edge-adjust-point"},i,{x:n,y:o}))},e.prototype.getAdjustPoints=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.adjustEdgeStartAndEnd,l=i.adjustEdgeStart,s=i.adjustEdgeEnd,f=o.getAdjustStart(),h=o.getAdjustEnd();return $t("g",{children:[a&&l&&$t(Bk,d_({type:$d.SOURCE},f,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&s&&$t(Bk,d_({type:$d.TARGET},h,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return $t("g",{})},e.prototype.getAppend=function(){return $t("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,o=n.graphModel,r=n.model;o.toFront(r.id)},e.prototype.render=function(){var n=this.props.model,o=n.isSelected,r=n.isHitable,i=n.isShowAdjustPoint;return $t("g",{children:[$t("g",{className:["lf-edge",!r&&"pointer-none",o&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&o?this.getAdjustPoints():""]})},e.isObserved=!1,e})(Po),Fee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l2=function(){return l2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$k=(function(t){Fee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.getEdgeStyle(),r=n,i=r.path,a=r.isAnimation,l=r.arrowConfig,s=n.getEdgeAnimationStyle(),f=s.strokeDasharray,h=s.stroke,v=s.strokeDashoffset,b=s.animationName,w=s.animationDuration,O=s.animationIterationCount,E=s.animationTimingFunction,S=s.animationDirection;return $t(k_,l2({d:i},o,l,a?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:w,animationIterationCount:O,animationTimingFunction:E,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(k_,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,o=this.state.hover,r=n.isSelected,i=n.getArrowStyle().offset,a=n.pointsList.map(function(v){return{x:v.x,y:v.y}}),l=Bee(_k(a,i),2),s=l[0],f=l[1],h={start:s,end:f,hover:o,isSelected:r};return h},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.getArrowStyle().offset,r=n.pointsList.map(function(i){return{x:i.x,y:i.y}});return _k(r,o)},e})(ZE),$ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u2=function(){return u2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$_=(function(t){Uee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var o=n.props.model;o.dragAppendStart(),n.isShowAdjustPointTemp=o.isShowAdjustPoint,o.isShowAdjustPoint=!1},n.onDragging=function(o){var r=o.deltaX,i=o.deltaY,a=n.props,l=a.model,s=a.graphModel;n.isDragging=!0;var f=s.transformModel,h=s.editConfigModel,v=Vee(f.fixDeltaXY(r,i),2),b=v[0],w=v[1],O=l,E=h.adjustEdgeMiddle;E?n.appendInfo=O.dragAppendSimple(n.appendInfo,{x:b,y:w}):n.appendInfo=O.dragAppend(n.appendInfo,{x:b,y:w})},n.onDragEnd=function(){var o,r=n.props,i=r.model,a=r.graphModel.eventCenter,l=i;l.dragAppendEnd(),n.isDragging=!1,l.isShowAdjustPoint=(o=n.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,n.appendInfo=void 0,a.emit(pr.EDGE_ADJUST,{data:l.getData()})},n.beforeDragStart=function(o,r){r.draggable&&n.drag.handleMouseDown(o),n.appendInfo=r},n.drag=new oc({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),s=l.strokeDasharray,f=l.stroke,h=l.strokeDashoffset,v=l.animationName,b=l.animationDuration,w=l.animationIterationCount,O=l.animationTimingFunction,E=l.animationDirection;return $t(TJ,$v({points:o},a,i,r?{strokeDasharray:s,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:b,animationIterationCount:w,animationTimingFunction:O,animationDirection:E}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.points,r=n.isSelected,i=this.state.hover,a=Kv(o),l=a[0],s=a[0];return a.length>=2&&(l=a[a.length-2],s=a[a.length-1]),{start:l,end:s,hover:i,isSelected:r}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.points,r=Kv(o),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),[i,a]},e.prototype.getAppendAttributes=function(n){var o=n.start,r=n.end,i;if(o.x===r.x&&o.y===r.y)i="";else{var a={start:o,end:r,offset:10,verticalLength:5},l=C_($v($v({},a),{type:"start"})),s=C_($v($v({},a),{type:"end"}));i="M".concat(l.leftX," ").concat(l.leftY,` L`).concat(l.rightX," ").concat(l.rightY,` L`).concat(s.rightX," ").concat(s.rightY,` L`).concat(s.leftX," ").concat(s.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var o=this.getAppendAttributes(n),r=o.d,i=o.strokeWidth,a=o.fill,l=o.strokeDasharray,s=o.stroke;return $t(k_,{d:r,fill:a,strokeWidth:i,stroke:s,strokeDasharray:l})},e.prototype.getAppendWidth=function(){for(var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,l=r.draggable,s=[],f=a.length,h=function(w){var O="lf-polyline-append",E={start:{x:a[w].x,y:a[w].y},end:{x:a[w+1].x,y:a[w+1].y},startIndex:w,endIndex:w+1,direction:ni.HORIZONTAL,draggable:!0},S=$t("g",{className:O,children:v.getAppendShape(E)}),M=i.editConfigModel,C=M.adjustEdge,$=M.adjustEdgeMiddle;if(C&&l){var D=E.startIndex,k=E.endIndex,B=$&&(D===0||k===f-1);E.draggable=!B,E.start.x===E.end.x?(E.draggable&&(O+="-ew-resize"),E.direction=ni.VERTICAL):E.start.y===E.end.y&&(E.draggable&&(O+="-ns-resize"),E.direction=ni.HORIZONTAL),S=$t("g",{className:v.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(F){return n.beforeDragStart(F,E)},children:$t("g",{className:O,children:v.getAppendShape(E)})})}s.push(S)},v=this,b=0;b=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Xee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Yee=(function(t){zee(e,t);function e(n){var o=t.call(this,n)||this;return o.ref=WE(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(Wo.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return e.getDerivedStateFromProps=function(n){var o,r=n.textEditElement,i=n.graphModel,a=i.transformModel,l=i.theme,s=l.inputText,f;if(r){if(!(!((o=r.text)===null||o===void 0)&&o.value)&&r.BaseType===da.EDGE){var h=r.text,v=r.textPosition,b=v.x,w=v.y;h.x=b,h.y=w,r.setText(h)}var O={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===da.EDGE){var E=l.edgeText,S=E.overflowMode,M=E.lineHeight,C=E.wrapPadding,$=E.textWidth;$&&S==="autoWrap"&&(f=np(np({},O),{width:$,minWidth:$,lineHeight:M,padding:C}))}else if(r.BaseType===da.NODE){var D=l.nodeText,S=D.overflowMode,M=D.lineHeight,C=D.wrapPadding,$=D.textWidth,k=r.width,B=r.modelType,F=r.textWidth,I=F||$||k;(B!==_o.TEXT_NODE&&S==="autoWrap"||B===_o.TEXT_NODE&&$)&&(f=np(np({},O),{width:I,minWidth:I,lineHeight:M,padding:C}))}var V=r.text,z=V.x,X=V.y,Y=Xee(a.CanvasPointToHtmlPoint([z,X]),2),W=Y[0],Q=Y[1];return{style:np(np({left:W,top:Q},f),s)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var o=this.__prevText,r=o.text,i=o.id;n.updateText(i,r),n.eventCenter.emit(pr.TEXT_UPDATE,{data:np({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var o=document.createRange();o.selectNodeContents(n),o.collapse(!1);var r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(o)}},e.prototype.render=function(){var n,o=this.props.graphModel.textEditElement,r=this.state.style;return o?$t("div",{contentEditable:!0,className:"lf-text-input",style:r,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=o.text)===null||n===void 0?void 0:n.value},o.id):null},e.toolName="text-edit-tool",e=Hee([xl],e),e})(Po),qee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},sS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Zee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Qee=[Yee,Jee],ete=(function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,ri(Qee,function(i){n.isDisabled(i.toolName)||n.registerTool(i.toolName,i)});var o=e.graphModel,r=o.eventCenter;r.on("".concat(pr.GRAPH_TRANSFORM,",").concat(pr.NODE_CLICK,",").concat(pr.BLANK_CLICK," "),function(){var i,a=o.textEditElement,l=o.editConfigModel,s=l.edgeTextEdit,f=l.nodeTextEdit;(s||f)&&a&&((i=o.textEditElement)===null||i===void 0||i.setElementState(Wo.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},lS([Ut],t.prototype,"toolMap",void 0),lS([Bt],t.prototype,"disableTool",null),lS([Bt],t.prototype,"enableTool",null),t})();function tte(t){throw new Error("[mobx-utils] "+t)}function Hw(t,e){e===void 0&&(e="Illegal state"),t||tte(e)}var C3=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(C3(Object.getPrototypeOf(t))||[])},nte=function(t){var e=C3(t),n=e.filter(function(o,r){return e.indexOf(o)===r});return n},rte=function(t){return nte(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},N3="pending",Xw="fulfilled",kM="rejected";function ote(t){switch(this.state){case N3:return t.pending&&t.pending(this.value);case kM:return t.rejected&&t.rejected(this.value);case Xw:return t.fulfilled?t.fulfilled(this.value):this.value}}function Vk(t,e){if(Hw(arguments.length<=2,"fromPromise expects up to two arguments"),Hw(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(Bt("observableFromPromise-resolve",function(r){n.value=r,n.state=Xw}),Bt("observableFromPromise-reject",function(r){n.value=r,n.state=kM})),n.isPromiseBasedObservable=!0,n.case=ote;var o=e&&e.state===Xw?e.value:void 0;return NA(n,{value:o,state:N3},{},{deep:!1}),n}(function(t){t.reject=Bt("fromPromise.reject",function(n){var o=t(Promise.reject(n));return o.state=kM,o.value=n,o});function e(n){n===void 0&&(n=void 0);var o=t(Promise.resolve(n));return o.state=Xw,o.value=n,o}t.resolve=Bt("fromPromise.resolve",e)})(Vk||(Vk={}));var P0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i};(function(){function t(e,n){var o=this;PK(function(){o.current=n,o.subscription=e.subscribe(o)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},P0([Ut.ref],t.prototype,"current",void 0),P0([Bt.bound],t.prototype,"next",null),P0([Bt.bound],t.prototype,"complete",null),P0([Bt.bound],t.prototype,"error",null),t})();var Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ite=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=Ut.map({}),this.localComputedValues=Ut.map({}),this.isPropertyDirty=function(o){return n.localValues.has(o)},Hw(nd(e),"createViewModel expects an observable object"),rte(e).forEach(function(o){if(!(o===eo||o==="__mobxDidRunLazyInitializers")){if(Hw(ite.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),NP(e,o)){var r=YE(e,o).derivation;n.localComputedValues.set(o,Ai(r.bind(n)))}var i=Object.getOwnPropertyDescriptor(e,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(n,o,Yw(Yw({},a),{configurable:!0,get:function(){return NP(e,o)?n.localComputedValues.get(o).get():n.isPropertyDirty(o)?n.localValues.get(o):n.model[o]},set:Bt(function(l){l!==n.model[o]?n.localValues.set(o,l):n.localValues.delete(o)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Vg(this.localValues).forEach(function(n){var o=e.localValues.get(n),r=e.model[n];tf(r)?r.replace(o):Yl(r)?(r.clear(),r.merge(o)):FK(o)||(e.model[n]=o)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},Fy([Ai],t.prototype,"isDirty",null),Fy([Ai],t.prototype,"changedValues",null),Fy([Bt.bound],t.prototype,"submit",null),Fy([Bt.bound],t.prototype,"reset",null),Fy([Bt.bound],t.prototype,"resetProperty",null),t})();function uS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function cS(t){return nd(t)||tf(t)||Yl(t)}function ate(t,e){var n=new WeakMap;function o(l){var s=n.get(l.object);r(l,s),e(l,uS(s),t)}function r(l,s){switch(l.type){case"add":i(l.newValue,s,l.name);break;case"update":a(l.oldValue),i(l.newValue,s,l.name||""+l.index);break;case"remove":case"delete":a(l.oldValue);break;case"splice":l.removed.map(a),l.added.forEach(function(v,b){return i(v,s,""+(l.index+b))});for(var f=l.index+l.addedCount;fthis.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=to(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=to(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=ate(e,D2(function(){var o=e.modelToHistoryData();o&&n.add(c2({},o))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t})(),dS={exports:{}},Wk;function ute(){return Wk||(Wk=1,(function(t){(function(e,n,o){if(!e)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},s,f=1;f<20;++f)r[111+f]="f"+f;for(f=0;f<=9;++f)r[f+96]=f.toString();function h(F,I,V){if(F.addEventListener){F.addEventListener(I,V,!1);return}F.attachEvent("on"+I,V)}function v(F){if(F.type=="keypress"){var I=String.fromCharCode(F.which);return F.shiftKey||(I=I.toLowerCase()),I}return r[F.which]?r[F.which]:i[F.which]?i[F.which]:String.fromCharCode(F.which).toLowerCase()}function b(F,I){return F.sort().join(",")===I.sort().join(",")}function w(F){var I=[];return F.shiftKey&&I.push("shift"),F.altKey&&I.push("alt"),F.ctrlKey&&I.push("ctrl"),F.metaKey&&I.push("meta"),I}function O(F){if(F.preventDefault){F.preventDefault();return}F.returnValue=!1}function E(F){if(F.stopPropagation){F.stopPropagation();return}F.cancelBubble=!0}function S(F){return F=="shift"||F=="ctrl"||F=="alt"||F=="meta"}function M(){if(!s){s={};for(var F in r)F>95&&F<112||r.hasOwnProperty(F)&&(s[r[F]]=F)}return s}function C(F,I,V){return V||(V=M()[F]?"keydown":"keypress"),V=="keypress"&&I.length&&(V="keydown"),V}function $(F){return F==="+"?["+"]:(F=F.replace(/\+{2}/g,"+plus"),F.split("+"))}function D(F,I){var V,z,X,Y=[];for(V=$(F),X=0;X1){ke(ze,se,Ye,Be);return}Ze=D(ze,Be),I._callbacks[Ze.key]=I._callbacks[Ze.key]||[],J(Ze.key,Ze.modifiers,{type:Ze.action},Je,ze,gt),I._callbacks[Ze.key][Je?"unshift":"push"]({callback:Ye,modifiers:Ze.modifiers,action:Ze.action,seq:Je,level:gt,combo:ze})}I._bindMultiple=function(ze,Ye,Be){for(var Je=0;Je-1||k(I,V.target))return!1;if("composedPath"in F&&typeof F.composedPath=="function"){var z=F.composedPath()[0];z!==F.target&&(I=z)}return I.tagName=="INPUT"||I.tagName=="SELECT"||I.tagName=="TEXTAREA"||I.isContentEditable},B.prototype.handleKey=function(){var F=this;return F._handleKey.apply(F,arguments)},B.addKeycodes=function(F){for(var I in F)F.hasOwnProperty(I)&&(r[I]=F[I]);s=null},B.init=function(){var F=B(n);for(var I in F)I.charAt(0)!=="_"&&(B[I]=(function(V){return function(){return F[V].apply(F,arguments)}})(I))},B.init(),e.Mousetrap=B,t.exports&&(t.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var cte=ute();const dte=Z_(cte);var kd=null;function Gk(t,e){var n,o;return t.x+=e,t.y+=e,dw(t.text)||(t.text.x+=e,t.text.y+=e),dw((n=t.properties)===null||n===void 0?void 0:n._label)||(o=t.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=e,r.y+=e}),t}function zk(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),dw(t.text)||(t.text.x+=e,t.text.y+=e),t}var ag=40,k0=40;function fte(t,e){var n=t.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(k0=ag,!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=t.options.guards,i=e.getSelectElements(!1),a=r&&r.beforeClone?r.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(kd=null,!0):(kd=i,kd.nodes.forEach(function(l){return Gk(l,ag)}),kd.edges.forEach(function(l){return zk(l,ag)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(kd&&(kd.nodes||kd.edges)){t.clearSelectElements();var r=t.addElements(kd,k0);if(!r)return!0;r.nodes.forEach(function(i){return t.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return t.selectElementById(i.id,!0)}),kd.nodes.forEach(function(i){return Gk(i,ag)}),kd.edges.forEach(function(i){return zk(i,ag)}),k0=k0+ag}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=e.getSelectElements(!0);return t.clearSelectElements(),r.edges.forEach(function(i){return i.id&&t.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&t.deleteNode(i.id)}),!1})}var pte=(function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new dte(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,o=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(o)if(qa(o))o.forEach(function(l){var s=l.keys,f=l.callback,h=l.action;return e.on(s,f,h)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},t.prototype.on=function(e,n,o){this.mousetrap.bind(this.getKeys(e),n,o)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(o){return n.formatKey(o)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t})(),ph=function(){return ph=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o/g,">").replace(/"/g,""").replace(/'/g,"'")}function _te(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Zw(t)).replace(/"/g,"'")}return Jw(String(e))}var Tv=` `;function Z0(t,e,n){var o=yte(n);if(t!==0&&t!==!1&&!t)return Tv+o+"<".concat(e," />");var r="";if(e==="#text")return Tv+o+Jw(String(t));if(e==="#cdata-section")return Tv+o+"";if(e==="#comment")return Tv+o+"";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+_te(t)+'"';if(Array.isArray(t))t.forEach(function(s){r+=Z0(s,e,n+1)});else if(I3(t)==="[object Object]"){var i=Object.keys(t),a="",l="";r+=(n===0?"":Tv+o)+"<"+e,i.forEach(function(s){s.charAt(0)==="-"?a+=Z0(t[s],s,n+1):l+=Z0(t[s],s,n+1)}),r+=a+(l!==""?">".concat(l).concat(Tv+o,""):" />")}else r+=Tv+o+"<".concat(e,">").concat(Jw(String(t)),"");return r}function bte(t){var e="";for(var n in t)e+=Z0(t[n],n,0);return e}var Al=function(){};Al.ObjTree=function(){return this};Al.ObjTree.VERSION="0.23";Al.ObjTree.prototype.xmlDecl=` `;Al.ObjTree.prototype.attr_prefix="-";Al.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};Al.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,l=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),l&&l(h)}}else o.asynchronous=!1;var s;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(s=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(s=f.transport)}if(n)return s;if(s&&s.responseXML&&s.responseXML.documentElement)return this.parseDOM(s.responseXML.documentElement)};Al.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var l=!0;n&&(l=!1);for(var r=0;r"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Al.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=o):n==1?t[e]=o:n==2?t[e]=[t[e],o]:t[e][t[e].length]=o};Al.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Al.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<"+r+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),l=n.join("");return typeof t>"u"||t==null||(n.length>0?l.match(/\n/)?l="<"+t+a+`> `+l+" `:l="<"+t+a+">"+l+" `:l="<"+t+a+` /> `),l};Al.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o"u"||r==null?n[n.length]="<"+t+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};Al.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+" `};Al.ObjTree.prototype.xml_escape=Jw;var wte=function(t){return new Al.ObjTree().parseXML(t)},Ete=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f2=function(){return f2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xd;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Xd||(Xd={}));var F3=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],Yk=["properties","startPoint","endPoint","pointsList"],B3=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function qk(t){var e=t?Yk.concat(t):Yk;return function(n){function o(r){var i={};return typeof r=="string"?r:Array.isArray(r)?r.map(function(a){return o(a)}):(Object.entries(r).forEach(function(a){var l=JE(a,2),s=l[0],f=l[1];typeof f!="object"?s.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(s)?i[s]=f:i["-".concat(s)]=f:e.includes(s)?i["-".concat(s)]=o(f):i[s]=o(f)}),i)}return o(n)}}function Qw(t){var e={};return Object.entries(t).forEach(function(n){var o=JE(n,2),r=o[0],i=o[1];r.indexOf("-")===0?e[r.substring(1)]=Zw(i):typeof i=="string"?e[r]=i:Object.prototype.toString.call(i)==="[object Object]"?e[r]=Qw(i):Array.isArray(i)?e[r]=i.map(function(a){return Qw(a)}):e[r]=i}),e}function xte(t,e,n){var o=new Map;e.nodes.forEach(function(i){var a,l={"-id":i.id};if(!((a=i.text)===null||a===void 0)&&a.value&&(l["-name"]=i.text.value),i.properties){var s=qk(n)(i.properties);Object.assign(l,s)}o.set(i.id,l),t[i.type]?Array.isArray(t[i.type])?t[i.type].push(l):t[i.type]=[t[i.type],l]:t[i.type]=l});var r=e.edges.map(function(i){var a,l,s=o.get(i.targetNodeId);s["bpmn:incoming"]?Array.isArray(s["bpmn:incoming"])?s["bpmn:incoming"].push(i.id):s["bpmn:incoming"]=[s["bpmn:incoming"],i.id]:s["bpmn:incoming"]=i.id;var f={"-id":i.id,"-sourceRef":i.sourceNodeId,"-targetRef":i.targetNodeId};if(!((a=i.text)===null||a===void 0)&&a.value&&(f["-name"]=(l=i.text)===null||l===void 0?void 0:l.value),i.properties){var h=qk(n)(i.properties);Object.assign(f,h)}return f});e.edges.forEach(function(i){var a=o.get(i.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(i.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],i.id]:a["bpmn:outgoing"]=i.id}),t[Xd.FLOW]=r}function Ote(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(l){var s=l.x,f=l.y;return{"-x":s,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,l=n.x,s=n.y,f=Fh.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),l-=i/2,s-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":l,"-y":s,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}function Ste(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"],i=o["bpmndi:BPMNDiagram"],a=i==null?void 0:i["bpmndi:BPMNPlane"];if(!r||!a)return{nodes:e,edges:n};Object.keys(r).forEach(function(l){if(l.indexOf("bpmn:")===0){var s=r[l];if(l===Xd.FLOW){var f=a["bpmndi:BPMNEdge"],h=(Array.isArray(f),f);n=Mte(s,h)}else{var v=a["bpmndi:BPMNShape"],b=(Array.isArray(v),v);e=e.concat(Ate(s,b,l))}}})}return{nodes:e,edges:n}}function Ate(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var l;Array.isArray(e)?l=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):l=e;var s=Kk(l,n,a);o.push(s)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=Kk(r,n,t);o.push(i)}return o}function Kk(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=B3(n["-name"]),a=Fh.shapeConfigMap.get(e);a&&(o+=a.width/2,r+=a.height/2);var l;Object.entries(n).forEach(function(v){var b=JE(v,2),w=b[0],O=b[1];F3.indexOf(w)===-1&&(l||(l={}),l[w]=O)}),l&&(l=Qw(l));var s;if(i&&(s={x:o,y:r,value:i},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(f["-x"])+Number(f["-width"])/2,s.y=Number(f["-y"])+Number(f["-height"])/2}var h={id:t["-bpmnElement"],type:e,x:o,y:r,properties:l};return s&&(h.text=s),h}function Mte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(Zk(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(Zk(o,t))}return n}function Zk(t,e){var n,o=e["-name"]?B3("".concat(e["-name"])):"";if(o){var r=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(r=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var i=0;if(o.split(` `).forEach(function(w){i/g,">");return'name="'.concat(i,'"')})},e.pluginName="bpmnXmlAdapter",e})(Fh);var Tte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var o=Math.random()*16|0,r=n==="x"?o:o&3|8;return r.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),Cte=(globalThis==null?void 0:globalThis._ids)||new Tte;function Nte(){return Cte.next()}Lr("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Lr("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});Lr("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"});Lr("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var Pte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uv=function(){return Uv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rte=oc,Dte=(function(t){Pte(e,t);function e(n){var o=t.call(this)||this;return o.updatePosition=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.x,f=l.y;o.nodeModel.x=s+i/2,o.nodeModel.y=f+a/2,o.nodeModel.moveText(i/2,a/2)},o.getResize=function(r){var i=r.index,a=r.deltaX,l=r.deltaY,s=r.width,f=r.height,h=r.PCTResizeInfo,v=r.pct,b=v===void 0?1:v,w=r.freezeWidth,O=w===void 0?!1:w,E=r.freezeHeight,S=E===void 0?!1:E,M={width:s,height:f,deltaX:a,deltaY:l};if(h){var C=4,$=0,D=0;switch(i){case 0:D=(a*-1-l)/C;break;case 1:D=(a-l)/C;break;case 2:D=(a+l)/C;break;case 3:D=(a*-1+l)/C;break}D!==0&&($=Math.round(D/h.ResizeBasis.basisHeight*1e5)/1e3),h.ResizePCT.widthPCT=Math.max(Math.min(h.ResizePCT.widthPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit),h.ResizePCT.heightPCT=Math.max(Math.min(h.ResizePCT.heightPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit);var k=Math.round(h.ResizePCT.widthPCT*h.ResizeBasis.basisWidth/100),B=Math.round(h.ResizePCT.heightPCT*h.ResizeBasis.basisHeight/100);switch(i){case 0:a=s-k,l=f-B;break;case 1:a=k-s,l=f-B;break;case 2:a=k-s,l=B-f;break;case 3:a=s-k,l=B-f;break}return M.width=k,M.height=B,M.deltaX=a/b,M.deltaY=l/b,M}switch(i){case 0:M.width=O?s:s-a*b,M.height=S?f:f-l*b;break;case 1:M.width=O?s:s+a*b,M.height=S?f:f-l*b;break;case 2:M.width=O?s:s+a*b,M.height=S?f:f+l*b;break;case 3:M.width=O?s:s-a*b,M.height=S?f:f+l*b;break}return M},o.updateEdgePointByAnchors=function(){var r=o.nodeModel,i=r.id,a=r.anchors,l=o.getNodeEdges(i);l.sourceEdges.forEach(function(s){var f=a.find(function(h){return h.id===s.sourceAnchorId});f&&s.updateStartPoint({x:f.x,y:f.y})}),l.targetEdges.forEach(function(s){var f=a.find(function(h){return h.id===s.targetAnchorId});f&&s.updateEndPoint({x:f.x,y:f.y})})},o.updateRect=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.x,f=l.y,h=l.width,v=l.height,b=l.radius,w=l.PCTResizeInfo,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=o.index,D=E===M,k=S===C,B=o.getResize({index:$,deltaX:i,deltaY:a,width:h,height:v,PCTResizeInfo:w,pct:1,freezeWidth:D,freezeHeight:k});if(B.widthM||B.heightC){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:D?0:B.deltaX,deltaY:k?0:B.deltaY}),o.nodeModel.width=B.width,o.nodeModel.height=B.height,o.nodeModel.setProperties({nodeSize:{width:B.width,height:B.height}});var F={x:s,y:f,width:h,height:v,radius:b},I={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:b};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:F,afterNode:I})},o.updateEllipse=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.rx,f=l.ry,h=l.x,v=l.y,b=l.PCTResizeInfo,w=o.index,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=E===M,D=S===C,k=s,B=f,F=o.getResize({index:w,deltaX:i,deltaY:a,width:k,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.widthM/2||F.heightC/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:Uv(Uv({},I),{rx:s,ry:f}),afterNode:V})},o.updateDiamond=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.rx,f=l.ry,h=l.x,v=l.y,b=l.PCTResizeInfo,w=o.index,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=E===M,D=S===C,k=s,B=f,F=o.getResize({index:w,deltaX:i,deltaY:a,width:k,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.widthM/2||F.heightC/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v,rx:s,ry:f},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:I,afterNode:V})},o.eventEmit=function(r){var i=r.deltaX,a=r.deltaY,l=r.beforeNode,s=r.afterNode,f=o.nodeModel,h=f.id,v=f.modelType,b=f.type,w=Uv({id:h,modelType:v,type:b},l),O=Uv({id:h,modelType:v,type:b},s);o.graphModel.eventCenter.emit("node:resize",{preData:w,data:O,deltaX:i,deltaY:a,index:o.index,model:o.nodeModel})},o.onDragging=function(r){var i,a=r.deltaX,l=r.deltaY,s=o.graphModel.transformModel,f=o.nodeModel.modelType;i=kte(s.fixDeltaXY(a,l),2),a=i[0],l=i[1],f===_o.RECT_NODE||f===_o.HTML_NODE?o.updateRect({deltaX:a,deltaY:l}):f===_o.ELLIPSE_NODE?o.updateEllipse({deltaX:a,deltaY:l}):f===_o.DIAMOND_NODE&&o.updateDiamond({deltaX:a,deltaY:l})},o.onDragEnd=function(){var r=o.graphModel.gridSize,i=r===void 0?1:r,a=i*Math.round(o.nodeModel.x/i),l=i*Math.round(o.nodeModel.y/i);o.nodeModel.moveTo(a,l),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new Rte({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return e.prototype.getNodeEdges=function(n){for(var o=this.graphModel,r=o.edges,i=[],a=[],l=0;l0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nv=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=this.x-this.width/2&&i<=this.x+this.width/2&&r>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return{x:o>=this.x-this.width/2&&i<=this.x+this.width/2,y:r>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this);o.children=[],this.children.forEach(function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&o.children.push(i)});var r=o.properties;return r==null||delete r.groupAddable,r==null||delete r.isFolded,o},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=Nv([],Cv(this.children),!1),n.isGroup=!0;var o=n.properties;return o==null||delete o.groupAddable,o!=null&&o.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(Fte);(function(t){z3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,o=n.resizable,r=n.properties;return o&&!r.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,l=n.radius,s=n.properties,f=n.getAddableOutlineStyle;if(!s.groupAddable)return null;var h=this.props.model.getNodeStyle().strokeWidth,v=h===void 0?0:h,b=f(),w=o+v+8,O=r+v+8;return Lr("rect",tE(tE({},b),{width:w,height:O,x:i-w/2,y:a-O/2,rx:l,ry:l}))},e.prototype.getFoldIcon=function(){var n=this.props.model,o=n.x-n.width/2+5,r=n.y-n.height/2+5;if(!n.foldable)return null;var i=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," M").concat(o+7,",").concat(r+2," ").concat(o+7,",").concat(r+10):"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," ")});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),i])},e.prototype.getResizeShape=function(){return Lr("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Bte);var eR=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p_=function(){return p_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vte(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(rE(t)).replace(/"/g,"'")}return oE(String(e))}var dR=` `;function J0(t,e,n){var o=cR(n),r="",i=dR+o;if(e==="-json")return"";if(e==="#text")return i+oE(String(t));if(e==="#cdata-section")return"".concat(i,"");if(e==="#comment")return"".concat(i,"");if(t!==0&&t!==!1&&!t)return"".concat(i,"<").concat(e," />");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Vte(t),'"');if(Array.isArray(t))r+=t.map(function(f){return J0(f,e,n+1)}).join("");else if(H3(t)==="[object Object]"){var a=Object.keys(t),l="",s=t["-json"]?dR+cR(n+1)+t["-json"]:"";r+="".concat(n===0?"":i,"<").concat(e),a.forEach(function(f){f.charAt(0)==="-"?l+=J0(t[f],f,n+1):s+=J0(t[f],f,n+1)}),r+=l+(s!==""?">".concat(s).concat(i,""):" />")}else r+="".concat(i,"<").concat(e,">").concat(oE(String(t)),"");return r}function Wte(t){var e="";for(var n in t)e+=J0(t[n],n,0);return e}var Ml=function(){};Ml.ObjTree=function(){return this};Ml.ObjTree.VERSION="0.23";Ml.ObjTree.prototype.xmlDecl=` `;Ml.ObjTree.prototype.attr_prefix="-";Ml.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var r=this.parseDOM(e);return r}};Ml.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,l=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),l&&l(h)}}else o.asynchronous=!1;var s;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(s=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(s=f.transport)}if(n)return s;if(s&&s.responseXML&&s.responseXML.documentElement)return this.parseDOM(s.responseXML.documentElement)};Ml.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var l=!0;n&&(l=!1);for(var r=0;r"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Ml.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=o):n===1?t[e]=o:n===2?t[e]=[t[e],o]:t[e][t[e].length]=o};Ml.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Ml.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(hw(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<".concat(r," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),l=n.join("");return typeof t>"u"||t==null||(n.length>0?l.match(/\n/)?l="<".concat(t).concat(a,`> `).concat(l," `):l="<".concat(t).concat(a,">").concat(l," `):l="<".concat(t).concat(a,` /> `)),l};Ml.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o"u"||r==null?n[n.length]="<".concat(t," />"):typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};Ml.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e)," `)};Ml.ObjTree.prototype.xml_escape=oE;var Gte=function(t){return new Ml.ObjTree().parseXML(t)},zte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h2=function(){return h2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ks=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},zc=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o")}:{json:''.concat(o,"")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId,i=function(){return"').concat(o,"")};return{json:'".concat(i(),""):"/>")}},in:function(t,e){var n,o,r,i,a=t,l=e["-id"],s="",f="";try{for(var h=RM(Object.keys(e)),v=h.next();!v.done;v=h.next()){var b=v.value;b.includes("bpmn:")&&(r=Ks(b.split(":"),2),s=r[1],f=(i=e[b])===null||i===void 0?void 0:i["#text"])}}catch(w){n={error:w}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return{"-definitionId":l,"-definitionType":a,"-timerType":s,"-timerValue":f}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function Xte(t){var e=t??{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(zc(zc([],Ks(Hte),!1),Ks(n||[]),!1)),a={in:new Set(zc(zc([],Ks(iE.in),!1),Ks((o==null?void 0:o.in)||[]),!1)),out:new Set(zc(zc([],Ks(iE.out),!1),Ks((o==null?void 0:o.out)||[]),!1))};return Hu=Y3(Hu,r),function(l){var s=l.nodes,f=l.edges;function h(v,b){var w,O;if((v==null?void 0:v.flag)!==1){var E;if((E=Hu[v.type])&&E.out){var S=E.out(v),M=Object.keys(S);M.length>0&&M.forEach(function(V){v[V]=S[V]})}v!=null&&v.children&&(v.children=v.children.map(function(V){var z=s.find(function(X){return X.id===V})||f.find(function(X){return X.id===V});return z||{}}));var C={};if(typeof v=="string")return v;if(Array.isArray(v))return v.map(function(V){return h(V,"")}).filter(function(V){return V!=null});try{for(var $=RM(Object.entries(v)),D=$.next();!D.done;D=$.next()){var k=Ks(D.value,2),B=k[0],F=k[1];if((F==null?void 0:F.flag)===1)return;var I=[b,B].filter(function(V){return V}).join(".");a.out.has(I)||(typeof F!="object"?B.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(B)?C[B]=F:C["-".concat(B)]=F:i.has(I)?C["-".concat(B)]=h(F,I):C[B]=h(F,I))}}catch(V){w={error:V}}finally{try{D&&!D.done&&(O=$.return)&&O.call($)}finally{if(w)throw w.error}}return C}}return h(l,"")}}function aE(t){var e,n,o={};try{for(var r=RM(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=Ks(i.value,2),l=a[0],s=a[1];l.indexOf("-")===0?o[l.substring(1)]=rE(s):typeof s=="string"?o[l]=s:Object.prototype.toString.call(s)==="[object Object]"?o[l]=aE(s):Array.isArray(s)?o[l]=s.map(function(f){return aE(f)}):o[l]=s}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function Yte(t,e,n){var o,r=new Map,i=Xte(n)(e);i.nodes.forEach(function(l){var s=l["-id"],f=l["-type"],h=l.text,v=l.children,b=fR(l,["-id","-type","text","children"]),w={"-id":s};h!=null&&h["-value"]&&(w["-name"]=h["-value"]),b["-json"]&&(w["-json"]=b["-json"]),b["-properties"]&&Object.assign(w,b["-properties"]),v&&(w.children=v),t[f]||(t[f]=[]),t[f].push(w),r.set(s,w)});var a=i.edges.map(function(l){var s=l["-id"],f=l["-sourceNodeId"],h=l["-targetNodeId"],v=l.text,b=fR(l,["-id","-sourceNodeId","-targetNodeId","text"]),w=r.get(h);w["bpmn:incoming"]||(w["bpmn:incoming"]=[]),w["bpmn:incoming"].push(s);var O={"-id":s,"-sourceRef":f,"-targetRef":h};return v!=null&&v["-value"]&&(O["-name"]=v["-value"]),b["-json"]&&(O["-json"]=b["-json"]),b["-properties"]&&Object.assign(O,b["-properties"]),O});return e.edges.forEach(function(l){var s=l.sourceNodeId,f=l.id,h=r.get(s);h["bpmn:outgoing"]||(h["bpmn:outgoing"]=[]),h["bpmn:outgoing"].push(f)}),(o=t["bpmn:subProcess"])===null||o===void 0||o.forEach(function(l){var s={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},f=[];l.children.forEach(function(E){var S,M=r.get(E["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function($){M[$]&&M[$].forEach(function(D){s[$].add(D)})});var C=(S=t[E["-type"]])===null||S===void 0?void 0:S.findIndex(function($){return $["-id"]===E["-id"]});C>=0&&t[E["-type"]].splice(C,1),r.delete(E["-id"]),l[E["-type"]]||(l[E["-type"]]=[]),l[E["-type"]].push(M)});var h=s["bpmn:incoming"],v=s["bpmn:outgoing"];v.forEach(function(E){h.has(E)&&f.push(E)});for(var b=function(E){var S=a.findIndex(function(M){return M["-id"]===f[E]});S>=0?(l["bpmn:sequenceFlow"]||(l["bpmn:sequenceFlow"]=[]),l["bpmn:sequenceFlow"].push(a[S]),a.splice(S,1)):E++,w=E},w,O=0;O0&&D.forEach(function(k){Reflect.set(E,k,$[k])})}})};function O(E){r.set(E["-id"],E),Array.isArray(E)?E.forEach(function(S){O(S)}):typeof E=="object"&&w(E)}O(h[b])},function(b){if(b.indexOf("bpmn:")===0){var w=h[b];if(b==="bpmn:sequenceFlow"){var O=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=Qte(w,O)}else{var E=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(b==="bpmn:boundaryEvent"){var S=h[b],M=function(C){var $=C["-attachedToRef"],D=r.get($);D["-boundaryEvents"]||(D["-boundaryEvents"]=[]),D["-boundaryEvents"].push(C["-id"])};Array.isArray(S)?S.forEach(function(C){M(C)}):M(S)}n=n.concat(Jte(w,E,b))}}}])}var v=function(b,w,O){Object.keys(b).forEach(function(E){var S=O?"".concat(O,".").concat(E):E;w.has(S)?delete b[E]:typeof b[E]=="object"&&v(b[E],w,S)})};return n.forEach(function(b){var w,O;if(!((w=e==null?void 0:e.mapping)===null||w===void 0)&&w.in){var E=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;E[S]&&(b.type=E[S])}v(b,s.in,"")}),o.forEach(function(b){var w,O;if(!((w=e==null?void 0:e.mapping)===null||w===void 0)&&w.in){var E=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;E[S]&&(b.type=E[S])}v(b,s.in,"")}),{nodes:n,edges:o}}function Jte(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var l;Array.isArray(e)?l=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):l=e;var s=pR(l,n,a);o.push(s)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=pR(r,n,t);o.push(i)}return o}function pR(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],l=ql.shapeConfigMap.get(e);l&&(o+=l.width/2,r+=l.height/2);var s={};Object.entries(n).forEach(function(b){var w=Ks(b,2),O=w[0],E=w[1];X3.includes(O)||(s[O]=E)}),s=aE(s);var f;if(a&&(f={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var h=t["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(h["-x"])+Number(h["-width"])/2,f.y=Number(h["-y"])+Number(h["-height"])/2}var v={id:t["-bpmnElement"],type:e,x:o,y:r,properties:s};return i&&(v.children=i),f&&(v.text=f),v}function Qte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(hR(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(hR(o,t))}return n}function hR(t,e){var n,o=e["-name"]?"".concat(e["-name"]):"";if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split(` `).forEach(function(f){i0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rne=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},sg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},By=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},fne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pne=(function(t){cne(e,t);function e(n){var o=t.call(this,n)||this;o.textRef=WE(),o.setHoverOn=function(){var s=o.props.element;s.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),s.setHovered(!0))},o.setHoverOff=function(){var s=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),s.setHovered(!1))},o.handleMouseDown=function(s){var f,h=o.props,v=h.label,b=h.graphModel,w=b.editConfigModel.nodeTextDraggable;((f=v.draggable)!==null&&f!==void 0?f:w)&&!o.state.isDragging&&!o.state.isEditing&&o.stepDrag.handleMouseDown(s)},o.handleMouseUp=function(s){o.state.isDragging&&o.stepDrag.handleMouseUp(s)},o.handleDragging=function(s){var f=s.deltaX,h=s.deltaY;o.state.isDragging||o.setState({isDragging:!0});var v=o.props,b=v.label,w=v.graphModel,O=w.transformModel,E=fne(O.fixDeltaXY(f,h),2),S=E[0],M=E[1];o.setElementModelLabelInfo({x:b.x+S,y:b.y+M}),w.eventCenter.emit("label:drag",{data:b.getData(),model:b})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleClick=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel;v.setSelected(!o.state.isSelected),o.setState({isSelected:!o.state.isSelected}),o.setElementModelLabelInfo({isSelected:!0}),b.eventCenter.emit("label:click",{data:h.getData(),e:s,model:v})},o.handleDbClick=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel;if(b.eventCenter.emit("label:dblclick",{data:h.getData(),e:s,model:v}),!h.editable){v.setSelected(!0);return}if(v.setSelected(),v.setElementState(Wo.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var w=document.createRange(),O=window.getSelection();w.selectNodeContents(o.textRef.current),w.collapse(!1),O==null||O.removeAllRanges(),O==null||O.addRange(w)}},o.handleBlur=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel.eventCenter;b.emit("label:blur",{e:s,model:v,data:h.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1,isSelected:!1})},o.handleInput=function(s){var f=o.props,h=f.label,v=f.graphModel;v.eventCenter.emit("label:input",{e:s,data:h.getData()})},o.reCalcLabelSize=function(){};var r=n.label,i=n.graphModel,a=i.gridSize,l=i.eventCenter;return o.stepDrag=new oc({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:r,eventCenter:l}),o.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},o}return e.prototype.setElementModelLabelInfo=function(n){var o=this.props,r=o.label,i=o.element,a=o.graphModel,l=i.properties._label,s=l,f=Wj(s,function(b){return b.id===r.id}),h=s[f];s[f]=h_(h_({},h),n);var v=a.getElement(i.id);v==null||v.setProperty("_label",s)},e.prototype.componentDidMount=function(){var n=this,o=this.props,r=o.label,i=o.element,a=o.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(l){var s,f,h,v,b=l.data;if(((b==null?void 0:b.type)!=="label"||b.type==="label"&&b.id!==r.id||n.state.isSelected)&&n.setState({isSelected:!1}),((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.state.isEditing){n.setState({isEditing:!1});var w=(f=(s=n.textRef.current)===null||s===void 0?void 0:s.innerText)!==null&&f!==void 0?f:"",O=(v=(h=n.textRef.current)===null||h===void 0?void 0:h.innerHTML)!==null&&v!==void 0?v:"";n.setElementModelLabelInfo({value:w,content:O,isSelected:!1}),i.setElementState(Wo.DEFAULT)}((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,o=this.props,r=o.label,i=o.element,a=o.graphModel,l=this.state,s=l.isDragging,f=l.isHovered,h=l.isSelected,v=l.isEditing,b=a.transformModel,w=b.getTransformStyle().transform,O=r.id,E=r.x,S=r.y,M=r.zIndex,C=r.vertical,$=r.style,D=r.rotate,k=r.content,B=r.labelWidth,F=r.textOverflowMode,I=B??(i.BaseType==="node"?i.width-20:80),V={left:"".concat(E-I/2,"px"),top:"".concat(S-10,"px"),width:"".concat(I,"px"),height:"20px",zIndex:M??1,transform:D?"".concat(w," rotate(").concat(D,"deg)"):"".concat(w," rotate(").concat(C?-.25:0,"turn)")};return $t("div",{id:"element-container-".concat(O),className:ZA("lf-label-editor-container"),style:V,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:$t("div",{ref:this.textRef,id:"editor-container-".concat(O),className:ZA("lf-label-editor",(n={"lf-label-editor-dragging":s,"lf-label-editor-editing":v,"lf-label-editor-hover":!v&&(f||h)},n["lf-label-editor-".concat(F)]=!v,n)),onInput:this.handleInput,style:h_({maxWidth:"".concat(I,"px"),boxSizing:"border-box",display:"inline-block",background:v||i.BaseType==="edge"?"#fff":"transparent"},$),dangerouslySetInnerHTML:{__html:k}})})},e=dne([xl],e),e})(Po),Vu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},hne=wh,vne=(function(){function t(e,n,o){var r;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=o,this.id=(r=e.id)!==null&&r!==void 0?r:hne(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xo(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:Gc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Vu([Ut],t.prototype,"x",void 0),Vu([Ut],t.prototype,"y",void 0),Vu([Ut],t.prototype,"content",void 0),Vu([Ut],t.prototype,"value",void 0),Vu([Ut],t.prototype,"rotate",void 0),Vu([Ut],t.prototype,"style",void 0),Vu([Ut],t.prototype,"zIndex",void 0),Vu([Ut],t.prototype,"vertical",void 0),Vu([Ut],t.prototype,"editable",void 0),Vu([Ut],t.prototype,"draggable",void 0),Vu([Ut],t.prototype,"labelWidth",void 0),Vu([Ut],t.prototype,"textOverflowMode",void 0),t})(),Q0={exports:{}},vS=Q0.exports,mR;function mne(){return mR||(mR=1,(function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var n="classList",o="prototype",r=e.Element[o],i=Object,a=String[o].trim||function(){return this.replace(/^\s+|\s+$/g,"")},l=Array[o].indexOf||function(O){for(var E=0,S=this.length;E1?I:this.data.length),V,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},a})(e);e.Blob=function(r,i){var a=i&&i.type||"",l=new n;if(r)for(var s=0,f=r.length;s-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(s){return!!(l.isMac&&s.metaKey||!l.isMac&&s.ctrlKey)},isKey:function(s,f){var h=l.getKeyCode(s);return Array.isArray(f)===!1?h===f:f.indexOf(h)!==-1},getKeyCode:function(s){var f=s.which;return f===null&&(f=s.charCode!==null?s.charCode:s.keyCode),f},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var f=[!0].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},defaults:function(){var f=[!1].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},createLink:function(s,f,h,v){var b=s.createElement("a");return l.moveTextRangeIntoElement(f[0],f[f.length-1],b),b.setAttribute("href",h),v&&(v==="_blank"&&b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",v)),b},findOrCreateMatchingTextNodes:function(s,f,h){for(var v=s.createTreeWalker(f,NodeFilter.SHOW_ALL,null,!1),b=[],w=0,O=!1,E=null,S=null;(E=v.nextNode())!==null;)if(!(E.nodeType>3))if(E.nodeType===3){if(!O&&h.starth.end+1)throw new Error("PerformLinking overshot the target!");O&&b.push(S||E),w+=E.nodeValue.length,S!==null&&(w+=S.nodeValue.length,v.nextNode()),S=null}else E.tagName.toLowerCase()==="img"&&(!O&&h.start<=w&&(O=!0),O&&b.push(E));return b},splitStartNodeIfNeeded:function(s,f,h){return f!==h?s.splitText(f-h):null},splitEndNodeIfNeeded:function(s,f,h,v){var b,w;b=v+s.nodeValue.length+(f?f.nodeValue.length:0)-1,w=h-v-(f?s.nodeValue.length:0),b>=h&&v!==b&&w!==0&&(f||s).splitText(w)},splitByBlockElements:function(s){if(s.nodeType!==3&&s.nodeType!==1)return[];var f=[],h=e.util.blockContainerElementNames.join(",");if(s.nodeType===3||s.querySelectorAll(h).length===0)return[s];for(var v=0;v0)break;w=O.nextNode()}return w},findPreviousSibling:function(s){if(!s||l.isMediumEditorElement(s))return!1;for(var f=s.previousSibling;!f&&!l.isMediumEditorElement(s.parentNode);)s=s.parentNode,f=s.previousSibling;return f},isDescendant:function(f,h,v){if(!f||!h)return!1;if(f===h)return!!v;if(f.nodeType!==1)return!1;if(r||h.nodeType!==3)return f.contains(h);for(var b=h.parentNode;b!==null;){if(b===f)return!0;b=b.parentNode}return!1},isElement:function(f){return!!(f&&f.nodeType===1)},throttle:function(s,f){var h=50,v,b,w,O=null,E=0,S=function(){E=Date.now(),O=null,w=s.apply(v,b),O||(v=b=null)};return!f&&f!==0&&(f=h),function(){var M=Date.now(),C=f-(M-E);return v=this,b=arguments,C<=0||C>f?(O&&(clearTimeout(O),O=null),E=M,w=s.apply(v,b),O||(v=b=null)):O||(O=setTimeout(S,C)),w}},traverseUp:function(s,f){if(!s)return!1;do{if(s.nodeType===1){if(f(s))return s;if(l.isMediumEditorElement(s))return!1}s=s.parentNode}while(s);return!1},htmlEntities:function(s){return String(s).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},insertHTMLCommand:function(s,f){var h,v,b,w,O,E,S,M=!1,C=["insertHTML",!1,f];if(!e.util.isEdge&&s.queryCommandSupported("insertHTML"))try{return s.execCommand.apply(s,C)}catch{}if(h=s.getSelection(),h.rangeCount){if(v=h.getRangeAt(0),S=v.commonAncestorContainer,l.isMediumEditorElement(S)&&!S.firstChild)v.selectNode(S.appendChild(s.createTextNode("")));else if(S.nodeType===3&&v.startOffset===0&&v.endOffset===S.nodeValue.length||S.nodeType!==3&&S.innerHTML===v.toString()){for(;!l.isMediumEditorElement(S)&&S.parentNode&&S.parentNode.childNodes.length===1&&!l.isMediumEditorElement(S.parentNode);)S=S.parentNode;v.selectNode(S)}for(v.deleteContents(),b=s.createElement("div"),b.innerHTML=f,w=s.createDocumentFragment();b.firstChild;)O=b.firstChild,E=w.appendChild(O);v.insertNode(w),E&&(v=v.cloneRange(),v.setStartAfter(E),v.collapse(!0),e.selection.selectRange(s,v)),M=!0}return s.execCommand.callListeners&&s.execCommand.callListeners(C,M),M},execFormatBlock:function(s,f){var h=l.getTopBlockContainer(e.selection.getSelectionStart(s)),v;if(f==="blockquote"){if(h&&(v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return l.isBlockContainer(b)})))return s.execCommand("outdent",!1,null);if(l.isIE)return s.execCommand("indent",!1,f)}if(h&&f===h.nodeName.toLowerCase()&&(f="p"),l.isIE&&(f="<"+f+">"),h&&h.nodeName.toLowerCase()==="blockquote"){if(l.isIE&&f==="

")return s.execCommand("outdent",!1,f);if((l.isFF||l.isEdge)&&f==="p")return v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return!l.isBlockContainer(b)})&&s.execCommand("formatBlock",!1,f),s.execCommand("outdent",!1,f)}return s.execCommand("formatBlock",!1,f)},setTargetBlank:function(s,f){var h,v=f||!1;if(s.nodeName.toLowerCase()==="a")s.target="_blank",s.rel="noopener noreferrer";else for(s=s.getElementsByTagName("a"),h=0;hv?(b=b.parentNode,h-=1):(w=w.parentNode,v-=1);for(;b!==w;)b=b.parentNode,w=w.parentNode;return b},isElementAtBeginningOfBlock:function(s){for(var f,h;!l.isBlockContainer(s)&&!l.isMediumEditorElement(s);){for(h=s;h=h.previousSibling;)if(f=h.nodeType===3?h.nodeValue:h.textContent,f.length>0)return!1;s=s.parentNode}return!0},isMediumEditorElement:function(s){return s&&s.getAttribute&&!!s.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(s){return l.traverseUp(s,function(f){return l.isMediumEditorElement(f)})},isBlockContainer:function(s){return s&&s.nodeType!==3&&l.blockContainerElementNames.indexOf(s.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(s){return l.traverseUp(s,function(f){return l.isBlockContainer(f)||l.isMediumEditorElement(f)})},getTopBlockContainer:function(s){var f=l.isBlockContainer(s)?s:!1;return l.traverseUp(s,function(h){return l.isBlockContainer(h)&&(f=h),!f&&l.isMediumEditorElement(h)?(f=h,!0):!1}),f},getFirstSelectableLeafNode:function(s){for(;s&&s.firstChild;)s=s.firstChild;if(s=l.traverseUp(s,function(h){return l.emptyElementNames.indexOf(h.nodeName.toLowerCase())===-1}),s.nodeName.toLowerCase()==="table"){var f=s.querySelector("th, td");f&&(s=f)}return s},getFirstTextNode:function(s){return l.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),l._getFirstTextNode(s)},_getFirstTextNode:function(s){if(s.nodeType===3)return s;for(var f=0;f0){var s=l.getRangeAt(0),f=s.cloneRange(),h;f.selectNodeContents(r),f.setEnd(s.startContainer,s.startOffset),h=f.toString().length,a={start:h,end:h+s.toString().length},this.doesRangeStartWithImages(s,i)&&(a.startsWithImage=!0);var v=this.getTrailingImageCount(r,a,s.endContainer,s.endOffset);if(v&&(a.trailingImageCount=v),h!==0){var b=this.getIndexRelativeToAdjacentEmptyBlocks(i,r,s.startContainer,s.startOffset);b!==-1&&(a.emptyBlocksIndex=b)}}return a},importSelection:function(r,i,a,l){if(!(!r||!i)){var s=a.createRange();s.setStart(i,0),s.collapse(!0);var f=i,h=[],v=0,b=!1,w=!1,O=0,E=!1,S,M=!1,C=null;for((l||r.startsWithImage||typeof r.emptyBlocksIndex<"u")&&(M=!0);!E&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!w)S=v+f.length,!b&&r.start>=v&&r.start<=S&&(M||r.start=v&&r.end<=S&&(r.trailingImageCount?w=!0:(s.setEnd(f,r.end-v),E=!0)),v=S;else{if(r.trailingImageCount&&w&&(f.nodeName.toLowerCase()==="img"&&O++,O===r.trailingImageCount)){for(var $=0;f.parentNode.childNodes[$]!==f;)$++;s.setEnd(f.parentNode,$+1),E=!0}if(!E&&f.nodeType===1)for(var D=f.childNodes.length-1;D>=0;)h.push(f.childNodes[D]),D-=1}E||(f=h.pop())}!b&&C&&(s.setStart(C,C.length),s.setEnd(C,C.length)),typeof r.emptyBlocksIndex<"u"&&(s=this.importSelectionMoveCursorPastBlocks(a,i,r.emptyBlocksIndex,s)),l&&(s=this.importSelectionMoveCursorPastAnchor(r,s)),this.selectRange(a,s)}},importSelectionMoveCursorPastAnchor:function(r,i){var a=function(v){return v.nodeName.toLowerCase()==="a"};if(r.start===r.end&&i.startContainer.nodeType===3&&i.startOffset===i.startContainer.nodeValue.length&&e.util.traverseUp(i.startContainer,a)){for(var l=i.startContainer,s=i.startContainer.parentNode;s!==null&&s.nodeName.toLowerCase()!=="a";)s.childNodes[s.childNodes.length-1]!==l?s=null:(l=s,s=s.parentNode);if(s!==null&&s.nodeName.toLowerCase()==="a"){for(var f=null,h=0;f===null&&h0)break;return v||(v=h),l.setStart(e.util.getFirstSelectableLeafNode(v),0),l},getIndexRelativeToAdjacentEmptyBlocks:function(r,i,a,l){if(a.textContent.length>0&&l>0)return-1;var s=a;if(s.nodeType!==3&&(s=a.childNodes[l]),s){if(!e.util.isElementAtBeginningOfBlock(s))return-1;var f=e.util.findPreviousSibling(s);if(f){if(f.nodeValue)return-1}else return-1}for(var h=e.util.getClosestBlockContainer(a),v=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),b=0;v.nextNode();){var w=v.currentNode.textContent==="";if((w||b>0)&&(b+=1),v.currentNode===h)return b;w||(b=0)}return b},doesRangeStartWithImages:function(r,i){if(r.startOffset!==0||r.startContainer.nodeType!==1)return!1;if(r.startContainer.nodeName.toLowerCase()==="img")return!0;var a=r.startContainer.querySelector("img");if(!a)return!1;for(var l=i.createTreeWalker(r.startContainer,NodeFilter.SHOW_ALL,null,!1);l.nextNode();){var s=l.currentNode;if(s===a)break;if(s.nodeValue)return!1}return!0},getTrailingImageCount:function(r,i,a,l){if(l===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var s=a.childNodes[l-1];s.hasChildNodes();)s=s.lastChild;for(var f=r,h=[],v=0,b=!1,w=!1,O=!1,E,S=0;!O&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!w)S=0,E=v+f.length,!b&&i.start>=v&&i.start<=E&&(b=!0),b&&i.end>=v&&i.end<=E&&(w=!0),v=E;else if(f.nodeName.toLowerCase()==="img"&&S++,f===s)O=!0;else if(f.nodeType===1)for(var M=f.childNodes.length-1;M>=0;)h.push(f.childNodes[M]),M-=1;O||(f=h.pop())}return S},selectionContainsContent:function(r){var i=r.getSelection();if(!i||i.isCollapsed||!i.rangeCount)return!1;if(i.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(i.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(r){var i,a=this.findMatchingSelectionParent(function(l){var s=l&&l.getAttribute("contenteditable");return s==="true"&&(i=!0),l.nodeName!=="#text"&&s==="false"},r);return!i&&a},getSelectionHtml:function(i){var a,l="",s=i.getSelection(),f,h;if(s.rangeCount){for(h=i.createElement("div"),a=0,f=s.rangeCount;a-1?[r]:r,Array.prototype.forEach.call(r,(function(h){h.addEventListener(i,a,l),this.events.push([h,i,a,l])}).bind(this))},detachDOMEvent:function(r,i,a,l){var s,f,h=this.base.options.contentWindow,v=this.base.options.ownerDocument;r&&(r=e.util.isElement(r)||[h,v].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(b){s=this.indexOfListener(b,i,a,l),s!==-1&&(f=this.events.splice(s,1)[0],f[0].removeEventListener(f[1],f[2],f[3]))}).bind(this)))},indexOfListener:function(r,i,a,l){var s,f,h;for(s=0,f=this.events.length;s0&&(r=i.indexOf(o.nodeName.toLowerCase())!==-1),!r&&this.style&&(a=this.style.value.split("|"),l=this.window.getComputedStyle(o,null).getPropertyValue(this.style.prop),a.forEach(function(s){this.knownState||(r=l.indexOf(s)!==-1,(r||this.style.prop!=="text-decoration")&&(this.knownState=r))},this)),r)}});n.isBuiltInButton=function(o){return typeof o=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(o)},e.extensions.button=n})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"B",contentFA:''},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"I",contentFA:''},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"U",contentFA:''},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"A",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"html",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.hideToolbarDefaultActions()},setToolbarPosition:function(){var o=this.base.getExtensionByName("toolbar");o&&o.setToolbarPosition()}});e.extensions.form=n})(),(function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"#",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=e.selection.getSelectionRange(this.document);return r.startContainer.nodeName.toLowerCase()==="a"||r.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(r),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(o){e.util.isKey(o,e.util.keyCode.K)&&e.util.isMetaCtrlKey(o)&&!o.shiftKey&&this.handleClick(o)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var o=[''];return o.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formSaveLabel,""),o.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formCloseLabel,""),this.targetCheckbox&&o.push('

','','","
"),this.customClassOption&&o.push('
','',"","
"),o.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(o){var r=this.getInput(),i=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(o=o||{value:""},typeof o=="string"&&(o={value:o}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),r.value=o.value,r.focus(),i&&(i.checked=o.target==="_blank"),a){var l=o.buttonClass?o.buttonClass.split(" "):[];a.checked=l.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox(),i={value:this.getInput().value.trim()};return this.linkValidation&&(i.value=this.checkLinkFormat(i.value)),i.target="_self",o&&o.checked&&(i.target="_blank"),r&&r.checked&&(i.buttonClass=this.customClassOption),i},doFormSave:function(){var o=this.getFormOpts();this.completeFormSave(o)},completeFormSave:function(o){this.base.restoreSelection(),this.execAction(this.action,o),this.base.checkSelection()},ensureEncodedUri:function(o){return o===decodeURI(o)?encodeURI(o):o},ensureEncodedUriComponent:function(o){return o===decodeURIComponent(o)?encodeURIComponent(o):o},ensureEncodedParam:function(o){var r=o.split("="),i=r[0],a=r[1];return i+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(o){return o.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(o){var r=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,i=r.test(o),a="",l=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,s=o.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),f=s[1],h=s[2],v=s[3];if(l.test(o))return"tel:"+o;if(!i){var b=f.split("/")[0];(b.match(/.+(\.|:).+/)||b==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(f)+(h===void 0?"":"?"+this.ensureEncodedQuery(h))+(v===void 0?"":"#"+v)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(o){var r=o.querySelector(".medium-editor-toolbar-close"),i=o.querySelector(".medium-editor-toolbar-save"),a=o.querySelector(".medium-editor-toolbar-input");this.on(o,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(r,"click",this.handleCloseClick.bind(this)),this.on(i,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var o=this.document,r=o.createElement("div");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),r.innerHTML=this.getTemplate(),this.attachFormEvents(r),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(o){if(o.keyCode===e.util.keyCode.ENTER){o.preventDefault(),this.doFormSave();return}o.keyCode===e.util.keyCode.ESCAPE&&(o.preventDefault(),this.doFormCancel())},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n})(),(function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var o=this.document.createElement("div");return o.id="medium-editor-anchor-preview-"+this.getEditorId(),o.className="medium-editor-anchor-preview",o.innerHTML=this.getTemplate(),this.on(o,"click",this.handleClick.bind(this)),o},getTemplate:function(){return'
'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(o){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||o.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=o.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=o.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=o,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(o){o=o||this.activeAnchor;var r=this.window.innerWidth,i=this.anchorPreview.offsetHeight,a=o.getBoundingClientRect(),l=this.diffLeft,s=this.diffTop,f=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,v={},b,w,O,E,S;b=this.anchorPreview.offsetWidth/2;var M=this.base.getExtensionByName("toolbar");M&&(l=M.diffLeft,s=M.diffTop),w=l-b,h?(E=f.getBoundingClientRect(),["top","left"].forEach(function(C){v[C]=a[C]-E[C]}),v.width=a.width,v.height=a.height,a=v,r=E.width,S=f.scrollTop):S=this.window.pageYOffset,O=a.left+a.width/2,S+=i+a.top+a.height-s-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(S)+"px",this.anchorPreview.style.right="initial",Othis.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n})(),(function(){var n,o,r,i,a;n=[" "," ",` `,"\r"," "," "," "," "," ","\u2028","\u2029"],o="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",r="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+o+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+o+"))",i=new RegExp("^("+o+")$","i"),a=new RegExp(r,"gi");function l(f){return!e.util.getClosestTag(f,"a")}var s=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var f=0,h=0;h0&&E!==null;)w=v.currentNode,O=w.nodeValue,O.length>h?(E=w.splitText(O.length-h),h=0):(E=v.previousNode(),h-=O.length);return E},performLinkingWithinElement:function(f){for(var h=this.findLinkableText(f),v=!1,b=0;b1;)b.appendChild(v.childNodes[1])}});e.extensions.autoLink=s})(),(function(){var n="medium-editor-dragover";function o(i){var a=e.util.getContainerEditorElement(i),l=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));l.forEach(function(s){s.classList.remove(n)})}var r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(i){i.preventDefault(),i.dataTransfer.dropEffect="copy";var a=i.target.classList?i.target:i.target.parentElement;o(a),i.type==="dragover"&&a.classList.add(n)},handleDrop:function(i){i.preventDefault(),i.stopPropagation(),this.base.selectElement(i.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),i.dataTransfer.files&&Array.prototype.slice.call(i.dataTransfer.files).forEach(function(l){this.isAllowedFile(l)&&l.type.match("image")&&this.insertImageFile(l)},this),o(i.target)},isAllowedFile:function(i){return this.allowedTypes.some(function(a){return!!i.type.match(a)})},insertImageFile:function(i){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(i),a.addEventListener("load",(function(l){var s=this.document.createElement("img");s.src=l.target.result,e.util.insertHTMLCommand(this.document,s.outerHTML)}).bind(this))}}});e.extensions.fileDragging=r})(),(function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(o){var r=o.key.charCodeAt(0);this.keys[r]||(this.keys[r]=[]),this.keys[r].push(o)},this)},handleKeydown:function(o){var r=e.util.getKeyCode(o);if(this.keys[r]){var i=e.util.isMetaCtrlKey(o),a=!!o.shiftKey,l=!!o.altKey;this.keys[r].forEach(function(s){s.meta===i&&s.shift===a&&(s.alt===l||s.alt===void 0)&&(o.preventDefault(),o.stopPropagation(),typeof s.command=="function"?s.command.apply(this):s.command!==!1&&this.execAction(s.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontName")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(o){var r=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("select"),a=o.createElement("a"),l=o.createElement("a"),s;r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this));for(var f=0;f
':"✓",r.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("face")&&o.removeAttribute("face")})},handleFontChange:function(){var o=this.getSelect().value;o===""?this.clearFontName():this.execAction("fontName",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontSize")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(o){var r=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("input"),a=o.createElement("a"),l=o.createElement("a");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this)),i.setAttribute("type","range"),i.setAttribute("min","1"),i.setAttribute("max","7"),i.className="medium-editor-toolbar-input",r.appendChild(i),this.on(i,"change",this.handleSliderChange.bind(this)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"✓",r.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("size")&&o.removeAttribute("size")})},handleSliderChange:function(){var o=this.getInput().value;o==="4"?this.clearFontSize():this.execAction("fontSize",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",o=null,r=null,i=function(f){f.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/|/g),""],[new RegExp(/
$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
/g),"
"],[new RegExp(/]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:(bold|700)[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"

"],[new RegExp(/\n+

/gi),""],[new RegExp(/(((?!/gi),"$1"]]}function l(f,h,v){var b=f.clipboardData||h.clipboardData||v.dataTransfer,w={};if(!b)return w;if(b.getData){var O=b.getData("Text");O&&O.length>0&&(w["text/plain"]=O)}if(b.types)for(var E=0;E1)for(O=0;O"+e.util.htmlEntities(b[O])+"

");else w=e.util.htmlEntities(b[0]);e.util.insertHTMLCommand(this.document,w)}},handlePasteBinPaste:function(f){if(f.defaultPrevented){this.removePasteBin();return}var h=l(f,this.window,this.document),v=h["text/html"],b=h["text/plain"],w=r;if(!this.cleanPastedHTML||v){f.preventDefault(),this.removePasteBin(),this.doPaste(v,b,w),this.trigger("editablePaste",{currentTarget:w,target:w},w);return}setTimeout((function(){this.cleanPastedHTML&&(v=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(v,b,w),this.trigger("editablePaste",{currentTarget:w,target:w},w)}).bind(this),0)},handleKeydown:function(f,h){e.util.isKey(f,e.util.keyCode.V)&&e.util.isMetaCtrlKey(f)&&(f.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(h))},createPasteBin:function(f){var h,v=e.selection.getSelectionRange(this.document),b=this.window.pageYOffset;r=f,v&&(h=v.getClientRects(),h.length?b+=h[0].top:v.startContainer.getBoundingClientRect!==void 0?b+=v.startContainer.getBoundingClientRect().top:b+=v.getBoundingClientRect().top),o=v;var w=this.document.createElement("div");w.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),w.setAttribute("style","border: 1px red solid; position: absolute; top: "+b+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),w.setAttribute("contentEditable",!0),w.innerHTML=n,this.document.body.appendChild(w),this.on(w,"focus",i),this.on(w,"focusin",i),this.on(w,"focusout",i),w.focus(),e.selection.selectNode(w,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(w,"paste",this.boundHandlePaste)},removePasteBin:function(){o!==null&&(e.selection.selectRange(this.document,o),o=null),r!==null&&(r=null);var f=this.getPasteBin();f&&f&&(this.off(f,"focus",i),this.off(f,"focusin",i),this.off(f,"focusout",i),this.off(f,"paste",this.boundHandlePaste),f.parentElement.removeChild(f))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var f=this.getPasteBin();if(!f||f.firstChild&&f.firstChild.id==="mcepastebin")return!1;var h=f.innerHTML;return!h||h===n?!1:h},cleanPaste:function(f){var h,v,b,w,O=/"+f.split("

").join("

")+"

",v=b.querySelectorAll("a,p,div,br"),h=0;h"+v.innerHTML+"
":b.innerHTML=v.innerHTML,v.parentNode.replaceChild(b,v);for(w=f.querySelectorAll("span"),h=0;h0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),o},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(o){if(o&&o.target&&e.util.isDescendant(this.getToolbarElement(),o.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(o){o.hasForm&&o.isDisplayed()&&o.hideForm()})},multipleBlockElementsSelected:function(){var o=/<[^\/>][^>]*><\/[^>]+>/gim,r=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=e.selection.getSelectionHtml(this.document).replace(o,""),a=i.match(r);return!!a&&a.length>1},modifySelection:function(){var o=this.window.getSelection(),r=o.getRangeAt(0);if(this.standardizeSelectionStart&&r.startContainer.nodeValue&&r.startOffset===r.startContainer.nodeValue.length){var i=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),r.startContainer,this.document);if(i){for(var a=0;i.nodeValue.substr(a,1).trim().length===0;)a=a+1;r=e.selection.select(this.document,i,a,r.endContainer,r.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var o=e.selection.getSelectionElement(this.window);if(!o||this.getEditorElements().indexOf(o)===-1||o.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(o){typeof o.isActive=="function"&&typeof o.setInactive=="function"&&o.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var o=[],r=null,i=e.selection.getSelectionRange(this.document),a,l=function(s){typeof s.checkState=="function"?s.checkState(a):typeof s.isActive=="function"&&typeof s.isAlreadyApplied=="function"&&typeof s.setActive=="function"&&!s.isActive()&&s.isAlreadyApplied(a)&&s.setActive()};if(i&&(this.forEachExtension(function(s){if(typeof s.queryCommandState=="function"&&(r=s.queryCommandState(),r!==null)){r&&typeof s.setActive=="function"&&s.setActive();return}o.push(s)}),a=e.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(s){return e.util.isDescendant(s,a,!0)})))for(;a&&(o.forEach(l),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var o=this.base.getFocusedElement(),r=this.window.getSelection();if(!o)return this;(this.static||!r.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(o):this.positionToolbar(r)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(o){this.getToolbarElement().style.left="0";var r=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,a=this.getToolbarElement(),l=o.getBoundingClientRect(),s=l.top+r,f=l.left+l.width/2,h=a.offsetHeight,v=a.offsetWidth,b=v/2,w;switch(this.sticky?r>s+o.offsetHeight-h-this.stickyTopOffset?(a.style.top=s+o.offsetHeight-h+"px",a.classList.remove("medium-editor-sticky-toolbar")):r>s-h-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=s-h+"px"):a.style.top=s-h+"px",this.align){case"left":w=l.left;break;case"right":w=l.right-v;break;case"center":w=f-b;break}w<0?w=0:w+v>i&&(w=i-Math.ceil(v)-1),a.style.left=w+"px"},positionToolbar:function(o){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var r=o.getRangeAt(0),i=r.getBoundingClientRect();(!i||i.height===0&&i.width===0&&r.startContainer===r.endContainer)&&(r.startContainer.nodeType===1&&r.startContainer.querySelector("img")?i=r.startContainer.querySelector("img").getBoundingClientRect():i=r.startContainer.getBoundingClientRect());var a=this.window.innerWidth,l=this.getToolbarElement(),s=l.offsetHeight,f=l.offsetWidth,h=f/2,v=50,b=this.diffLeft-h,w=this.getEditorOption("elementsContainer"),O=["absolute","fixed"].indexOf(window.getComputedStyle(w).getPropertyValue("position"))>-1,E={},S={},M,C;O?(C=w.getBoundingClientRect(),["top","left"].forEach(function($){S[$]=i[$]-C[$]}),S.width=i.width,S.height=i.height,i=S,a=C.width,E.top=w.scrollTop):E.top=this.window.pageYOffset,M=i.left+i.width/2,E.top+=i.top-s,i.top'),l.onload=(function(){var f=this.document.getElementById(s);f&&(f.removeAttribute("id"),f.removeAttribute("class"),f.src=l.result)}).bind(this)}}).bind(this))),o.target.classList.remove(r)}});e.extensions.imageDragging=n})(),(function(){function n(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q.textContent,ie=e.selection.getCaretOffsets(Q);(J[ie.left-1]===void 0||J[ie.left-1].trim()===""||J[ie.left]!==void 0&&J[ie.left].trim()==="")&&W.preventDefault()}function o(W,Q){if(this.options.disableReturn||Q.getAttribute("data-disable-return"))W.preventDefault();else if(this.options.disableDoubleReturn||Q.getAttribute("data-disable-double-return")){var J=e.selection.getSelectionStart(this.options.ownerDocument);(J&&J.textContent.trim()===""&&J.nodeName.toLowerCase()!=="li"||J.previousElementSibling&&J.previousElementSibling.nodeName.toLowerCase()!=="br"&&J.previousElementSibling.textContent.trim()==="")&&W.preventDefault()}}function r(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q&&Q.nodeName.toLowerCase();J==="pre"&&(W.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(Q)&&(W.preventDefault(),W.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(W){var Q,J=e.selection.getSelectionStart(this.options.ownerDocument),ie=J.nodeName.toLowerCase(),Se=/^(\s+|)?$/i,Ae=/h\d/i;e.util.isKey(W,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&J.previousElementSibling&&Ae.test(ie)&&e.selection.getCaretOffsets(J).left===0?e.util.isKey(W,e.util.keyCode.BACKSPACE)&&Se.test(J.previousElementSibling.innerHTML)?(J.previousElementSibling.parentNode.removeChild(J.previousElementSibling),W.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(W,e.util.keyCode.ENTER)&&(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.previousElementSibling.parentNode.insertBefore(Q,J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.DELETE)&&J.nextElementSibling&&J.previousElementSibling&&!Ae.test(ie)&&Se.test(J.innerHTML)&&Ae.test(J.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,J.nextElementSibling),J.previousElementSibling.parentNode.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&ie==="li"&&Se.test(J.innerHTML)&&!J.previousElementSibling&&!J.parentElement.previousElementSibling&&J.nextElementSibling&&J.nextElementSibling.nodeName.toLowerCase()==="li"?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.parentElement.parentElement.insertBefore(Q,J.parentElement),e.selection.moveCursor(this.options.ownerDocument,Q),J.parentElement.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).left===0?(W.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(W,e.util.keyCode.ENTER)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).right===0?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.parentElement.insertBefore(Q,J.nextSibling),e.selection.moveCursor(this.options.ownerDocument,Q),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(J.parentElement)&&!J.previousElementSibling&&J.nextElementSibling&&Se.test(J.innerHTML)&&(W.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,J.nextSibling),J.parentElement.removeChild(J))}function a(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J;Q&&(e.util.isMediumEditorElement(Q)&&Q.children.length===0&&!e.util.isBlockContainer(Q)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(W,e.util.keyCode.ENTER)&&!e.util.isListItem(Q)&&!e.util.isBlockContainer(Q)&&(J=Q.nodeName.toLowerCase(),J==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!W.shiftKey&&!W.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function l(W,Q){var J=Q.parentNode.querySelector('textarea[medium-editor-textarea-id="'+Q.getAttribute("medium-editor-textarea-id")+'"]');J&&(J.value=Q.innerHTML.trim())}function s(W){W._mediumEditors||(W._mediumEditors=[null]),this.id||(this.id=W._mediumEditors.length),W._mediumEditors[this.id]=this}function f(W){!W._mediumEditors||!W._mediumEditors[this.id]||(W._mediumEditors[this.id]=null)}function h(W,Q,J){var ie=[];if(W||(W=[]),typeof W=="string"&&(W=Q.querySelectorAll(W)),e.util.isElement(W)&&(W=[W]),J)for(var Se=0;Se=0&&(J=e.selection.exportSelection(W,this.options.ownerDocument)),J!==null&&Q!==0&&(J.editableElementIndex=Q),J},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(W,Q){if(W){var J=this.elements[W.editableElementIndex||0];e.selection.importSelection(W,J,this.options.ownerDocument,Q)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(W){var Q=e.selection.getSelectionElement(this.options.contentWindow),J={},ie;if(this.elements.indexOf(Q)!==-1){try{if(this.events.disableCustomEvent("editableInput"),W.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),ie=W.url||W.value,ie&&ie.trim().length>0){var Se=this.options.contentWindow.getSelection();if(Se){var Ae=Se.getRangeAt(0),ke=Ae.commonAncestorContainer,De,ze,Ye,Be;if(Ae.endContainer.nodeType===3&&Ae.startContainer.nodeType!==3&&Ae.startOffset===0&&Ae.startContainer.firstChild===Ae.endContainer&&(ke=Ae.endContainer),ze=e.util.getClosestBlockContainer(Ae.startContainer),Ye=e.util.getClosestBlockContainer(Ae.endContainer),ke.nodeType!==3&&ke.textContent.length!==0&&ze===Ye){var Je=ze||Q,gt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),De=this.exportSelection(),gt.appendChild(Je.cloneNode(!0)),Q===Je?e.selection.select(this.options.ownerDocument,Je.firstChild,0,Je.lastChild,Je.lastChild.nodeType===3?Je.lastChild.nodeValue.length:Je.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,Je,0,Je,Je.childNodes.length);var se=this.exportSelection();Be=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,gt,{start:De.start-se.start,end:De.end-se.start,editableElementIndex:De.editableElementIndex}),Be.length===0&&(gt=this.options.ownerDocument.createDocumentFragment(),gt.appendChild(ke.cloneNode(!0)),Be=[gt.firstChild.firstChild,gt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(gt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,gt.firstChild.innerHTML.replace(/^\s+/,"")),De.start-=Ze,De.end-=Ze,this.importSelection(De)}else this.options.ownerDocument.execCommand("createLink",!1,ie);this.options.targetBlank||W.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie),W.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),W.buttonClass)}}if(this.options.targetBlank||W.target==="_blank"||W.buttonClass){J=this.options.ownerDocument.createEvent("HTMLEvents"),J.initEvent("input",!0,!0,this.options.contentWindow);for(var pe=0,le=this.elements.length;pe1?o[1]:"";return{major:parseInt(r[0],10),minor:parseInt(r[1],10),revision:parseInt(r[2],10),preRelease:i,toString:function(){return[r[0],r[1],r[2]].join(".")+(i?"-"+i:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Q0)),Q0.exports}var gne=mne();const D0=Z_(gne);/*! * vanilla-picker v2.12.3 * https://vanilla-picker.js.org * * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) * Released under the ISC license. */var DM=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jM=(function(){function t(e,n){for(var o=0;o1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var _ne=(function(){function t(e,n,o,r){DM(this,t);var i=this;function a(s){if(s.startsWith("hsl")){var f=s.match(/([\-\d\.e]+)/g).map(Number),h=j0(f,4),v=h[0],b=h[1],w=h[2],O=h[3];O===void 0&&(O=1),v/=360,b/=100,w/=100,i.hsla=[v,b,w,O]}else if(s.startsWith("rgb")){var E=s.match(/([\-\d\.e]+)/g).map(Number),S=j0(E,4),M=S[0],C=S[1],$=S[2],D=S[3];D===void 0&&(D=1),i.rgba=[M,C,$,D]}else s.startsWith("#")?i.rgba=t.hexToRgb(s):i.rgba=t.nameToRgb(s)||t.hexToRgb(s)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(o===void 0){var l=e&&""+e;l&&a(l.toLowerCase())}else this.rgba=[e,n,o,r===void 0?1:r]}return jM(t,[{key:"printRGB",value:function(n){var o=n?this.rgba:this.rgba.slice(0,3),r=o.map(function(i,a){return gR(i,a===3?3:0)});return n?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(n){var o=[360,100,100,1],r=["","%","%",""],i=n?this.hsla:this.hsla.slice(0,3),a=i.map(function(l,s){return gR(l*o[s],s===3?3:1)+r[s]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var o=this.hex;return n?o:o.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,o=n.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+o.map(function(r){return r.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var o=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!o.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var r=o.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(i){return parseInt(i,16)});return r[3]=r[3]/255,r}},{key:"nameToRgb",value:function(n){var o=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=yne[o];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],l=o[3];r/=255,i/=255,a/=255;var s=Math.max(r,i,a),f=Math.min(r,i,a),h=void 0,v=void 0,b=(s+f)/2;if(s===f)h=v=0;else{var w=s-f;switch(v=b>.5?w/(2-s-f):w/(s+f),s){case r:h=(i-a)/w+(i1&&(C-=1),C<.16666666666666666?S+(M-S)*6*C:C<.5?M:C<.6666666666666666?S+(M-S)*(.6666666666666666-C)*6:S},b=a<.5?a*(1+i):a+i-a*i,w=2*a-b;s=v(w,b,r+1/3),f=v(w,b,r),h=v(w,b,r-1/3)}var O=[s*255,f*255,h*255].map(Math.round);return O[3]=l,O}}]),t})(),bne=(function(){function t(){DM(this,t),this._events=[]}return jM(t,[{key:"add",value:function(n,o,r){n.addEventListener(o,r,!1),this._events.push({target:n,type:o,handler:r})}},{key:"remove",value:function(n,o,r){this._events=this._events.filter(function(i){var a=!0;return n&&n!==i.target&&(a=!1),o&&o!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&t._doRemove(i.target,i.type,i.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,o,r){n.removeEventListener(o,r,!1)}}]),t})();function wne(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function mS(t,e,n){var o=!1;function r(s,f,h){return Math.max(f,Math.min(s,h))}function i(s,f,h){if(h&&(o=!0),!!o){s.preventDefault();var v=e.getBoundingClientRect(),b=v.width,w=v.height,O=f.clientX,E=f.clientY,S=r(O-v.left,0,b),M=r(E-v.top,0,w);n(S/b,M/w)}}function a(s,f){var h=s.buttons===void 0?s.which:s.buttons;h===1?i(s,s,f):o=!1}function l(s,f){s.touches.length===1?i(s,s.touches[0],f):o=!1}t.add(e,"mousedown",function(s){a(s,!0)}),t.add(e,"touchstart",function(s){l(s,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",l),t.add(window,"mouseup",function(s){o=!1}),t.add(e,"touchend",function(s){o=!1}),t.add(e,"touchcancel",function(s){o=!1})}var Ene=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em, linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,xne=360,q3="keydown",L0="mousedown",gS="focusin";function Rd(t,e){return(e||document).querySelector(t)}function One(t){t.preventDefault(),t.stopPropagation()}function yS(t,e,n,o,r){t.add(e,q3,function(i){n.indexOf(i.key)>=0&&o(i)})}var K3=(function(){function t(e){DM(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new bne,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return jM(t,[{key:"setOptions",value:function(n){var o=this;if(!n)return;var r=this.settings;function i(f,h,v){for(var b in f)h[b]=f[b]}if(n instanceof HTMLElement)r.parent=n;else{r.parent&&n.parent&&r.parent!==n.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(n,r),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var l=r.parent;if(l&&r.popup&&!this._popupInited){var s=function(h){return o.openHandler(h)};this._events.add(l,"click",s),yS(this._events,l,[" ","Spacebar","Enter"],s),this._popupInited=!0}else n.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var o=n&&n.type===q3?this._domEdit:this.domElement;setTimeout(function(){return o.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var o=n&&n.type,r=!1;if(!n)r=!0;else if(o===L0||o===gS){var i=(this.__containedEvent||0)+100;n.timeStamp>i&&(r=!0)}else One(n),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",o!==L0&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,o){this.closeHandler(),this.setOptions(n),o&&this.openHandler()}},{key:"setColor",value:function(n,o){this._setColor(n,{silent:o})}},{key:"_setColor",value:function(n,o){if(typeof n=="string"&&(n=n.trim()),!!n){o=o||{};var r=void 0;try{r=new _ne(n)}catch(a){if(o.failSilently)return;throw a}if(!this.settings.alpha){var i=r.hsla;i[3]=1,r.hsla=i}this.colour=this.color=r,this._setHSLA(null,null,null,null,o)}}},{key:"setColour",value:function(n,o){this.setColor(n,o)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var o=this._toggleDOM(!0);return this._setPosition(),o}var r=this.settings.template||'
',i=wne(r);return this.domElement=i,this._domH=Rd(".picker_hue",i),this._domSL=Rd(".picker_sl",i),this._domA=Rd(".picker_alpha",i),this._domEdit=Rd(".picker_editor input",i),this._domSample=Rd(".picker_sample",i),this._domOkay=Rd(".picker_done button",i),this._domCancel=Rd(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,o=this,r=this.domElement,i=this._events;function a(f,h,v){i.add(f,h,v)}a(r,"click",function(f){return f.preventDefault()}),mS(i,this._domH,function(f,h){return o._setHSLA(f)}),mS(i,this._domSL,function(f,h){return o._setHSLA(null,f,1-h)}),this.settings.alpha&&mS(i,this._domA,function(f,h){return o._setHSLA(null,null,null,1-h)});var l=this._domEdit;a(l,"input",function(f){o._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(l,"focus",function(f){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var f=function(b){return n.closeHandler(b)};a(window,L0,f),a(window,gS,f),yS(i,r,["Esc","Escape"],f);var h=function(b){n.__containedEvent=b.timeStamp};a(r,L0,h),a(r,gS,h),a(n._domCancel,"click",f)});var s=function(h){n._ifPopup(function(){return n.closeHandler(h)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",s),yS(i,r,["Enter"],s)}},{key:"_setPosition",value:function(){var n=this.settings.parent,o=this.domElement;n!==o.parentNode&&n.appendChild(o),this._ifPopup(function(r){getComputedStyle(n).position==="static"&&(n.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===i?o.classList.add(a):o.classList.remove(a)}),o.classList.add(i)})}},{key:"_setHSLA",value:function(n,o,r,i,a){a=a||{};var l=this.colour,s=l.hsla;[n,o,r,i].forEach(function(f,h){(f||f===0)&&(s[h]=f)}),l.hsla=s,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(l)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var o=this.colour,r=o.hsla,i="hsl("+r[0]*xne+", 100%, 50%)",a=o.hslString,l=o.hslaString,s=this._domH,f=this._domSL,h=this._domA,v=Rd(".picker_selector",s),b=Rd(".picker_selector",f),w=Rd(".picker_selector",h);function O(B,F,I){F.style.left=I*100+"%"}function E(B,F,I){F.style.top=I*100+"%"}O(s,v,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,O(f,b,r[1]),E(f,b,1-r[2]),f.style.color=a,E(h,w,1-r[3]);var S=a,M=S.replace("hsl","hsla").replace(")",", 0)"),C="linear-gradient("+[S,M]+")";if(this._domA.style.background=C+", "+Ene,!n.fromEditor){var $=this.settings.editorFormat,D=this.settings.alpha,k=void 0;switch($){case"rgb":k=o.printRGB(D);break;case"hsl":k=o.printHSL(D);break;default:k=o.printHex(D)}this._domEdit.value=k}this._domSample.style.color=l}},{key:"_ifPopup",value:function(n,o){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):o&&o()}},{key:"_toggleDOM",value:function(n){var o=this.domElement;if(!o)return!1;var r=n?"":"none",i=o.style.display!==r;return i&&(o.style.display=r),i}}]),t})();{var _S=document.createElement("style");_S.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(_S),K3.StyleElement=_S}var bS={exports:{}},yR;function Z3(){return yR||(yR=1,(function(t,e){(function(n,o){t.exports=n()})(function(){var n="object",o="function",r="undefined",i=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],l=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],s=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function f(se,Ze){var pe=typeof se[Ze];return pe==o||!!(pe==n&&se[Ze])||pe=="unknown"}function h(se,Ze){return!!(typeof se[Ze]==n&&se[Ze])}function v(se,Ze){return typeof se[Ze]!=r}function b(se){return function(Ze,pe){for(var le=pe.length;le--;)if(!se(Ze,pe[le]))return!1;return!0}}var w=b(f),O=b(h),E=b(v);function S(se){return se&&w(se,s)&&E(se,l)}function M(se){return h(se,"body")?se.body:se.getElementsByTagName("body")[0]}var C=[].forEach?function(se,Ze){se.forEach(Ze)}:function(se,Ze){for(var pe=0,le=se.length;pevn?(oo.node=lr,oo.offset-=vn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return lr}function Gt(ut){if(ut.nodeType==9)return ut;if(typeof ut.ownerDocument!=pe)return ut.ownerDocument;if(typeof ut.document!=pe)return ut.document;if(ut.parentNode)return Gt(ut.parentNode);throw Ze.createError("getDocument: no document found for node")}function kn(ut){var vn=Gt(ut);if(typeof vn.defaultView!=pe)return vn.defaultView;if(typeof vn.parentWindow!=pe)return vn.parentWindow;throw Ze.createError("Cannot get a window object for node")}function qt(ut){if(typeof ut.contentDocument!=pe)return ut.contentDocument;if(typeof ut.contentWindow!=pe)return ut.contentWindow.document;throw Ze.createError("getIframeDocument: No Document object found for iframe element")}function On(ut){if(typeof ut.contentWindow!=pe)return ut.contentWindow;if(typeof ut.contentDocument!=pe)return ut.contentDocument.defaultView;throw Ze.createError("getIframeWindow: No Window object found for iframe element")}function Pe(ut){return ut&&le.isHostMethod(ut,"setTimeout")&&le.isHostObject(ut,"document")}function Ke(ut,vn,In){var lr;if(ut?le.isHostProperty(ut,"nodeType")?lr=ut.nodeType==1&&ut.tagName.toLowerCase()=="iframe"?qt(ut):Gt(ut):Pe(ut)&&(lr=ut.document):lr=document,!lr)throw vn.createError(In+"(): Parameter must be a Window object or DOM node");return lr}function Le(ut){for(var vn;vn=ut.parentNode;)ut=vn;return ut}function dt(ut,vn,In,lr){var wo,oo,ta,Ca,Yi;if(ut==In)return vn===lr?0:vn",At=Tt(vn),se.features.crashyTextNodes=At})();function En(ut){if(!ut)return"[No node]";if(At&&Tt(ut))return"[Broken node]";if(vt(ut))return'"'+ut.data+'"';if(ut.nodeType==1){var vn=ut.id?' id="'+ut.id+'"':"";return"<"+ut.nodeName+vn+">[index:"+en(ut)+",length:"+ut.childNodes.length+"]["+(ut.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return ut.nodeName}function Zn(ut){for(var vn=Gt(ut).createDocumentFragment(),In;In=ut.firstChild;)vn.appendChild(In);return vn}var ao;typeof window.getComputedStyle!=pe?ao=function(ut,vn){return kn(ut).getComputedStyle(ut,null)[vn]}:typeof document.documentElement.currentStyle!=pe?ao=function(ut,vn){return ut.currentStyle?ut.currentStyle[vn]:""}:Ze.fail("No means of obtaining computed style properties found");function Lo(ut,vn,In){var lr=we(ut),wo=ut.createElement("div");wo.contentEditable=""+!!In,vn&&(wo.innerHTML=vn);var oo=lr.firstChild;return oo?lr.insertBefore(wo,oo):lr.appendChild(wo),wo}function yo(ut){return ut.parentNode.removeChild(ut)}function ho(ut){this.root=ut,this._next=ut}ho.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var ut=this._current=this._next,vn,In;if(this._current)if(vn=ut.firstChild,vn)this._next=vn;else{for(In=null;ut!==this.root&&!(In=ut.nextSibling);)ut=ut.parentNode;this._next=In}return this._current},detach:function(){this._current=this._next=this.root=null}};function Nn(ut){return new ho(ut)}function qn(ut,vn){this.node=ut,this.offset=vn}qn.prototype={equals:function(ut){return!!ut&&this.node===ut.node&&this.offset==ut.offset},inspect:function(){return"[DomPosition("+En(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function rr(ut){this.code=this[ut],this.codeName=ut,this.message="DOMException: "+this.codeName}rr.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},rr.prototype.toString=function(){return this.message},se.dom={arrayContains:pt,isHtmlNamespace:Lt,parentElement:Jt,getNodeIndex:en,getNodeLength:zt,getCommonAncestor:it,isAncestorOf:ae,isOrIsAncestorOf:re,getClosestAncestorIn:je,isCharacterDataNode:vt,isTextOrCommentNode:q,insertAfter:Pt,splitDataNode:Rt,getDocument:Gt,getWindow:kn,getIframeWindow:On,getIframeDocument:qt,getBody:we,isWindow:Pe,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:En,getComputedStyleProperty:ao,createTestElement:Lo,removeNode:yo,fragmentFromNodeChildren:Zn,createIterator:Nn,DomPosition:qn},se.DOMException=rr}),B.createCoreModule("DomRange",["DomUtil"],function(se,Ze){var pe=se.dom,le=se.util,we=pe.DomPosition,$e=se.DOMException,rt=pe.isCharacterDataNode,pt=pe.getNodeIndex,Lt=pe.isOrIsAncestorOf,Jt=pe.getDocument,en=pe.comparePoints,zt=pe.splitDataNode,it=pe.getClosestAncestorIn,ae=pe.getNodeLength,re=pe.arrayContains,je=pe.getRootContainer,vt=se.features.crashyTextNodes,q=pe.removeNode;function Pt(ye,ht){return ye.nodeType!=3&&(Lt(ye,ht.startContainer)||Lt(ye,ht.endContainer))}function Rt(ye){return ye.document||Jt(ye.startContainer)}function Gt(ye){return je(ye.startContainer)}function kn(ye){return new we(ye.parentNode,pt(ye))}function qt(ye){return new we(ye.parentNode,pt(ye)+1)}function On(ye,ht,fn){var Rn=ye.nodeType==11?ye.firstChild:ye;return rt(ht)?fn==ht.length?pe.insertAfter(ye,ht):ht.parentNode.insertBefore(ye,fn==0?ht:zt(ht,fn)):fn>=ht.childNodes.length?ht.appendChild(ye):ht.insertBefore(ye,ht.childNodes[fn]),Rn}function Pe(ye,ht,fn){if(Sn(ye),Sn(ht),Rt(ht)!=Rt(ye))throw new $e("WRONG_DOCUMENT_ERR");var Rn=en(ye.startContainer,ye.startOffset,ht.endContainer,ht.endOffset),Cn=en(ye.endContainer,ye.endOffset,ht.startContainer,ht.startOffset);return fn?Rn<=0&&Cn>=0:Rn<0&&Cn>0}function Ke(ye){for(var ht,fn,Rn=Rt(ye.range).createDocumentFragment(),Cn;fn=ye.next();){if(ht=ye.isPartiallySelectedSubtree(),fn=fn.cloneNode(!ht),ht&&(Cn=ye.getSubtreeIterator(),fn.appendChild(Ke(Cn)),Cn.detach()),fn.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");Rn.appendChild(fn)}return Rn}function Le(ye,ht,fn){var Rn,Cn;fn=fn||{stop:!1};for(var nr,Mn;nr=ye.next();)if(ye.isPartiallySelectedSubtree()){if(ht(nr)===!1){fn.stop=!0;return}else if(Mn=ye.getSubtreeIterator(),Le(Mn,ht,fn),Mn.detach(),fn.stop)return}else for(Rn=pe.createIterator(nr);Cn=Rn.next();)if(ht(Cn)===!1){fn.stop=!0;return}}function dt(ye){for(var ht;ye.next();)ye.isPartiallySelectedSubtree()?(ht=ye.getSubtreeIterator(),dt(ht),ht.detach()):ye.remove()}function At(ye){for(var ht,fn=Rt(ye.range).createDocumentFragment(),Rn;ht=ye.next();){if(ye.isPartiallySelectedSubtree()?(ht=ht.cloneNode(!1),Rn=ye.getSubtreeIterator(),ht.appendChild(At(Rn)),Rn.detach()):ye.remove(),ht.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");fn.appendChild(ht)}return fn}function Tt(ye,ht,fn){var Rn=!!(ht&&ht.length),Cn,nr=!!fn;Rn&&(Cn=new RegExp("^("+ht.join("|")+")$"));var Mn=[];return Le(new Zn(ye,!1),function(or){if(!(Rn&&!Cn.test(or.nodeType))&&!(nr&&!fn(or))){var sr=ye.startContainer;if(!(or==sr&&rt(sr)&&ye.startOffset==sr.length)){var qr=ye.endContainer;or==qr&&rt(qr)&&ye.endOffset==0||Mn.push(or)}}}),Mn}function En(ye){var ht=typeof ye.getName>"u"?"Range":ye.getName();return"["+ht+"("+pe.inspectNode(ye.startContainer)+":"+ye.startOffset+", "+pe.inspectNode(ye.endContainer)+":"+ye.endOffset+")]"}function Zn(ye,ht){if(this.range=ye,this.clonePartiallySelectedTextNodes=ht,!ye.collapsed){this.sc=ye.startContainer,this.so=ye.startOffset,this.ec=ye.endContainer,this.eo=ye.endOffset;var fn=ye.commonAncestorContainer;this.sc===this.ec&&rt(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===fn&&!rt(this.sc)?this.sc.childNodes[this.so]:it(this.sc,fn,!0),this._last=this.ec===fn&&!rt(this.ec)?this.ec.childNodes[this.eo-1]:it(this.ec,fn,!0))}}Zn.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var ye=this._current=this._next;return ye&&(this._next=ye!==this._last?ye.nextSibling:null,rt(ye)&&this.clonePartiallySelectedTextNodes&&(ye===this.ec&&(ye=ye.cloneNode(!0)).deleteData(this.eo,ye.length-this.eo),this._current===this.sc&&(ye=ye.cloneNode(!0)).deleteData(0,this.so))),ye},remove:function(){var ye=this._current,ht,fn;rt(ye)&&(ye===this.sc||ye===this.ec)?(ht=ye===this.sc?this.so:0,fn=ye===this.ec?this.eo:ye.length,ht!=fn&&ye.deleteData(ht,fn-ht)):ye.parentNode&&q(ye)},isPartiallySelectedSubtree:function(){var ye=this._current;return Pt(ye,this.range)},getSubtreeIterator:function(){var ye;if(this.isSingleCharacterDataNode)ye=this.range.cloneRange(),ye.collapse(!1);else{ye=new li(Rt(this.range));var ht=this._current,fn=ht,Rn=0,Cn=ht,nr=ae(ht);Lt(ht,this.sc)&&(fn=this.sc,Rn=this.so),Lt(ht,this.ec)&&(Cn=this.ec,nr=this.eo),lo(ye,fn,Rn,Cn,nr)}return new Zn(ye,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var ao=[1,3,4,5,7,8,10],Lo=[2,9,11],yo=[5,6,10,12],ho=[1,3,4,5,7,8,10,11],Nn=[1,3,4,5,7,8];function qn(ye){return function(ht,fn){for(var Rn,Cn=fn?ht:ht.parentNode;Cn;){if(Rn=Cn.nodeType,re(ye,Rn))return Cn;Cn=Cn.parentNode}return null}}var rr=qn([9,11]),ut=qn(yo),vn=qn([6,10,12]),In=qn([1]);function lr(ye,ht){if(vn(ye,ht))throw new $e("INVALID_NODE_TYPE_ERR")}function wo(ye,ht){if(!re(ht,ye.nodeType))throw new $e("INVALID_NODE_TYPE_ERR")}function oo(ye,ht){if(ht<0||ht>(rt(ye)?ye.length:ye.childNodes.length))throw new $e("INDEX_SIZE_ERR")}function ta(ye,ht){if(rr(ye,!0)!==rr(ht,!0))throw new $e("WRONG_DOCUMENT_ERR")}function Ca(ye){if(ut(ye,!0))throw new $e("NO_MODIFICATION_ALLOWED_ERR")}function Yi(ye,ht){if(!ye)throw new $e(ht)}function fa(ye,ht){return ht<=(rt(ye)?ye.length:ye.childNodes.length)}function Ka(ye){return!!ye.startContainer&&!!ye.endContainer&&!(vt&&(pe.isBrokenNode(ye.startContainer)||pe.isBrokenNode(ye.endContainer)))&&je(ye.startContainer)==je(ye.endContainer)&&fa(ye.startContainer,ye.startOffset)&&fa(ye.endContainer,ye.endOffset)}function Sn(ye){if(!Ka(ye))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+ye.inspect()+")")}var Tl=document.createElement("style"),Oo=!1;try{Tl.innerHTML="x",Oo=Tl.firstChild.nodeType==3}catch{}se.features.htmlParsingConforms=Oo;var el=Oo?function(ye){var ht=this.startContainer,fn=Jt(ht);if(!ht)throw new $e("INVALID_STATE_ERR");var Rn=null;return ht.nodeType==1?Rn=ht:rt(ht)&&(Rn=pe.parentElement(ht)),Rn===null||Rn.nodeName=="HTML"&&pe.isHtmlNamespace(Jt(Rn).documentElement)&&pe.isHtmlNamespace(Rn)?Rn=fn.createElement("body"):Rn=Rn.cloneNode(!1),Rn.innerHTML=ye,pe.fragmentFromNodeChildren(Rn)}:function(ye){var ht=Rt(this),fn=ht.createElement("body");return fn.innerHTML=ye,pe.fragmentFromNodeChildren(fn)};function Ui(ye,ht){Sn(ye);var fn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=fn===Cn;rt(Cn)&&nr>0&&nr0&&Rn=pt(fn)&&nr++,Rn=0),ye.setStartAndEnd(fn,Rn,Cn,nr)}function gr(ye){Sn(ye);var ht=ye.commonAncestorContainer.parentNode.cloneNode(!1);return ht.appendChild(ye.cloneContents()),ht.innerHTML}var ms=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],pa=0,qi=1,Na=2,as=3,gs=0,Cl=1,ys=2,tl=3;le.extend(se.rangePrototype,{compareBoundaryPoints:function(ye,ht){Sn(this),ta(this.startContainer,ht.startContainer);var fn,Rn,Cn,nr,Mn=ye==as||ye==pa?"start":"end",or=ye==qi||ye==pa?"start":"end";return fn=this[Mn+"Container"],Rn=this[Mn+"Offset"],Cn=ht[or+"Container"],nr=ht[or+"Offset"],en(fn,Rn,Cn,nr)},insertNode:function(ye){if(Sn(this),wo(ye,ho),Ca(this.startContainer),Lt(ye,this.startContainer))throw new $e("HIERARCHY_REQUEST_ERR");var ht=On(ye,this.startContainer,this.startOffset);this.setStartBefore(ht)},cloneContents:function(){Sn(this);var ye,ht;if(this.collapsed)return Rt(this).createDocumentFragment();if(this.startContainer===this.endContainer&&rt(this.startContainer))return ye=this.startContainer.cloneNode(!0),ye.data=ye.data.slice(this.startOffset,this.endOffset),ht=Rt(this).createDocumentFragment(),ht.appendChild(ye),ht;var fn=new Zn(this,!0);return ye=Ke(fn),fn.detach(),ye},canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var ye=new Zn(this,!0),ht=ye._first&&Pt(ye._first,this)||ye._last&&Pt(ye._last,this);return ye.detach(),!ht},surroundContents:function(ye){if(wo(ye,Nn),!this.canSurroundContents())throw new $e("INVALID_STATE_ERR");var ht=this.extractContents();if(ye.hasChildNodes())for(;ye.lastChild;)ye.removeChild(ye.lastChild);On(ye,this.startContainer,this.startOffset),ye.appendChild(ht),this.selectNode(ye)},cloneRange:function(){Sn(this);for(var ye=new li(Rt(this)),ht=ms.length,fn;ht--;)fn=ms[ht],ye[fn]=this[fn];return ye},toString:function(){Sn(this);var ye=this.startContainer;if(ye===this.endContainer&&rt(ye))return ye.nodeType==3||ye.nodeType==4?ye.data.slice(this.startOffset,this.endOffset):"";var ht=[],fn=new Zn(this,!0);return Le(fn,function(Rn){(Rn.nodeType==3||Rn.nodeType==4)&&ht.push(Rn.data)}),fn.detach(),ht.join("")},compareNode:function(ye){Sn(this);var ht=ye.parentNode,fn=pt(ye);if(!ht)throw new $e("NOT_FOUND_ERR");var Rn=this.comparePoint(ht,fn),Cn=this.comparePoint(ht,fn+1);return Rn<0?Cn>0?ys:gs:Cn>0?Cl:tl},comparePoint:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)<0?-1:en(ye,ht,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:el,toHtml:function(){return gr(this)},intersectsNode:function(ye,ht){if(Sn(this),je(ye)!=Gt(this))return!1;var fn=ye.parentNode,Rn=pt(ye);if(!fn)return!0;var Cn=en(fn,Rn,this.endContainer,this.endOffset),nr=en(fn,Rn+1,this.startContainer,this.startOffset);return ht?Cn<=0&&nr>=0:Cn<0&&nr>0},isPointInRange:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)>=0&&en(ye,ht,this.endContainer,this.endOffset)<=0},intersectsRange:function(ye){return Pe(this,ye,!1)},intersectsOrTouchesRange:function(ye){return Pe(this,ye,!0)},intersection:function(ye){if(this.intersectsRange(ye)){var ht=en(this.startContainer,this.startOffset,ye.startContainer,ye.startOffset),fn=en(this.endContainer,this.endOffset,ye.endContainer,ye.endOffset),Rn=this.cloneRange();return ht==-1&&Rn.setStart(ye.startContainer,ye.startOffset),fn==1&&Rn.setEnd(ye.endContainer,ye.endOffset),Rn}return null},union:function(ye){if(this.intersectsOrTouchesRange(ye)){var ht=this.cloneRange();return en(ye.startContainer,ye.startOffset,this.startContainer,this.startOffset)==-1&&ht.setStart(ye.startContainer,ye.startOffset),en(ye.endContainer,ye.endOffset,this.endContainer,this.endOffset)==1&&ht.setEnd(ye.endContainer,ye.endOffset),ht}else throw new $e("Ranges do not intersect")},containsNode:function(ye,ht){return ht?this.intersectsNode(ye,!1):this.compareNode(ye)==tl},containsNodeContents:function(ye){return this.comparePoint(ye,0)>=0&&this.comparePoint(ye,ae(ye))<=0},containsRange:function(ye){var ht=this.intersection(ye);return ht!==null&&ye.equals(ht)},containsNodeText:function(ye){var ht=this.cloneRange();ht.selectNode(ye);var fn=ht.getNodes([3]);if(fn.length>0){ht.setStart(fn[0],0);var Rn=fn.pop();return ht.setEnd(Rn,Rn.length),this.containsRange(ht)}else return this.containsNodeContents(ye)},getNodes:function(ye,ht){return Sn(this),Tt(this,ye,ht)},getDocument:function(){return Rt(this)},collapseBefore:function(ye){this.setEndBefore(ye),this.collapse(!1)},collapseAfter:function(ye){this.setStartAfter(ye),this.collapse(!0)},getBookmark:function(ye){var ht=Rt(this),fn=se.createRange(ht);ye=ye||pe.getBody(ht),fn.selectNodeContents(ye);var Rn=this.intersection(fn),Cn=0,nr=0;return Rn&&(fn.setEnd(Rn.startContainer,Rn.startOffset),Cn=fn.toString().length,nr=Cn+Rn.toString().length),{start:Cn,end:nr,containerNode:ye}},moveToBookmark:function(ye){var ht=ye.containerNode,fn=0;this.setStart(ht,0),this.collapse(!0);for(var Rn=[ht],Cn,nr=!1,Mn=!1,or,sr,qr;!Mn&&(Cn=Rn.pop());)if(Cn.nodeType==3)or=fn+Cn.length,!nr&&ye.start>=fn&&ye.start<=or&&(this.setStart(Cn,ye.start-fn),nr=!0),nr&&ye.end>=fn&&ye.end<=or&&(this.setEnd(Cn,ye.end-fn),Mn=!0),fn=or;else for(qr=Cn.childNodes,sr=qr.length;sr--;)Rn.push(qr[sr])},getName:function(){return"DomRange"},equals:function(ye){return li.rangesEqual(this,ye)},isValid:function(){return Ka(this)},inspect:function(){return En(this)},detach:function(){}});function ve(ye){ye.START_TO_START=pa,ye.START_TO_END=qi,ye.END_TO_END=Na,ye.END_TO_START=as,ye.NODE_BEFORE=gs,ye.NODE_AFTER=Cl,ye.NODE_BEFORE_AND_AFTER=ys,ye.NODE_INSIDE=tl}function mt(ye){ve(ye),ve(ye.prototype)}function cn(ye,ht){return function(){Sn(this);var fn=this.startContainer,Rn=this.startOffset,Cn=this.commonAncestorContainer,nr=new Zn(this,!0),Mn,or;fn!==Cn&&(Mn=it(fn,Cn,!0),or=qt(Mn),fn=or.node,Rn=or.offset),Le(nr,Ca),nr.reset();var sr=ye(nr);return nr.detach(),ht(this,fn,Rn,fn,Rn),sr}}function Kn(ye,ht){function fn(Mn,or){return function(sr){wo(sr,ao),wo(je(sr),Lo);var qr=(Mn?kn:qt)(sr);(or?Rn:Cn)(this,qr.node,qr.offset)}}function Rn(Mn,or,sr){var qr=Mn.endContainer,na=Mn.endOffset;(or!==Mn.startContainer||sr!==Mn.startOffset)&&((je(or)!=je(qr)||en(or,sr,qr,na)==1)&&(qr=or,na=sr),ht(Mn,or,sr,qr,na))}function Cn(Mn,or,sr){var qr=Mn.startContainer,na=Mn.startOffset;(or!==Mn.endContainer||sr!==Mn.endOffset)&&((je(or)!=je(qr)||en(or,sr,qr,na)==-1)&&(qr=or,na=sr),ht(Mn,qr,na,or,sr))}var nr=function(){};nr.prototype=se.rangePrototype,ye.prototype=new nr,le.extend(ye.prototype,{setStart:function(Mn,or){lr(Mn,!0),oo(Mn,or),Rn(this,Mn,or)},setEnd:function(Mn,or){lr(Mn,!0),oo(Mn,or),Cn(this,Mn,or)},setStartAndEnd:function(){var Mn=arguments,or=Mn[0],sr=Mn[1],qr=or,na=sr;switch(Mn.length){case 3:na=Mn[2];break;case 4:qr=Mn[2],na=Mn[3];break}lr(or,!0),oo(or,sr),lr(qr,!0),oo(qr,na),ht(this,or,sr,qr,na)},setBoundary:function(Mn,or,sr){this["set"+(sr?"Start":"End")](Mn,or)},setStartBefore:fn(!0,!0),setStartAfter:fn(!1,!0),setEndBefore:fn(!0,!1),setEndAfter:fn(!1,!1),collapse:function(Mn){Sn(this),Mn?ht(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):ht(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(Mn){lr(Mn,!0),ht(this,Mn,0,Mn,ae(Mn))},selectNode:function(Mn){lr(Mn,!1),wo(Mn,ao);var or=kn(Mn),sr=qt(Mn);ht(this,or.node,or.offset,sr.node,sr.offset)},extractContents:cn(At,ht),deleteContents:cn(dt,ht),canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var Mn=new Zn(this,!0),or=Mn._first&&Pt(Mn._first,this)||Mn._last&&Pt(Mn._last,this);return Mn.detach(),!or},splitBoundaries:function(){Ui(this)},splitBoundariesPreservingPositions:function(Mn){Ui(this,Mn)},normalizeBoundaries:function(){Sn(this);var Mn=this.startContainer,or=this.startOffset,sr=this.endContainer,qr=this.endOffset,na=function(Ro){var La=Ro.nextSibling;La&&La.nodeType==Ro.nodeType&&(sr=Ro,qr=Ro.length,Ro.appendData(La.data),q(La))},vi=function(Ro){var La=Ro.previousSibling;if(La&&La.nodeType==Ro.nodeType){Mn=Ro;var od=Ro.length;if(or=La.length,Ro.insertData(0,La.data),q(La),Mn==sr)qr+=or,sr=Mn;else if(sr==Ro.parentNode){var _u=pt(Ro);qr==_u?(sr=Ro,qr=od):qr>_u&&qr--}}},_s=!0,Vi;if(rt(sr))qr==sr.length?na(sr):qr==0&&(Vi=sr.previousSibling,Vi&&Vi.nodeType==sr.nodeType&&(qr=Vi.length,Mn==sr&&(_s=!1),Vi.appendData(sr.data),q(sr),sr=Vi));else{if(qr>0){var Nl=sr.childNodes[qr-1];Nl&&rt(Nl)&&na(Nl)}_s=!this.collapsed}if(_s){if(rt(Mn))or==0?vi(Mn):or==Mn.length&&(Vi=Mn.nextSibling,Vi&&Vi.nodeType==Mn.nodeType&&(sr==Vi&&(sr=Mn,qr+=Mn.length),Mn.appendData(Vi.data),q(Vi)));else if(or"u"&&(vt.Range=le),se.createNativeRange=function(q){return q=Jt(q,Ze,"createNativeRange"),Lt(q).createTextRange()},se.WrappedRange=le}}se.createRange=function(q){return q=Jt(q,Ze,"createRange"),new se.WrappedRange(se.createNativeRange(q))},se.createRangyRange=function(q){return q=Jt(q,Ze,"createRangyRange"),new pt(q)},$e.createAliasForDeprecatedMethod(se,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(se,"createIframeRangyRange","createRangyRange"),se.addShimListener(function(q){var Pt=q.document;typeof Pt.createRange>"u"&&(Pt.createRange=function(){return se.createRange(Pt)}),Pt=q=null})}),B.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(se,Ze){se.config.checkSelectionRanges=!0;var pe="boolean",le="number",we=se.dom,$e=se.util,rt=$e.isHostMethod,pt=se.DomRange,Lt=se.WrappedRange,Jt=se.DOMException,en=we.DomPosition,zt,it,ae=se.features,re="Control",je=we.getDocument,vt=we.getBody,q=pt.rangesEqual;function Pt(ve){return typeof ve=="string"?/^backward(s)?$/i.test(ve):!!ve}function Rt(ve,mt){if(ve){if(we.isWindow(ve))return ve;if(ve instanceof Sn)return ve.win;var cn=we.getContentDocument(ve,Ze,mt);return we.getWindow(cn)}else return window}function Gt(ve){return Rt(ve,"getWinSelection").getSelection()}function kn(ve){return Rt(ve,"getDocSelection").document.selection}function qt(ve){var mt=!1;return ve.anchorNode&&(mt=we.comparePoints(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset)==1),mt}var On=rt(window,"getSelection"),Pe=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=On,ae.implementsDocSelection=Pe;var Ke=Pe&&(!On||se.config.preferTextRange);if(Ke)zt=kn,se.isSelectionValid=function(ve){var mt=Rt(ve,"isSelectionValid").document,cn=mt.selection;return cn.type!="None"||je(cn.createRange().parentElement())==mt};else if(On)zt=Gt,se.isSelectionValid=function(){return!0};else return Ze.fail("Neither document.selection or window.getSelection() detected."),!1;se.getNativeSelection=zt;var Le=zt();if(!Le)return Ze.fail("Native selection was null (possibly issue 138?)"),!1;var dt=se.createNativeRange(document),At=vt(document),Tt=$e.areHostProperties(Le,["anchorNode","focusNode","anchorOffset","focusOffset"]);ae.selectionHasAnchorAndFocus=Tt;var En=rt(Le,"extend");ae.selectionHasExtend=En;var Zn=rt(Le,"setBaseAndExtent");ae.selectionHasSetBaseAndExtent=Zn;var ao=typeof Le.rangeCount==le;ae.selectionHasRangeCount=ao;var Lo=!1,yo=!0,ho=En?function(ve,mt){var cn=pt.getRangeDocument(mt),Kn=se.createRange(cn);Kn.collapseToPoint(mt.endContainer,mt.endOffset),ve.addRange(lr(Kn)),ve.extend(mt.startContainer,mt.startOffset)}:null;$e.areHostMethods(Le,["addRange","getRangeAt","removeAllRanges"])&&typeof Le.rangeCount==le&&ae.implementsDomRange&&(function(){var ve=window.getSelection();if(ve){for(var mt=ve.rangeCount,cn=mt>1,Kn=[],br=qt(ve),lo=0;lo=36)Lo=!1;else{var Rn=ht.cloneRange();ht.setStart(ye,0),Rn.setEnd(ye,3),Rn.setStart(ye,2),ve.addRange(ht),ve.addRange(Rn),Lo=ve.rangeCount==2}}for(we.removeNode(li),ve.removeAllRanges(),lo=0;lo1)ms(this,ve);else{this.removeAllRanges();for(var mt=0,cn=ve.length;mt1?ms(this,ve):mt&&this.addRange(ve[0])};else return Ze.fail("No means of selecting a Range or TextRange was found"),!1;gr.getRangeAt=function(ve){if(ve<0||ve>=this.rangeCount)throw new Jt("INDEX_SIZE_ERR");return this._ranges[ve].cloneRange()};var qi;if(Ke)qi=function(ve){var mt;se.isSelectionValid(ve.win)?mt=ve.docSelection.createRange():(mt=vt(ve.win.document).createTextRange(),mt.collapse(!0)),ve.docSelection.type==re?Yi(ve):ta(mt)?Ca(ve,mt):vn(ve)};else if(rt(Le,"getRangeAt")&&typeof Le.rangeCount==le)qi=function(ve){if(Nn&&Pe&&ve.docSelection.type==re)Yi(ve);else if(ve._ranges.length=ve.rangeCount=ve.nativeSelection.rangeCount,ve.rangeCount){for(var mt=0,cn=ve.rangeCount;mt(we.isCharacterDataNode(ve)?ve.length:ve.childNodes.length))throw new Jt("INDEX_SIZE_ERR")}gr.collapse=function(ve,mt){gs(this,ve);var cn=se.createRange(ve);cn.collapseToPoint(ve,mt),this.setSingleRange(cn),this.isCollapsed=!0},gr.collapseToStart=function(){if(this.rangeCount){var ve=this._ranges[0];this.collapse(ve.startContainer,ve.startOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.collapseToEnd=function(){if(this.rangeCount){var ve=this._ranges[this.rangeCount-1];this.collapse(ve.endContainer,ve.endOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.selectAllChildren=function(ve){gs(this,ve);var mt=se.createRange(ve);mt.selectNodeContents(ve),this.setSingleRange(mt)},Zn?gr.setBaseAndExtent=function(ve,mt,cn,Kn){this.nativeSelection.setBaseAndExtent(ve,mt,cn,Kn),this.refresh()}:En&&(gr.setBaseAndExtent=function(ve,mt,cn,Kn){Cl(ve,mt),Cl(cn,Kn),gs(this,ve),gs(this,cn);var br=se.createRange(node),lo=we.comparePoints(ve,mt,cn,Kn)==-1;lo?br.setStartAndEnd(cn,Kn,ve,mt):br.setStartAndEnd(ve,mt,cn,Kn),this.setSingleRange(br,lo)}),gr.deleteFromDocument=function(){if(Nn&&Pe&&this.docSelection.type==re){for(var ve=this.docSelection.createRange(),mt;ve.length;)mt=ve.item(0),ve.remove(mt),we.removeNode(mt);this.refresh()}else if(this.rangeCount){var cn=this.getAllRanges();if(cn.length){this.removeAllRanges();for(var Kn=0,br=cn.length;Kn0)return se.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw Ze.createError("getNativeTextRange: selection contains no range")}});function tl(ve){var mt=[],cn=new en(ve.anchorNode,ve.anchorOffset),Kn=new en(ve.focusNode,ve.focusOffset),br=typeof ve.getName=="function"?ve.getName():"Selection";if(typeof ve.rangeCount<"u")for(var lo=0,li=ve.rangeCount;lo"u"&&(ve.getSelection=function(){return Ui(ve)}),ve=null})});var Je=!1,gt=function(se){Je||(Je=!0,!B.initialized&&B.config.autoInitialize&&J())};return D&&(document.readyState=="complete"?gt():(f(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",gt,!1),Y(window,"load",gt))),B})})(bS)),bS.exports}var Sne=Z3();const _R=Z_(Sne);var wS={exports:{}},bR;function Ane(){return bR||(bR=1,(function(t,e){(function(n,o){t.exports=n(Z3())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(o,r){var i=o.dom,a=i.DomPosition,l=i.arrayContains,s=o.util,f=s.forEach,h="span",v=s.isHostMethod(document,"createElementNS");function b(ae,re){for(var je in ae)if(ae.hasOwnProperty(je)&&re(je,ae[je])===!1)return!1;return!0}function w(ae){return ae.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function O(ae,re){return!!ae&&new RegExp("(?:^|\\s)"+re+"(?:\\s|$)").test(ae)}function E(ae,re){if(typeof ae.classList=="object")return ae.classList.contains(re);var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");return O(vt,re)}function S(ae,re){if(typeof ae.classList=="object")ae.classList.add(re);else{var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");vt?O(vt,re)||(vt+=" "+re):vt=re,je?ae.className=vt:ae.setAttribute("class",vt)}}var M=(function(){function ae(re,je,vt){return je&&vt?" ":""}return function(re,je){if(typeof re.classList=="object")re.classList.remove(je);else{var vt=typeof re.className=="string",q=vt?re.className:re.getAttribute("class");q=q.replace(new RegExp("(^|\\s)"+je+"(\\s|$)"),ae),vt?re.className=q:re.setAttribute("class",q)}}})();function C(ae){var re=typeof ae.className=="string";return re?ae.className:ae.getAttribute("class")}function $(ae){return ae&&ae.split(/\s+/).sort().join(" ")}function D(ae){return $(C(ae))}function k(ae,re){return D(ae)==D(re)}function B(ae,re){for(var je=re.split(/\s+/),vt=0,q=je.length;vtq&&++kn,Pt==re&&(Rt==je||Rt==je+1)&&(Gt=vt,kn+=q-je),Pt==re&&Rt>je+1&&--kn,ae.node=Gt,ae.offset=kn}function V(ae,re,je){ae.node==re&&ae.offset>je&&--ae.offset}function z(ae,re,je,vt){je==-1&&(je=re.childNodes.length);var q=ae.parentNode,Pt=i.getNodeIndex(ae);f(vt,function(Rt){I(Rt,q,Pt,re,je)}),re.childNodes.length==je?re.appendChild(ae):re.insertBefore(ae,re.childNodes[je])}function X(ae,re){var je=ae.parentNode,vt=i.getNodeIndex(ae);f(re,function(q){V(q,je,vt)}),i.removeNode(ae)}function Y(ae,re,je,vt,q){for(var Pt,Rt=[];Pt=ae.firstChild;)z(Pt,re,je++,q),Rt.push(Pt);return X(ae,q),Rt}function W(ae,re){return Y(ae,ae.parentNode,i.getNodeIndex(ae),!0,re)}function Q(ae,re){var je=ae.cloneRange();je.selectNodeContents(re);var vt=je.intersection(ae),q=vt?vt.toString():"";return q!=""}function J(ae){for(var re=ae.getNodes([3]),je=0,vt;(vt=re[je])&&!Q(ae,vt);)++je;for(var q=re.length-1;(vt=re[q])&&!Q(ae,vt);)--q;return re.slice(je,q+1)}function ie(ae,re){if(ae.attributes.length!=re.attributes.length)return!1;for(var je=0,vt=ae.attributes.length,q,Pt,Rt;je0&&re1){var vt=i.getNodeIndex(je),q=[],Pt=0,Rt;f(re,function(Gt,kn){Rt=Gt.parentNode,kn>0&&(Rt.removeChild(Gt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Gt&&(qt.node=je,qt.offset+=Pt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&kn"u"?!0:vt,Gt.attrExceptions=[];var On=document.createElement(Gt.elementTagName);Gt.elementProperties=Gt.copyPropertiesToElement(kn,On,!0),b(qt,function(Ke,Le){Gt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Gt.elementAttributes=qt,Gt.elementSortedClassName=Gt.elementProperties.hasOwnProperty("className")?$(Gt.elementProperties.className+" "+ae):ae,Gt.applyToAnyTagName=!1;var Pe=typeof je;if(Pe=="string")je=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames=w(je.toLowerCase()).split(/\s*,\s*/);else if(Pe=="object"&&typeof je.length=="number")for(Gt.tagNames=[],q=0,Pt=je.length;qColor",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,l,s;try{_R.init()}catch{console.error("rangy.init failed")}try{(s=(l=o==null?void 0:o.prototype)===null||l===void 0?void 0:l.init)===null||s===void 0||s.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new K3({parent:this.button||void 0,color:"#000",onDone:function(f){var h,v,b,w,O;try{a.coloredText&&(!((v=(h=a.coloredText).isAppliedToSelection)===null||v===void 0)&&v.call(h))&&a.coloredText.undoToSelection(),a.coloredText=_R.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:f.hex}},normalize:!0}),a.coloredText.toggleSelection(),(w=(b=a.base)===null||b===void 0?void 0:b.checkContentChanged)===null||w===void 0||w.call(b),(O=a.setInactive)===null||O===void 0||O.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,l,s;(a=this.setActive)===null||a===void 0||a.call(this),(s=(l=this.colorPicker)===null||l===void 0?void 0:l.show)===null||s===void 0||s.call(l)},isAlreadyApplied:function(a){var l,s;return((s=(l=a==null?void 0:a.nodeName)===null||l===void 0?void 0:l.toLowerCase)===null||s===void 0?void 0:s.call(l))==="mark"},isActive:function(){var a,l;return(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0?void 0:l.contains("medium-editor-button-active")},setInactive:function(){var a,l;(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0||l.remove("medium-editor-button-active")},setActive:function(){var a,l;(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0||l.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),(function(){function a(){}return a})())}var Mne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Tne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},xR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new D0(".lf-label-editor",Yv(wR,{autoLink:!0,extensions:{colorPicker:new(ER(D0))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,o=this.props,r=o.lf.extension,i=o.graphModel,a=OR(OR([],xR(i.nodes),!1),xR(i.edges),!1),l=r.label;if(l){var s=[];return ri(a,function(f){var h,v,b=f.getData(),w=(v=(h=b.properties)===null||h===void 0?void 0:h._label)!==null&&v!==void 0?v:[];ri(w,function(O){var E=n.labelMap,S=new vne(O,f,i);E.set(S.id,S),s.push($t(pne,{label:S,element:f,graphModel:i},S.id))})}),s}return null},e.prototype.render=function(){return $t("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=Tne([xl],e),e})(Po);var SR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},AR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0&&r.lf.emit("selection:drop",{e:a}),r.lf.emit("selection:selected",{elements:B,leftTopPoint:S,rightBottomPoint:M})}r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0)},this.lf=n,this.exclusiveMode=(i=o==null?void 0:o.exclusiveMode)!==null&&i!==void 0?i:!1,n.openSelectionSelect=function(){r.openSelectionSelect()},n.closeSelectionSelect=function(){r.closeSelectionSelect()},n.setSelectionSelectMode=function(a){r.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var o=e.button===2;if(!o){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var r=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,i=r.x,a=r.y;this.startPoint={x:i,y:a},this.endPoint={x:i,y:a};var l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(f){f.preventDefault()},l.style.top="".concat(this.startPoint.y,"px"),l.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(l),this.wrapper=l,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=to(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t})();var J3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Eg=function(){return Eg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nne={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function Pne(t){for(var e=t,n=1;ni?C<0?"l":"r":D<=i&&k>i?$<0?"t":"b":D<=i&&k<=i?"":D0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o1&&setTimeout(function(){var r;n.updatePointsByNodes(((r=n.properties)===null||r===void 0?void 0:r.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var o=n.x,r=n.y;this.x=o,this.y=r},e.prototype.updatePointsByNodes=function(n){var o=this,r=[],i=1/0,a=1/0,l=-1/0,s=-1/0;n.forEach(function(f){var h=o.graphModel.getNodeModelById(f);if(h){var v=h.width,b=h.height,w=h.x,O=h.y;i=Math.min(i,w-v/2-o.d),a=Math.min(a,O-b/2-o.d),l=Math.max(l,w+v/2+o.d),s=Math.max(s,O+b/2+o.d)}}),r.push([i,a],[l,a],[l,s],[i,s]),![i,a,l,s].some(function(f){return Math.abs(f)===1/0})&&(this.updatePoints(r),this.updateCoordinate({x:(l+i)/2,y:(s+a)/2}))},e.prototype.resize=function(n){var o;this.isResize=!0;for(var r=n.width,i=n.height,a={x:r/this.width,y:i/this.height},l=(this.properties.node_selection_ids||[]).slice(),s=[],f=new Set;l.length;){var h=l.shift(),v=(o=this.graphModel.nodesMap[h])===null||o===void 0?void 0:o.model;if(v){if(!ew(v)){s.push(v);continue}f.has(v.id)||(f.add(v.id),l.push.apply(l,TR([],MR(v.properties.node_selection_ids||[]),!1)))}}var b={x:this.x-this.width/2,y:this.y-this.height/2},w=t.prototype.resize.call(this,n),O={x:this.x-this.width/2,y:this.y-this.height/2};return s.forEach(function(E){E.width=E.width*a.x,E.height=E.height*a.y;var S=(E.x-b.x)*a.x+O.x-E.x,M=(E.y-b.y)*a.y+O.y-E.y;E.move(S,M,!0)}),this.isResize=!1,w},e})(Uw),v2="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:v2,view:jne,model:Lne})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,o=this.lf.getGraphRawData(),r=n.filter(function(i){return i!==e.currentClickNode.id});return o.nodes.find(function(i){if(i.type==="node-selection"){var a=om(i,"properties.node_selection_ids",[]);return r.every(function(l){return a.includes(l)})}return!1})},t.prototype.onNodeChange=function(e,n){var o=e.graphModel.nodes.filter(function(r){if(!ew(r))return!1;var i=r.properties.node_selection_ids||[];return i.includes(n.id)});Promise.resolve().then(function(){o.forEach(function(r){r.updatePointsByNodes(r.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(o){var r;if(!(!o.e.shiftKey||o.data.type===v2)){n.currentClickNode=o.data;var i=!1;n.selectNodesIds.includes(o.data.id)&&((r=n.lf.getNodeModelById(o.data.id))===null||r===void 0||r.setSelected(!1),i=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?i?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(o,r,i){if(n.onNodeChange(e,o),ew(o)&&!o.isResize){var a=o.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,r,i,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(o){return ew(o)||n.onNodeChange(e,o),!0})},t.pluginName="node-selection",t})();var ew=function(t){return!!(t&&t.type===v2)},Ine=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),cE=function(){return cE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),typeof pe=="function"&&pe.defaultProps!=null)for(pt in pe.defaultProps)Lt[pt]===void 0&&(Lt[pt]=pe.defaultProps[pt]);return C(pe,Lt,$e,rt,null)}function C(pe,le,we,$e,rt){var pt={type:pe,props:le,key:we,ref:$e,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:rt??++l};return rt==null&&a.vnode!=null&&a.vnode(pt),pt}function $(){return{current:null}}function D(pe){return pe.children}function k(pe,le){this.props=pe,this.context=le}function B(pe,le){if(le==null)return pe.__?B(pe.__,pe.__.__k.indexOf(pe)+1):null;for(var we;le0?C(je.type,je.props,je.key,null,je.__v):je)!=null){if(je.__=we,je.__b=we.__b+1,(re=Rt[it])===null||re&&je.key==re.key&&je.type===re.type)Rt[it]=void 0;else for(ae=0;ae2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),C(pe.type,Lt,$e||pe.key,rt||pe.ref,null)}function Ze(pe,le){var we={__c:le="__cC"+v++,__:pe,Consumer:function($e,rt){return $e.children(rt)},Provider:function($e){var rt,pt;return this.getChildContext||(rt=[],(pt={})[le]=this,this.getChildContext=function(){return pt},this.shouldComponentUpdate=function(Lt){this.props.value!==Lt.value&&rt.some(I)},this.sub=function(Lt){rt.push(Lt);var Jt=Lt.componentWillUnmount;Lt.componentWillUnmount=function(){rt.splice(rt.indexOf(Lt),1),Jt&&Jt.call(Lt)}}),$e.children}};return we.Provider.__=we.Consumer.contextType=we}i=w.slice,a={__e:function(pe,le){for(var we,$e,rt;le=le.__;)if((we=le.__c)&&!we.__)try{if(($e=we.constructor)&&$e.getDerivedStateFromError!=null&&(we.setState($e.getDerivedStateFromError(pe)),rt=we.__d),we.componentDidCatch!=null&&(we.componentDidCatch(pe),rt=we.__d),rt)return we.__E=we}catch(pt){pe=pt}throw pe}},l=0,k.prototype.setState=function(pe,le){var we;we=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof pe=="function"&&(pe=pe(E({},we),this.props)),pe&&E(we,pe),pe!=null&&this.__v&&(le&&this.__h.push(le),I(this))},k.prototype.forceUpdate=function(pe){this.__v&&(this.__e=!0,pe&&this.__h.push(pe),I(this))},k.prototype.render=D,s=[],f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V.__r=0,v=0},function(n,o,r){(function(i,a){r.d(o,"a",(function(){return I})),r.d(o,"b",(function(){return sf})),r.d(o,"c",(function(){return Na})),r.d(o,"d",(function(){return rr})),r.d(o,"e",(function(){return Tt})),r.d(o,"f",(function(){return At})),r.d(o,"g",(function(){return qn})),r.d(o,"h",(function(){return Pa})),r.d(o,"i",(function(){return kn})),r.d(o,"j",(function(){return Nn})),r.d(o,"k",(function(){return br})),r.d(o,"l",(function(){return ht})),r.d(o,"m",(function(){return q})),r.d(o,"n",(function(){return or})),r.d(o,"o",(function(){return X})),r.d(o,"p",(function(){return Uh})),r.d(o,"q",(function(){return sr})),r.d(o,"r",(function(){return Is})),r.d(o,"s",(function(){return ls})),r.d(o,"t",(function(){return vi})),r.d(o,"u",(function(){return li})),r.d(o,"v",(function(){return od})),r.d(o,"w",(function(){return _u})),r.d(o,"x",(function(){return ra})),r.d(o,"y",(function(){return Es})),r.d(o,"z",(function(){return Wi})),r.d(o,"A",(function(){return ia})),r.d(o,"B",(function(){return bs})),r.d(o,"C",(function(){return zt})),r.d(o,"D",(function(){return gp})),r.d(o,"E",(function(){return nr})),r.d(o,"F",(function(){return Cn})),r.d(o,"G",(function(){return lo})),r.d(o,"H",(function(){return ve})),r.d(o,"I",(function(){return rf})),r.d(o,"J",(function(){return oa})),r.d(o,"K",(function(){return Ke})),r.d(o,"L",(function(){return qo})),r.d(o,"M",(function(){return id}));var l=[];Object.freeze(l);var s={};function f(){return++Sn.mobxGuid}function h(R){throw v(!1,R),"X"}function v(R,L){if(!R)throw new Error("[mobx] "+(L||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(s);function b(R){var L=!1;return function(){if(!L)return L=!0,R.apply(this,arguments)}}var w=function(){};function O(R){return R!==null&&typeof R=="object"}function E(R){if(R===null||typeof R!="object")return!1;var L=Object.getPrototypeOf(R);return L===Object.prototype||L===null}function S(R,L,Z){Object.defineProperty(R,L,{enumerable:!1,writable:!0,configurable:!0,value:Z})}function M(R,L){var Z="isMobX"+R;return L.prototype[Z]=!0,function(fe){return O(fe)&&fe[Z]===!0}}function C(R){return R instanceof Map}function $(R){return R instanceof Set}function D(R){var L=new Set;for(var Z in R)L.add(Z);return Object.getOwnPropertySymbols(R).forEach((function(fe){Object.getOwnPropertyDescriptor(R,fe).enumerable&&L.add(fe)})),Array.from(L)}function k(R){return R&&R.toString?R.toString():new String(R).toString()}function B(R){return R===null?null:typeof R=="object"?""+R:R}var F=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:Object.getOwnPropertyNames,I=Symbol("mobx administration"),V=(function(){function R(L){L===void 0&&(L="Atom@"+f()),this.name=L,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ae.NOT_TRACKING}return R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.reportObserved=function(){return ms(this)},R.prototype.reportChanged=function(){Ui(),(function(L){L.lowestObserverState!==ae.STALE&&(L.lowestObserverState=ae.STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale()),Z.dependenciesState=ae.STALE})))})(this),gr()},R.prototype.toString=function(){return this.name},R})(),z=M("Atom",V);function X(R,L,Z){L===void 0&&(L=w),Z===void 0&&(Z=w);var fe,Re=new V(R);return L!==w&&Mn("onBecomeObserved",Re,L,fe),Z!==w&&nr(Re,Z),Re}var Y={structural:function(R,L){return un(R,L)},default:function(R,L){return Object.is(R,L)}},W=function(R,L){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,fe){Z.__proto__=fe}||function(Z,fe){for(var Re in fe)fe.hasOwnProperty(Re)&&(Z[Re]=fe[Re])},W(R,L)};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var Q=function(){return Q=Object.assign||function(R){for(var L,Z=1,fe=arguments.length;Z=R.length&&(R=void 0),{value:R&&R[Z++],done:!R}}}}function ie(R,L){var Z=typeof Symbol=="function"&&R[Symbol.iterator];if(!Z)return R;var fe,Re,st=Z.call(R),It=[];try{for(;(L===void 0||L-- >0)&&!(fe=st.next()).done;)It.push(fe.value)}catch(bn){Re={error:bn}}finally{try{fe&&!fe.done&&(Z=st.return)&&Z.call(st)}finally{if(Re)throw Re.error}}return It}function Se(){for(var R=[],L=0;L2&&it("box");var Z=we(L);return new In(R,Jt(Z),Z.name,!0,Z.equals)},array:function(R,L){arguments.length>2&&it("array");var Z=we(L);return Kl(R,Jt(Z),Z.name)},map:function(R,L){arguments.length>2&&it("map");var Z=we(L);return new sf(R,Jt(Z),Z.name)},set:function(R,L){arguments.length>2&&it("set");var Z=we(L);return new ol(R,Jt(Z),Z.name)},object:function(R,L,Z){typeof arguments[1]=="string"&&it("object");var fe=we(Z);if(fe.proxy===!1)return sr({},R,L,fe);var Re=qr(fe),st=sr({},void 0,void 0,fe),It=bu(st);return na(It,R,L,Re),It},ref:pt,shallow:rt,deep:$e,struct:Lt},zt=function(R,L,Z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return $e.apply(null,arguments);if(ra(R))return R;var fe=E(R)?zt.object(R,L,Z):Array.isArray(R)?zt.array(R,L):C(R)?zt.map(R,L):$(R)?zt.set(R,L):R;if(fe!==R)return fe;h(!1)};function it(R){h("Expected one or two arguments to observable."+R+". Did you accidentally try to use observable."+R+" as decorator?")}Object.keys(en).forEach((function(R){return zt[R]=en[R]}));var ae,re,je=Je(!1,(function(R,L,Z,fe,Re){var st=Z.get,It=Z.set,bn=Re[0]||{};ss(R).addComputedProp(R,L,Q({get:st,set:It,context:R},bn))})),vt=je({equals:Y.structural}),q=function(R,L,Z){if(typeof L=="string"||R!==null&&typeof R=="object"&&arguments.length===1)return je.apply(null,arguments);var fe=typeof L=="object"?L:{};return fe.get=R,fe.set=typeof L=="function"?L:fe.set,fe.name=fe.name||R.name||"",new wo(fe)};q.struct=vt,(function(R){R[R.NOT_TRACKING=-1]="NOT_TRACKING",R[R.UP_TO_DATE=0]="UP_TO_DATE",R[R.POSSIBLY_STALE=1]="POSSIBLY_STALE",R[R.STALE=2]="STALE"})(ae||(ae={})),(function(R){R[R.NONE=0]="NONE",R[R.LOG=1]="LOG",R[R.BREAK=2]="BREAK"})(re||(re={}));var Pt=function(R){this.cause=R};function Rt(R){return R instanceof Pt}function Gt(R){switch(R.dependenciesState){case ae.UP_TO_DATE:return!1;case ae.NOT_TRACKING:case ae.STALE:return!0;case ae.POSSIBLY_STALE:for(var L=At(!0),Z=Le(),fe=R.observing,Re=fe.length,st=0;st0;Sn.computationDepth>0&&L&&h(!1),Sn.allowStateChanges||!L&&Sn.enforceActions!=="strict"||h(!1)}function On(R,L,Z){var fe=At(!0);En(R),R.newObserving=new Array(R.observing.length+100),R.unboundDepsCount=0,R.runId=++Sn.runId;var Re,st=Sn.trackingDerivation;if(Sn.trackingDerivation=R,Sn.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new Pt(It)}return Sn.trackingDerivation=st,(function(It){for(var bn=It.observing,Jn=It.observing=It.newObserving,no=ae.UP_TO_DATE,$n=0,Do=It.unboundDepsCount,Kr=0;Krno&&(no=So.dependenciesState);for(Jn.length=$n,It.newObserving=null,Do=bn.length;Do--;)(So=bn[Do]).diffValue===0&&Oo(So,It),So.diffValue=0;for(;$n--;){var So;(So=Jn[$n]).diffValue===1&&(So.diffValue=0,Tl(So,It))}no!==ae.UP_TO_DATE&&(It.dependenciesState=no,It.onBecomeStale())})(R),Tt(fe),Re}function Pe(R){var L=R.observing;R.observing=[];for(var Z=L.length;Z--;)Oo(L[Z],R);R.dependenciesState=ae.NOT_TRACKING}function Ke(R){var L=Le();try{return R()}finally{dt(L)}}function Le(){var R=Sn.trackingDerivation;return Sn.trackingDerivation=null,R}function dt(R){Sn.trackingDerivation=R}function At(R){var L=Sn.allowStateReads;return Sn.allowStateReads=R,L}function Tt(R){Sn.allowStateReads=R}function En(R){if(R.dependenciesState!==ae.UP_TO_DATE){R.dependenciesState=ae.UP_TO_DATE;for(var L=R.observing,Z=L.length;Z--;)L[Z].lowestObserverState=ae.UP_TO_DATE}}var Zn=0,ao=1,Lo=Object.getOwnPropertyDescriptor((function(){}),"name");Lo&&Lo.configurable;function yo(R,L,Z){var fe=function(){return ho(R,L,Z||this,arguments)};return fe.isMobxAction=!0,fe}function ho(R,L,Z,fe){var Re=Nn();try{return L.apply(Z,fe)}catch(st){throw Re.error=st,st}finally{qn(Re)}}function Nn(R,L,Z){var fe=0,Re=Le();Ui();var st={prevDerivation:Re,prevAllowStateChanges:ut(!0),prevAllowStateReads:At(!0),notifySpy:!1,startTime:fe,actionId:ao++,parentActionId:Zn};return Zn=st.actionId,st}function qn(R){Zn!==R.actionId&&h("invalid action stack. did you forget to finish an action?"),Zn=R.parentActionId,R.error!==void 0&&(Sn.suppressReactionErrors=!0),vn(R.prevAllowStateChanges),Tt(R.prevAllowStateReads),gr(),dt(R.prevDerivation),R.notifySpy,Sn.suppressReactionErrors=!1}function rr(R,L){var Z,fe=ut(R);try{Z=L()}finally{vn(fe)}return Z}function ut(R){var L=Sn.allowStateChanges;return Sn.allowStateChanges=R,L}function vn(R){Sn.allowStateChanges=R}var In=(function(R){function L(Z,fe,Re,st,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=Y.default);var bn=R.call(this,Re)||this;return bn.enhancer=fe,bn.name=Re,bn.equals=It,bn.hasUnreportedChange=!1,bn.value=fe(Z,void 0,Re),bn}return(function(Z,fe){function Re(){this.constructor=Z}W(Z,fe),Z.prototype=fe===null?Object.create(fe):(Re.prototype=fe.prototype,new Re)})(L,R),L.prototype.dehanceValue=function(Z){return this.dehancer!==void 0?this.dehancer(Z):Z},L.prototype.set=function(Z){this.value,(Z=this.prepareNewValue(Z))!==Sn.UNCHANGED&&this.setNewValue(Z)},L.prototype.prepareNewValue=function(Z){if(qt(this),Ja(this)){var fe=vo(this,{object:this,type:"update",newValue:Z});if(!fe)return Sn.UNCHANGED;Z=fe.newValue}return Z=this.enhancer(Z,this.value,this.name),this.equals(this.value,Z)?Sn.UNCHANGED:Z},L.prototype.setNewValue=function(Z){var fe=this.value;this.value=Z,this.reportChanged(),Ua(this)&&ha(this,{type:"update",object:this,newValue:Z,oldValue:fe})},L.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},L.prototype.intercept=function(Z){return ws(this,Z)},L.prototype.observe=function(Z,fe){return fe&&Z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Fs(this,Z)},L.prototype.toJSON=function(){return this.get()},L.prototype.toString=function(){return this.name+"["+this.value+"]"},L.prototype.valueOf=function(){return B(this.get())},L.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},L})(V),lr=M("ObservableValue",In),wo=(function(){function R(L){this.dependenciesState=ae.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new Pt(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=re.NONE,v(L.get,"missing option for computed: get"),this.derivation=L.get,this.name=L.name||"ComputedValue@"+f(),L.set&&(this.setter=yo(this.name+"-setter",L.set)),this.equals=L.equals||(L.compareStructural||L.struct?Y.structural:Y.default),this.scope=L.context,this.requiresReaction=!!L.requiresReaction,this.keepAlive=!!L.keepAlive}return R.prototype.onBecomeStale=function(){(function(L){L.lowestObserverState===ae.UP_TO_DATE&&(L.lowestObserverState=ae.POSSIBLY_STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.dependenciesState=ae.POSSIBLY_STALE,Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale())})))})(this)},R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.get=function(){this.isComputing&&h("Cycle detected in computation "+this.name+": "+this.derivation),Sn.inBatch!==0||this.observers.size!==0||this.keepAlive?(ms(this),Gt(this)&&this.trackAndCompute()&&(function(Z){Z.lowestObserverState!==ae.STALE&&(Z.lowestObserverState=ae.STALE,Z.observers.forEach((function(fe){fe.dependenciesState===ae.POSSIBLY_STALE?fe.dependenciesState=ae.STALE:fe.dependenciesState===ae.UP_TO_DATE&&(Z.lowestObserverState=ae.UP_TO_DATE)})))})(this)):Gt(this)&&(this.warnAboutUntrackedRead(),Ui(),this.value=this.computeValue(!1),gr());var L=this.value;if(Rt(L))throw L.cause;return L},R.prototype.peek=function(){var L=this.computeValue(!1);if(Rt(L))throw L.cause;return L},R.prototype.set=function(L){if(this.setter){v(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,L)}finally{this.isRunningSetter=!1}}else v(!1,!1)},R.prototype.trackAndCompute=function(){var L=this.value,Z=this.dependenciesState===ae.NOT_TRACKING,fe=this.computeValue(!0),Re=Z||Rt(L)||Rt(fe)||!this.equals(L,fe);return Re&&(this.value=fe),Re},R.prototype.computeValue=function(L){var Z;if(this.isComputing=!0,Sn.computationDepth++,L)Z=On(this,this.derivation,this.scope);else if(Sn.disableErrorBoundaries===!0)Z=this.derivation.call(this.scope);else try{Z=this.derivation.call(this.scope)}catch(fe){Z=new Pt(fe)}return Sn.computationDepth--,this.isComputing=!1,Z},R.prototype.suspend=function(){this.keepAlive||(Pe(this),this.value=void 0)},R.prototype.observe=function(L,Z){var fe=this,Re=!0,st=void 0;return ht((function(){var It=fe.get();if(!Re||Z){var bn=Le();L({type:"update",object:fe,newValue:It,oldValue:st}),dt(bn)}Re=!1,st=It}))},R.prototype.warnAboutUntrackedRead=function(){},R.prototype.toJSON=function(){return this.get()},R.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},R.prototype.valueOf=function(){return B(this.get())},R.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},R})(),oo=M("ComputedValue",wo),ta=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Ca={};function Yi(){return typeof window<"u"?window:a!==void 0?a:typeof self<"u"?self:Ca}var fa=!0,Ka=!1,Sn=(function(){var R=Yi();return R.__mobxInstanceCount>0&&!R.__mobxGlobals&&(fa=!1),R.__mobxGlobals&&R.__mobxGlobals.version!==new ta().version&&(fa=!1),fa?R.__mobxGlobals?(R.__mobxInstanceCount+=1,R.__mobxGlobals.UNCHANGED||(R.__mobxGlobals.UNCHANGED={}),R.__mobxGlobals):(R.__mobxInstanceCount=1,R.__mobxGlobals=new ta):(setTimeout((function(){Ka||h("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ta)})();function Tl(R,L){R.observers.add(L),R.lowestObserverState>L.dependenciesState&&(R.lowestObserverState=L.dependenciesState)}function Oo(R,L){R.observers.delete(L),R.observers.size===0&&el(R)}function el(R){R.isPendingUnobservation===!1&&(R.isPendingUnobservation=!0,Sn.pendingUnobservations.push(R))}function Ui(){Sn.inBatch++}function gr(){if(--Sn.inBatch==0){gs();for(var R=Sn.pendingUnobservations,L=0;L0&&el(R),!1)}function pa(R,L){if(R.isTracing===re.BREAK){var Z=[];qi(vi(R),Z,1),new Function(`debugger; /* Tracing '`+R.name+`' You are entering this break point because derivation '`+R.name+"' is being traced and '"+L.name+`' is now forcing it to update. Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update The stackframe you are looking for is at least ~6-8 stack-frames up. `+(R instanceof wo?R.derivation.toString().replace(/[*]\//g,"/"):"")+` The dependencies for this derivation are: `+Z.join(` `)+` */ `)()}}function qi(R,L,Z){L.length>=1e3?L.push("(and many more)"):(L.push(""+new Array(Z).join(" ")+R.name),R.dependencies&&R.dependencies.forEach((function(fe){return qi(fe,L,Z+1)})))}var Na=(function(){function R(L,Z,fe,Re){L===void 0&&(L="Reaction@"+f()),Re===void 0&&(Re=!1),this.name=L,this.onInvalidate=Z,this.errorHandler=fe,this.requiresObservable=Re,this.observing=[],this.newObserving=[],this.dependenciesState=ae.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=re.NONE}return R.prototype.onBecomeStale=function(){this.schedule()},R.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Sn.pendingReactions.push(this),gs())},R.prototype.isScheduled=function(){return this._isScheduled},R.prototype.runReaction=function(){if(!this.isDisposed){if(Ui(),this._isScheduled=!1,Gt(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(L){this.reportExceptionInDerivation(L)}}gr()}},R.prototype.track=function(L){if(!this.isDisposed){Ui(),this._isRunning=!0;var Z=On(this,L,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Pe(this),Rt(Z)&&this.reportExceptionInDerivation(Z.cause),gr()}},R.prototype.reportExceptionInDerivation=function(L){var Z=this;if(this.errorHandler)this.errorHandler(L,this);else{if(Sn.disableErrorBoundaries)throw L;Sn.suppressReactionErrors,Sn.globalReactionErrorHandlers.forEach((function(fe){return fe(L,Z)}))}},R.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ui(),Pe(this),gr()))},R.prototype.getDisposer=function(){var L=this.dispose.bind(this);return L[I]=this,L},R.prototype.toString=function(){return"Reaction["+this.name+"]"},R.prototype.trace=function(L){L===void 0&&(L=!1),(function(){for(var Z=[],fe=0;fe0||Sn.isRunningReactions||as(Cl)}function Cl(){Sn.isRunningReactions=!0;for(var R=Sn.pendingReactions,L=0;R.length>0;){++L==100&&R.splice(0);for(var Z=R.splice(0),fe=0,Re=Z.length;fe",R):arguments.length===2&&typeof L=="function"?yo(R,L):arguments.length===1&&typeof R=="string"?cn(R):fe!==!0?cn(L).apply(null,arguments):void S(R,L,yo(R.name||L,Z.value,this))};function lo(R,L){return ho(typeof R=="string"?R:R.name||"",typeof R=="function"?R:L,this,void 0)}function li(R){return typeof R=="function"&&R.isMobxAction===!0}function ye(R,L,Z){S(R,L,yo(L,Z.bind(R)))}function ht(R,L){L===void 0&&(L=s);var Z,fe=L&&L.name||R.name||"Autorun@"+f();if(!L.scheduler&&!L.delay)Z=new Na(fe,(function(){this.track(It)}),L.onError,L.requiresObservable);else{var Re=Rn(L),st=!1;Z=new Na(fe,(function(){st||(st=!0,Re((function(){st=!1,Z.isDisposed||Z.track(It)})))}),L.onError,L.requiresObservable)}function It(){R(Z)}return Z.schedule(),Z.getDisposer()}br.bound=function(R,L,Z,fe){return fe===!0?(ye(R,L,Z.value),null):Z?{configurable:!0,enumerable:!1,get:function(){return ye(this,L,Z.value||Z.initializer.call(this)),this[L]},set:mt}:{enumerable:!1,configurable:!0,set:function(Re){ye(this,L,Re)},get:function(){}}};var fn=function(R){return R()};function Rn(R){return R.scheduler?R.scheduler:R.delay?function(L){return setTimeout(L,R.delay)}:fn}function Cn(R,L,Z){Z===void 0&&(Z=s);var fe,Re,st,It=Z.name||"Reaction@"+f(),bn=br(It,Z.onError?(fe=Z.onError,Re=L,function(){try{return Re.apply(this,arguments)}catch(wi){fe.call(this,wi)}}):L),Jn=!Z.scheduler&&!Z.delay,no=Rn(Z),$n=!0,Do=!1,Kr=Z.compareStructural?Y.structural:Z.equals||Y.default,So=new Na(It,(function(){$n||Jn?us():Do||(Do=!0,no(us))}),Z.onError,Z.requiresObservable);function us(){if(Do=!1,!So.isDisposed){var wi=!1;So.track((function(){var es=R(So);wi=$n||!Kr(st,es),st=es})),$n&&Z.fireImmediately&&bn(st,So),$n||wi!==!0||bn(st,So),$n&&($n=!1)}}return So.schedule(),So.getDisposer()}function nr(R,L,Z){return Mn("onBecomeUnobserved",R,L,Z)}function Mn(R,L,Z,fe){var Re=typeof fe=="function"?ls(L,Z):ls(L),st=typeof fe=="function"?fe:Z,It=R+"Listeners";return Re[It]?Re[It].add(st):Re[It]=new Set([st]),typeof Re[R]!="function"?h(!1):function(){var bn=Re[It];bn&&(bn.delete(st),bn.size===0&&delete Re[It])}}function or(R){var L=R.enforceActions,Z=R.computedRequiresReaction,fe=R.computedConfigurable,Re=R.disableErrorBoundaries,st=R.reactionScheduler,It=R.reactionRequiresObservable,bn=R.observableRequiresReaction;if(R.isolateGlobalState===!0&&((Sn.pendingReactions.length||Sn.inBatch||Sn.isRunningReactions)&&h("isolateGlobalState should be called before MobX is running any reactions"),Ka=!0,fa&&(--Yi().__mobxInstanceCount==0&&(Yi().__mobxGlobals=void 0),Sn=new ta)),L!==void 0){var Jn=void 0;switch(L){case!0:case"observed":Jn=!0;break;case!1:case"never":Jn=!1;break;case"strict":case"always":Jn="strict";break;default:h("Invalid value for 'enforceActions': '"+L+"', expected 'never', 'always' or 'observed'")}Sn.enforceActions=Jn,Sn.allowStateChanges=Jn!==!0&&Jn!=="strict"}Z!==void 0&&(Sn.computedRequiresReaction=!!Z),It!==void 0&&(Sn.reactionRequiresObservable=!!It),bn!==void 0&&(Sn.observableRequiresReaction=!!bn,Sn.allowStateReads=!Sn.observableRequiresReaction),fe!==void 0&&(Sn.computedConfigurable=!!fe),Re!==void 0&&(Sn.disableErrorBoundaries=!!Re),st&&tl(st)}function sr(R,L,Z,fe){var Re=qr(fe=we(fe));return Be(R),ss(R,fe.name,Re.enhancer),L&&na(R,L,Z,Re),R}function qr(R){return R.defaultDecorator||(R.deep===!1?pt:$e)}function na(R,L,Z,fe){var Re,st;Ui();try{var It=F(L);try{for(var bn=J(It),Jn=bn.next();!Jn.done;Jn=bn.next()){var no=Jn.value,$n=Object.getOwnPropertyDescriptor(L,no),Do=(Z&&no in Z?Z[no]:$n.get?je:fe)(R,no,$n,!0);Do&&Object.defineProperty(R,no,Do)}}catch(Kr){Re={error:Kr}}finally{try{Jn&&!Jn.done&&(st=bn.return)&&st.call(bn)}finally{if(Re)throw Re.error}}}finally{gr()}}function vi(R,L){return _s(ls(R,L))}function _s(R){var L,Z,fe={name:R.name};return R.observing&&R.observing.length>0&&(fe.dependencies=(L=R.observing,Z=[],L.forEach((function(Re){Z.indexOf(Re)===-1&&Z.push(Re)})),Z).map(_s)),fe}var Vi=0;function Nl(){this.message="FLOW_CANCELLED"}function Is(R){arguments.length!==1&&h("Flow expects 1 argument and cannot be used as decorator");var L=R.name||"";return function(){var Z,fe=this,Re=arguments,st=++Vi,It=br(L+" - runid: "+st+" - init",R).apply(fe,Re),bn=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var es;bn=void 0;try{es=br(L+" - runid: "+st+" - yield "+Do++,It.next).call(It,wi)}catch(Pl){return $n(Pl)}us(es)}function So(wi){var es;bn=void 0;try{es=br(L+" - runid: "+st+" - yield "+Do++,It.throw).call(It,wi)}catch(Pl){return $n(Pl)}us(es)}function us(wi){if(!wi||typeof wi.then!="function")return wi.done?no(wi.value):(bn=Promise.resolve(wi.value)).then(Kr,So);wi.then(us,$n)}Z=$n,Kr(void 0)}));return Jn.cancel=br(L+" - runid: "+st+" - cancel",(function(){try{bn&&Ro(bn);var no=It.return(void 0),$n=Promise.resolve(no.value);$n.then(w,w),Ro($n),Z(new Nl)}catch(Do){Z(Do)}})),Jn}}function Ro(R){typeof R.cancel=="function"&&R.cancel()}function La(R,L){if(R==null)return!1;if(L!==void 0){if(ia(R)===!1||!R[I].values.has(L))return!1;var Z=ls(R,L);return oo(Z)}return oo(R)}function od(R){return arguments.length>1?h(!1):La(R)}function _u(R,L){return typeof L!="string"?h(!1):La(R,L)}function Ia(R,L){return R!=null&&(L!==void 0?!!ia(R)&&R[I].values.has(L):ia(R)||!!R[I]||z(R)||ys(R)||oo(R))}function ra(R){return arguments.length!==1&&h(!1),Ia(R)}function bs(R){return ia(R)?R[I].getKeys():Wi(R)||Ki(R)?Array.from(R.keys()):Es(R)?R.map((function(L,Z){return Z})):h(!1)}function qo(R){return ia(R)?bs(R).map((function(L){return R[L]})):Wi(R)?bs(R).map((function(L){return R.get(L)})):Ki(R)?Array.from(R.values()):Es(R)?R.slice():h(!1)}function Uh(R){return ia(R)?bs(R).map((function(L){return[L,R[L]]})):Wi(R)?bs(R).map((function(L){return[L,R.get(L)]})):Ki(R)?Array.from(R.entries()):Es(R)?R.map((function(L,Z){return[Z,L]})):h(!1)}function Fa(R,L,Z){if(arguments.length!==2||Ki(R))if(ia(R)){var fe=R[I],Re=fe.values.get(L);Re?fe.write(L,Z):fe.addObservableProp(L,Z,fe.defaultEnhancer)}else if(Wi(R))R.set(L,Z);else if(Ki(R))R.add(L);else{if(!Es(R))return h(!1);typeof L!="number"&&(L=parseInt(L,10)),v(L>=0,"Not a valid index: '"+L+"'"),Ui(),L>=R.length&&(R.length=L+1),R[L]=Z,gr()}else{Ui();var st=L;try{for(var It in st)Fa(R,It,st[It])}finally{gr()}}}function gp(R,L,Z,fe){return typeof Z=="function"?(function(Re,st,It,bn){return Pa(Re,st).observe(It,bn)})(R,L,Z,fe):(function(Re,st,It){return Pa(Re).observe(st,It)})(R,L,Z)}Nl.prototype=Object.create(Error.prototype);var yp={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ba(R,L,Z,fe){return fe.detectCycles&&R.set(L,Z),Z}function Za(R,L,Z){if(!L.recurseEverything&&!ra(R)||typeof R!="object")return R;if(R===null)return null;if(R instanceof Date)return R;if(lr(R))return Za(R.get(),L,Z);if(ra(R)&&bs(R),L.detectCycles===!0&&R!==null&&Z.has(R))return Z.get(R);if(Es(R)||Array.isArray(R)){var fe=Ba(Z,R,[],L),Re=R.map((function(Kr){return Za(Kr,L,Z)}));fe.length=Re.length;for(var st=0,It=Re.length;st0}function ws(R,L){var Z=R.interceptors||(R.interceptors=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function vo(R,L){var Z=Le();try{for(var fe=Se(R.interceptors||[]),Re=0,st=fe.length;Re0}function Fs(R,L){var Z=R.changeListeners||(R.changeListeners=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function ha(R,L){var Z=Le(),fe=R.changeListeners;if(fe){for(var Re=0,st=(fe=fe.slice()).length;Re0?L.map(this.dehancer):L},R.prototype.intercept=function(L){return ws(this,L)},R.prototype.observe=function(L,Z){return Z===void 0&&(Z=!1),Z&&L({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Fs(this,L)},R.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},R.prototype.setArrayLength=function(L){if(typeof L!="number"||L<0)throw new Error("[mobx.array] Out of range: "+L);var Z=this.values.length;if(L!==Z)if(L>Z){for(var fe=new Array(L-Z),Re=0;Rest?L=st:L<0&&(L=Math.max(0,st+L)),Z=arguments.length===1?st-L:Z==null?0:Math.max(0,Math.min(Z,st-L)),fe===void 0&&(fe=l),Ja(this)){var It=vo(this,{object:this.proxy,type:"splice",index:L,removedCount:Z,added:fe});if(!It)return l;Z=It.removedCount,fe=It.added}fe=fe.length===0?fe:fe.map((function(Jn){return Re.enhancer(Jn,void 0)}));var bn=this.spliceItemsIntoValues(L,Z,fe);return Z===0&&fe.length===0||this.notifyArraySplice(L,fe,bn),this.dehanceValues(bn)},R.prototype.spliceItemsIntoValues=function(L,Z,fe){var Re;if(fe.length<1e4)return(Re=this.values).splice.apply(Re,Se([L,Z],fe));var st=this.values.slice(L,L+Z);return this.values=this.values.slice(0,L).concat(fe,this.values.slice(L+Z)),st},R.prototype.notifyArrayChildUpdate=function(L,Z,fe){var Re=!this.owned&&!1,st=Ua(this),It=st||Re?{object:this.proxy,type:"update",index:L,newValue:Z,oldValue:fe}:null;this.atom.reportChanged(),st&&ha(this,It)},R.prototype.notifyArraySplice=function(L,Z,fe){var Re=!this.owned&&!1,st=Ua(this),It=st||Re?{object:this.proxy,type:"splice",index:L,removed:fe,added:Z,removedCount:fe.length,addedCount:Z.length}:null;this.atom.reportChanged(),st&&ha(this,It)},R})(),ui={intercept:function(R){return this[I].intercept(R)},observe:function(R,L){return L===void 0&&(L=!1),this[I].observe(R,L)},clear:function(){return this.splice(0)},replace:function(R){var L=this[I];return L.spliceWithArray(0,L.values.length,R)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(R,L){for(var Z=[],fe=2;fe-1&&(this.splice(Z,1),!0)},get:function(R){var L=this[I];if(L&&R=0&&Z++}R=Gn(R),L=Gn(L);var bn=It==="[object Array]";if(!bn){if(typeof R!="object"||typeof L!="object")return!1;var Jn=R.constructor,no=L.constructor;if(Jn!==no&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof no=="function"&&no instanceof no)&&"constructor"in R&&"constructor"in L)return!1}if(Z===0)return!1;Z<0&&(Z=-1),Re=Re||[];for(var $n=(fe=fe||[]).length;$n--;)if(fe[$n]===R)return Re[$n]===L;if(fe.push(R),Re.push(L),bn){if(($n=R.length)!==L.length)return!1;for(;$n--;)if(!dn(R[$n],L[$n],Z-1,fe,Re))return!1}else{var Do=Object.keys(R),Kr=void 0;if($n=Do.length,Object.keys(L).length!==$n)return!1;for(;$n--;)if(!Wr(L,Kr=Do[$n])||!dn(R[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Gn(R){return Es(R)?R.slice():C(R)||Wi(R)||$(R)||Ki(R)?Array.from(R.entries()):R}function Wr(R,L){return Object.prototype.hasOwnProperty.call(R,L)}function mo(R){return R[Symbol.iterator]=ci,R}function ci(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ve,extras:{getDebugName:function(R,L){return(L!==void 0?ls(R,L):ia(R)||Wi(R)||Ki(R)?Pa(R):ls(R)).name}},$mobx:I})}).call(this,r(163),r(68))},function(n,o,r){var i=r(113),a=r(42),l=r(179);i||a(Object.prototype,"toString",l,{unsafe:!0})},function(n,o,r){var i=r(41),a=r(100),l=r(80),s=r(58),f=r(116),h="Array Iterator",v=s.set,b=s.getterFor(h);n.exports=f(Array,"Array",(function(w,O){v(this,{type:h,target:i(w),index:0,kind:O})}),(function(){var w=b(this),O=w.target,E=w.kind,S=w.index++;return!O||S>=O.length?(w.target=void 0,{value:void 0,done:!0}):E=="keys"?{value:S,done:!1}:E=="values"?{value:O[S],done:!1}:{value:[S,O[S]],done:!1}}),"values"),l.Arguments=l.Array,a("keys"),a("values"),a("entries")},function(n,o,r){var i=r(16),a=r(7),l=r(46),s=r(76),f=r(34),h=r(15),v=r(71),b=r(36),w=r(108),O=r(18),E=r(35),S=r(96),M=r(30),C=r(33),$=r(54),D=r(87),k=r(32),B=r(40),F=r(41),I=r(86),V=r(39),z=r(69),X=r(60),Y=r(77),W=r(74),Q=r(139),J=r(112),ie=r(50),Se=r(38),Ae=r(84),ke=r(98),De=r(42),ze=r(89),Ye=r(93),Be=r(72),Je=r(90),gt=r(28),se=r(140),Ze=r(141),pe=r(78),le=r(58),we=r(79).forEach,$e=Ye("hidden"),rt="Symbol",pt=gt("toPrimitive"),Lt=le.set,Jt=le.getterFor(rt),en=Object.prototype,zt=a.Symbol,it=zt&&zt.prototype,ae=a.TypeError,re=a.QObject,je=l("JSON","stringify"),vt=ie.f,q=Se.f,Pt=Q.f,Rt=Ae.f,Gt=h([].push),kn=ze("symbols"),qt=ze("op-symbols"),On=ze("string-to-symbol-registry"),Pe=ze("symbol-to-string-registry"),Ke=ze("wks"),Le=!re||!re.prototype||!re.prototype.findChild,dt=b&&O((function(){return X(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a!=7}))?function(Nn,qn,rr){var ut=vt(en,qn);ut&&delete en[qn],q(Nn,qn,rr),ut&&Nn!==en&&q(en,qn,ut)}:q,At=function(Nn,qn){var rr=kn[Nn]=X(it);return Lt(rr,{type:rt,tag:Nn,description:qn}),b||(rr.description=qn),rr},Tt=function(Nn,qn,rr){Nn===en&&Tt(qt,qn,rr),k(Nn);var ut=I(qn);return k(rr),E(kn,ut)?(rr.enumerable?(E(Nn,$e)&&Nn[$e][ut]&&(Nn[$e][ut]=!1),rr=X(rr,{enumerable:z(0,!1)})):(E(Nn,$e)||q(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):q(Nn,ut,rr)},En=function(Nn,qn){k(Nn);var rr=F(qn),ut=Y(rr).concat(yo(rr));return we(ut,(function(vn){b&&!f(Zn,rr,vn)||Tt(Nn,vn,rr[vn])})),Nn},Zn=function(Nn){var qn=I(Nn),rr=f(Rt,this,qn);return!(this===en&&E(kn,qn)&&!E(qt,qn))&&(!(rr||!E(this,qn)||!E(kn,qn)||E(this,$e)&&this[$e][qn])||rr)},ao=function(Nn,qn){var rr=F(Nn),ut=I(qn);if(rr!==en||!E(kn,ut)||E(qt,ut)){var vn=vt(rr,ut);return!vn||!E(kn,ut)||E(rr,$e)&&rr[$e][ut]||(vn.enumerable=!0),vn}},Lo=function(Nn){var qn=Pt(F(Nn)),rr=[];return we(qn,(function(ut){E(kn,ut)||E(Be,ut)||Gt(rr,ut)})),rr},yo=function(Nn){var qn=Nn===en,rr=Pt(qn?qt:F(Nn)),ut=[];return we(rr,(function(vn){!E(kn,vn)||qn&&!E(en,vn)||Gt(ut,kn[vn])})),ut};if(w||(zt=function(){if($(it,this))throw ae("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?V(arguments[0]):void 0,qn=Je(Nn),rr=function(ut){this===en&&f(rr,qt,ut),E(this,$e)&&E(this[$e],qn)&&(this[$e][qn]=!1),dt(this,qn,z(1,ut))};return b&&Le&&dt(en,qn,{configurable:!0,set:rr}),At(qn,Nn)},De(it=zt.prototype,"toString",(function(){return Jt(this).tag})),De(zt,"withoutSetter",(function(Nn){return At(Je(Nn),Nn)})),Ae.f=Zn,Se.f=Tt,ie.f=ao,W.f=Q.f=Lo,J.f=yo,se.f=function(Nn){return At(gt(Nn),Nn)},b&&(q(it,"description",{configurable:!0,get:function(){return Jt(this).description}}),v||De(en,"propertyIsEnumerable",Zn,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!w,sham:!w},{Symbol:zt}),we(Y(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!w},{for:function(Nn){var qn=V(Nn);if(E(On,qn))return On[qn];var rr=zt(qn);return On[qn]=rr,Pe[rr]=qn,rr},keyFor:function(Nn){if(!D(Nn))throw ae(Nn+" is not a symbol");if(E(Pe,Nn))return Pe[Nn]},useSetter:function(){Le=!0},useSimple:function(){Le=!1}}),i({target:"Object",stat:!0,forced:!w,sham:!b},{create:function(Nn,qn){return qn===void 0?X(Nn):En(X(Nn),qn)},defineProperty:Tt,defineProperties:En,getOwnPropertyDescriptor:ao}),i({target:"Object",stat:!0,forced:!w},{getOwnPropertyNames:Lo,getOwnPropertySymbols:yo}),i({target:"Object",stat:!0,forced:O((function(){J.f(1)}))},{getOwnPropertySymbols:function(Nn){return J.f(B(Nn))}}),je&&i({target:"JSON",stat:!0,forced:!w||O((function(){var Nn=zt();return je([Nn])!="[null]"||je({a:Nn})!="{}"||je(Object(Nn))!="{}"}))},{stringify:function(Nn,qn,rr){var ut=ke(arguments),vn=qn;if((C(qn)||Nn!==void 0)&&!D(Nn))return S(qn)||(qn=function(In,lr){if(M(vn)&&(lr=f(vn,this,In,lr)),!D(lr))return lr}),ut[1]=qn,s(je,null,ut)}}),!it[pt]){var ho=it.valueOf;De(it,pt,(function(Nn){return f(ho,this)}))}pe(zt,rt),Be[$e]=!0},function(n,o,r){var i=r(7),a=r(152),l=r(153),s=r(3),f=r(57),h=r(28),v=h("iterator"),b=h("toStringTag"),w=s.values,O=function(S,M){if(S){if(S[v]!==w)try{f(S,v,w)}catch{S[v]=w}if(S[b]||f(S,b,M),a[M]){for(var C in s)if(S[C]!==s[C])try{f(S,C,s[C])}catch{S[C]=s[C]}}}};for(var E in a)O(i[E]&&i[E].prototype,E);O(l,"DOMTokenList")},function(n,o,r){var i=r(151).charAt,a=r(39),l=r(58),s=r(116),f="String Iterator",h=l.set,v=l.getterFor(f);s(String,"String",(function(b){h(this,{type:f,string:a(b),index:0})}),(function(){var b,w=v(this),O=w.string,E=w.index;return E>=O.length?{value:void 0,done:!0}:(b=i(O,E),w.index+=b.length,{value:b,done:!1})}))},function(n,o,r){(function(i){var a=function(l){return l&&l.Math==Math&&l};n.exports=a(typeof globalThis=="object"&&globalThis)||a(typeof window=="object"&&window)||a(typeof self=="object"&&self)||a(typeof i=="object"&&i)||(function(){return this})()||Function("return this")()}).call(this,r(68))},function(n,o,r){var i=r(16),a=r(36),l=r(7),s=r(15),f=r(35),h=r(30),v=r(54),b=r(39),w=r(38).f,O=r(134),E=l.Symbol,S=E&&E.prototype;if(a&&h(E)&&(!("description"in S)||E().description!==void 0)){var M={},C=function(){var V=arguments.length<1||arguments[0]===void 0?void 0:b(arguments[0]),z=v(S,this)?new E(V):V===void 0?E():E(V);return V===""&&(M[z]=!0),z};O(C,E),C.prototype=S,S.constructor=C;var $=String(E("test"))=="Symbol(test)",D=s(S.toString),k=s(S.valueOf),B=/^Symbol\((.*)\)[^)]+$/,F=s("".replace),I=s("".slice);w(S,"description",{configurable:!0,get:function(){var V=k(this),z=D(V);if(f(M,V))return"";var X=$?I(z,7,-1):F(z,B,"$1");return X===""?void 0:X}}),i({global:!0,forced:!0},{Symbol:C})}},function(n,o,r){r(141)("iterator")},function(n,o,r){r.d(o,"a",(function(){return s.a})),r.d(o,"c",(function(){return s.e})),r.d(o,"h",(function(){return B})),r.d(o,"i",(function(){return $})),r.d(o,"j",(function(){return M})),r.d(o,"b",(function(){return ie})),r.d(o,"e",(function(){return De})),r.d(o,"f",(function(){return Se})),r.d(o,"g",(function(){return kn}));var i,a,l,s=r(0),f=0,h=[],v=s.i.__b,b=s.i.__r,w=s.i.diffed,O=s.i.__c,E=s.i.unmount;function S(Pe,Ke){s.i.__h&&s.i.__h(a,Pe,f||Ke),f=0;var Le=a.__H||(a.__H={__:[],__h:[]});return Pe>=Le.__.length&&Le.__.push({}),Le.__[Pe]}function M(Pe){return f=1,C(W,Pe)}function C(Pe,Ke,Le){var dt=S(i++,2);return dt.t=Pe,dt.__c||(dt.__=[Le?Le(Ke):W(void 0,Ke),function(At){var Tt=dt.t(dt.__[0],At);dt.__[0]!==Tt&&(dt.__=[Tt,dt.__[1]],dt.__c.setState({}))}],dt.__c=a),dt.__}function $(Pe,Ke){var Le=S(i++,3);!s.i.__s&&Y(Le.__H,Ke)&&(Le.__=Pe,Le.__H=Ke,a.__H.__h.push(Le))}function D(Pe,Ke){var Le=S(i++,4);!s.i.__s&&Y(Le.__H,Ke)&&(Le.__=Pe,Le.__H=Ke,a.__h.push(Le))}function k(Pe,Ke){var Le=S(i++,7);return Y(Le.__H,Ke)&&(Le.__=Pe(),Le.__H=Ke,Le.__h=Pe),Le.__}function B(Pe,Ke){return f=8,k((function(){return Pe}),Ke)}function F(){var Pe;for(h.sort((function(Ke,Le){return Ke.__v.__b-Le.__v.__b}));Pe=h.pop();)if(Pe.__P)try{Pe.__H.__h.forEach(z),Pe.__H.__h.forEach(X),Pe.__H.__h=[]}catch(Ke){Pe.__H.__h=[],s.i.__e(Ke,Pe.__v)}}s.i.__b=function(Pe){a=null,v&&v(Pe)},s.i.__r=function(Pe){b&&b(Pe),i=0;var Ke=(a=Pe.__c).__H;Ke&&(Ke.__h.forEach(z),Ke.__h.forEach(X),Ke.__h=[])},s.i.diffed=function(Pe){w&&w(Pe);var Ke=Pe.__c;Ke&&Ke.__H&&Ke.__H.__h.length&&(h.push(Ke)!==1&&l===s.i.requestAnimationFrame||((l=s.i.requestAnimationFrame)||V)(F)),a=null},s.i.__c=function(Pe,Ke){Ke.some((function(Le){try{Le.__h.forEach(z),Le.__h=Le.__h.filter((function(dt){return!dt.__||X(dt)}))}catch(dt){Ke.some((function(At){At.__h&&(At.__h=[])})),Ke=[],s.i.__e(dt,Le.__v)}})),O&&O(Pe,Ke)},s.i.unmount=function(Pe){E&&E(Pe);var Ke,Le=Pe.__c;Le&&Le.__H&&(Le.__H.__.forEach((function(dt){try{z(dt)}catch(At){Ke=At}})),Ke&&s.i.__e(Ke,Le.__v))};var I=typeof requestAnimationFrame=="function";function V(Pe){var Ke,Le=function(){clearTimeout(dt),I&&cancelAnimationFrame(Ke),setTimeout(Pe)},dt=setTimeout(Le,100);I&&(Ke=requestAnimationFrame(Le))}function z(Pe){var Ke=a,Le=Pe.__c;typeof Le=="function"&&(Pe.__c=void 0,Le()),a=Ke}function X(Pe){var Ke=a;Pe.__c=Pe.__(),a=Ke}function Y(Pe,Ke){return!Pe||Pe.length!==Ke.length||Ke.some((function(Le,dt){return Le!==Pe[dt]}))}function W(Pe,Ke){return typeof Ke=="function"?Ke(Pe):Ke}function Q(Pe,Ke){for(var Le in Ke)Pe[Le]=Ke[Le];return Pe}function J(Pe,Ke){for(var Le in Pe)if(Le!=="__source"&&!(Le in Ke))return!0;for(var dt in Ke)if(dt!=="__source"&&Pe[dt]!==Ke[dt])return!0;return!1}function ie(Pe){this.props=Pe}function Se(Pe,Ke){function Le(At){var Tt=this.props.ref,En=Tt==At.ref;return!En&&Tt&&(Tt.call?Tt(null):Tt.current=null),Ke?!Ke(this.props,At)||!En:J(this.props,At)}function dt(At){return this.shouldComponentUpdate=Le,Object(s.e)(Pe,At)}return dt.displayName="Memo("+(Pe.displayName||Pe.name)+")",dt.prototype.isReactComponent=!0,dt.__f=!0,dt}(ie.prototype=new s.a).isPureReactComponent=!0,ie.prototype.shouldComponentUpdate=function(Pe,Ke){return J(this.props,Pe)||J(this.state,Ke)};var Ae=s.i.__b;s.i.__b=function(Pe){Pe.type&&Pe.type.__f&&Pe.ref&&(Pe.props.ref=Pe.ref,Pe.ref=null),Ae&&Ae(Pe)};var ke=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function De(Pe){function Ke(Le,dt){var At=Q({},Le);return delete At.ref,Pe(At,!(dt=Le.ref||dt)||typeof dt=="object"&&!("current"in dt)?null:dt)}return Ke.$$typeof=ke,Ke.render=Ke,Ke.prototype.isReactComponent=Ke.__f=!0,Ke.displayName="ForwardRef("+(Pe.displayName||Pe.name)+")",Ke}var ze=function(Pe,Ke){return Pe==null?null:Object(s.k)(Object(s.k)(Pe).map(Ke))},Ye={map:ze,forEach:ze,count:function(Pe){return Pe?Object(s.k)(Pe).length:0},only:function(Pe){var Ke=Object(s.k)(Pe);if(Ke.length!==1)throw"Children.only";return Ke[0]},toArray:s.k},Be=s.i.__e;s.i.__e=function(Pe,Ke,Le){if(Pe.then){for(var dt,At=Ke;At=At.__;)if((dt=At.__c)&&dt.__c)return Ke.__e==null&&(Ke.__e=Le.__e,Ke.__k=Le.__k),dt.__c(Pe,Ke)}Be(Pe,Ke,Le)};var Je=s.i.unmount;function gt(Pe,Ke,Le){return Pe&&(Pe.__c&&Pe.__c.__H&&(Pe.__c.__H.__.forEach((function(dt){typeof dt.__c=="function"&&dt.__c()})),Pe.__c.__H=null),(Pe=Q({},Pe)).__c!=null&&(Pe.__c.__P===Le&&(Pe.__c.__P=Ke),Pe.__c=null),Pe.__k=Pe.__k&&Pe.__k.map((function(dt){return gt(dt,Ke,Le)}))),Pe}function se(Pe,Ke,Le){return Pe&&(Pe.__v=null,Pe.__k=Pe.__k&&Pe.__k.map((function(dt){return se(dt,Ke,Le)})),Pe.__c&&Pe.__c.__P===Ke&&(Pe.__e&&Le.insertBefore(Pe.__e,Pe.__d),Pe.__c.__e=!0,Pe.__c.__P=Le)),Pe}function Ze(){this.__u=0,this.t=null,this.__b=null}function pe(Pe){var Ke=Pe.__.__c;return Ke&&Ke.__e&&Ke.__e(Pe)}function le(){this.u=null,this.o=null}s.i.unmount=function(Pe){var Ke=Pe.__c;Ke&&Ke.__R&&Ke.__R(),Ke&&Pe.__h===!0&&(Pe.type=null),Je&&Je(Pe)},(Ze.prototype=new s.a).__c=function(Pe,Ke){var Le=Ke.__c,dt=this;dt.t==null&&(dt.t=[]),dt.t.push(Le);var At=pe(dt.__v),Tt=!1,En=function(){Tt||(Tt=!0,Le.__R=null,At?At(Zn):Zn())};Le.__R=En;var Zn=function(){if(!--dt.__u){if(dt.state.__e){var Lo=dt.state.__e;dt.__v.__k[0]=se(Lo,Lo.__c.__P,Lo.__c.__O)}var yo;for(dt.setState({__e:dt.__b=null});yo=dt.t.pop();)yo.forceUpdate()}},ao=Ke.__h===!0;dt.__u++||ao||dt.setState({__e:dt.__b=dt.__v.__k[0]}),Pe.then(En,En)},Ze.prototype.componentWillUnmount=function(){this.t=[]},Ze.prototype.render=function(Pe,Ke){if(this.__b){if(this.__v.__k){var Le=document.createElement("div"),dt=this.__v.__k[0].__c;this.__v.__k[0]=gt(this.__b,Le,dt.__O=dt.__P)}this.__b=null}var At=Ke.__e&&Object(s.e)(s.b,null,Pe.fallback);return At&&(At.__h=null),[Object(s.e)(s.b,null,Ke.__e?null:Pe.children),At]};var we=function(Pe,Ke,Le){if(++Le[1]===Le[0]&&Pe.o.delete(Ke),Pe.props.revealOrder&&(Pe.props.revealOrder[0]!=="t"||!Pe.o.size))for(Le=Pe.u;Le;){for(;Le.length>3;)Le.pop()();if(Le[1]>>1,1),Ke.i.removeChild(dt)}}),Object(s.j)(Object(s.e)($e,{context:Ke.context},Pe.__v),Ke.l)):Ke.l&&Ke.componentWillUnmount()}(le.prototype=new s.a).__e=function(Pe){var Ke=this,Le=pe(Ke.__v),dt=Ke.o.get(Pe);return dt[0]++,function(At){var Tt=function(){Ke.props.revealOrder?(dt.push(At),we(Ke,Pe,dt)):At()};Le?Le(Tt):Tt()}},le.prototype.render=function(Pe){this.u=null,this.o=new Map;var Ke=Object(s.k)(Pe.children);Pe.revealOrder&&Pe.revealOrder[0]==="b"&&Ke.reverse();for(var Le=Ke.length;Le--;)this.o.set(Ke[Le],this.u=[1,0,this.u]);return Pe.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var Pe=this;this.o.forEach((function(Ke,Le){we(Pe,Le,Ke)}))};var pt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Jt=typeof document<"u",en=function(Pe){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(Pe)};s.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(Pe){Object.defineProperty(s.a.prototype,Pe,{configurable:!0,get:function(){return this["UNSAFE_"+Pe]},set:function(Ke){Object.defineProperty(this,Pe,{configurable:!0,writable:!0,value:Ke})}})}));var zt=s.i.event;function it(){}function ae(){return this.cancelBubble}function re(){return this.defaultPrevented}s.i.event=function(Pe){return zt&&(Pe=zt(Pe)),Pe.persist=it,Pe.isPropagationStopped=ae,Pe.isDefaultPrevented=re,Pe.nativeEvent=Pe};var je,vt={configurable:!0,get:function(){return this.class}},q=s.i.vnode;s.i.vnode=function(Pe){var Ke=Pe.type,Le=Pe.props,dt=Le;if(typeof Ke=="string"){var At=Ke.indexOf("-")===-1;for(var Tt in dt={},Le){var En=Le[Tt];Jt&&Tt==="children"&&Ke==="noscript"||Tt==="value"&&"defaultValue"in Le&&En==null||(Tt==="defaultValue"&&"value"in Le&&Le.value==null?Tt="value":Tt==="download"&&En===!0?En="":/ondoubleclick/i.test(Tt)?Tt="ondblclick":/^onchange(textarea|input)/i.test(Tt+Ke)&&!en(Le.type)?Tt="oninput":/^onfocus$/i.test(Tt)?Tt="onfocusin":/^onblur$/i.test(Tt)?Tt="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(Tt)?Tt=Tt.toLowerCase():At&&Lt.test(Tt)?Tt=Tt.replace(/[A-Z0-9]/,"-$&").toLowerCase():En===null&&(En=void 0),dt[Tt]=En)}Ke=="select"&&dt.multiple&&Array.isArray(dt.value)&&(dt.value=Object(s.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.value.indexOf(Zn.props.value)!=-1}))),Ke=="select"&&dt.defaultValue!=null&&(dt.value=Object(s.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.multiple?dt.defaultValue.indexOf(Zn.props.value)!=-1:dt.defaultValue==Zn.props.value}))),Pe.props=dt,Le.class!=Le.className&&(vt.enumerable="className"in Le,Le.className!=null&&(dt.class=Le.className),Object.defineProperty(dt,"className",vt))}Pe.$$typeof=pt,q&&q(Pe)};var Pt=s.i.__r;s.i.__r=function(Pe){Pt&&Pt(Pe),je=Pe.__c};var Rt={ReactCurrentDispatcher:{current:{readContext:function(Pe){return je.__n[Pe.__c].props.value}}}};function Gt(Pe){return!!Pe&&Pe.$$typeof===pt}var kn=function(Pe,Ke){return Pe(Ke)},qt=s.b,On={useState:M,useReducer:C,useEffect:$,useLayoutEffect:D,useRef:function(Pe){return f=5,k((function(){return{current:Pe}}),[])},useImperativeHandle:function(Pe,Ke,Le){f=6,D((function(){typeof Pe=="function"?Pe(Ke()):Pe&&(Pe.current=Ke())}),Le==null?Le:Le.concat(Pe))},useMemo:k,useCallback:B,useContext:function(Pe){var Ke=a.context[Pe.__c],Le=S(i++,9);return Le.c=Pe,Ke?(Le.__==null&&(Le.__=!0,Ke.sub(a)),Ke.props.value):Pe.__},useDebugValue:function(Pe,Ke){s.i.useDebugValue&&s.i.useDebugValue(Ke?Ke(Pe):Pe)},version:"17.0.2",Children:Ye,render:function(Pe,Ke,Le){return Ke.__k==null&&(Ke.textContent=""),Object(s.j)(Pe,Ke),typeof Le=="function"&&Le(),Pe?Pe.__c:null},hydrate:function(Pe,Ke,Le){return Object(s.h)(Pe,Ke),typeof Le=="function"&&Le(),Pe?Pe.__c:null},unmountComponentAtNode:function(Pe){return!!Pe.__k&&(Object(s.j)(null,Pe),!0)},createPortal:function(Pe,Ke){return Object(s.e)(rt,{__v:Pe,i:Ke})},createElement:s.e,createContext:s.d,createFactory:function(Pe){return s.e.bind(null,Pe)},cloneElement:function(Pe){return Gt(Pe)?s.c.apply(null,arguments):Pe},createRef:s.f,Fragment:s.b,isValidElement:Gt,findDOMNode:function(Pe){return Pe&&(Pe.base||Pe.nodeType===1&&Pe)||null},Component:s.a,PureComponent:ie,memo:Se,forwardRef:De,flushSync:function(Pe,Ke){return Pe(Ke)},unstable_batchedUpdates:kn,StrictMode:qt,Suspense:Ze,SuspenseList:le,lazy:function(Pe){var Ke,Le,dt;function At(Tt){if(Ke||(Ke=Pe()).then((function(En){Le=En.default||En}),(function(En){dt=En})),dt)throw dt;if(!Le)throw Ke;return Object(s.e)(Le,Tt)}return At.displayName="Lazy",At.__f=!0,At},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Rt};o.d=On},function(n,o,r){var i=r(7),a=r(152),l=r(153),s=r(187),f=r(57),h=function(b){if(b&&b.forEach!==s)try{f(b,"forEach",s)}catch{b.forEach=s}};for(var v in a)a[v]&&h(i[v]&&i[v].prototype);h(l)},function(n,o,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,o,r){var i=r(16),a=r(18),l=r(40),s=r(101),f=r(143);i({target:"Object",stat:!0,forced:a((function(){s(1)})),sham:!f},{getPrototypeOf:function(h){return s(l(h))}})},function(n,o,r){var i=r(16),a=r(46),l=r(76),s=r(203),f=r(165),h=r(32),v=r(33),b=r(60),w=r(18),O=a("Reflect","construct"),E=Object.prototype,S=[].push,M=w((function(){function D(){}return!(O((function(){}),[],D)instanceof D)})),C=!w((function(){O((function(){}))})),$=M||C;i({target:"Reflect",stat:!0,forced:$,sham:$},{construct:function(D,k){f(D),h(k);var B=arguments.length<3?D:f(arguments[2]);if(C&&!M)return O(D,k,B);if(D==B){switch(k.length){case 0:return new D;case 1:return new D(k[0]);case 2:return new D(k[0],k[1]);case 3:return new D(k[0],k[1],k[2]);case 4:return new D(k[0],k[1],k[2],k[3])}var F=[null];return l(S,F,k),new(l(s,D,F))}var I=B.prototype,V=b(v(I)?I:E),z=l(D,V,k);return v(z)?z:V}})},function(n,o){var r=Function.prototype,i=r.bind,a=r.call,l=i&&i.bind(a);n.exports=i?function(s){return s&&l(a,s)}:function(s){return s&&function(){return a.apply(s,arguments)}}},function(n,o,r){var i=r(7),a=r(50).f,l=r(57),s=r(42),f=r(110),h=r(134),v=r(95);n.exports=function(b,w){var O,E,S,M,C,$=b.target,D=b.global,k=b.stat;if(O=D?i:k?i[$]||f($,{}):(i[$]||{}).prototype)for(E in w){if(M=w[E],S=b.noTargetGet?(C=a(O,E))&&C.value:O[E],!v(D?E:$+(k?".":"#")+E,b.forced)&&S!==void 0){if(typeof M==typeof S)continue;h(M,S)}(b.sham||S&&S.sham)&&l(M,"sham",!0),s(O,E,M,b)}}},function(n,o,r){var i=r(16),a=r(7),l=r(96),s=r(99),f=r(33),h=r(75),v=r(45),b=r(41),w=r(63),O=r(28),E=r(81),S=r(98),M=E("slice"),C=O("species"),$=a.Array,D=Math.max;i({target:"Array",proto:!0,forced:!M},{slice:function(k,B){var F,I,V,z=b(this),X=v(z),Y=h(k,X),W=h(B===void 0?X:B,X);if(l(z)&&(F=z.constructor,(s(F)&&(F===$||l(F.prototype))||f(F)&&(F=F[C])===null)&&(F=void 0),F===$||F===void 0))return S(z,Y,W);for(I=new(F===void 0?$:F)(D(W-Y,0)),V=0;Y1?arguments[1]:void 0)}})},function(n,o,r){var i=r(16),a=r(36),l=r(135),s=r(41),f=r(50),h=r(63);i({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(v){for(var b,w,O=s(v),E=f.f,S=l(O),M={},C=0;S.length>C;)(w=E(O,b=S[C++]))!==void 0&&h(M,b,w);return M}})},,function(n,o,r){var i=r(16),a=r(7),l=r(18),s=r(96),f=r(33),h=r(40),v=r(45),b=r(63),w=r(115),O=r(81),E=r(28),S=r(70),M=E("isConcatSpreadable"),C=9007199254740991,$="Maximum allowed index exceeded",D=a.TypeError,k=S>=51||!l((function(){var I=[];return I[M]=!1,I.concat()[0]!==I})),B=O("concat"),F=function(I){if(!f(I))return!1;var V=I[M];return V!==void 0?!!V:s(I)};i({target:"Array",proto:!0,forced:!k||!B},{concat:function(I){var V,z,X,Y,W,Q=h(this),J=w(Q,0),ie=0;for(V=-1,X=arguments.length;VC)throw D($);for(z=0;z=C)throw D($);b(J,ie++,W)}return J.length=ie,J}})},function(n,o,r){var i=r(7),a=r(89),l=r(35),s=r(90),f=r(108),h=r(132),v=a("wks"),b=i.Symbol,w=b&&b.for,O=h?b:b&&b.withoutSetter||s;n.exports=function(E){if(!l(v,E)||!f&&typeof v[E]!="string"){var S="Symbol."+E;f&&l(b,E)?v[E]=b[E]:v[E]=h&&w?w(S):O(S)}return v[E]}},function(n,o,r){var i=r(16),a=r(202);i({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(n,o){n.exports=function(r){return typeof r=="function"}},function(n,o,r){var i=r(106),a=typeof self=="object"&&self&&self.Object===Object&&self,l=i.a||a||Function("return this")();o.a=l},function(n,o,r){var i=r(7),a=r(33),l=i.String,s=i.TypeError;n.exports=function(f){if(a(f))return f;throw s(l(f)+" is not an object")}},function(n,o,r){var i=r(30);n.exports=function(a){return typeof a=="object"?a!==null:i(a)}},function(n,o){var r=Function.prototype.call;n.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(n,o,r){var i=r(15),a=r(40),l=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(s,f){return l(a(s),f)}},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}))},function(n,o,r){var i=r(16),a=r(79).map;i({target:"Array",proto:!0,forced:!r(81)("map")},{map:function(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(7),a=r(36),l=r(133),s=r(32),f=r(86),h=i.TypeError,v=Object.defineProperty;o.f=a?v:function(b,w,O){if(s(b),w=f(w),s(O),l)try{return v(b,w,O)}catch{}if("get"in O||"set"in O)throw h("Accessors not supported");return"value"in O&&(b[w]=O.value),b}},function(n,o,r){var i=r(7),a=r(97),l=i.String;n.exports=function(s){if(a(s)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return l(s)}},function(n,o,r){var i=r(7),a=r(44),l=i.Object;n.exports=function(s){return l(a(s))}},function(n,o,r){var i=r(85),a=r(44);n.exports=function(l){return i(a(l))}},function(n,o,r){var i=r(7),a=r(30),l=r(35),s=r(57),f=r(110),h=r(92),v=r(58),b=r(73).CONFIGURABLE,w=v.get,O=v.enforce,E=String(String).split("String");(n.exports=function(S,M,C,$){var D,k=!!$&&!!$.unsafe,B=!!$&&!!$.enumerable,F=!!$&&!!$.noTargetGet,I=$&&$.name!==void 0?$.name:M;a(C)&&(String(I).slice(0,7)==="Symbol("&&(I="["+String(I).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!l(C,"name")||b&&C.name!==I)&&s(C,"name",I),(D=O(C)).source||(D.source=E.join(typeof I=="string"?I:""))),S!==i?(k?!F&&S[M]&&(B=!0):delete S[M],B?S[M]=C:s(S,M,C)):B?S[M]=C:f(M,C)})(Function.prototype,"toString",(function(){return a(this)&&w(this).source||h(this)}))},function(n,o,r){(function(i){r.d(o,"d",(function(){return s})),r.d(o,"c",(function(){return f})),r.d(o,"b",(function(){return h})),r.d(o,"a",(function(){return b}));var a=r(10),l=function(w,O){var E=typeof Symbol=="function"&&w[Symbol.iterator];if(!E)return w;var S,M,C=E.call(w),$=[];try{for(;(O===void 0||O-- >0)&&!(S=C.next()).done;)$.push(S.value)}catch(D){M={error:D}}finally{try{S&&!S.done&&(E=C.return)&&E.call(C)}finally{if(M)throw M.error}}return $};function s(){var w=l(Object(a.j)(0),2)[1];return Object(a.h)((function(){w((function(O){return O+1}))}),[])}function f(w){if(!w||typeof w!="object")return!1;var O=Object.getPrototypeOf(w);return!O||O===Object.prototype}function h(w){return typeof Symbol=="function"?Symbol.for(w):"__$mobx-react "+w+"__"}var v={};function b(){return typeof window<"u"?window:i!==void 0?i:typeof self<"u"?self:v}}).call(this,r(68))},function(n,o,r){var i=r(7).TypeError;n.exports=function(a){if(a==null)throw i("Can't call method on "+a);return a}},function(n,o,r){var i=r(94);n.exports=function(a){return i(a.length)}},function(n,o,r){var i=r(7),a=r(30),l=function(s){return a(s)?s:void 0};n.exports=function(s,f){return arguments.length<2?l(i[s]):i[s]&&i[s][f]}},function(n,o,r){var i=r(16),a=r(34),l=r(33),s=r(32),f=r(204),h=r(50),v=r(101);i({target:"Reflect",stat:!0},{get:function b(w,O){var E,S,M=arguments.length<3?w:arguments[2];return s(w)===M?w[O]:(E=h.f(w,O))?f(E)?E.value:E.get===void 0?void 0:a(E.get,M):l(S=v(w))?b(S,O,M):void 0}})},function(n,o,r){(function(i){var a=r(31),l=r(171),s=e&&!e.nodeType&&e,f=s&&typeof i=="object"&&i&&!i.nodeType&&i,h=f&&f.exports===s?a.a.Buffer:void 0,v=(h?h.isBuffer:void 0)||l.a;o.a=v}).call(this,r(122)(n))},function(n,o,r){(function(i){var a=r(106),l=e&&!e.nodeType&&e,s=l&&typeof i=="object"&&i&&!i.nodeType&&i,f=s&&s.exports===l&&a.a.process,h=(function(){try{var v=s&&s.require&&s.require("util").types;return v||f&&f.binding&&f.binding("util")}catch{}})();o.a=h}).call(this,r(122)(n))},function(n,o,r){var i=r(36),a=r(34),l=r(84),s=r(69),f=r(41),h=r(86),v=r(35),b=r(133),w=Object.getOwnPropertyDescriptor;o.f=i?w:function(O,E){if(O=f(O),E=h(E),b)try{return w(O,E)}catch{}if(v(O,E))return s(!a(l.f,O,E),O[E])}},function(n,o,r){var i=r(15),a=i({}.toString),l=i("".slice);n.exports=function(s){return l(a(s),8,-1)}},function(n,o,r){r(182)("Map",(function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}}),r(186))},function(n,o,r){var i=r(16),a=r(220).entries;i({target:"Object",stat:!0},{entries:function(l){return a(l)}})},function(n,o,r){var i=r(15);n.exports=i({}.isPrototypeOf)},function(n,o,r){var i=r(46);n.exports=i("navigator","userAgent")||""},function(n,o,r){var i=r(7),a=r(30),l=r(88),s=i.TypeError;n.exports=function(f){if(a(f))return f;throw s(l(f)+" is not a function")}},function(n,o,r){var i=r(36),a=r(38),l=r(69);n.exports=i?function(s,f,h){return a.f(s,f,l(1,h))}:function(s,f,h){return s[f]=h,s}},function(n,o,r){var i,a,l,s=r(175),f=r(7),h=r(15),v=r(33),b=r(57),w=r(35),O=r(109),E=r(93),S=r(72),M="Object already initialized",C=f.TypeError,$=f.WeakMap;if(s||O.state){var D=O.state||(O.state=new $),k=h(D.get),B=h(D.has),F=h(D.set);i=function(V,z){if(B(D,V))throw new C(M);return z.facade=V,F(D,V,z),z},a=function(V){return k(D,V)||{}},l=function(V){return B(D,V)}}else{var I=E("state");S[I]=!0,i=function(V,z){if(w(V,I))throw new C(M);return z.facade=V,b(V,I,z),z},a=function(V){return w(V,I)?V[I]:{}},l=function(V){return w(V,I)}}n.exports={set:i,get:a,has:l,enforce:function(V){return l(V)?a(V):i(V,{})},getterFor:function(V){return function(z){var X;if(!v(z)||(X=a(z)).type!==V)throw C("Incompatible receiver, "+V+" required");return X}}}},function(n,o){var r=Math.ceil,i=Math.floor;n.exports=function(a){var l=+a;return l!=l||l===0?0:(l>0?i:r)(l)}},function(n,o,r){var i,a=r(32),l=r(176),s=r(111),f=r(72),h=r(138),v=r(91),b=r(93),w=b("IE_PROTO"),O=function(){},E=function(C){return"