@neo4j-nvl/base 0.3.3 → 0.3.4-34f121d2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/base.mjs +1 -1
- package/dist/types/index.d.ts +30 -49
- package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +2 -1
- package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +1 -0
- package/dist/types/modules/CallbackHelper.d.ts +1 -1
- package/dist/types/modules/state.d.ts +4 -5
- package/dist/types/types/graph-element.d.ts +10 -10
- package/dist/types/utils/canvasManagement.d.ts +1 -1
- package/dist/types/utils/geometry.d.ts +5 -5
- package/package.json +4 -9
package/dist/base.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see base.mjs.LICENSE.txt */
|
|
2
|
-
import*as t from"@neo4j-nvl/layout-workers";import*as e from"@segment/analytics-next";var n={931:t=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},269:(t,e,n)=>{var r=n(931),i=n(975),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},792:(t,e,n)=>{var r=n(45),i=n(360),o=n(804);t.exports=function(t,e){if(!e)return t;var n=Object.keys(e);if(0===n.length)return t;for(var a=r(t),s=n.length-1;s>=0;s--){var u=n[s],l=String(e[u]);l&&(l=" "+l),o(a,{type:"preprocessor",data:"#define "+u+l})}return i(a)}},804:t=>{t.exports=function(t,i){Array.isArray(i)||(i=[i]);var o=function(t){for(var e=-1,n=0;n<t.length;n++){var i=t[n];if("preprocessor"===i.type)/^#(extension|version)/.test(i.data)&&(e=Math.max(e,n));else if("keyword"===i.type&&"precision"===i.data){var o=r(t,n);if(-1===o)throw new Error("precision statement not followed by any semicolons!");e=Math.max(e,o)}}return e+1}(t),a=o>0?t[o-1]:null;a&&n.test(a.data)&&t.splice(o++,0,e),t.splice.apply(t,[o,0].concat(i));var s=o+i.length;return t[s]&&/[^\r\n]$/.test(t[s].data)&&t.splice(s,0,e),t};var e={data:"\n",type:"whitespace"},n=/[^\r\n]$/;function r(t,e){for(var n=e;n<t.length;n++)if("operator"===t[n].type&&";"===t[n].data)return n;return-1}},360:t=>{t.exports=function(t){for(var e=[],n=0;n<t.length;n++)"eof"!==t[n].type&&e.push(t[n].data);return e.join("")}},206:(t,e,n)=>{t.exports=function(t){var e,n,S,T=0,A=0,O=u,P=[],E=[],k=1,C=0,j=0,D=!1,R=!1,I="",M=o,L=r;"300 es"===(t=t||{}).version&&(M=s,L=a);var N={},F={};for(T=0;T<M.length;T++)N[M[T]]=!0;for(T=0;T<L.length;T++)F[L[T]]=!0;return function(t){return E=[],null!==t?function(t){var n;for(T=0,t.toString&&(t=t.toString()),I+=t.replace(/\r\n/g,"\n"),S=I.length;e=I[T],T<S;){switch(n=T,O){case c:T=G();break;case f:case h:T=V();break;case d:T=W();break;case p:T=Y();break;case x:T=H();break;case v:T=$();break;case l:T=q();break;case b:T=B();break;case u:T=z()}n!==T&&("\n"===I[n]?(C=0,++k):++C)}return A+=T,I=I.slice(T),E}(t):(P.length&&U(P.join("")),O=w,U("(eof)"),E)};function U(t){t.length&&E.push({type:_[O],data:t,position:j,line:k,column:C})}function z(){return P=P.length?[]:P,"/"===n&&"*"===e?(j=A+T-1,O=c,n=e,T+1):"/"===n&&"/"===e?(j=A+T-1,O=f,n=e,T+1):"#"===e?(O=h,j=A+T,T):/\s/.test(e)?(O=b,j=A+T,T):(D=/\d/.test(e),R=/[^\w_]/.test(e),j=A+T,O=D?p:R?d:l,T)}function B(){return/[^\s]/g.test(e)?(U(P.join("")),O=u,T):(P.push(e),n=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===n?(P.push(e),n=e,T+1):(U(P.join("")),O=u,T)}function G(){return"/"===e&&"*"===n?(P.push(e),U(P.join("")),O=u,T+1):(P.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return O=v,T;if("/"===n&&"*"===e)return O=c,T;if("/"===n&&"/"===e)return O=f,T;if("."===e&&P.length){for(;X(P););return O=v,T}if(";"===e||")"===e||"("===e){if(P.length)for(;X(P););return U(e),O=u,T+1}var t=2===P.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(P););return O=u,T}return P.push(e),n=e,T+1}function X(t){for(var e,n,r=0;;){if(e=i.indexOf(t.slice(0,t.length+r).join("")),n=i[e],-1===e){if(r--+t.length>0)continue;n=t.slice(0,1).join("")}return U(n),j+=n.length,(P=P.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(U(P.join("")),O=u,T):(P.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(P.push(e),O=v,n=e,T+1):"x"===e&&1===P.length&&"0"===P[0]?(O=x,P.push(e),n=e,T+1):/[^\d]/.test(e)?(U(P.join("")),O=u,T):(P.push(e),n=e,T+1)}function $(){return"f"===e&&(P.push(e),n=e,T+=1),/[eE]/.test(e)?(P.push(e),n=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(n))&&/[^\d]/.test(e)?(U(P.join("")),O=u,T):(P.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=P.join("");return O=F[t]?g:N[t]?m:y,U(P.join("")),O=u,T}return P.push(e),n=e,T+1}};var r=n(704),i=n(63),o=n(192),a=n(784),s=n(592),u=999,l=9999,c=0,f=1,h=2,d=3,p=4,v=5,y=6,m=7,g=8,b=9,w=10,x=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},592:(t,e,n)=>{var r=n(192);r=r.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},192:t=>{t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},784:(t,e,n)=>{var r=n(704);t.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},704:t=>{t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},63:t=>{t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},45:(t,e,n)=>{var r=n(206);t.exports=function(t,e){var n=r(e),i=[];return(i=i.concat(n(t))).concat(n(null))}},250:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",_="[object Map]",S="[object Number]",T="[object Object]",A="[object Promise]",O="[object RegExp]",P="[object Set]",E="[object String]",k="[object Symbol]",C="[object WeakMap]",j="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",I="[object Float64Array]",M="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Y=RegExp(X.source),$=RegExp(H.source),q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,xt="\\ud800-\\udfff",_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Et="["+xt+"]",kt="["+Pt+"]",Ct="["+_t+"]",jt="\\d+",Dt="["+St+"]",Rt="["+Tt+"]",It="[^"+xt+Pt+jt+St+Tt+At+"]",Mt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+xt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+At+"]",zt="\\u200d",Bt="(?:"+Rt+"|"+It+")",Vt="(?:"+Ut+"|"+It+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+Ct+"|"+Mt+")?",Ht="["+Ot+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Lt,Nt,Ft].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Dt,Nt,Ft].join("|")+")"+Yt,qt="(?:"+[Lt+Ct+"?",Ct,Nt,Ft,Et].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(Ct,"g"),Jt=RegExp(Mt+"(?="+Mt+")|"+qt+Yt,"g"),Qt=RegExp([Ut+"?"+Rt+"+"+Gt+"(?="+[kt,Ut,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[kt,Ut+Bt,"$"].join("|")+")",Ut+"?"+Bt+"+"+Gt,Ut+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,$t].join("|"),"g"),te=RegExp("["+zt+xt+_t+Ot+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[R]=ie[I]=ie[M]=ie[L]=ie[N]=ie[F]=ie[U]=ie[z]=ie[B]=!0,ie[v]=ie[y]=ie[j]=ie[m]=ie[D]=ie[g]=ie[b]=ie[w]=ie[_]=ie[S]=ie[T]=ie[O]=ie[P]=ie[E]=ie[C]=!1;var oe={};oe[v]=oe[y]=oe[j]=oe[D]=oe[m]=oe[g]=oe[R]=oe[I]=oe[M]=oe[L]=oe[N]=oe[_]=oe[S]=oe[T]=oe[O]=oe[P]=oe[E]=oe[k]=oe[F]=oe[U]=oe[z]=oe[B]=!0,oe[b]=oe[w]=oe[C]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ve=pe&&le.process,ye=function(){try{return de&&de.require&&de.require("util").types||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,ge=ye&&ye.isDate,be=ye&&ye.isMap,we=ye&&ye.isRegExp,xe=ye&&ye.isSet,_e=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Pe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ee(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ke(t,e){return!(null==t||!t.length)&&Ue(t,e,0)>-1}function Ce(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function De(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Re(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=Ge("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Fe(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ue(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Fe(t,Be,n)}function ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?He(t,e)/n:h}function Ge(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function He(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function $e(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function qe(t){return function(e){return t(e)}}function Ze(t,e){return je(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Ue(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ue(e,t[n],0)>-1;);return n}var tn=We({À:"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"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Le(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,xt=e.Error,_t=e.Function,St=e.Math,Tt=e.Object,At=e.RegExp,Ot=e.String,Pt=e.TypeError,Et=r.prototype,kt=_t.prototype,Ct=Tt.prototype,jt=e["__core-js_shared__"],Dt=kt.toString,Rt=Ct.hasOwnProperty,It=0,Mt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Lt=Ct.toString,Nt=Dt.call(Tt),Ft=fe._,Ut=At("^"+Dt.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:i,Bt=e.Symbol,Vt=e.Uint8Array,Gt=zt?zt.allocUnsafe:i,Wt=an(Tt.getPrototypeOf,Tt),Xt=Tt.create,Ht=Ct.propertyIsEnumerable,Yt=Et.splice,$t=Bt?Bt.isConcatSpreadable:i,qt=Bt?Bt.iterator:i,Jt=Bt?Bt.toStringTag:i,te=function(){try{var t=uo(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=it&&it.now!==fe.Date.now&&it.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=St.ceil,de=St.floor,ve=Tt.getOwnPropertySymbols,ye=zt?zt.isBuffer:i,Le=e.isFinite,We=Et.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,wn=St.random,xn=Et.reverse,_n=uo(e,"DataView"),Sn=uo(e,"Map"),Tn=uo(e,"Promise"),An=uo(e,"Set"),On=uo(e,"WeakMap"),Pn=uo(Tt,"create"),En=On&&new On,kn={},Cn=No(_n),jn=No(Sn),Dn=No(Tn),Rn=No(An),In=No(On),Mn=Bt?Bt.prototype:i,Ln=Mn?Mn.valueOf:i,Nn=Mn?Mn.toString:i;function Fn(t){if(ts(t)&&!Ga(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(Rt.call(t,"__wrapped__"))return Fo(t)}return new Bn(t)}var Un=function(){function t(){}return function(e){if(!Qa(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function $n(t,e){var n=Ga(t),r=!n&&Va(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&us(t),a=n||r||i||o,s=a?Ye(t.length,Ot):[],u=s.length;for(var l in t)!e&&!Rt.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yo(l,u))||s.push(l);return s}function qn(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Do(Oi(t),or(e,0,t.length))}function Kn(t){return Do(Oi(t))}function Jn(t,e,n){(n!==i&&!Ua(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Rt.call(t,e)&&Ua(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Ua(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Pi(e,Cs(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:As(t,e[n]);return a}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ar(t,e,n,r,o,a){var s,u=1&e,l=2&e,c=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!Qa(t))return t;var f=Ga(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Oi(t,s)}else{var h=fo(t),d=h==w||h==x;if(Ya(t))return wi(t,u);if(h==T||h==v||d&&!o){if(s=l||d?{}:po(t),!u)return l?function(t,e){return Pi(t,co(t),e)}(t,function(t,e){return t&&Pi(e,js(e),t)}(s,t)):function(t,e){return Pi(t,lo(t),e)}(t,nr(s,t))}else{if(!oe[h])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case j:return xi(t);case m:case g:return new i(+t);case D:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case I:case M:case L:case N:case F:case U:case z:case B:return _i(t,n);case _:return new i;case S:case E:return new i(t);case O:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case P:return new i;case k:return r=t,Ln?Tt(Ln.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),os(t)?t.forEach((function(r){s.add(ar(r,e,n,r,t,a))})):es(t)&&t.forEach((function(r,i){s.set(i,ar(r,e,n,i,t,a))}));var y=f?i:(c?l?eo:to:l?js:Cs)(t);return Ae(y||t,(function(r,i){y&&(r=t[i=r]),Qn(s,i,ar(r,e,n,i,t,a))})),s}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new Pt(o);return Eo((function(){t.apply(i,n)}),e)}function lr(t,e,n,r){var i=-1,o=ke,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=je(e,qe(n))),r?(o=Ce,a=!1):e.length>=200&&(o=Ke,a=!1,e=new Hn(e));t:for(;++i<s;){var c=t[i],f=null==n?c:n(c);if(c=r||0!==c?c:0,a&&f==f){for(var h=l;h--;)if(e[h]===f)continue t;u.push(c)}else o(e,f,r)||u.push(c)}return u}Fn.templateSettings={escape:q,evaluate:Z,interpolate:K,variable:"",imports:{_:Fn}},Fn.prototype=zn.prototype,Fn.prototype.constructor=Fn,Bn.prototype=Un(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Un(zn.prototype),Vn.prototype.constructor=Vn,Gn.prototype.clear=function(){this.__data__=Pn?Pn(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(Pn){var n=e[t];return n===a?i:n}return Rt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return Pn?e[t]!==i:Rt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pn&&e===i?a:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Sn||Wn),string:new Gn}},Xn.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ao(this,t).get(t)},Xn.prototype.has=function(t){return ao(this,t).has(t)},Xn.prototype.set=function(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,a),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var cr=Ci(gr),fr=Ci(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,l=a}return l}function pr(t,e){var n=[];return cr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?vr(s,e-1,n,r,i):De(i,s):r||(i[i.length]=s)}return i}var yr=ji(),mr=ji(!0);function gr(t,e){return t&&yr(t,e,Cs)}function br(t,e){return t&&mr(t,e,Cs)}function wr(t,e){return Ee(e,(function(e){return Za(t[e])}))}function xr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Lo(e[n++])];return n&&n==r?t:i}function _r(t,e,n){var r=e(t);return Ga(t)?r:De(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Tt(t)?function(t){var e=Rt.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(t){}var o=Lt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Lt.call(t)}(t)}function Tr(t,e){return t>e}function Ar(t,e){return null!=t&&Rt.call(t,e)}function Or(t,e){return null!=t&&e in Tt(t)}function Pr(t,e,n){for(var o=n?Ce:ke,a=t[0].length,s=t.length,u=s,l=r(s),c=1/0,f=[];u--;){var h=t[u];u&&e&&(h=je(h,qe(e))),c=mn(h.length,c),l[u]=!n&&(e||a>=120&&h.length>=120)?new Hn(u&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&f.length<c;){var v=h[d],y=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ke(p,y):o(f,y,n))){for(u=s;--u;){var m=l[u];if(!(m?Ke(m,y):o(t[u],y,n)))continue t}p&&p.push(y),f.push(v)}}return f}function Er(t,e,n){var r=null==(t=Ao(t,e=yi(e,t)))?t:t[Lo(qo(e))];return null==r?i:Se(r,t,n)}function kr(t){return ts(t)&&Sr(t)==v}function Cr(t,e,n,r,o){return t===e||(null==t||null==e||!ts(t)&&!ts(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=Ga(t),u=Ga(e),l=s?y:fo(t),c=u?y:fo(e),f=(l=l==v?T:l)==T,h=(c=c==v?T:c)==T,d=l==c;if(d&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||us(t)?Ji(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case D:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case m:case g:case S:return Ua(+t,+e);case b:return t.name==e.name&&t.message==e.message;case O:case E:return t==e+"";case _:var s=on;case P:var u=1&r;if(s||(s=un),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=Ji(s(t),s(e),r,i,o,a);return a.delete(t),c;case k:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,l,n,r,o,a);if(!(1&n)){var p=f&&Rt.call(t,"__wrapped__"),w=h&&Rt.call(e,"__wrapped__");if(p||w){var x=p?t.value():t,A=w?e.value():e;return a||(a=new Yn),o(x,A,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=to(t),l=u.length;if(l!=to(e).length&&!s)return!1;for(var c=l;c--;){var f=u[c];if(!(s?f in e:Rt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++c<l;){var y=t[f=u[c]],m=e[f];if(r)var g=s?r(m,y,f,e,t,a):r(y,m,f,t,e,a);if(!(g===i?y===m||o(y,m,n,r,a):g)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,Cr,o))}function jr(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=n[o])[0],c=t[l],f=u[1];if(s&&u[2]){if(c===i&&!(l in t))return!1}else{var h=new Yn;if(r)var d=r(c,f,l,t,e,h);if(!(d===i?Cr(f,c,3,r,h):d))return!1}}return!0}function Dr(t){return!(!Qa(t)||(e=t,Mt&&Mt in e))&&(Za(t)?Ut:vt).test(No(t));var e}function Rr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Fr(t[0],t[1]):Nr(t):fu(t)}function Ir(t){if(!xo(t))return vn(t);var e=[];for(var n in Tt(t))Rt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Mr(t,e){return t<e}function Lr(t,e){var n=-1,i=Xa(t)?r(t.length):[];return cr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function Fr(t,e){return go(t)&&_o(e)?So(Lo(t),e):function(n){var r=As(n,t);return r===i&&r===e?Os(n,t):Cr(e,r,3)}}function Ur(t,e,n,r,o){t!==e&&yr(e,(function(a,s){if(o||(o=new Yn),Qa(a))!function(t,e,n,r,o,a,s){var u=Oo(t,n),l=Oo(e,n),c=s.get(l);if(c)Jn(t,n,c);else{var f=a?a(u,l,n+"",t,e,s):i,h=f===i;if(h){var d=Ga(l),p=!d&&Ya(l),v=!d&&!p&&us(l);f=l,d||p||v?Ga(u)?f=u:Ha(u)?f=Oi(u):p?(h=!1,f=wi(l,!0)):v?(h=!1,f=_i(l,!0)):f=[]:rs(l)||Va(l)?(f=u,Va(u)?f=ys(u):Qa(u)&&!Za(u)||(f=po(l))):h=!1}h&&(s.set(l,f),o(f,l,r,a,s),s.delete(l)),Jn(t,n,f)}}(t,e,s,n,Ur,r,o);else{var u=r?r(Oo(t,s),a,s+"",t,e,o):i;u===i&&(u=a),Jn(t,s,u)}}),js)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Br(t,e,n){e=e.length?je(e,(function(t){return Ga(t)?function(e){return xr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=je(e,qe(oo()));var i=Lr(t,(function(t,n,i){var o=je(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Si(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=xr(t,a);n(s,a)&&Zr(o,yi(a,t),s)}return o}function Gr(t,e,n,r){var i=r?ze:Ue,o=-1,a=e.length,s=t;for(t===e&&(e=Oi(e)),n&&(s=je(t,qe(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Yt.call(s,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function Xr(t,e){return t+de(wn()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(To(t,e,nu),t+"")}function $r(t){return qn(Us(t))}function qr(t,e){var n=Us(t);return Do(n,or(e,0,n.length))}function Zr(t,e,n,r){if(!Qa(t))return t;for(var o=-1,a=(e=yi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=Lo(e[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var f=u[l];(c=r?r(f,l,u):i)===i&&(c=Qa(f)?f:yo(e[o+1])?[]:{})}Qn(u,l,c),u=u[l]}return t}var Kr=En?function(t,e){return En.set(t,e),t}:nu,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qs(e),writable:!0})}:nu;function Qr(t){return Do(Us(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ei(t,e){var n;return cr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=ss(e),c=e===i;o<a;){var f=de((o+a)/2),h=n(t[f]),d=h!==i,p=null===h,v=h==h,y=ss(h);if(s)var m=r||v;else m=c?v&&(r||d):u?v&&d&&(r||!p):l?v&&d&&!p&&(r||!y):!p&&!y&&(r?h<=e:h<e);m?o=f+1:a=f}return mn(a,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ua(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function oi(t){return"number"==typeof t?t:ss(t)?h:+t}function ai(t){if("string"==typeof t)return t;if(Ga(t))return je(t,ai)+"";if(ss(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=ke,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Ce;else if(o>=200){var l=e?null:Hi(t);if(l)return un(l);a=!1,i=Ke,u=new Hn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(c)}else i(u,f,n)||(u!==s&&u.push(f),s.push(c))}return s}function ui(t,e){return null==(t=Ao(t,e=yi(e,t)))||delete t[Lo(qo(e))]}function li(t,e,n,r){return Zr(t,e,n(xr(t,e)),r)}function ci(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),Re(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=lr(a[o]||s,t[u],e,n));return si(vr(a,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function pi(t){return Ha(t)?t:[]}function vi(t){return"function"==typeof t?t:nu}function yi(t,e){return Ga(t)?t:go(t,e)?[t]:Mo(ms(t))}var mi=Yr;function gi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var bi=ae||function(t){return fe.clearTimeout(t)};function wi(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _i(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=ss(t),s=e!==i,u=null===e,l=e==e,c=ss(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!c&&t<e||c&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,l=e.length,c=yn(a-s,0),f=r(l+c),h=!i;++u<l;)f[u]=e[u];for(;++o<s;)(h||o<a)&&(f[n[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}function Ai(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,l=-1,c=e.length,f=yn(a-u,0),h=r(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++l<c;)h[p+l]=e[l];for(;++s<u;)(d||o<a)&&(h[p+n[s]]=t[o++]);return h}function Oi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Pi(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=r?r(n[u],t[u],u,n,t):i;l===i&&(l=t[u]),o?rr(n,u,l):Qn(n,u,l)}return n}function Ei(t,e){return function(n,r){var i=Ga(n)?Te:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function ki(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&mo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function Ci(t,e){return function(n,r){if(null==n)return n;if(!Xa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ji(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Di(t){return function(e){var n=rn(e=ms(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?gi(n,1).join(""):e.slice(1);return r[t]()+o}}function Ri(t){return function(e){return Re(Zs(Vs(e).replace(Zt,"")),t,"")}}function Ii(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=Un(t.prototype),r=t.apply(n,e);return Qa(r)?r:n}}function Mi(t){return function(e,n,r){var o=Tt(e);if(!Xa(e)){var a=oo(n,3);e=Cs(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Li(t){return Qi((function(e){var n=e.length,r=n,a=Bn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Pt(o);if(a&&!u&&"wrapper"==ro(s))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var l=ro(s=e[r]),c="wrapper"==l?no(s):i;u=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ro(c[0])].apply(u,c[3]):1==s.length&&bo(s)?u[l]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ga(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,a,s,u,c,f,h){var d=e&l,p=1&e,v=2&e,y=24&e,m=512&e,g=v?i:Ii(t);return function l(){for(var b=arguments.length,w=r(b),x=b;x--;)w[x]=arguments[x];if(y)var _=io(l),S=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(w,_);if(o&&(w=Ti(w,o,a,y)),s&&(w=Ai(w,s,u,y)),b-=S,y&&b<h){var T=sn(w,_);return Wi(t,e,Ni,l.placeholder,n,w,T,c,f,h-b)}var A=p?n:this,O=v?A[t]:t;return b=w.length,c?w=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Oi(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}(w,c):m&&b>1&&w.reverse(),d&&f<b&&(w.length=f),this&&this!==fe&&this instanceof l&&(O=g||Ii(O)),O.apply(A,w)}}function Fi(t,e){return function(n,r){return function(t,e,n,r){return gr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ui(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ai(n),r=ai(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function zi(t){return Qi((function(e){return e=je(e,qe(oo())),Yr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Bi(t,e){var n=(e=e===i?" ":ai(e)).length;if(n<2)return n?Hr(e,t):e;var r=Hr(e,he(t/cn(e)));return rn(e)?gi(fn(r),0,t).join(""):r.slice(0,t)}function Vi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n,i){for(var o=-1,a=yn(he((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:hs(o),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vs(e),n=vs(n)),t(e,n)}}function Wi(t,e,n,r,o,a,s,l,c,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,l,c,f],p=n.apply(i,d);return bo(t)&&Po(p,d),p.placeholder=r,Co(p,t,e)}function Xi(t){var e=St[t];return function(t,n){if(t=vs(t),(n=null==n?0:mn(ds(n),292))&&Le(t)){var r=(ms(t)+"e").split("e");return+((r=(ms(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Hi=An&&1/un(new An([,-0]))[1]==c?function(t){return new An(t)}:su;function Yi(t){return function(e){var n=fo(e);return n==_?on(e):n==P?ln(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function $i(t,e,n,a,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Pt(o);var v=a?a.length:0;if(v||(e&=-97,a=c=i),h=h===i?h:yn(ds(h),0),d=d===i?d:ds(d),v-=c?c.length:0,64&e){var y=a,m=c;a=c=i}var g=p?i:no(t),b=[t,e,n,a,c,y,m,f,h,d];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Ti(c,u,e[4]):u,t[4]=c?sn(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Ai(c,u,e[6]):u,t[6]=c?sn(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&l&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,g),t=b[0],e=b[1],n=b[2],a=b[3],c=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)w=8==e||16==e?function(t,e,n){var o=Ii(t);return function a(){for(var s=arguments.length,u=r(s),l=s,c=io(a);l--;)u[l]=arguments[l];var f=s<3&&u[0]!==c&&u[s-1]!==c?[]:sn(u,c);return(s-=f.length)<n?Wi(t,e,Ni,a.placeholder,i,u,f,i,i,n-s):Se(this&&this!==fe&&this instanceof a?o:t,this,u)}}(t,e,d):e!=u&&33!=e||c.length?Ni.apply(i,b):function(t,e,n,i){var o=1&e,a=Ii(t);return function e(){for(var s=-1,u=arguments.length,l=-1,c=i.length,f=r(c+u),h=this&&this!==fe&&this instanceof e?a:t;++l<c;)f[l]=i[l];for(;u--;)f[l++]=arguments[++s];return Se(h,o?n:this,f)}}(t,e,n,a);else var w=function(t,e,n){var r=1&e,i=Ii(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Co((g?Kr:Po)(w,b),t,e)}function qi(t,e,n,r){return t===i||Ua(t,Ct[n])&&!Rt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return Qa(t)&&Qa(e)&&(a.set(e,t),Ur(t,e,i,Zi,a),a.delete(e)),t}function Ki(t){return rs(t)?i:t}function Ji(t,e,n,r,o,a){var s=1&n,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),f=a.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Hn:i;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],y=e[h];if(r)var m=s?r(y,v,h,e,t,a):r(v,y,h,t,e,a);if(m!==i){if(m)continue;d=!1;break}if(p){if(!Me(e,(function(t,e){if(!Ke(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==y&&!o(v,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Qi(t){return ko(To(t,i,Wo),t+"")}function to(t){return _r(t,Cs,lo)}function eo(t){return _r(t,js,co)}var no=En?function(t){return En.get(t)}:su;function ro(t){for(var e=t.name+"",n=kn[e],r=Rt.call(kn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Rt.call(Fn,"placeholder")?Fn:t).placeholder}function oo(){var t=Fn.iteratee||ru;return t=t===ru?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=Cs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_o(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Dr(n)?n:i}var lo=ve?function(t){return null==t?[]:(t=Tt(t),Ee(ve(t),(function(e){return Ht.call(t,e)})))}:pu,co=ve?function(t){for(var e=[];t;)De(e,lo(t)),t=Wt(t);return e}:pu,fo=Sr;function ho(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Lo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ja(i)&&yo(a,i)&&(Ga(t)||Va(t))}function po(t){return"function"!=typeof t.constructor||xo(t)?{}:Un(Wt(t))}function vo(t){return Ga(t)||Va(t)||!!($t&&t&&t[$t])}function yo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!Qa(n))return!1;var r=typeof e;return!!("number"==r?Xa(n)&&yo(e,n.length):"string"==r&&e in n)&&Ua(n[e],t)}function go(t,e){if(Ga(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ss(t))||Q.test(t)||!J.test(t)||null!=e&&t in Tt(e)}function bo(t){var e=ro(t),n=Fn[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(_n&&fo(new _n(new ArrayBuffer(1)))!=D||Sn&&fo(new Sn)!=_||Tn&&fo(Tn.resolve())!=A||An&&fo(new An)!=P||On&&fo(new On)!=C)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?No(n):"";if(r)switch(r){case Cn:return D;case jn:return _;case Dn:return A;case Rn:return P;case In:return C}return e});var wo=jt?Za:vu;function xo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ct)}function _o(t){return t==t&&!Qa(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Tt(n))}}function To(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Se(t,this,u)}}function Ao(t,e){return e.length<2?t:xr(t,ti(e,0,-1))}function Oo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Po=jo(Kr),Eo=ce||function(t,e){return fe.setTimeout(t,e)},ko=jo(Jr);function Co(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(p,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function jo(t){var e=0,n=0;return function(){var r=gn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Do(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Ro,Io,Mo=(Ro=Ra((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Io.size&&Io.clear(),t})),Io=Ro.cache,Ro);function Lo(t){if("string"==typeof t||ss(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Fo(t){if(t instanceof Vn)return t.clone();var e=new Bn(t.__wrapped__,t.__chain__);return e.__actions__=Oi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Uo=Yr((function(t,e){return Ha(t)?lr(t,vr(e,1,Ha,!0)):[]})),zo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),oo(n,2)):[]})),Bo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Fe(t,oo(e,3),i)}function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ds(n),o=n<0?yn(r+o,0):mn(o,r-1)),Fe(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Xo(t){return t&&t.length?t[0]:i}var Ho=Yr((function(t){var e=je(t,pi);return e.length&&e[0]===t[0]?Pr(e):[]})),Yo=Yr((function(t){var e=qo(t),n=je(t,pi);return e===qo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Pr(n,oo(e,2)):[]})),$o=Yr((function(t){var e=qo(t),n=je(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Pr(n,i,e):[]}));function qo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Zo=Yr(Ko);function Ko(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Jo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,je(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function Qo(t){return null==t?t:xn.call(t)}var ta=Yr((function(t){return si(vr(t,1,Ha,!0))})),ea=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),si(vr(t,1,Ha,!0),oo(e,2))})),na=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,si(vr(t,1,Ha,!0),i,e)}));function ra(t){if(!t||!t.length)return[];var e=0;return t=Ee(t,(function(t){if(Ha(t))return e=yn(t.length,e),!0})),Ye(e,(function(e){return je(t,Ge(e))}))}function ia(t,e){if(!t||!t.length)return[];var n=ra(t);return null==e?n:je(n,(function(t){return Se(e,i,t)}))}var oa=Yr((function(t,e){return Ha(t)?lr(t,e):[]})),aa=Yr((function(t){return hi(Ee(t,Ha))})),sa=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),hi(Ee(t,Ha),oo(e,2))})),ua=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,hi(Ee(t,Ha),i,e)})),la=Yr(ra),ca=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ia(t,n)}));function fa(t){var e=Fn(t);return e.__chain__=!0,e}function ha(t,e){return e(t)}var da=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),pa=Ei((function(t,e,n){Rt.call(t,n)?++t[n]:rr(t,n,1)})),va=Mi(Vo),ya=Mi(Go);function ma(t,e){return(Ga(t)?Ae:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Oe:fr)(t,oo(e,3))}var ba=Ei((function(t,e,n){Rt.call(t,n)?t[n].push(e):rr(t,n,[e])})),wa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=Xa(t)?r(t.length):[];return cr(t,(function(t){a[++i]=o?Se(e,t,n):Er(t,e,n)})),a})),xa=Ei((function(t,e,n){rr(t,n,e)}));function _a(t,e){return(Ga(t)?je:Lr)(t,oo(e,3))}var Sa=Ei((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,vr(e,1),[])})),Aa=le||function(){return fe.Date.now()};function Oa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,$i(t,l,i,i,i,i,e)}function Pa(t,e){var n;if("function"!=typeof e)throw new Pt(o);return t=ds(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Ea=Yr((function(t,e,n){var r=1;if(n.length){var i=sn(n,io(Ea));r|=u}return $i(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=sn(n,io(ka));r|=u}return $i(e,r,t,n,i)}));function Ca(t,e,n){var r,a,s,u,l,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Pt(o);function v(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function y(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=s}function m(){var t=Aa();if(y(t))return g(t);l=Eo(m,function(t){var n=e-(t-c);return d?mn(n,s-(t-f)):n}(t))}function g(t){return l=i,p&&r?v(t):(r=a=i,u)}function b(){var t=Aa(),n=y(t);if(r=arguments,a=this,c=t,n){if(l===i)return function(t){return f=t,l=Eo(m,e),h?v(t):u}(c);if(d)return bi(l),l=Eo(m,e),v(c)}return l===i&&(l=Eo(m,e)),u}return e=vs(e)||0,Qa(n)&&(h=!!n.leading,s=(d="maxWait"in n)?yn(vs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==i&&bi(l),f=0,r=c=a=l=i},b.flush=function(){return l===i?u:g(Aa())},b}var ja=Yr((function(t,e){return ur(t,1,e)})),Da=Yr((function(t,e,n){return ur(t,vs(e)||0,n)}));function Ra(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Pt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Xn),n}function Ia(t){if("function"!=typeof t)throw new Pt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ra.Cache=Xn;var Ma=mi((function(t,e){var n=(e=1==e.length&&Ga(e[0])?je(e[0],qe(oo())):je(vr(e,1),qe(oo()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),La=Yr((function(t,e){var n=sn(e,io(La));return $i(t,u,i,e,n)})),Na=Yr((function(t,e){var n=sn(e,io(Na));return $i(t,64,i,e,n)})),Fa=Qi((function(t,e){return $i(t,256,i,i,i,e)}));function Ua(t,e){return t===e||t!=t&&e!=e}var za=Gi(Tr),Ba=Gi((function(t,e){return t>=e})),Va=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Rt.call(t,"callee")&&!Ht.call(t,"callee")},Ga=r.isArray,Wa=me?qe(me):function(t){return ts(t)&&Sr(t)==j};function Xa(t){return null!=t&&Ja(t.length)&&!Za(t)}function Ha(t){return ts(t)&&Xa(t)}var Ya=ye||vu,$a=ge?qe(ge):function(t){return ts(t)&&Sr(t)==g};function qa(t){if(!ts(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Za(t){if(!Qa(t))return!1;var e=Sr(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==ds(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=be?qe(be):function(t){return ts(t)&&fo(t)==_};function ns(t){return"number"==typeof t||ts(t)&&Sr(t)==S}function rs(t){if(!ts(t)||Sr(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==Nt}var is=we?qe(we):function(t){return ts(t)&&Sr(t)==O},os=xe?qe(xe):function(t){return ts(t)&&fo(t)==P};function as(t){return"string"==typeof t||!Ga(t)&&ts(t)&&Sr(t)==E}function ss(t){return"symbol"==typeof t||ts(t)&&Sr(t)==k}var us=_e?qe(_e):function(t){return ts(t)&&Ja(t.length)&&!!ie[Sr(t)]},ls=Gi(Mr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Oi(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=fo(t);return(e==_?on:e==P?un:Us)(t)}function hs(t){return t?(t=vs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ds(t){var e=hs(t),n=e%1;return e==e?n?e-n:e:0}function ps(t){return t?or(ds(t),0,d):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return h;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var n=pt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return Pi(t,js(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(xo(e)||Xa(e))Pi(e,Cs(e),t);else for(var n in e)Rt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Pi(e,js(e),t)})),ws=ki((function(t,e,n,r){Pi(e,js(e),t,r)})),xs=ki((function(t,e,n,r){Pi(e,Cs(e),t,r)})),_s=Qi(ir),Ss=Yr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=js(a),u=-1,l=s.length;++u<l;){var c=s[u],f=t[c];(f===i||Ua(f,Ct[c])&&!Rt.call(t,c))&&(t[c]=a[c])}return t})),Ts=Yr((function(t){return t.push(i,Zi),Se(Rs,i,t)}));function As(t,e,n){var r=null==t?i:xr(t,e);return r===i?n:r}function Os(t,e){return null!=t&&ho(t,e,Or)}var Ps=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),Qs(nu)),Es=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),Rt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),ks=Yr(Er);function Cs(t){return Xa(t)?$n(t):Ir(t)}function js(t){return Xa(t)?$n(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=xo(t),n=[];for(var r in t)("constructor"!=r||!e&&Rt.call(t,r))&&n.push(r);return n}(t)}var Ds=ki((function(t,e,n){Ur(t,e,n)})),Rs=ki((function(t,e,n,r){Ur(t,e,n,r)})),Is=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Pi(t,eo(t),n),r&&(n=ar(n,7,Ki));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ms=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return Os(t,n)}))}(t,e)}));function Ls(t,e){if(null==t)return{};var n=je(eo(t),(function(t){return[t]}));return e=oo(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var Ns=Yi(Cs),Fs=Yi(js);function Us(t){return null==t?[]:Ze(t,Cs(t))}var zs=Ri((function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)}));function Bs(t){return qs(ms(t).toLowerCase())}function Vs(t){return(t=ms(t))&&t.replace(gt,tn).replace(Kt,"")}var Gs=Ri((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Ri((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Di("toLowerCase"),Hs=Ri((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Ri((function(t,e,n){return t+(n?" ":"")+qs(e)})),$s=Ri((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),qs=Di("toUpperCase");function Zs(t,e,n){return t=ms(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ks=Yr((function(t,e){try{return Se(t,i,e)}catch(t){return qa(t)?t:new xt(t)}})),Js=Qi((function(t,e){return Ae(e,(function(e){e=Lo(e),rr(t,e,Ea(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Li(),eu=Li(!0);function nu(t){return t}function ru(t){return Rr("function"==typeof t?t:ar(t,1))}var iu=Yr((function(t,e){return function(n){return Er(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Er(t,n,e)}}));function au(t,e,n){var r=Cs(e),i=wr(e,r);null!=n||Qa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=wr(e,Cs(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=Za(t);return Ae(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,De([this.value()],arguments))})})),t}function su(){}var uu=zi(je),lu=zi(Pe),cu=zi(Me);function fu(t){return go(t)?Ge(Lo(t)):function(t){return function(e){return xr(e,t)}}(t)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var yu,mu=Ui((function(t,e){return t+e}),0),gu=Xi("ceil"),bu=Ui((function(t,e){return t/e}),1),wu=Xi("floor"),xu=Ui((function(t,e){return t*e}),1),_u=Xi("round"),Su=Ui((function(t,e){return t-e}),0);return Fn.after=function(t,e){if("function"!=typeof e)throw new Pt(o);return t=ds(t),function(){if(--t<1)return e.apply(this,arguments)}},Fn.ary=Oa,Fn.assign=gs,Fn.assignIn=bs,Fn.assignInWith=ws,Fn.assignWith=xs,Fn.at=_s,Fn.before=Pa,Fn.bind=Ea,Fn.bindAll=Js,Fn.bindKey=ka,Fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ga(t)?t:[t]},Fn.chain=fa,Fn.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(ds(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(he(o/e));a<o;)u[s++]=ti(t,a,a+=e);return u},Fn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Fn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return De(Ga(n)?Oi(n):[n],vr(e,1))},Fn.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new Pt(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Fn.conforms=function(t){return function(t){var e=Cs(t);return function(n){return sr(n,t,e)}}(ar(t,1))},Fn.constant=Qs,Fn.countBy=pa,Fn.create=function(t,e){var n=Un(t);return null==e?n:nr(n,e)},Fn.curry=function t(e,n,r){var o=$i(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.curryRight=function t(e,n,r){var o=$i(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.debounce=Ca,Fn.defaults=Ss,Fn.defaultsDeep=Ts,Fn.defer=ja,Fn.delay=Da,Fn.difference=Uo,Fn.differenceBy=zo,Fn.differenceWith=Bo,Fn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:ds(e))<0?0:e,r):[]},Fn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:ds(e)))<0?0:e):[]},Fn.dropRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0,!0):[]},Fn.dropWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0):[]},Fn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ds(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ds(r))<0&&(r+=o),r=n>r?0:ps(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Fn.filter=function(t,e){return(Ga(t)?Ee:pr)(t,oo(e,3))},Fn.flatMap=function(t,e){return vr(_a(t,e),1)},Fn.flatMapDeep=function(t,e){return vr(_a(t,e),c)},Fn.flatMapDepth=function(t,e,n){return n=n===i?1:ds(n),vr(_a(t,e),n)},Fn.flatten=Wo,Fn.flattenDeep=function(t){return null!=t&&t.length?vr(t,c):[]},Fn.flattenDepth=function(t,e){return null!=t&&t.length?vr(t,e=e===i?1:ds(e)):[]},Fn.flip=function(t){return $i(t,512)},Fn.flow=tu,Fn.flowRight=eu,Fn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Fn.functions=function(t){return null==t?[]:wr(t,Cs(t))},Fn.functionsIn=function(t){return null==t?[]:wr(t,js(t))},Fn.groupBy=ba,Fn.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Fn.intersection=Ho,Fn.intersectionBy=Yo,Fn.intersectionWith=$o,Fn.invert=Ps,Fn.invertBy=Es,Fn.invokeMap=wa,Fn.iteratee=ru,Fn.keyBy=xa,Fn.keys=Cs,Fn.keysIn=js,Fn.map=_a,Fn.mapKeys=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Fn.mapValues=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Fn.matches=function(t){return Nr(ar(t,1))},Fn.matchesProperty=function(t,e){return Fr(t,ar(e,1))},Fn.memoize=Ra,Fn.merge=Ds,Fn.mergeWith=Rs,Fn.method=iu,Fn.methodOf=ou,Fn.mixin=au,Fn.negate=Ia,Fn.nthArg=function(t){return t=ds(t),Yr((function(e){return zr(e,t)}))},Fn.omit=Is,Fn.omitBy=function(t,e){return Ls(t,Ia(oo(e)))},Fn.once=function(t){return Pa(2,t)},Fn.orderBy=function(t,e,n,r){return null==t?[]:(Ga(e)||(e=null==e?[]:[e]),Ga(n=r?i:n)||(n=null==n?[]:[n]),Br(t,e,n))},Fn.over=uu,Fn.overArgs=Ma,Fn.overEvery=lu,Fn.overSome=cu,Fn.partial=La,Fn.partialRight=Na,Fn.partition=Sa,Fn.pick=Ms,Fn.pickBy=Ls,Fn.property=fu,Fn.propertyOf=function(t){return function(e){return null==t?i:xr(t,e)}},Fn.pull=Zo,Fn.pullAll=Ko,Fn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,oo(n,2)):t},Fn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,i,n):t},Fn.pullAt=Jo,Fn.range=hu,Fn.rangeRight=du,Fn.rearg=Fa,Fn.reject=function(t,e){return(Ga(t)?Ee:pr)(t,Ia(oo(e,3)))},Fn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Wr(t,i),n},Fn.rest=function(t,e){if("function"!=typeof t)throw new Pt(o);return Yr(t,e=e===i?e:ds(e))},Fn.reverse=Qo,Fn.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),(Ga(t)?Zn:qr)(t,e)},Fn.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Fn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Fn.shuffle=function(t){return(Ga(t)?Kn:Qr)(t)},Fn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:ds(e),n=n===i?r:ds(n)),ti(t,e,n)):[]},Fn.sortBy=Ta,Fn.sortedUniq=function(t){return t&&t.length?ii(t):[]},Fn.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Fn.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ms(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=ai(e))&&rn(t)?gi(fn(t),0,n):t.split(e,n):[]},Fn.spread=function(t,e){if("function"!=typeof t)throw new Pt(o);return e=null==e?0:yn(ds(e),0),Yr((function(n){var r=n[e],i=gi(n,0,e);return r&&De(i,r),Se(t,this,i)}))},Fn.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Fn.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:ds(e))<0?0:e):[]},Fn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:ds(e)))<0?0:e,r):[]},Fn.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Fn.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Fn.tap=function(t,e){return e(t),t},Fn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Pt(o);return Qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ca(t,e,{leading:r,maxWait:e,trailing:i})},Fn.thru=ha,Fn.toArray=fs,Fn.toPairs=Ns,Fn.toPairsIn=Fs,Fn.toPath=function(t){return Ga(t)?je(t,Lo):ss(t)?[t]:Oi(Mo(ms(t)))},Fn.toPlainObject=ys,Fn.transform=function(t,e,n){var r=Ga(t),i=r||Ya(t)||us(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qa(t)&&Za(o)?Un(Wt(t)):{}}return(i?Ae:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Oa(t,1)},Fn.union=ta,Fn.unionBy=ea,Fn.unionWith=na,Fn.uniq=function(t){return t&&t.length?si(t):[]},Fn.uniqBy=function(t,e){return t&&t.length?si(t,oo(e,2)):[]},Fn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Fn.unset=function(t,e){return null==t||ui(t,e)},Fn.unzip=ra,Fn.unzipWith=ia,Fn.update=function(t,e,n){return null==t?t:li(t,e,vi(n))},Fn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:li(t,e,vi(n),r)},Fn.values=Us,Fn.valuesIn=function(t){return null==t?[]:Ze(t,js(t))},Fn.without=oa,Fn.words=Zs,Fn.wrap=function(t,e){return La(vi(e),t)},Fn.xor=aa,Fn.xorBy=sa,Fn.xorWith=ua,Fn.zip=la,Fn.zipObject=function(t,e){return di(t||[],e||[],Qn)},Fn.zipObjectDeep=function(t,e){return di(t||[],e||[],Zr)},Fn.zipWith=ca,Fn.entries=Ns,Fn.entriesIn=Fs,Fn.extend=bs,Fn.extendWith=ws,au(Fn,Fn),Fn.add=mu,Fn.attempt=Ks,Fn.camelCase=zs,Fn.capitalize=Bs,Fn.ceil=gu,Fn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=vs(n))==n?n:0),e!==i&&(e=(e=vs(e))==e?e:0),or(vs(t),e,n)},Fn.clone=function(t){return ar(t,4)},Fn.cloneDeep=function(t){return ar(t,5)},Fn.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:i)},Fn.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:i)},Fn.conformsTo=function(t,e){return null==e||sr(t,e,Cs(e))},Fn.deburr=Vs,Fn.defaultTo=function(t,e){return null==t||t!=t?e:t},Fn.divide=bu,Fn.endsWith=function(t,e,n){t=ms(t),e=ai(e);var r=t.length,o=n=n===i?r:or(ds(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Fn.eq=Ua,Fn.escape=function(t){return(t=ms(t))&&$.test(t)?t.replace(H,en):t},Fn.escapeRegExp=function(t){return(t=ms(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Fn.every=function(t,e,n){var r=Ga(t)?Pe:hr;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.find=va,Fn.findIndex=Vo,Fn.findKey=function(t,e){return Ne(t,oo(e,3),gr)},Fn.findLast=ya,Fn.findLastIndex=Go,Fn.findLastKey=function(t,e){return Ne(t,oo(e,3),br)},Fn.floor=wu,Fn.forEach=ma,Fn.forEachRight=ga,Fn.forIn=function(t,e){return null==t?t:yr(t,oo(e,3),js)},Fn.forInRight=function(t,e){return null==t?t:mr(t,oo(e,3),js)},Fn.forOwn=function(t,e){return t&&gr(t,oo(e,3))},Fn.forOwnRight=function(t,e){return t&&br(t,oo(e,3))},Fn.get=As,Fn.gt=za,Fn.gte=Ba,Fn.has=function(t,e){return null!=t&&ho(t,e,Ar)},Fn.hasIn=Os,Fn.head=Xo,Fn.identity=nu,Fn.includes=function(t,e,n,r){t=Xa(t)?t:Us(t),n=n&&!r?ds(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),as(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ue(t,e,n)>-1},Fn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Ue(t,e,i)},Fn.inRange=function(t,e,n){return e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=vs(t),e,n)},Fn.invoke=ks,Fn.isArguments=Va,Fn.isArray=Ga,Fn.isArrayBuffer=Wa,Fn.isArrayLike=Xa,Fn.isArrayLikeObject=Ha,Fn.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Sr(t)==m},Fn.isBuffer=Ya,Fn.isDate=$a,Fn.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Fn.isEmpty=function(t){if(null==t)return!0;if(Xa(t)&&(Ga(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||us(t)||Va(t)))return!t.length;var e=fo(t);if(e==_||e==P)return!t.size;if(xo(t))return!Ir(t).length;for(var n in t)if(Rt.call(t,n))return!1;return!0},Fn.isEqual=function(t,e){return Cr(t,e)},Fn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Cr(t,e,i,n):!!r},Fn.isError=qa,Fn.isFinite=function(t){return"number"==typeof t&&Le(t)},Fn.isFunction=Za,Fn.isInteger=Ka,Fn.isLength=Ja,Fn.isMap=es,Fn.isMatch=function(t,e){return t===e||jr(t,e,so(e))},Fn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,jr(t,e,so(e),n)},Fn.isNaN=function(t){return ns(t)&&t!=+t},Fn.isNative=function(t){if(wo(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(t)},Fn.isNil=function(t){return null==t},Fn.isNull=function(t){return null===t},Fn.isNumber=ns,Fn.isObject=Qa,Fn.isObjectLike=ts,Fn.isPlainObject=rs,Fn.isRegExp=is,Fn.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=f},Fn.isSet=os,Fn.isString=as,Fn.isSymbol=ss,Fn.isTypedArray=us,Fn.isUndefined=function(t){return t===i},Fn.isWeakMap=function(t){return ts(t)&&fo(t)==C},Fn.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Sr(t)},Fn.join=function(t,e){return null==t?"":We.call(t,e)},Fn.kebabCase=Gs,Fn.last=qo,Fn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ds(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Fe(t,Be,o,!0)},Fn.lowerCase=Ws,Fn.lowerFirst=Xs,Fn.lt=ls,Fn.lte=cs,Fn.max=function(t){return t&&t.length?dr(t,nu,Tr):i},Fn.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Tr):i},Fn.mean=function(t){return Ve(t,nu)},Fn.meanBy=function(t,e){return Ve(t,oo(e,2))},Fn.min=function(t){return t&&t.length?dr(t,nu,Mr):i},Fn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Mr):i},Fn.stubArray=pu,Fn.stubFalse=vu,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xu,Fn.nth=function(t,e){return t&&t.length?zr(t,ds(e)):i},Fn.noConflict=function(){return fe._===this&&(fe._=Ft),this},Fn.noop=su,Fn.now=Aa,Fn.pad=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(de(i),n)+t+Bi(he(i),n)},Fn.padEnd=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?t+Bi(e-r,n):t},Fn.padStart=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Fn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ms(t).replace(rt,""),e||0)},Fn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=hs(t),e===i?(e=t,t=0):e=hs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=wn();return mn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Fn.reduce=function(t,e,n){var r=Ga(t)?Re:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,cr)},Fn.reduceRight=function(t,e,n){var r=Ga(t)?Ie:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Fn.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),Hr(ms(t),e)},Fn.replace=function(){var t=arguments,e=ms(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fn.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Lo(e[r])];a===i&&(r=o,a=n),t=Za(a)?a.call(t):a}return t},Fn.round=_u,Fn.runInContext=t,Fn.sample=function(t){return(Ga(t)?qn:$r)(t)},Fn.size=function(t){if(null==t)return 0;if(Xa(t))return as(t)?cn(t):t.length;var e=fo(t);return e==_||e==P?t.size:Ir(t).length},Fn.snakeCase=Hs,Fn.some=function(t,e,n){var r=Ga(t)?Me:ei;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.sortedIndex=function(t,e){return ni(t,e)},Fn.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Fn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Ua(t[r],e))return r}return-1},Fn.sortedLastIndex=function(t,e){return ni(t,e,!0)},Fn.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Fn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Ua(t[n],e))return n}return-1},Fn.startCase=Ys,Fn.startsWith=function(t,e,n){return t=ms(t),n=null==n?0:or(ds(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Fn.subtract=Su,Fn.sum=function(t){return t&&t.length?He(t,nu):0},Fn.sumBy=function(t,e){return t&&t.length?He(t,oo(e,2)):0},Fn.template=function(t,e,n){var r=Fn.templateSettings;n&&mo(t,e,n)&&(e=i),t=ms(t),e=ws({},e,r,qi);var o,a,s=ws({},e.imports,r.imports,qi),u=Cs(s),l=Ze(s,u),c=0,f=e.interpolate||bt,h="__p += '",d=At((e.escape||bt).source+"|"+f.source+"|"+(f===K?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Rt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),h+=t.slice(c,u).replace(wt,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var v=Rt.call(e,"variable")&&e.variable;if(v){if(lt.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(W,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ks((function(){return _t(u,p+"return "+h).apply(i,l)}));if(y.source=h,qa(y))throw y;return y},Fn.times=function(t,e){if((t=ds(t))<1||t>f)return[];var n=d,r=mn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Fn.toFinite=hs,Fn.toInteger=ds,Fn.toLength=ps,Fn.toLower=function(t){return ms(t).toLowerCase()},Fn.toNumber=vs,Fn.toSafeInteger=function(t){return t?or(ds(t),-9007199254740991,f):0===t?t:0},Fn.toString=ms,Fn.toUpper=function(t){return ms(t).toUpperCase()},Fn.trim=function(t,e,n){if((t=ms(t))&&(n||e===i))return $e(t);if(!t||!(e=ai(e)))return t;var r=fn(t),o=fn(e);return gi(r,Je(r,o),Qe(r,o)+1).join("")},Fn.trimEnd=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,0,Qe(r,fn(e))+1).join("")},Fn.trimStart=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,Je(r,fn(e))).join("")},Fn.truncate=function(t,e){var n=30,r="...";if(Qa(e)){var o="separator"in e?e.separator:o;n="length"in e?ds(e.length):n,r="omission"in e?ai(e.omission):r}var a=(t=ms(t)).length;if(rn(t)){var s=fn(t);a=s.length}if(n>=a)return t;var u=n-cn(r);if(u<1)return r;var l=s?gi(s,0,u).join(""):t.slice(0,u);if(o===i)return l+r;if(s&&(u+=l.length-u),is(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=At(o.source,ms(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(t.indexOf(ai(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Fn.unescape=function(t){return(t=ms(t))&&Y.test(t)?t.replace(X,dn):t},Fn.uniqueId=function(t){var e=++It;return ms(t)+e},Fn.upperCase=$s,Fn.upperFirst=qs,Fn.each=ma,Fn.eachRight=ga,Fn.first=Xo,au(Fn,(yu={},gr(Fn,(function(t,e){Rt.call(Fn.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Fn.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),Ae(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===i?1:yn(ds(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return Er(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(Ia(oo(t)))},Vn.prototype.slice=function(t,e){t=ds(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ds(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},gr(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Fn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Fn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Vn,l=s[0],c=u||Ga(e),f=function(t){var e=o.apply(Fn,De([t],s));return r&&h?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&c){e=v?e:new Vn(this);var y=t.apply(e,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,h)}return p&&v?t.apply(this,s):(y=this.thru(f),p?r?y.value()[0]:y.value():y)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Et[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Fn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ga(i)?i:[],t)}return this[n]((function(n){return e.apply(Ga(n)?n:[],t)}))}})),gr(Vn.prototype,(function(t,e){var n=Fn[e];if(n){var r=n.name+"";Rt.call(kn,r)||(kn[r]=[]),kn[r].push({name:e,func:n})}})),kn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Oi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Oi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Oi(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ga(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=mn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,y=t[l+=e];++v<f;){var m=c[v],g=m.iteratee,b=m.type,w=g(y);if(2==b)y=w;else if(!w){if(1==b)continue t;break t}}p[h++]=y}return p},Fn.prototype.at=da,Fn.prototype.chain=function(){return fa(this)},Fn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Fo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:i}),new Bn(e,this.__chain__)}return this.thru(Qo)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,qt&&(Fn.prototype[qt]=function(){return this}),Fn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},880:function(t,e,n){var r,i;r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function l(t){return function(){typeof console!==e&&(u.call(this),this[t].apply(this,arguments))}}function c(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):t)}(r)||l.apply(this,arguments)}function f(t,n){var a,s,l,f=this,h="loglevel";function d(){var t;if(typeof window!==e&&h){try{t=window.localStorage[h]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(t=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(t){}return void 0===f.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==f.levels[e.toUpperCase()]&&(e=f.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=f.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?h+=":"+t:"symbol"==typeof t&&(h=void 0),f.name=t,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||c,f.getLevel=function(){return null!=l?l:null!=s?s:a},f.setLevel=function(t,n){return l=p(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(t){}}}(l),u.call(f)},f.setDefaultLevel=function(t){s=p(t),d()||f.setLevel(t,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==e&&h){try{window.localStorage.removeItem(h)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),u.call(f)},f.enableAll=function(t){f.setLevel(f.levels.TRACE,t)},f.disableAll=function(t){f.setLevel(f.levels.SILENT,t)},f.rebuild=function(){if(o!==f&&(a=p(o.getLevel())),u.call(f),o===f)for(var t in i)i[t].rebuild()},a=p(o?o.getLevel():"WARN");var v=d();null!=v&&(l=p(v)),u.call(f)}(o=new f).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=i[t];return e||(e=i[t]=new f(t,o.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},481:(t,e,n)=>{t.exports=n(137)},137:t=>{t.exports=class{constructor(t,e,n,r){let i;if("object"==typeof t){let o=t;t=o.k_p,e=o.k_i,n=o.k_d,r=o.dt,i=o.i_max}this.k_p="number"==typeof t?t:1,this.k_i=e||0,this.k_d=n||0,this.dt=r||0,this.i_max=i||0,this.sumError=0,this.lastError=0,this.lastTime=0,this.target=0}setTarget(t){this.target=t}update(t){this.currentValue=t;let e=this.dt;if(!e){let t=Date.now();e=0===this.lastTime?0:(t-this.lastTime)/1e3,this.lastTime=t}"number"==typeof e&&0!==e||(e=1);let n=this.target-this.currentValue;if(this.sumError=this.sumError+n*e,this.i_max>0&&Math.abs(this.sumError)>this.i_max){let t=this.sumError>0?1:-1;this.sumError=t*this.i_max}let r=(n-this.lastError)/e;return this.lastError=n,this.k_p*n+this.k_i*this.sumError+this.k_d*r}reset(){this.sumError=0,this.lastError=0,this.lastTime=0}}},803:t=>{var e,n,r=document.attachEvent,i=!1;function o(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function a(t){var e=this;o(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}if(!r){var s=(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return n(t)}),u=(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),l=!1,c="",f="animationstart",h="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(l=!0),!1===l)for(var v=0;v<h.length;v++)if(void 0!==p.style[h[v]+"AnimationName"]){c="-"+h[v].toLowerCase()+"-",f=d[v],l=!0;break}var y="resizeanim",m="@"+c+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",g=c+"animation: 1ms "+y+"; "}t.exports=function(t,e){return r?t.attachEvent("onresize",e):(t.__resizeTriggers__||("static"==getComputedStyle(t).position&&(t.style.position="relative"),function(){if(!i){var t=(m||"")+".resize-triggers { "+(g||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n),i=!0}}(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),o(t),t.addEventListener("scroll",a,!0),f&&t.__resizeTriggers__.addEventListener(f,(function(e){e.animationName==y&&o(t)}))),t.__resizeListeners__.push(e)),function(){r?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",a),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))}}},975:(t,e,n)=>{var r=n(101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},101:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={id:t,loaded:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};(()=>{i.d(o,{RL:()=>Li,wK:()=>ua,x_:()=>fa,lv:()=>ca,YQ:()=>la,BP:()=>yf,GZ:()=>mf,Vw:()=>ha,Ay:()=>gf,_G:()=>Fs});var n=i(250);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}var u=["onLayoutDone","onLayoutStep","onError","onLayoutComputing","onWebGLContextLost","restart"],l=function(){function t(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=s(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks=i}var e,n;return e=t,n=[{key:"onLayoutDone",value:function(){this.isValidFunction(this.callbacks.onLayoutDone)&&this.callbacks.onLayoutDone()}},{key:"onLayoutStep",value:function(t){this.isValidFunction(this.callbacks.onLayoutStep)&&this.callbacks.onLayoutStep(t)}},{key:"onLayoutComputing",value:function(t){this.isValidFunction(this.callbacks.onLayoutComputing)&&this.callbacks.onLayoutComputing(t)}},{key:"onError",value:function(t){this.isValidFunction(this.callbacks.onError)&&this.callbacks.onError(t)}},{key:"onWebGLContextLost",value:function(t){this.isValidFunction(this.callbacks.onWebGLContextLost)&&this.callbacks.onWebGLContextLost(t)}},{key:"isValidFunction",value:function(t){return void 0!==t&&"function"==typeof t}}],n&&a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function f(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){function t(t){void 0===t&&(t="Atom@"+re()),this.name=t,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Ae.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){He(this)},t.prototype.reportChanged=function(){We(),function(t){if(t.lowestObserverState!==Ae.STALE){t.lowestObserverState=Ae.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.UP_TO_DATE&&(r.isTracing!==Oe.NONE&&Ye(r,t),r.onBecomeStale()),r.dependenciesState=Ae.STALE}}}(this),Xe()},t.prototype.toString=function(){return this.name},t}(),d=function(t){function e(e,n,r){void 0===e&&(e="Atom@"+re()),void 0===n&&(n=le),void 0===r&&(r=le);var i=t.call(this,e)||this;return i.name=e,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return f(e,t),e.prototype.reportObserved=function(){return We(),t.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),Xe(),!!ke.trackingDerivation},e.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},e}(h),p=xe("Atom",h);function v(t){return t.interceptors&&t.interceptors.length>0}function y(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function m(t,e){var n=rn();try{var r=t.interceptors;if(r)for(var i=0,o=r.length;i<o&&(oe(!(e=r[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{on(n)}}function g(t){return t.changeListeners&&t.changeListeners.length>0}function b(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function w(t,e){var n=rn(),r=t.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](e);on(n)}}function x(){return!!ke.spyListeners.length}function _(t){if(ke.spyListeners.length)for(var e=ke.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function S(t){_(pe({},t,{spyReportStart:!0}))}var T={spyReportEnd:!0};function A(t){_(t?pe({},t,T):T)}function O(t){return ke.spyListeners.push(t),ue((function(){var e=ke.spyListeners.indexOf(t);-1!==e&&ke.spyListeners.splice(e,1)}))}var P="__$$iterating";function E(t){oe(!0!==t[P],"Illegal state: cannot recycle array as iterator"),ge(t,P,!0);var e=-1;return ge(t,"next",(function(){return{done:++e>=this.length,value:e<this.length?this[e]:void 0}})),t}function k(t,e){ge(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var C,j,D=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,!1===t}(),R=0,I=function(){};C=I,j=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(C.prototype,j):void 0!==C.prototype.__proto__?C.prototype.__proto__=j:C.prototype=j,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(t){Object.defineProperty(I.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})}));var M=function(){function t(t,e,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new h(t||"ObservableArray@"+re()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer?t.map(this.dehancer):t},t.prototype.intercept=function(t){return y(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),b(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=e,e>0&&t+e+1>R&&z(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Qe(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=[]),v(this)){var o=m(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!o)return ee;e=o.removedCount,n=o.added}var a=(n=n.map((function(t){return r.enhancer(t,void 0)}))).length-e;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(t,e,n){if(n.length<1e4)return(r=this.values).splice.apply(r,[t,e].concat(n));var r,i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&x(),i=g(this),o=i||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&S(o),this.atom.reportChanged(),i&&w(this,o),r&&A()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&x(),i=g(this),o=i||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&S(o),this.atom.reportChanged(),i&&w(this,o),r&&A()},t}(),L=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableArray@"+re()),void 0===i&&(i=!1);var o=t.call(this)||this,a=new M(r,n,o,i);return ge(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),D&&Object.defineProperty(a.array,"0",N),o}return f(e,t),e.prototype.intercept=function(t){return this.$mobx.intercept(t)},e.prototype.observe=function(t,e){return void 0===e&&(e=!1),this.$mobx.observe(t,e)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),t.map((function(t){return V(t)?t.peek():t})))},e.prototype.replace=function(t){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,t)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(t,e,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},e.prototype.findIndex=function(t,e,n){void 0===n&&(n=0);for(var r=this.peek(),i=r.length,o=n;o<i;o++)if(t.call(e,r[o],o,this))return o;return-1},e.prototype.splice=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(t);case 2:return this.$mobx.spliceWithArray(t,e)}return this.$mobx.spliceWithArray(t,e,n)},e.prototype.spliceWithArray=function(t,e,n){return this.$mobx.spliceWithArray(t,e,n)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,t),n.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(0,0,t),n.values.length},e.prototype.reverse=function(){var t=this.slice();return t.reverse.apply(t,arguments)},e.prototype.sort=function(t){var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.dehanceValues(this.$mobx.values).indexOf(t);return e>-1&&(this.splice(e,1),!0)},e.prototype.move=function(t,e){function n(t){if(t<0)throw new Error("[mobx.array] Index out of bounds: "+t+" is negative");var e=this.$mobx.values.length;if(t>=e)throw new Error("[mobx.array] Index out of bounds: "+t+" is not smaller than "+e)}if(n.call(this,t),n.call(this,e),t!==e){var r,i=this.$mobx.values;r=t<e?i.slice(0,t).concat(i.slice(t+1,e+1),[i[t]],i.slice(e+1)):i.slice(0,e).concat([i[t]],i.slice(e,t),i.slice(t+1)),this.replace(r)}},e.prototype.get=function(t){var e=this.$mobx;if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(t,e){var n=this.$mobx,r=n.values;if(t<r.length){Qe(n.atom);var i=r[t];if(v(n)){var o=m(n,{type:"update",object:this,index:t,newValue:e});if(!o)return;e=o.newValue}(e=n.enhancer(e,i))!==i&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}},e}(I);k(L.prototype,(function(){return E(this.slice())})),Object.defineProperty(L.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(t){this.$mobx.setArrayLength(t)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach((function(t){var e=Array.prototype[t];oe("function"==typeof e,"Base function not defined on Array prototype: '"+t+"'"),me(L.prototype,t,(function(){return e.apply(this.peek(),arguments)}))})),function(t,e){for(var n=0;n<e.length;n++)me(t,e[n],t[e[n]])}(L.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var N=F(0);function F(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function U(t){Object.defineProperty(L.prototype,""+t,F(t))}function z(t){for(var e=R;e<t;e++)U(e);R=t}z(1e3);var B=xe("ObservableArrayAdministration",M);function V(t){return he(t)&&B(t.$mobx)}var G={},W=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableValue@"+re()),void 0===i&&(i=!0);var o=t.call(this,r)||this;return o.enhancer=n,o.hasUnreportedChange=!1,o.dehancer=void 0,o.value=n(e,void 0,r),i&&x()&&_({type:"create",object:o,newValue:o.value}),o}return f(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){var e=this.value;if((t=this.prepareNewValue(t))!==G){var n=x();n&&S({type:"update",object:this,newValue:t,oldValue:e}),this.setNewValue(t),n&&A()}},e.prototype.prepareNewValue=function(t){if(Qe(this),v(this)){var e=m(this,{object:this,type:"update",newValue:t});if(!e)return G;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.value!==t?t:G},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),g(this)&&w(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return y(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),b(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Te(this.get())},e}(h);W.prototype[Se()]=W.prototype.valueOf;var X=xe("ObservableValue",W),H={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"};function Y(t){return H[t]}function $(t,e){oe("function"==typeof e,Y("m026")),oe("string"==typeof t&&t.length>0,"actions should have valid names, got: '"+t+"'");var n=function(){return q(t,e,this,arguments)};return n.originalFn=e,n.isMobxAction=!0,n}function q(t,e,n,r){var i=function(t,e,n,r){var i=x()&&!!t,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];S({type:"action",name:t,fn:e,object:n,arguments:s})}var l=rn();return We(),{prevDerivation:l,prevAllowStateChanges:K(!0),notifySpy:i,startTime:o}}(t,e,n,r);try{return e.apply(n,r)}finally{!function(t){J(t.prevAllowStateChanges),Xe(),on(t.prevDerivation),t.notifySpy&&A({time:Date.now()-t.startTime})}(i)}}function Z(t){oe(null===ke.trackingDerivation,Y("m028")),ke.strictMode=t,ke.allowStateChanges=!t}function K(t){var e=ke.allowStateChanges;return ke.allowStateChanges=t,e}function J(t){ke.allowStateChanges=t}function Q(t,e,n,r,i){function o(o,a,s,u,l){if(void 0===l&&(l=0),oe(i||nt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){ye(o,"__mobxLazyInitializers")||me(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var c=s.value,f=s.initializer;return o.__mobxLazyInitializers.push((function(e){t(e,a,f?f.call(e):c,u,s)})),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&et(this),e.call(this,a)},set:function(t){!0!==this.__mobxDidRunLazyInitializers&&et(this),n.call(this,a,t)}}}var h={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||tt(this,a,void 0,t,u,s),e.call(this,a)},set:function(e){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,e):tt(this,a,e,t,u,s)}};return(arguments.length<3||5===arguments.length&&l<3)&&Object.defineProperty(o,a,h),h}return i?function(){if(nt(arguments))return o.apply(null,arguments);var t=arguments,e=arguments.length;return function(n,r,i){return o(n,r,i,t,e)}}:o}function tt(t,e,n,r,i,o){ye(t,"__mobxInitializedProps")||me(t,"__mobxInitializedProps",{}),t.__mobxInitializedProps[e]=!0,r(t,e,n,i,o)}function et(t){!0!==t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers&&(me(t,"__mobxDidRunLazyInitializers",!0),t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers.forEach((function(e){return e(t)})))}function nt(t){return(2===t.length||3===t.length)&&"string"==typeof t[1]}var rt=Q((function(t,e,n,r,i){var o=r&&1===r.length?r[0]:n.name||e||"<unnamed action>";me(t,e,ot(o,n))}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!0),it=Q((function(t,e,n){ut(t,e,n)}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!1),ot=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?$(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?$(t,e):1===arguments.length&&"string"==typeof t?at(t):at(e).apply(null,arguments)};function at(t){return function(e,n,r){if(r&&"function"==typeof r.value)return r.value=$(t,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return rt(t).apply(this,arguments)}}function st(t){return"function"==typeof t&&!0===t.isMobxAction}function ut(t,e,n){var r=function(){return q(e,n,t,arguments)};r.isMobxAction=!0,me(t,e,r)}ot.bound=function(t,e,n){if("function"==typeof t){var r=$("<not yet bound action>",t);return r.autoBind=!0,r}return it.apply(null,arguments)};var lt=Object.prototype.toString;function ct(t,e){return ft(t,e)}function ft(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&function(t,e,n,r){t=ht(t),e=ht(e);var i=lt.call(t);if(i!==lt.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!ft(t[u],e[u],n,r))return!1}else{var l,c=Object.keys(t);if(u=c.length,Object.keys(e).length!==u)return!1;for(;u--;)if(!dt(e,l=c[u])||!ft(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function ht(t){return V(t)?t.peek():te(t)?t.entries():_e(t)?function(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}(t.entries()):t}function dt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pt(t,e){return t===e}var vt={identity:pt,structural:function(t,e){return ct(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||pt(t,e)}};function yt(t,e,n){var r,i,o;"string"==typeof t?(r=t,i=e,o=n):(r=t.name||"Autorun@"+re(),i=t,o=e),oe("function"==typeof i,Y("m004")),oe(!1===st(i),Y("m005")),o&&(i=i.bind(o));var a=new ln(r,(function(){this.track(s)}));function s(){i(a)}return a.schedule(),a.getDisposer()}function mt(t,e,n){var r;arguments.length>3&&ie(Y("m007")),Wt(t)&&ie(Y("m008")),(r="object"==typeof n?n:{}).name=r.name||t.name||e.name||"Reaction@"+re(),r.fireImmediately=!0===n||!0===r.fireImmediately,r.delay=r.delay||0,r.compareStructural=r.compareStructural||r.struct||!1,e=ot(r.name,r.context?e.bind(r.context):e),r.context&&(t=t.bind(r.context));var i,o=!0,a=!1,s=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default,u=new ln(r.name,(function(){o||r.delay<1?l():a||(a=!0,setTimeout((function(){a=!1,l()}),r.delay))}));function l(){if(!u.isDisposed){var n=!1;u.track((function(){var e=t(u);n=o||!s(i,e),i=e})),o&&r.fireImmediately&&e(i,u),o||!0!==n||e(i,u),o&&(o=!1)}}return u.schedule(),u.getDisposer()}var gt=function(){function t(t,e,n,r,i){this.derivation=t,this.scope=e,this.equals=n,this.dependenciesState=Ae.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+re(),this.value=new qe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Oe.NONE,this.name=r||"ComputedValue@"+re(),i&&(this.setter=$(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Ae.UP_TO_DATE){t.lowestObserverState=Ae.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.UP_TO_DATE&&(r.dependenciesState=Ae.POSSIBLY_STALE,r.isTracing!==Oe.NONE&&Ye(r,t),r.onBecomeStale())}}}(this)},t.prototype.onBecomeUnobserved=function(){en(this),this.value=void 0},t.prototype.get=function(){oe(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===ke.inBatch?(We(),Ke(this)&&(this.isTracing!==Oe.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),Xe()):(He(this),Ke(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState!==Ae.STALE){t.lowestObserverState=Ae.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.POSSIBLY_STALE?r.dependenciesState=Ae.STALE:r.dependenciesState===Ae.UP_TO_DATE&&(t.lowestObserverState=Ae.UP_TO_DATE)}}}(this));var t=this.value;if(Ze(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Ze(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){oe(!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,t)}finally{this.isRunningSetter=!1}}else oe(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){x()&&_({object:this.scope,type:"compute",fn:this.derivation});var t=this.value,e=this.dependenciesState===Ae.NOT_TRACKING,n=this.value=this.computeValue(!0);return e||Ze(t)||Ze(n)||!this.equals(t,n)},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ke.computationDepth++,t)e=tn(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new qe(t)}return ke.computationDepth--,this.isComputing=!1,e},t.prototype.observe=function(t,e){var n=this,r=!0,i=void 0;return yt((function(){var o=n.get();if(!r||e){var a=rn();t({type:"update",object:n,newValue:o,oldValue:i}),on(a)}r=!1,i=o}))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Te(this.get())},t.prototype.whyRun=function(){var t=Boolean(ke.trackingDerivation),e=ce(this.isComputing?this.newObserving:this.observing).map((function(t){return t.name})),n=ce(ze(this).map((function(t){return t.name})));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(t?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Ae.NOT_TRACKING?Y("m032"):" * This computation will re-run if any of the following observables changes:\n "+fe(e)+"\n "+(this.isComputing&&t?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+Y("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+fe(n)+"\n")},t}();gt.prototype[Se()]=gt.prototype.valueOf;var bt=xe("ComputedValue",gt),wt=function(){function t(t,e){this.target=t,this.name=e,this.values={},this.changeListeners=null,this.interceptors=null}return t.prototype.observe=function(t,e){return oe(!0!==e,"`observe` doesn't support the fire immediately property for observable objects."),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();function xt(t,e){if(Ct(t)&&t.hasOwnProperty("$mobx"))return t.$mobx;oe(Object.isExtensible(t),Y("m035")),de(t)||(e=(t.constructor.name||"ObservableObject")+"@"+re()),e||(e="ObservableObject@"+re());var n=new wt(t,e);return ge(t,"$mobx",n),n}function _t(t,e,n,r){if(t.values[e]&&!bt(t.values[e]))return oe("value"in n,"The property "+e+" in "+t.name+" is already observable, cannot redefine it as computed property"),void(t.target[e]=n.value);if("value"in n)if(Wt(n.value)){var i=n.value;St(t,e,i.initialValue,i.enhancer)}else st(n.value)&&!0===n.value.autoBind?ut(t.target,e,n.value.originalFn):bt(n.value)?function(t,e,n){var r=t.name+"."+e;n.name=r,n.scope||(n.scope=t.target),t.values[e]=n,Object.defineProperty(t.target,e,Pt(e))}(t,e,n.value):St(t,e,n.value,r);else Tt(t,e,n.get,n.set,vt.default,!0)}function St(t,e,n,r){if(we(t.target,e),v(t)){var i=m(t,{object:t.target,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(t.values[e]=new W(n,r,t.name+"."+e,!1)).value,Object.defineProperty(t.target,e,function(t){return At[t]||(At[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[t].get()},set:function(e){Et(this,t,e)}})}(e)),function(t,e,n,r){var i=g(t),o=x(),a=i||o?{type:"add",object:e,name:n,newValue:r}:null;o&&S(a),i&&w(t,a),o&&A()}(t,t.target,e,n)}function Tt(t,e,n,r,i,o){o&&we(t.target,e),t.values[e]=new gt(n,t.target,i,t.name+"."+e,r),o&&Object.defineProperty(t.target,e,Pt(e))}var At={},Ot={};function Pt(t){return Ot[t]||(Ot[t]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[t].get()},set:function(e){return this.$mobx.values[t].set(e)}})}function Et(t,e,n){var r=t.$mobx,i=r.values[e];if(v(r)){if(!(s=m(r,{type:"update",object:t,name:e,newValue:n})))return;n=s.newValue}if((n=i.prepareNewValue(n))!==G){var o=g(r),a=x(),s=o||a?{type:"update",object:t,oldValue:i.value,name:e,newValue:n}:null;a&&S(s),i.setNewValue(n),o&&w(r,s),a&&A()}}var kt=xe("ObservableObjectAdministration",wt);function Ct(t){return!!he(t)&&(et(t),kt(t.$mobx))}function jt(t,e){if(null==t)return!1;if(void 0!==e){if(V(t)||te(t))throw new Error(Y("m019"));if(Ct(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return Ct(t)||!!t.$mobx||p(t)||vn(t)||bt(t)}function Dt(t){return oe(!!t,":("),Q((function(e,n,r,i,o){we(e,n),oe(!o||!o.get,Y("m022")),St(xt(e,void 0),n,r,t)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){Et(this,t,e)}),!0,!1)}function Rt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Mt(t,Ht,e)}function It(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Mt(t,$t,e)}function Mt(t,e,n){oe(arguments.length>=2,Y("m014")),oe("object"==typeof t,Y("m015")),oe(!te(t),Y("m016")),n.forEach((function(t){oe("object"==typeof t,Y("m017")),oe(!jt(t),Y("m018"))}));for(var r=xt(t),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&ye(a,s)){if(i[s]=!0,t===a&&!be(t,s))continue;_t(r,s,Object.getOwnPropertyDescriptor(a,s),e)}}return t}var Lt=Dt(Ht),Nt=Dt(Yt),Ft=Dt($t),Ut=Dt(qt),zt=Dt(Zt),Bt={box:function(t,e){return arguments.length>2&&Gt("box"),new W(t,Ht,e)},shallowBox:function(t,e){return arguments.length>2&&Gt("shallowBox"),new W(t,$t,e)},array:function(t,e){return arguments.length>2&&Gt("array"),new L(t,Ht,e)},shallowArray:function(t,e){return arguments.length>2&&Gt("shallowArray"),new L(t,$t,e)},map:function(t,e){return arguments.length>2&&Gt("map"),new Qt(t,Ht,e)},shallowMap:function(t,e){return arguments.length>2&&Gt("shallowMap"),new Qt(t,$t,e)},object:function(t,e){arguments.length>2&&Gt("object");var n={};return xt(n,e),Rt(n,t),n},shallowObject:function(t,e){arguments.length>2&&Gt("shallowObject");var n={};return xt(n,e),It(n,t),n},ref:function(){return arguments.length<2?Xt($t,arguments[0]):Ft.apply(null,arguments)},shallow:function(){return arguments.length<2?Xt(Yt,arguments[0]):Nt.apply(null,arguments)},deep:function(){return arguments.length<2?Xt(Ht,arguments[0]):Lt.apply(null,arguments)},struct:function(){return arguments.length<2?Xt(qt,arguments[0]):Ut.apply(null,arguments)}},Vt=function(t){if(void 0===t&&(t=void 0),"string"==typeof arguments[1])return Lt.apply(null,arguments);if(oe(arguments.length<=1,Y("m021")),oe(!Wt(t),Y("m020")),jt(t))return t;var e=Ht(t,0,void 0);return e!==t?e:Vt.box(t)};function Gt(t){ie("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function Wt(t){return"object"==typeof t&&null!==t&&!0===t.isMobxModifierDescriptor}function Xt(t,e){return oe(!Wt(e),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:e,enhancer:t}}function Ht(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),jt(t)?t:Array.isArray(t)?Vt.array(t,n):de(t)?Vt.object(t,n):_e(t)?Vt.map(t,n):t}function Yt(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),null==t||Ct(t)||V(t)||te(t)?t:Array.isArray(t)?Vt.shallowArray(t,n):de(t)?Vt.shallowObject(t,n):_e(t)?Vt.shallowMap(t,n):ie("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function $t(t){return t}function qt(t,e,n){if(ct(t,e))return e;if(jt(t))return t;if(Array.isArray(t))return new L(t,qt,n);if(_e(t))return new Qt(t,qt,n);if(de(t)){var r={};return xt(r,n),Mt(r,qt,[t]),r}return t}function Zt(t,e,n){return ct(t,e)?e:t}function Kt(t,e){void 0===e&&(e=void 0),We();try{return t.apply(e)}finally{Xe()}}Object.keys(Bt).forEach((function(t){return Vt[t]=Bt[t]})),Vt.deep.struct=Vt.struct,Vt.ref.struct=function(){return arguments.length<2?Xt(Zt,arguments[0]):zt.apply(null,arguments)};var Jt={},Qt=function(){function t(t,e,n){void 0===e&&(e=Ht),void 0===n&&(n="ObservableMap@"+re()),this.enhancer=e,this.name=n,this.$mobx=Jt,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new L(void 0,$t,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(t)}return t.prototype._has=function(t){return void 0!==this._data[t]},t.prototype.has=function(t){return!!this.isValidKey(t)&&(t=""+t,this._hasMap[t]?this._hasMap[t].get():this._updateHasMapEntry(t,!1).get())},t.prototype.set=function(t,e){this.assertValidKey(t),t=""+t;var n=this._has(t);if(v(this)){var r=m(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if(this.assertValidKey(t),t=""+t,v(this)&&!(i=m(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=x(),r=g(this),i=r||n?{type:"delete",object:this,oldValue:this._data[t].value,name:t}:null;return n&&S(i),Kt((function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data[t].setNewValue(void 0),e._data[t]=void 0})),r&&w(this,i),n&&A(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap[t];return n?n.setNewValue(e):n=this._hasMap[t]=new W(e,$t,this.name+"."+t+"?",!1),n},t.prototype._updateValue=function(t,e){var n=this._data[t];if((e=n.prepareNewValue(e))!==G){var r=x(),i=g(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&S(o),n.setNewValue(e),i&&w(this,o),r&&A()}},t.prototype._addValue=function(t,e){var n=this;Kt((function(){var r=n._data[t]=new W(e,n.enhancer,n.name+"."+t,!1);e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)}));var r=x(),i=g(this),o=i||r?{type:"add",object:this,name:t,newValue:e}:null;r&&S(o),i&&w(this,o),r&&A()},t.prototype.get=function(t){return t=""+t,this.has(t)?this.dehanceValue(this._data[t].get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return E(this._keys.slice())},t.prototype.values=function(){return E(this._keys.map(this.get,this))},t.prototype.entries=function(){var t=this;return E(this._keys.map((function(e){return[e,t.get(e)]})))},t.prototype.forEach=function(t,e){var n=this;this.keys().forEach((function(r){return t.call(e,n.get(r),r,n)}))},t.prototype.merge=function(t){var e=this;return te(t)&&(t=t.toJS()),Kt((function(){de(t)?Object.keys(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=t[0],r=t[1];return e.set(n,r)})):_e(t)?t.forEach((function(t,n){return e.set(n,t)})):null!=t&&ie("Cannot initialize map from "+t)})),this},t.prototype.clear=function(){var t=this;Kt((function(){nn((function(){t.keys().forEach(t.delete,t)}))}))},t.prototype.replace=function(t){var e=this;return Kt((function(){var n,r=de(n=t)?Object.keys(n):Array.isArray(n)?n.map((function(t){return t[0]})):_e(n)?Array.from(n.keys()):te(n)?n.keys():ie("Cannot get keys from "+n);e.keys().filter((function(t){return-1===r.indexOf(t)})).forEach((function(t){return e.delete(t)})),e.merge(t)})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toJS=function(){var t=this,e={};return this.keys().forEach((function(n){return e[n]=t.get(n)})),e},t.prototype.toJSON=function(){return this.toJS()},t.prototype.isValidKey=function(t){return null!=t&&("string"==typeof t||"number"==typeof t||"boolean"==typeof t)},t.prototype.assertValidKey=function(t){if(!this.isValidKey(t))throw new Error("[mobx.map] Invalid key: '"+t+"', only strings, numbers and booleans are accepted as key in observable maps.")},t.prototype.toString=function(){var t=this;return this.name+"[{ "+this.keys().map((function(e){return e+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return oe(!0!==e,Y("m033")),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();k(Qt.prototype,(function(){return this.entries()}));var te=xe("ObservableMap",Qt),ee=[];function ne(){return"undefined"!=typeof window?window:i.g}function re(){return++ke.mobxGuid}function ie(t,e){throw oe(!1,t,e),"X"}function oe(t,e,n){if(!t)throw new Error("[mobx] Invariant failed: "+e+(n?" in '"+n+"'":""))}Object.freeze(ee);var ae=[];function se(t){return-1===ae.indexOf(t)&&(ae.push(t),console.error("[mobx] Deprecated: "+t),!0)}function ue(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var le=function(){};function ce(t){var e=[];return t.forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),e}function fe(t,e,n){return void 0===e&&(e=100),void 0===n&&(n=" - "),t?t.slice(0,e).join(n)+(t.length>e?" (... and "+(t.length-e)+"more)":""):""}function he(t){return null!==t&&"object"==typeof t}function de(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function pe(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)ye(r,i)&&(t[i]=r[i])}return t}var ve=Object.prototype.hasOwnProperty;function ye(t,e){return ve.call(t,e)}function me(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function ge(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function be(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}function we(t,e){oe(be(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function xe(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return he(t)&&!0===t[n]}}function _e(t){return void 0!==ne().Map&&t instanceof ne().Map}function Se(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function Te(t){return null===t?null:"object"==typeof t?""+t:t}var Ae,Oe,Pe=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ee=function(){this.version=5,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.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]},ke=new Ee,Ce=!1,je=!1,De=!1,Re=ne();function Ie(t,e){if("object"==typeof t&&null!==t){if(V(t))return oe(void 0===e,Y("m036")),t.$mobx.atom;if(te(t)){var n=t;return void 0===e?Ie(n._keys):(oe(!!(r=n._data[e]||n._hasMap[e]),"the entry '"+e+"' does not exist in the observable map '"+Le(t)+"'"),r)}var r;if(et(t),e&&!t.$mobx&&t[e],Ct(t))return e?(oe(!!(r=t.$mobx.values[e]),"no observable property '"+e+"' found on the observable object '"+Le(t)+"'"),r):ie("please specify a property");if(p(t)||bt(t)||vn(t))return t}else if("function"==typeof t&&vn(t.$mobx))return t.$mobx;return ie("Cannot obtain atom from "+t)}function Me(t,e){return oe(t,"Expecting some object"),void 0!==e?Me(Ie(t,e)):p(t)||bt(t)||vn(t)||te(t)?t:(et(t),t.$mobx?t.$mobx:void oe(!1,"Cannot obtain administration from "+t))}function Le(t,e){return(void 0!==e?Ie(t,e):Ct(t)||te(t)?Me(t):Ie(t)).name}function Ne(t,e){return Fe(Ie(t,e))}function Fe(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=ce(t.observing).map(Fe)),e}function Ue(t){var e={name:t.name};return function(t){return t.observers&&t.observers.length>0}(t)&&(e.observers=ze(t).map(Ue)),e}function ze(t){return t.observers}function Be(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Ve(t,e){if(1===t.observers.length)t.observers.length=0,Ge(t);else{var n=t.observers,r=t.observersIndexes,i=n.pop();if(i!==e){var o=r[e.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[e.__mapid]}}function Ge(t){t.isPendingUnobservation||(t.isPendingUnobservation=!0,ke.pendingUnobservations.push(t))}function We(){ke.inBatch++}function Xe(){if(0==--ke.inBatch){dn();for(var t=ke.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}ke.pendingUnobservations=[]}}function He(t){var e=ke.trackingDerivation;null!==e?e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t):0===t.observers.length&&Ge(t)}function Ye(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Oe.BREAK){var n=[];$e(Ne(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof gt?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function $e(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return $e(t,e,n+1)})))}Re.__mobxInstanceCount?(Re.__mobxInstanceCount++,setTimeout((function(){Ce||je||De||(De=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))}),1)):Re.__mobxInstanceCount=1,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"}(Ae||(Ae={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Oe||(Oe={}));var qe=function(t){this.cause=t};function Ze(t){return t instanceof qe}function Ke(t){switch(t.dependenciesState){case Ae.UP_TO_DATE:return!1;case Ae.NOT_TRACKING:case Ae.STALE:return!0;case Ae.POSSIBLY_STALE:for(var e=rn(),n=t.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(bt(o)){try{o.get()}catch(t){return on(e),!0}if(t.dependenciesState===Ae.STALE)return on(e),!0}}return an(t),on(e),!1}}function Je(){return null!==ke.trackingDerivation}function Qe(t){var e=t.observers.length>0;ke.computationDepth>0&&e&&ie(Y("m031")+t.name),!ke.allowStateChanges&&e&&ie(Y(ke.strictMode?"m030a":"m030b")+t.name)}function tn(t,e,n){an(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ke.runId;var r,i=ke.trackingDerivation;ke.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new qe(t)}return ke.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Ae.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++)0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState);for(n.length=i,t.newObserving=null,o=e.length;o--;)0===(s=e[o]).diffValue&&Ve(s,t),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Be(s,t))}r!==Ae.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function en(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Ve(e[n],t);t.dependenciesState=Ae.NOT_TRACKING}function nn(t){var e=rn(),n=t();return on(e),n}function rn(){var t=ke.trackingDerivation;return ke.trackingDerivation=null,t}function on(t){ke.trackingDerivation=t}function an(t){if(t.dependenciesState!==Ae.UP_TO_DATE){t.dependenciesState=Ae.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Ae.UP_TO_DATE}}function sn(t){return console.log(t),t}function un(t){switch(t.length){case 0:return ke.trackingDerivation;case 1:return Ie(t[0]);case 2:return Ie(t[0],t[1])}}var ln=function(){function t(t,e){void 0===t&&(t="Reaction@"+re()),this.name=t,this.onInvalidate=e,this.observing=[],this.newObserving=[],this.dependenciesState=Ae.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+re(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Oe.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ke.pendingReactions.push(this),dn())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(We(),this._isScheduled=!1,Ke(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&x()&&_({object:this,type:"scheduled-reaction"})),Xe())},t.prototype.track=function(t){We();var e,n=x();n&&(e=Date.now(),S({object:this,type:"reaction",fn:t})),this._isRunning=!0;var r=tn(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&en(this),Ze(r)&&this.reportExceptionInDerivation(r.cause),n&&A({time:Date.now()-e}),Xe()},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=Y("m037");console.error(n||r,t),x()&&_({type:"error",message:n,error:t,object:this}),ke.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(We(),en(this),Xe()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t.$mobx=this,t.onError=cn,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.whyRun=function(){var t=ce(this._isRunning?this.newObserving:this.observing).map((function(t){return t.name}));return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+fe(t)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+Y("m038")+"\n"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=un(t);if(!r)return ie("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===Oe.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Oe.BREAK:Oe.LOG}(this,t)},t}();function cn(t){oe(this&&this.$mobx&&vn(this.$mobx),"Invalid `this`"),oe(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=t}var fn=100,hn=function(t){return t()};function dn(){ke.inBatch>0||ke.isRunningReactions||hn(pn)}function pn(){ke.isRunningReactions=!0;for(var t=ke.pendingReactions,e=0;t.length>0;){++e===fn&&(console.error("Reaction doesn't converge to a stable state after "+fn+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}ke.isRunningReactions=!1}var vn=xe("Reaction",ln);function yn(t){return Q((function(e,n,r,i,o){oe(void 0!==o,Y("m009")),oe("function"==typeof o.get,Y("m010")),Tt(xt(e,""),n,o.get,o.set,t,!1)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){this.$mobx.values[t].set(e)}),!1,!1)}var mn=yn(vt.default),gn=yn(vt.structural),bn=function(t,e,n){if("string"==typeof e)return mn.apply(null,arguments);oe("function"==typeof t,Y("m011")),oe(arguments.length<3,Y("m012"));var r="object"==typeof e?e:{};r.setter="function"==typeof e?e:r.setter;var i=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default;return new gt(t,r.context,i,r.name||t.name||"",r.setter)};function wn(t,e,n){function r(r){return e&&n.push([t,r]),r}if(void 0===e&&(e=!0),void 0===n&&(n=[]),jt(t)){if(e&&null===n&&(n=[]),e&&null!==t&&"object"==typeof t)for(var i=0,o=n.length;i<o;i++)if(n[i][0]===t)return n[i][1];if(V(t)){var a=r([]),s=t.map((function(t){return wn(t,e,n)}));for(a.length=s.length,i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(Ct(t)){for(var u in a=r({}),t)a[u]=wn(t[u],e,n);return a}if(te(t)){var l=r({});return t.forEach((function(t,r){return l[r]=wn(t,e,n)})),l}if(X(t))return wn(t.get(),e,n)}return t}bn.struct=gn,bn.equals=yn;var xn={allowStateChanges:function(t,e){var n,r=K(t);try{n=e()}finally{J(r)}return n},deepEqual:ct,getAtom:Ie,getDebugName:Le,getDependencyTree:Ne,getAdministration:Me,getGlobalState:function(){return ke},getObserverTree:function(t,e){return Ue(Ie(t,e))},interceptReads:function(t,e,n){var r;if(te(t)||V(t)||X(t))r=Me(t);else{if(!Ct(t))return ie("Expected observable map, object or array as first array");if("string"!=typeof e)return ie("InterceptReads can only be used with a specific property, not with an object in general");r=Me(t,e)}return void 0!==r.dehancer?ie("An intercept reader was already established"):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},isComputingDerivation:Je,isSpyEnabled:x,onReactionError:function(t){return ke.globalReactionErrorHandlers.push(t),function(){var e=ke.globalReactionErrorHandlers.indexOf(t);e>=0&&ke.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:z,resetGlobalState:function(){ke.resetId++;var t=new Ee;for(var e in t)-1===Pe.indexOf(e)&&(ke[e]=t[e]);ke.allowStateChanges=!ke.strictMode},isolateGlobalState:function(){je=!0,ne().__mobxInstanceCount--},shareGlobalState:function(){se("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),Ce=!0;var t=ne(),e=ke;if(t.__mobservableTrackingStack||t.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(t.__mobxGlobal&&t.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");t.__mobxGlobal?ke=t.__mobxGlobal:t.__mobxGlobal=e},spyReport:_,spyReportEnd:A,spyReportStart:S,setReactionScheduler:function(t){var e=hn;hn=function(n){return t((function(){return e(n)}))}}},_n={Reaction:ln,untracked:nn,Atom:d,BaseAtom:h,useStrict:Z,isStrictModeEnabled:function(){return ke.strictMode},spy:O,comparer:vt,asReference:function(t){return se("asReference is deprecated, use observable.ref instead"),Vt.ref(t)},asFlat:function(t){return se("asFlat is deprecated, use observable.shallow instead"),Vt.shallow(t)},asStructure:function(t){return se("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),Vt.struct(t)},asMap:function(t){return se("asMap is deprecated, use observable.map or observable.shallowMap instead"),Vt.map(t||{})},isModifierDescriptor:Wt,isObservableObject:Ct,isBoxedObservable:X,isObservableArray:V,ObservableMap:Qt,isObservableMap:te,map:function(t){return se("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),Vt.map(t)},transaction:Kt,observable:Vt,computed:bn,isObservable:jt,isComputed:function(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Ct(t))return!1;if(!t.$mobx.values[e])return!1;var n=Ie(t,e);return bt(n)}return bt(t)},extendObservable:Rt,extendShallowObservable:It,observe:function(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return Me(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Me(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Me(t,e).intercept(n)}(t,e,n):function(t,e){return Me(t).intercept(e)}(t,e)},autorun:yt,autorunAsync:function(t,e,n,r){var i,o,a,s;"string"==typeof t?(i=t,o=e,a=n,s=r):(i=t.name||"AutorunAsync@"+re(),o=t,a=e,s=n),oe(!1===st(o),Y("m006")),void 0===a&&(a=1),s&&(o=o.bind(s));var u=!1,l=new ln(i,(function(){u||(u=!0,setTimeout((function(){u=!1,l.isDisposed||l.track(c)}),a))}));function c(){o(l)}return l.schedule(),l.getDisposer()},when:function(t,e,n,r){var i,o,a,s;return"string"==typeof t?(i=t,o=e,a=n,s=r):(i="When@"+re(),o=t,a=e,s=n),yt(i,(function(t){if(o.call(s)){t.dispose();var e=rn();a.call(s),on(e)}}))},reaction:mt,action:ot,isAction:st,runInAction:function(t,e,n){var r="string"==typeof t?t:t.name||"<unnamed action>",i="function"==typeof t?t:e,o="function"==typeof t?e:n;return oe("function"==typeof i,Y("m002")),oe(0===i.length,Y("m003")),oe("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),q(r,i,o,void 0)},expr:function(t,e){return Je()||console.warn(Y("m013")),bn(t,{context:e}).get()},toJS:wn,createTransformer:function(t,e){oe("function"==typeof t&&t.length<2,"createTransformer expects a function that accepts one argument");var n={},r=ke.resetId,i=function(r){function i(e,n){var i=r.call(this,(function(){return t(n)}),void 0,vt.default,"Transformer-"+t.name+"-"+e,void 0)||this;return i.sourceIdentifier=e,i.sourceObject=n,i}return f(i,r),i.prototype.onBecomeUnobserved=function(){var t=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],e&&e(t,this.sourceObject)},i}(gt);return function(t){r!==ke.resetId&&(n={},r=ke.resetId);var e=function(t){if("string"==typeof t||"number"==typeof t)return t;if(null===t||"object"!=typeof t)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+t);var e=t.$transformId;return void 0===e&&me(t,"$transformId",e=re()),e}(t),o=n[e];return o?o.get():(o=n[e]=new i(e,t)).get()}},whyRun:function(t,e){return se("`whyRun` is deprecated in favor of `trace`"),(t=un(arguments))?bt(t)||vn(t)?sn(t.whyRun()):ie(Y("m025")):sn(Y("m024"))},isArrayLike:function(t){return Array.isArray(t)||V(t)},extras:xn},Sn=!1,Tn=function(t){var e=_n[t];Object.defineProperty(_n,t,{get:function(){return Sn||(Sn=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),e}})};for(var An in _n)Tn(An);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:O,extras:xn});var On=i(803),Pn=i.n(On),En={value:()=>{}};function kn(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Cn(r)}function Cn(t){this._=t}function jn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Dn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=En,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Cn.prototype=kn.prototype={constructor:Cn,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=Dn(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Dn(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=jn(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Cn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Rn=kn;var In,Mn,Ln=0,Nn=0,Fn=0,Un=1e3,zn=0,Bn=0,Vn=0,Gn="object"==typeof performance&&performance.now?performance:Date,Wn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xn(){return Bn||(Wn(Hn),Bn=Gn.now()+Vn)}function Hn(){Bn=0}function Yn(){this._call=this._time=this._next=null}function $n(t,e,n){var r=new Yn;return r.restart(t,e,n),r}function qn(){Bn=(zn=Gn.now())+Vn,Ln=Nn=0;try{!function(){Xn(),++Ln;for(var t,e=In;e;)(t=Bn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ln}()}finally{Ln=0,function(){for(var t,e,n=In,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:In=e);Mn=t,Kn(r)}(),Bn=0}}function Zn(){var t=Gn.now(),e=t-zn;e>Un&&(Vn-=e,zn=t)}function Kn(t){Ln||(Nn&&(Nn=clearTimeout(Nn)),t-Bn>24?(t<1/0&&(Nn=setTimeout(qn,t-Gn.now()-Vn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(zn=Gn.now(),Fn=setInterval(Zn,Un)),Ln=1,Wn(qn)))}Yn.prototype=$n.prototype={constructor:Yn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Xn():+n)+(null==e?0:+e),this._next||Mn===this||(Mn?Mn._next=this:In=this,Mn=this),this._call=t,this._time=n,Kn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Kn())}};const Jn=4294967296;function Qn(t){return t.x}function tr(t){return t.y}var er=Math.PI*(3-Math.sqrt(5));function nr(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,h,d=t._root,p={data:r},v=t._x0,y=t._y0,m=t._x1,g=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function rr(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ir(t){return t[0]}function or(t){return t[1]}function ar(t,e,n){var r=new sr(null==e?ir:e,null==n?or:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function sr(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ur(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var lr=ar.prototype=sr.prototype;function cr(t){return function(){return t}}function fr(t){return 1e-6*(t()-.5)}function hr(){var t,e,n,r,i,o=cr(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=ar(t,Qn,tr).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/u<p)return p<s&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:cr(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l}function dr(t){return t.x+t.vx}function pr(t){return t.y+t.vy}function vr(t){return t.index}function yr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}lr.copy=function(){var t,e,n=new sr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ur(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=ur(e));return n},lr.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return nr(this.cover(e,n),e,n,t)},lr.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)nr(this,a[n],s[n],t[n]);return this},lr.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},lr.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},lr.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},lr.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new rr(v,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<c||(s=u.y1)<f))if(v.length){var y=(i+a)/2,m=(o+s)/2;p.push(new rr(v[3],y,m,a,s),new rr(v[2],i,m,y,s),new rr(v[1],y,o,a,m),new rr(v[0],i,o,y,m)),(l=(e>=m)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var g=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),w=g*g+b*b;if(w<n){var x=Math.sqrt(n=w);c=t-x,f=e-x,h=t+x,d=e+x,r=v.data}}return r},lr.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,h,d=this._root,p=this._x0,v=this._y0,y=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(v+m)/2))?v=u:m=u,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},lr.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},lr.root=function(){return this._root},lr.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},lr.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new rr(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new rr(n,l,c,o,a)),(n=u[2])&&s.push(new rr(n,r,c,l,a)),(n=u[1])&&s.push(new rr(n,l,i,o,c)),(n=u[0])&&s.push(new rr(n,r,i,l,c))}return this},lr.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new rr(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new rr(o,a,s,c,f)),(o=i[1])&&n.push(new rr(o,c,s,u,f)),(o=i[2])&&n.push(new rr(o,a,f,c,l)),(o=i[3])&&n.push(new rr(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},lr.x=function(t){return arguments.length?(this._x=t,this):this._x},lr.y=function(t){return arguments.length?(this._y=t,this):this._y};var mr=256,gr=4096,br=25,wr="#ededed",xr={position:"absolute",top:0,bottom:0,left:0,right:0},_r=function(){return window.devicePixelRatio||1},Sr=["NVL_basic-wrapper","NVL_interactive-wrapper"];function Tr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ar(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Or=function(t){var e=new Map;return t.forEach((function(t){var n=t.id,r=t.from,i=t.to,o=t.color,a=t.width,s=t.disabled,u=[r,i].sort(),l="".concat(u[0],".").concat(u[1]),c=e.get(l);c?c.bundledRels.push({id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}):e.set(l,{bundledRels:[{id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}],key:l,from:r,to:i,color:null!=o?o:void 0,disabled:null!=s&&s,width:0})})),e.forEach((function(t){var e=(0,n.uniqBy)(t.bundledRels,"disabled"),r=1===e.length&&!0===e[0].disabled,i=1===e.length&&!0!==e[0].disabled;if(r)t.color=wr,t.width=1;else{var o=t.bundledRels.filter((function(t){return!0!==t.disabled})),a=(0,n.uniqBy)(o,"color");i?(t.color=a.length>1?void 0:t.bundledRels[0].color,t.bundledRels.forEach((function(e){t.width+=e.width}))):(t.color=1===a.length?a[0].color:void 0,t.disabled=!1,t.bundledRels.forEach((function(e){t.width+=!0!==e.disabled?e.width:0})))}})),Array.from(e.values())},Pr=function(){return void 0!==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t}))};function Er(t){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(t)}var kr=function(t){var e,n;return"number"==typeof t.source||"number"==typeof t.target||"string"==typeof t.source||"string"==typeof t.target?45*devicePixelRatio:(null!==(e=t.source.size)&&void 0!==e?e:br)+(null!==(n=t.target.size)&&void 0!==n?n:br)+90*devicePixelRatio};function Cr(t){return"object"===Er(t)}var jr=function(t){var e;return(null!==(e=t.size)&&void 0!==e?e:br)+25*devicePixelRatio},Dr=function(){return-400*Math.pow(devicePixelRatio,2)},Rr=function(){return 2*Dr()};function Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(t)}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fr(r.key),r)}}function Fr(t){var e=function(t,e){if("object"!=Ir(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ir(e)?e:String(e)}var Ur="d3ForceLayout",zr=function(t){return t?wn(t):t},Br=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.d3Nodes={},this.d3RelList={},this.computing=!0,this.center={x:0,y:0},this.nodeRelCount=[];var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Ur),a.addChannel(Ur),this.simulation=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=$n(f),l=Rn("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Jn)/Jn}();function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*er;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}().velocityDecay(.4).force("charge",hr().strength(Dr)).force("centerX",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).force("centerY",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).alpha(1).alphaMin(.05).on("end",(function(){n.simulationStopped=!0,n.shouldUpdate=!1,n.shouldReheatNodes=!1,n.shouldCountNodeRels=!1})).stop(),this.simulationStopped=!0,this.shouldUpdate=!0,this.shouldReheatNodes=!1,this.shouldCountNodeRels=!0,this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){var t=o.channels[Ur];if(void 0!==o.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),s=Pr(i);e||r||s?(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0):n.shouldReheatNodes=!1}var u=a.channels[Ur];if(void 0!==a.version&&u){var l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;(l||c)&&(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0)}})))}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e=this;t.forEach((function(t){void 0===e.d3Nodes[t.id]&&(e.d3Nodes[t.id]={id:t.id}),null!=t&&t.pinned?(e.d3Nodes[t.id].fx=t.x,e.d3Nodes[t.id].fy=t.y):(e.d3Nodes[t.id].x=t.x,e.d3Nodes[t.id].y=t.y),e.d3Nodes[t.id].vy=0,e.d3Nodes[t.id].vx=0})),this.shouldUpdate=!0,this.simulation.tick().alpha(.2)}},{key:"update",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||n){var r=this.state,i=r.nodes,o=r.rels,a=i.channels[Ur],s=o.channels[Ur],u=Object.values(a.adds).length>0,l=Object.values(s.adds).length>0,c=Object.values(a.removes).length>0,f=Object.values(s.removes).length>0,h=Object.values(a.updates).length>0;if(u||l||c||f||h){var d=u&&0===Object.keys(this.d3Nodes).length,p=zr(a.removes);Object.keys(p).forEach((function(t){delete e.d3Nodes[t]}));var v=zr(a.adds);if(Object.keys(v).forEach((function(t){e.d3Nodes[t]=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Fr(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},v[t])})),h&&Object.values(a.updates).forEach((function(t){!0===t.pinned?(e.d3Nodes[t.id].fx=e.d3Nodes[t.id].x,e.d3Nodes[t.id].fy=e.d3Nodes[t.id].y):!1===t.pinned&&(e.d3Nodes[t.id].fx=null,e.d3Nodes[t.id].fy=null),void 0!==t.size&&(e.d3Nodes[t.id].size=t.size)})),(l||f)&&(this.d3RelList=Or(zr(o.items)).filter((function(t){return t.from!==t.to})).map((function(t,e){return{source:t.from,target:t.to,index:e}}))),d){var y=Object.values(this.d3Nodes);!function(t,e,n){var r=t.filter((function(t){return void 0===t.x&&void 0===t.y}));r.forEach((function(t,i){t.x=e.x+n*Math.sin(2*Math.PI*i/r.length),t.y=e.y+n*Math.cos(2*Math.PI*i/r.length)}))}(y,this.center,(t=y.length,45*t/(2*Math.PI)))}this.layout(i.items,o.items,d)}i.clearChannel(Ur),o.clearChannel(Ur),this.shouldUpdate=!1,this.simulation.alpha()>this.simulation.alphaMin()&&(this.shouldUpdate=!0,this.simulationStopped&&(this.simulation.restart(),this.simulationStopped=!1))}}},{key:"layout",value:function(t,e,r){var i=this;if(!(0,n.isEmpty)(this.d3Nodes)){if(this.simulation.stop(),this.simulation.nodes(Object.values(this.d3Nodes)).force("collide",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=ar(e,dr,pr).visitAfter(s),t=0;t<d;++t)u=e[t],f=n[u.index],h=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(v);function v(t,e,n,o,a){var s=t.data,d=t.r,p=f+d;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var v=l-s.x-s.vx,y=c-s.y-s.vy,m=v*v+y*y;m<p*p&&(0===v&&(m+=(v=fr(r))*v),0===y&&(m+=(y=fr(r))*y),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(v*=m)*(p=(d*=d)/(h+d)),u.vy+=(y*=m)*p,s.vx-=v*(p=1-p),s.vy-=y*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=cr(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),u(),a):t},a}().radius(jr)),this.shouldCountNodeRels&&(this.nodeRelCount=this.countNodeRels()),this.simulation.force("link",function(t){var e,n,r,i,o,a,s=vr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=cr(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,h,d,p,v,y=0;y<s;++y)l=(u=t[y]).source,h=(f=u.target).x+f.vx-l.x-l.vx||fr(a),d=f.y+f.vy-l.y-l.vy||fr(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[y])/p*r*e[y],d*=p,f.vx-=h*(v=o[y]),f.vy-=d*v,l.vx+=h*(v=1-v),l.vy+=d*v}function h(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=yr(f,u.source)),"object"!=typeof u.target&&(u.target=yr(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"==typeof t?t:cr(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:cr(+t),p(),f):l},f}(this.d3RelList).id((function(t){return t.id})).distance(kr).strength((function(t){return function(t,e){if(!Cr(t.source)||!Cr(t.target))return 1;var n=1.2/(Math.min(e[t.source.index],e[t.target.index])+(Math.max(e[t.source.index],e[t.target.index])-1)/100);return Math.max(Math.min(n,1),.06)}(t,i.nodeRelCount)}))),r){var o=0;this.simulation.force("charge",hr().strength(Rr));for(var a=performance.now();performance.now()-a<300&&o<200;)this.simulation.alpha(1),this.simulation.tick(1),o+=1;this.simulation.force("charge",hr().strength(Dr));for(var s=performance.now();performance.now()-s<100&&this.simulation.alpha()>=this.simulation.alphaMin();)this.simulation.tick(1);return this.computing=!1,void this.simulation.restart()}this.shouldReheatNodes?this.simulation.alpha(1).restart():this.simulation.restart()}}},{key:"getNodePositions",value:function(t){var e,n=[],r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.d3Nodes[i.id];if(void 0!==o){var a={id:o.id,x:o.x,y:o.y};n.push(a)}}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return this.computing}},{key:"terminateUpdate",value:function(){this.simulation.alpha(this.simulation.alphaMin()).stop(),this.simulationStopped=!0}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ur),this.state.rels.removeChannel(Ur),this.simulation.stop()}},{key:"setAlpha",value:function(t){this.simulation.alpha(t),this.simulation.restart(),this.simulation.shouldUpdate=!0}},{key:"countNodeRels",value:function(){for(var t=new Map(Object.entries(this.d3Nodes)),e=Object.values(this.d3RelList),n=new Array(t.length),r=0;r<e.length;++r){var i=e[r];i.index=r,"object"!==Ir(i.source)&&(i.source=t.get(i.source)),"object"!==Ir(i.target)&&(i.target=t.get(i.target)),n[i.source.index]=(n[i.source.index]||0)+1,n[i.target.index]=(n[i.target.index]||0)+1}return n}}],r&&Nr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vr=i(880),Gr=i.n(Vr)().getLogger("NVL");const Wr=(t=>{var e={};return i.d(e,t),e})({createCoseBilkentLayoutWorker:()=>t.createCoseBilkentLayoutWorker,createHierarchicalLayoutWorker:()=>t.createHierarchicalLayoutWorker});function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Hr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hr(Object(n),!0).forEach((function(e){Kr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return qr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}function Kr(t,e,n){return(e=Jr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jr(t){var e=function(t,e){if("object"!=Xr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:String(e)}var Qr=function(t,e,n){return t+(e-t)*function(t){return t*t*(3-2*t)}(n)},ti=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Kr(this,"positions",void 0),Kr(this,"oldPositions",void 0),Kr(this,"startTime",void 0),Kr(this,"t",void 0),Kr(this,"currentT",void 0),Kr(this,"state",void 0),Kr(this,"shouldUpdateAnimator",void 0),Kr(this,"parents",void 0),Kr(this,"animationCompleteCallback",void 0),Kr(this,"shouldUpdate",void 0);var n=e.state;this.positions={},this.oldPositions={},this.startTime=0,this.t=1,this.currentT=1,this.state=n,this.shouldUpdateAnimator=!1,this.parents={},this.animationCompleteCallback=e.animationCompleteCallback}var e,n;return e=t,n=[{key:"getPositionMapFromState",value:function(){var t,e=this.state.nodes,n=e.idToPosition,r={},i=$r(e.items);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id];void 0!==a&&(r[o.id]={id:o.id,x:a.x,y:a.y})}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"updatePositionsFromState",value:function(){this.positions=Yr({},this.getPositionMapFromState())}},{key:"updateOldPositionFromState",value:function(){this.oldPositions=Yr({},this.getPositionMapFromState())}},{key:"startAnimation",value:function(){this.updateOldPositionFromState(),this.startTime=Date.now(),this.t=0,this.currentT=0,this.shouldUpdateAnimator=!0}},{key:"update",value:function(){var t=this.shouldUpdateAnimator,e=(Date.now()-this.startTime)/400;this.t=Math.min(e,1),this.currentT<1?this.shouldUpdateAnimator=!0:(this.shouldUpdateAnimator=!1,t&&!this.shouldUpdateAnimator&&void 0!==this.animationCompleteCallback&&this.animationCompleteCallback(),this.shouldUpdateAnimator||this.updatePositionsFromState())}},{key:"updateNodes",value:function(t){var e,n=$r(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={id:r.id,x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"getNodePositions",value:function(t){var e,n=this.parents,r=this.state.nodes.idToPosition,i=function(t,e){for(var n={x:0,y:0},r=t.length,i=0,o=0;o<r;o++){var a=e[t[o].id];void 0===a||isNaN(a.x)||isNaN(a.y)||0===a.x||0===a.y||(n.x+=a.x,n.y+=a.y,i+=1)}return i>0?[n.x/i,n.y/i]:[0,0]}(t,r),o={x:i[0],y:i[1]},a=[],s=$r(t);try{for(s.s();!(e=s.n()).done;){var u=e.value,l=this.positions[u.id],c=r[u.id],f={id:u.id};if(void 0!==l){for(var h,d,p,v=u.id,y=null!==(h=this.oldPositions[u.id])&&void 0!==h?h:Yr({},o);void 0===y&&void 0!==n[v];)v=n[v],y=this.oldPositions[v];y.x=null!==(d=y.x)&&void 0!==d?d:o.x,y.y=null!==(p=y.y)&&void 0!==p?p:o.y,f.x=Qr(y.x,l.x,this.t),f.y=Qr(y.y,l.y,this.t)}else void 0!==c&&(f.x=c.x||o.x,f.y=c.y||o.y);a.push(f)}}catch(t){s.e(t)}finally{s.f()}return this.currentT=this.t,a}}],n&&Zr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ei(t){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(t)}function ni(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ri(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ni(Object(n),!0).forEach((function(e){vi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ii(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ai(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oi(t){return function(t){if(Array.isArray(t))return si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ai(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ai(t,e){if(t){if("string"==typeof t)return si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yi(r.key),r)}}function li(t,e,n){return e=di(e),function(t,e){if(e&&("object"===ei(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fi(t)}(t,ci()?Reflect.construct(e,n||[],di(t).constructor):e.apply(t,n))}function ci(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ci=function(){return!!t})()}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hi(){return hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=di(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},hi.apply(this,arguments)}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(t)}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t,e,n){return(e=yi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yi(t){var e=function(t,e){if("object"!=ei(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ei(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ei(e)?e:String(e)}var mi=function(t){return void 0!==t?wn(t):t},gi=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),vi(fi(n=li(this,e,[t])),"stateDisposers",void 0),vi(fi(n),"cytoCompleteCallback",void 0),vi(fi(n),"computing",void 0),vi(fi(n),"pendingLayoutData",void 0),vi(fi(n),"worker",void 0),n.stateDisposers=[],n.stateDisposers.push(n.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var r=n.state,i=r.nodes,o=r.rels;return n.cytoCompleteCallback=t.cytoCompleteCallback,n.shouldUpdate=!0,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createCoseBilkentLayoutWorker)(),n.worker.port.start(),n.setOptions(),n.layout(i.items,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(){this.shouldUpdate=!0}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.shouldUpdate||t){var i=mi(n),o=mi(r);(i.length>0||o.length>0)&&(this.updatePositionsFromState(),this.layout(i,o))}hi(di(e.prototype),"update",this).call(this),this.shouldUpdate=!1}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e){var n=this;if(t.length){var r=t.map((function(t){return{group:"nodes",data:{id:t.id}}})),i=e.map((function(t){return{group:"edges",data:{id:"rel".concat(t.id),source:t.from,target:t.to}}})),o={elements:[].concat(oi(r),oi(i)),spacingFactor:t.reduce((function(t,e){var n;return t+(null!==(n=e.size)&&void 0!==n?n:br)}),0)/t.length*4.5/50*_r()};this.computing?this.pendingLayoutData=o:(this.computing=!0,this.worker.port.onmessage=function(t){var e=t.data.positions;if(n.computing){for(var r=0,i=Object.entries(e);r<i.length;r++){var o=ii(i[r],2),a=o[0],s=o[1];n.positions[a]=ri({id:a},s)}n.cytoCompleteCallback(),n.startAnimation()}n.computing=!1,n.shouldUpdate=!0},setTimeout((function(){n.computing&&n.worker.port.postMessage(o)}),0))}}},{key:"terminateUpdate",value:function(){this.computing=!1}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.worker.port.close()}}],r&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti),bi="undefined"!=typeof Float32Array?Float32Array:Array;function wi(){var t=new bi(16);return bi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var xi=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t},_i=i(792),Si=i.n(_i);function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pi(r.key),r)}}function Oi(t,e,n){return(e=Pi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pi(t){var e=function(t,e){if("object"!=Ti(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:String(e)}var Ei=function(){function t(e,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Oi(this,"shaderProgram",void 0),Oi(this,"gl",void 0),Oi(this,"curTexture",void 0),Oi(this,"attributeInfo",void 0),Oi(this,"uniformInfo",void 0);var a=e.createShader(e.FRAGMENT_SHADER);if(!e.isShader(a))throw new Error("Could not create shader object");var s=Si()(i,o);e.shaderSource(a,s),e.compileShader(a),(0,n.isNil)(e.getShaderParameter(a,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(a));var u=e.createShader(e.VERTEX_SHADER);if(!e.isShader(u))throw new Error("Could not create shader object");var l=Si()(r,o);if(e.shaderSource(u,l),e.compileShader(u),(0,n.isNil)(e.getShaderParameter(u,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(u)),this.shaderProgram=e.createProgram(),e.attachShader(this.shaderProgram,a),e.attachShader(this.shaderProgram,u),e.linkProgram(this.shaderProgram),(0,n.isNil)(e.getProgramParameter(this.shaderProgram,e.LINK_STATUS)))throw new Error("Could not initialise shader");this.gl=e,this.curTexture=0,this.scanUniforms(),this.scanAttributes()}var e,r;return e=t,r=[{key:"setUniform",value:function(t,e){var n=this.gl,r=this.uniformInfo[t];if(void 0===r)throw new Error("Shader.setUniform - Uniform ".concat(t," not found in shader"));switch(r.type){case n.INT:n.uniform1i(r.location,e);break;case n.INT_VEC2:n.uniform2iv(r.location,e);break;case n.INT_VEC3:n.uniform3iv(r.location,e);break;case n.INT_VEC4:n.uniform4iv(r.location,e);break;case n.SAMPLER_2D:n.activeTexture(n.TEXTURE0+r.texture),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(r.location,r.texture);break;case n.SAMPLER_CUBE:case n.FLOAT:n.uniform1f(r.location,e);break;case n.FLOAT_VEC2:n.uniform2fv(r.location,e);break;case n.FLOAT_VEC3:n.uniform3fv(r.location,e);break;case n.FLOAT_VEC4:n.uniform4fv(r.location,e);break;case n.FLOAT_MAT2:n.uniformMatrix2fv(r.location,!1,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(r.location,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(r.location,!1,e)}}},{key:"setAttributePointer",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t],a=n*Float32Array.BYTES_PER_ELEMENT,s=r*Float32Array.BYTES_PER_ELEMENT;i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,s,a)}},{key:"setAttributePointerFloat",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,r,n)}},{key:"setAttributePointerUShort",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_SHORT,!1,r,n)}},{key:"setAttributePointerByteNorm",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!0,r,n)}},{key:"setAttributePointerByte",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!1,r,n)}},{key:"use",value:function(){this.gl.useProgram(this.shaderProgram)}},{key:"remove",value:function(){this.gl.deleteProgram(this.shaderProgram)}},{key:"scanAttributes",value:function(){var t=this.gl;this.attributeInfo={};for(var e,n,r=t.getProgramParameter(this.shaderProgram,t.ACTIVE_ATTRIBUTES),i=0;i<r;i++)e=t.getActiveAttrib(this.shaderProgram,i),n=t.getAttribLocation(this.shaderProgram,e.name),this.attributeInfo[e.name]={type:e.type,position:n}}},{key:"scanUniforms",value:function(){var t=this.gl;this.uniformInfo={};for(var e,n=t.getProgramParameter(this.shaderProgram,t.ACTIVE_UNIFORMS),r=0;r<n;r++){e=t.getActiveUniform(this.shaderProgram,r);var i=t.getUniformLocation(this.shaderProgram,e.name),o={type:e.type,location:i};e.type===t.SAMPLER_2D&&(o.texture=this.curTexture,this.curTexture+=1),this.uniformInfo[e.name]=o}}}],r&&Ai(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function Ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ji(r.key),r)}}function ji(t){var e=function(t,e){if("object"!=ki(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ki(e)?e:String(e)}function Di(t){var e="function"==typeof Map?new Map:void 0;return Di=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Ri())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ii(i,n.prototype),i}(t,arguments,Mi(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ii(n,t)},Di(t)}function Ri(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ri=function(){return!!t})()}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Mi(t){return Mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mi(t)}var Li=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=arguments,n=Mi(n=e),function(t,e){if(e&&("object"===ki(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ri()?Reflect.construct(n,r||[],Mi(t).constructor):n.apply(t,r));var t,n,r}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&Ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Di(Error));const Ni="uniform mat4 u_projection;\n\nattribute vec2 a_position;\n//attribute float a_index;\n\n//varying highp float index;\n\nvoid main() {\n// index = a_index;\n gl_Position = u_projection * vec4(a_position, 0.0, 1.0);\n}";function Fi(t){return Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(t)}function Ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zi(r.key),r)}}function zi(t){var e=function(t,e){if("object"!=Fi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:String(e)}var Bi=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=this.constructGraphObjects(e,n),this.subGraphs=[],this.sunMap={}}var e,n;return e=t,n=[{key:"constructGraphObjects",value:function(t,e){var n=new Array(t.nodes.length),r=new Array(t.rels.length),i={},o=[];return t.nodes.forEach((function(t,e){n[e]=[],r[e]=[],o.push(t)})),t.rels.forEach((function(t){var o=e[t.from],a=e[t.to];void 0!==o&&void 0!==a&&(n[o].push(a),n[a].push(o),r[o].push(t.id),r[a].push(t.id),i[t.id]=t)})),this.relIdMap=r,{nodes:o,relationships:n,idToRel:i}}},{key:"coarsenTo",value:function(t){for(var e=this.graph,n=e.nodes.length,r=0;e.nodes.length>t&&e.relationships.some((function(t){return t.length>0}));){var i=this.coarsen(e,0===r);if(0===r&&(this.nodeSortMap=i.nodeSortMap),this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,r++}return this.subGraphs.push(e),e}},{key:"coarsenBy",value:function(t){for(var e=this.graph,n=e.nodes.length,r=t;t>0;){var i=this.coarsen(e,t===r);if(this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,t--}return this.subGraphs.push(e),e}},{key:"coarsen",value:function(t,e){var n=this,r=t.nodes,i=t.relationships,o=r.map((function(t,e){return e})),a={},s={};r.forEach((function(t,e){a[e]=t,s[t.id]=e}));for(var u=i.map((function(t){return t.slice()})),l={suns:{},planets:{},moons:{}},c=[],f=[],h=function(){var t=o[0];o.splice(o.indexOf(t),1),i[t].forEach((function(e){var n=o.indexOf(e);n>=0&&o.splice(n,1);var r=-1,i=u[e];i.forEach((function(e,n){var i=o.indexOf(e);i>=0?o.splice(i,1):e===t&&(r=n)})),i.splice(r,1)}));var n={id:t};if(e)n.originalId=a[t].id;else{var r=a[t];n.finestIndex=r.finestIndex,n.originalId=r.originalId}c.push(n),l.suns[t]=n};o.length>0;)h();c.forEach((function(t,e){f[e]=[]})),c.forEach((function(t,n){var r={},o=[];i[t.id].forEach((function(i){if(i!==t.id&&!r[i]){var s={id:i,parent:t,sunId:n,moons:[]},u=a[i];s.size=function(){return s.moons.length+1},s.weight=u.weight||1,s.children=function(){return s.moons},e?s.originalId=u.id:(s.finestIndex=u.finestIndex,s.originalId=u.originalId),o.push(s),r[i]=!0}})),o.forEach((function(t){l.planets[t.id]=t})),t.planets=o,t.children=function(){return t.planets},t.weight=t.planets.reduce((function(t,e){return t+(e.weight||1)}),0)+(a[t.id].weight||1),t.size=function(){return t.planets.reduce((function(t,e){return t+e.size()}),0)+1}}));var d=r.filter((function(t,e){return!c.find((function(t){return t.id===e}))&&!l.planets[e]})),p=[];d.forEach((function(t){for(var n=s[t.id],r=u[n],i=null,o=-1,c=0;c<r.length;c++){var f=r[c];if(f!==n&&(i=l.planets[f])){o=c;break}}if(r.splice(o,1),i){var h={id:n,size:function(){return 0}};h.weight=a[n].weight||1,h.parent=i,h.sunId=i.sunId,e?h.originalId=t.id:(h.finestIndex=t.finestIndex,h.originalId=t.originalId),l.moons[n]=h,i.moons.push(h),i.weight+=h.weight,i.parent.weight+=h.weight;var d=u[i.id];d.splice(d.indexOf(n),1)}else p.push(t)})),u.forEach((function(t,e){if(!l.suns[e]){var n=l.planets[e]||l.moons[e];u[e].forEach((function(t){var e=l.planets[t];if(e||(e=l.moons[t]),n.sunId!==e.sunId){var r=f[n.sunId];r.includes(e.sunId)||r.push(e.sunId)}}))}}));var v=[],y=0,m={};c.forEach((function(t,i){var o=r[t.id];m[t.id]=y,t.previousIndex=i,t.id=y++,e&&(o.finestIndex=t.id,t.finestIndex=t.id),v.push(o),t.planets.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o),i.moons.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o)}))}))}));var g=[],b=[];return i.forEach((function(t,r){var i=m[r];g[i]=t.map((function(t){return m[t]})),e&&(b[i]=t.map((function(t,e){return n.relIdMap[r][e]})))})),b&&b.length>0&&(this.relIdMap=b),{output:{nodes:c,relationships:f},sortedInput:{nodes:v,relationships:g},nodeSortMap:m}}}],n&&Ui(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vi=function(t,e,n){for(var r=2*Math.PI/n,i=[],o=0;o<n;o++){var a=r*o;i.push({x:t.x+e*Math.cos(a),y:t.y+e*Math.sin(a)})}return i};function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Wi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$i(r.key),r)}}function Yi(t,e,n){return(e=$i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $i(t){var e=function(t,e){if("object"!=Gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gi(e)?e:String(e)}var qi="PhysLayout",Zi=new Float32Array(4),Ki=256,Ji=function(t){for(var e={},n={},r=0;r<t.length;r++)e[t[r].id]=r,n[r]=t[r].id;return{nodeIdToIndex:e,nodeIndexToId:n}},Qi=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yi(this,"physVbo",void 0),Yi(this,"physSmallVbo",void 0),Yi(this,"physProjection",void 0),Yi(this,"physSmallProjection",void 0),Yi(this,"gl",void 0),Yi(this,"useReadpixelWorkaround",void 0),Yi(this,"averageNodeSize",void 0),Yi(this,"shouldUpdate",void 0),Yi(this,"iterationCount",void 0),Yi(this,"lastSpeedValues",void 0),Yi(this,"rollingAvgGraphSpeed",void 0),Yi(this,"nodeVariation",void 0),Yi(this,"nodeCenterPoint",void 0),Yi(this,"peakIterationMultiplier",void 0),Yi(this,"stateDisposers",void 0),Yi(this,"state",void 0),Yi(this,"dpr",void 0),Yi(this,"intelWorkaround",void 0),Yi(this,"simulationStopVelocitySquared",void 0),Yi(this,"gravity",void 0),Yi(this,"force",void 0),Yi(this,"nodeIdToIndex",void 0),Yi(this,"nodeIndexToId",void 0),Yi(this,"numNodes",void 0),Yi(this,"solarMerger",void 0),Yi(this,"subGraphs",void 0),Yi(this,"nodeSortMap",void 0),Yi(this,"firstUpdate",void 0),Yi(this,"curPhysData",void 0),Yi(this,"apprxRepForceShader",void 0),Yi(this,"levelsClusterTexture",void 0),Yi(this,"levelsFinestIndexTexture",void 0),Yi(this,"initalLevelTexture",void 0),Yi(this,"levelsData",void 0),Yi(this,"collisionDetectionMultiplier",void 0),Yi(this,"physShader",void 0),Yi(this,"physData",void 0),Yi(this,"workaroundData",void 0),Yi(this,"pinData",void 0),Yi(this,"updateData",void 0),Yi(this,"updateShader",void 0),Yi(this,"workaroundShader",void 0),Yi(this,"physPositions",void 0),Yi(this,"springTexture",void 0),Yi(this,"sizeTexture",void 0),Yi(this,"offsetTexture",void 0),Yi(this,"pinTexture",void 0),Yi(this,"addedNodes",void 0),Yi(this,"updateTexture",void 0),Yi(this,"enableVerlet",void 0);var r=e.state,i=e.webGLContext;if(Gr.info("layout - webGLContext",Boolean(i)),void 0===e.webGLContext)throw new Error("PhysLayout missing options: webGLContext - webgl context");if(void 0===e.state)throw new Error("PhysLayout missing options: state - state object");var o=i;this.checkCompatibility(o),this.printGlStats(o),this.physVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physVbo);var a=new Float32Array([0,0,mr,0,0,mr,mr,mr]);o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),this.physSmallVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physSmallVbo);var s=new Float32Array([0,0,Ki,0,0,Ki,Ki,Ki]);o.bufferData(o.ARRAY_BUFFER,s,o.STATIC_DRAW),this.physProjection=wi(),xi(this.physProjection,0,mr,mr,0,0,1e6),this.physSmallProjection=wi(),xi(this.physSmallProjection,0,Ki,Ki,0,0,1e6),o.disable(o.DEPTH_TEST),this.gl=o,this.useReadpixelWorkaround&&this.setupReadpixelWorkaround(),this.setupUpdates(),this.averageNodeSize=br,this.shouldUpdate=!0,this.iterationCount=0,this.lastSpeedValues=[],this.rollingAvgGraphSpeed=0,this.nodeVariation=0,this.nodeCenterPoint=[0,0],this.peakIterationMultiplier=160,this.setOptions(e,!0),this.definePhysicsArrays();var u=r.nodes,l=r.rels;u.addChannel(qi),l.addChannel(qi),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[qi];if(void 0!==u.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),o=Pr(i);(e||r||o)&&(n.shouldUpdate=!0,n.checkForUpdates())}var a=l.channels[qi];if(void 0!==l.version&&a){var s=Object.values(a.adds).length>0,c=Object.values(a.removes).length>0;(s||c)&&(n.shouldUpdate=!0,n.checkForUpdates())}}))),this.setData({nodes:u.items,rels:l.items}),this.state=r,this.dpr=window.devicePixelRatio||1}var e,n;return e=t,n=[{key:"setOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t.intelWorkaround,r=t.simulationStopVelocity,i=t.gravity,o=t.enableVerlet,a=void 0!==o&&o;e&&(this.intelWorkaround=n,this.enableVerlet=a);var s=this.enableVerlet?.1:null!=r?r:100;this.simulationStopVelocitySquared=s*s,this.gravity=null!=i?i:100,this.force=0}}},{key:"setData",value:function(t){var e=Ji(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this.nodeIdToIndex=n,this.nodeIndexToId=r,this.numNodes=t.nodes.length,this.solarMerger=new Bi(t,n),this.solarMerger.coarsenTo(1),this.subGraphs=this.solarMerger.subGraphs,this.nodeSortMap=this.solarMerger.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]),this.setupPhysics(),this.firstUpdate=!0,this.curPhysData=0,this.shouldUpdate=!0,this.iterationCount=0,this.subGraphs[0]}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.gl;if(this.checkForUpdates(t),!this.shouldUpdate)return e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this.physPositions),!1;e.disable(e.BLEND);for(var n=this.nodeVariation/(this.numNodes||1)>.3,r=this.getScaleNumber(this.iterationCount),i=this.subGraphs?this.subGraphs.length:0,o=this.getPhysData(0).texture,a=i-1;a>0;a--){var s=this.subGraphs[a].nodes.length,u=a===i-1;this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_physData",o),this.apprxRepForceShader.setUniform("u_clusterData",this.levelsClusterTexture[a]),this.apprxRepForceShader.setUniform("u_finestIndexes",this.levelsFinestIndexTexture[a]),this.apprxRepForceShader.setUniform("u_prevForce",u?this.initalLevelTexture:this.levelsData[a+1].texture),this.apprxRepForceShader.setUniform("u_numNodes",s),this.apprxRepForceShader.setUniform("u_iterationMultiplier",r),this.apprxRepForceShader.setUniform("u_baseLength",this.getBaseLength(s)),this.apprxRepForceShader.setUniform("u_isTopLevel",u?1:0),e.bindBuffer(e.ARRAY_BUFFER,this.physSmallVbo),this.apprxRepForceShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.levelsData[a].frameBuffer),e.viewport(0,0,Ki,Ki),e.drawArrays(e.TRIANGLE_STRIP,0,4)}if(this.collisionDetectionMultiplier=0,this.collisionDetectionMultiplier=n?Math.min(this.iterationCount/Math.min(this.numNodes,300),1):1,this.force=i<=1?this.initalLevelTexture:this.levelsData[1].texture,this.physShader.use(),this.physShader.setUniform("u_prevForce",i<=1?this.initalLevelTexture:this.levelsData[1].texture),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_physData",o),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_iterationMultiplier",r),this.physShader.setUniform("u_curIteration",this.iterationCount),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_clusterData",this.levelsClusterTexture[0]),this.physShader.setUniform("u_collisionMultiplier",this.collisionDetectionMultiplier),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.firstUpdate=!1,e.bindBuffer(e.ARRAY_BUFFER,this.physVbo),this.physShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(1).frameBuffer),e.viewport(0,0,mr,mr),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.useReadpixelWorkaround?this.doReadpixelWorkaround():(e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this.physPositions)),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.iterationCount+=1,this.numNodes<2)this.shouldUpdate=!1,this.iterationCount=0;else if(this.iterationCount%5==0){var l=this.iterationCount<300,c=l?this.getMaxSpeedSquared():this.getMedianSpeedSquared(this.addedNodes);this.lastSpeedValues.push(c),this.rollingAvgGraphSpeed=this.lastSpeedValues.reduce((function(t,e){return t+e}),0)/this.lastSpeedValues.length;var f=l&&c>=this.rollingAvgGraphSpeed,h=this.simulationStopVelocitySquared&&this.rollingAvgGraphSpeed<this.simulationStopVelocitySquared;this.lastSpeedValues.length>20&&this.lastSpeedValues.shift(),!f&&!0===h&&this.iterationCount>2&&this.terminateUpdate()}return this.shouldUpdate}},{key:"terminateUpdate",value:function(){Gr.info("Cooling down after ".concat(this.iterationCount," iterations at graph speed of ").concat(Math.sqrt(this.rollingAvgGraphSpeed))),this.shouldUpdate=!1,this.iterationCount=0,this.rollingAvgGraphSpeed=0,this.lastSpeedValues=[],this.addedNodes=null,this.nodeVariation=0}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"getNodePositions",value:function(t){var e=[];if(this.useReadpixelWorkaround){var n,r=Wi(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.nodeIdToIndex[i.id],a=i.id,s=void 0,u=void 0;void 0!==o&&(s=this.workaroundData[0].dataFloat[o],u=this.workaroundData[1].dataFloat[o]),e.push({id:a,x:s,y:u})}}catch(t){r.e(t)}finally{r.f()}}else{var l,c=Wi(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=this.nodeIdToIndex[f.id],d=f.id,p=void 0,v=void 0;void 0!==h&&(p=this.physPositions[4*h+0],v=this.physPositions[4*h+1]),e.push({id:d,x:p,y:v})}}catch(t){c.e(t)}finally{c.f()}}return e}},{key:"reheat",value:function(t){this.setupSize(this.subGraphs[0]),this.shouldUpdate=!0,this.iterationCount=0,this.nodeVariation=t.nodes.length}},{key:"updateNodes",value:function(t){var e=this.gl,n=new Set;e.bindTexture(e.TEXTURE_2D,this.getPhysData().texture);var r,i=Wi(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.nodeIdToIndex[o.id];if(void 0!==o.x&&void 0!==o.y){Zi[0]=o.x,Zi[1]=o.y,Zi[2]=0,Zi[3]=0;var s=a%mr,u=(a-s)/mr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,Zi),this.useReadpixelWorkaround?(this.workaroundData[0].dataFloat[a]=o.x,this.workaroundData[1].dataFloat[a]=o.y):(this.physPositions[4*a+0]=o.x,this.physPositions[4*a+1]=o.y)}void 0!==o.pinned&&(this.pinData[a]=o.pinned?255:0),Object.keys(o).forEach((function(t){return n.add(t)}))}}catch(t){i.e(t)}finally{i.f()}n.has("pinned")&&(e.bindTexture(e.TEXTURE_2D,this.pinTexture),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,mr,mr,0,e.ALPHA,e.UNSIGNED_BYTE,this.pinData)),(n.has("x")||n.has("y")||n.has("size"))&&(this.shouldUpdate=!0,this.iterationCount=0)}},{key:"addRemoveData",value:function(t,e){var n=this.gl;this.numNodes=t.nodes.length,this.physShader.use(),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_baseLength",this.getBaseLength());var r=Ji(t.nodes).nodeIdToIndex,i=new Bi(t,r);i.coarsenTo(1);var o=i.subGraphs[0],a=this.subGraphs[0],s=function(t){return a.nodes.findIndex((function(e){return e.id===t}))},u=Object.values(e.adds),l=Object.values(e.removes);this.addedNodes=u.length>0?{}:null,this.nodeVariation=u.length+l.length;for(var c,f=3*Math.sqrt(t.nodes.length),h={x:0,y:0},d=o.nodes.length,p=new Uint8Array(65536),v=0;v<d;v++){var y=0,m=0,g=o.nodes[v];if(c=g.id,Boolean(e.adds[c])){if(this.addedNodes[v]=g.id,y=g.position?g.position.x:void 0,m=g.position?g.position.y:void 0,void 0===y||void 0===m){var b=i.sunMap,w=void 0;for(w=b[g.id];void 0!==w;w=b[w]){var x=s(w);if(-1!==x){var _=this.getNodePosition(x);y=_.x+10*(Math.random()-.5),m=_.y+10*(Math.random()-.5);break}}void 0===w&&(y=this.nodeCenterPoint[0]+f*(Math.random()-.5),m=this.nodeCenterPoint[1]+f*(Math.random()-.5))}this.updateData[2*v]=y,this.updateData[2*v+1]=m,p[v]=g.pinned?255:0}else{var S=s(g.id),T=this.getNodePosition(S);y=T.x,m=T.y,this.updateData[2*v]=S,this.updateData[2*v+1]=999999,p[v]=this.pinData[S]}h.x+=y||0,h.y+=m||0}this.nodeCenterPoint=d?[h.x/d,h.y/d]:[0,0],this.pinData=p,this.subGraphs=i.subGraphs,this.nodeSortMap=i.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]);var A=Ji(this.subGraphs[0].nodes),O=A.nodeIdToIndex,P=A.nodeIndexToId;return this.nodeIdToIndex=O,this.nodeIndexToId=P,n.bindTexture(n.TEXTURE_2D,this.updateTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.FLOAT,this.updateData),Gr.info("Setting gravity center to ",this.nodeCenterPoint),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.updateShader.use(),this.updateShader.setUniform("u_numNodesNew",o.nodes.length),this.updateShader.setUniform("u_physData",this.getPhysData(0).texture),this.updateShader.setUniform("u_updateData",this.updateTexture),n.disable(n.BLEND),n.bindBuffer(n.ARRAY_BUFFER,this.physVbo),this.updateShader.setAttributePointer("a_position",2,0,2),n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData(1).frameBuffer),n.viewport(0,0,mr,mr),n.drawArrays(n.TRIANGLE_STRIP,0,4),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.useReadpixelWorkaround?this.doReadpixelWorkaround():(n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData().frameBuffer),n.readPixels(0,0,mr,mr,n.RGBA,n.FLOAT,this.physPositions)),(u.length>0||l.length>0)&&(n.bindTexture(n.TEXTURE_2D,this.pinTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.UNSIGNED_BYTE,this.pinData)),this.shouldUpdate=!0,this.iterationCount=0,this.setupPhysicsForCoarse(),this.subGraphs[0]}},{key:"destroy",value:function(){var t=this;this.gl.deleteBuffer(this.physVbo),this.gl.deleteBuffer(this.physSmallVbo),this.physData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsClusterTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.levelsFinestIndexTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.gl.deleteTexture(this.initalLevelTexture),this.gl.deleteTexture(this.sizeTexture),this.gl.deleteTexture(this.offsetTexture),this.gl.deleteTexture(this.springTexture),this.gl.deleteTexture(this.pinTexture),this.gl.deleteTexture(this.updateTexture),void 0!==this.apprxRepForceShader&&this.apprxRepForceShader.remove(),void 0!==this.updateShader&&this.updateShader.remove(),void 0!==this.physShader&&this.physShader.remove(),this.physPositions=null,this.gl=null,this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(qi),this.state.rels.removeChannel(qi)}},{key:"dumpTexture",value:function(t,e,n){var r=this.gl;Gr.info("--- Dumping texture ",n),r.bindFramebuffer(r.FRAMEBUFFER,t),r.readPixels(0,0,mr,mr,r.RGBA,r.FLOAT,this.physPositions);for(var i=0;i<e;i++)Gr.info(i,": ",this.physPositions[4*i+0],this.physPositions[4*i+1],this.physPositions[4*i+2],this.physPositions[4*i+3])}},{key:"getScaleNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e,n){return n+Math.pow(10,6)*Math.pow(t-120,-1.7)};return 0===t?0:t<300?200+-1/Math.pow(10,5)*3*Math.pow(Math.abs(t-200+12),3):e(t,200,10)}},{key:"getBaseLength",value:function(t){if(void 0===t||t===this.numNodes)return 100*this.dpr;var e=Math.pow(this.averageNodeSize/2,2)*Math.PI,n=this.numNodes/t*e;return(100+Math.sqrt(n/Math.PI)/2/t)*this.dpr}},{key:"checkForUpdates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i={nodes:n.items,rels:r.items},o=Object.values(n.channels[qi].adds).length>0,a=Object.values(r.channels[qi].adds).length>0,s=Object.values(n.channels[qi].removes).length>0,u=Object.values(r.channels[qi].removes).length>0,l=Object.values(n.channels[qi].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[qi].adds,removes:n.channels[qi].removes}),t?(this.updateNodes(i.nodes),this.reheat(i)):l.length>0&&(this.updateNodes(l),Pr(l)&&this.reheat(i)),n.clearChannel(qi),r.clearChannel(qi)}},{key:"getNodePosition",value:function(t){return this.useReadpixelWorkaround?{x:this.workaroundData[0].dataFloat[t],y:this.workaroundData[1].dataFloat[t]}:{x:this.physPositions[4*t+0],y:this.physPositions[4*t+1]}}},{key:"getMaxSpeedSquared",value:function(){var t=0;if(this.useReadpixelWorkaround)for(var e=0;e<this.numNodes;e++){var n=this.workaroundData[2].dataFloat[e],r=this.workaroundData[3].dataFloat[e],i=n*n+r*r;i>t&&(t=i)}else for(var o=0;o<this.numNodes;o++){var a=this.physPositions[4*o+2],s=this.physPositions[4*o+3],u=a*a+s*s;u>t&&(t=u)}return t}},{key:"getMedianSpeedSquared",value:function(t){var e=[];if(this.useReadpixelWorkaround)for(var n=0;n<this.numNodes;n++){var r=this.workaroundData[2].dataFloat[n],i=this.workaroundData[3].dataFloat[n],o=r*r+i*i;e[n]=o}else for(var a=0;a<this.numNodes;a++)if(!t||t[a]){var s=this.physPositions[4*a+2],u=this.physPositions[4*a+3],l=s*s+u*u;e.push(l)}return e.sort((function(t,e){return t-e})),e[Math.floor(e.length/2)]}},{key:"getPhysData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.physData[(this.curPhysData+t)%this.physData.length]}},{key:"newTexture",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.FLOAT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.RGBA,o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,i,n,n,0,i,r,e),o}},{key:"newFramebuffer",value:function(t,e){var n=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),n}},{key:"checkCompatibility",value:function(t){function e(t){throw new Li(t)}t||e("Could not initialize WebGL"),0===t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)&&e("Vertex shader texture access not available"),t.getExtension("OES_texture_float")||e("OES_texture_float extension not available");var n=t.getParameter(t.MAX_TEXTURE_SIZE),r=Math.max(mr,gr);n<r&&e("Need larger WebGL texture support. Avaliable: ".concat(n," needed: ").concat(r));var i=new Float32Array(4),o=this.newTexture(t,i,1),a=this.newFramebuffer(t,o);t.bindFramebuffer(t.FRAMEBUFFER,a),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),t.getError()!==t.NO_ERROR&&(Gr.info("gl.readPixels doesnt work for float texture, activating workaround"),this.useReadpixelWorkaround=!0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(a),t.deleteTexture(o)}},{key:"printGlStats",value:function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n="?",r="?";null!==e&&(n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),Gr.trace("Vendor: ".concat(n)),Gr.trace("Renderer: ".concat(r));var i=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);Gr.trace("Line width range: ".concat(i));var o=t.getSupportedExtensions();Gr.trace("Extentions:"),o.length>0&&o.forEach((function(t){return Gr.trace(t)}))}},{key:"adjustToGlSize",value:function(t){return t*this.dpr*2.5}},{key:"setupSize",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=new Float32Array(65536),n=t.nodes,r=n.length,i=0,o=0;o<r;o++){var a,s=parseInt(null!==(a=n[o].size)&&void 0!==a?a:br,10);e[o]=this.adjustToGlSize(s),i+=s}this.averageNodeSize=r?i/r:br;var u=this.gl;void 0===this.sizeTexture&&(this.sizeTexture=u.createTexture()),u.bindTexture(u.TEXTURE_2D,this.sizeTexture),u.texImage2D(u.TEXTURE_2D,0,u.ALPHA,mr,mr,0,u.ALPHA,u.FLOAT,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE)}},{key:"setupSprings",value:function(t){var e,n,r=this.gl,i=t.relationships,o=new Float32Array(16777216),a=new Float32Array(65536),s=0;for(e=0;e<t.nodes.length;e++)for(a[e]=s,o[s]=i[e].length,s+=1,n=0;n<i[e].length;n++)o[s]=i[e][n],s+=1;for(n=s;n<o.length;n++)o[n]=1;for(n=e;n<a.length;n++)a[n]=0;void 0===this.offsetTexture&&(this.offsetTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.offsetTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,mr,mr,0,r.ALPHA,r.FLOAT,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),void 0===this.springTexture&&(this.springTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.springTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,gr,gr,0,r.ALPHA,r.FLOAT,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}},{key:"setupPhysics",value:function(){this.setupPhysicsForCoarse(),this.setupPhysicsForNodes(),this.physPositions=new Float32Array(262144),this.setupPinData()}},{key:"setupPhysicsForNodes",value:function(){var t=this.gl,e=this.subGraphs.length,n=this.subGraphs[0].nodes,r=3*Math.sqrt(n.length),i=new Float32Array(262144),o=new Float32Array(262144);this.numNodes=n.length;for(var a=0;a<262144;a++)i[a]=0,o[a]=0;for(var s=function(t,e,n,r){r[4*t+0]=e,r[4*t+1]=n,r[4*t+2]=0,r[4*t+3]=0},u=e-1;u>=0;u--){var l=u===e-1?[]:this.subGraphs[u+1].nodes;0===l.length?this.subGraphs[u].nodes.forEach((function(t,e){var n=t.placement?t.placement.x:r*(Math.random()-.5),o=t.placement?t.placement.y:r*(Math.random()-.5);s(void 0===t.finestIndex?e:t.finestIndex,n,o,i)})):l.forEach((function(t){var e=t.finestIndex,n=i[4*t.finestIndex],r=i[4*t.finestIndex+1],o=Vi({x:n,y:r},10,t.planets.length+1);e++,t.planets.forEach((function(t,n){var r=o[n];s(e++,r.x,r.y,i);var a=Vi({x:r.x,y:r.y},10,t.moons.length+1);t.moons.forEach((function(t,n){var r=a[n];s(e++,r.x,r.y,i)}))}))}))}this.physData=[];for(var c=0;c<2;c++){var f=this.newTexture(t,0===c?i:o,mr),h=this.newFramebuffer(t,f);this.physData.push({texture:f,frameBuffer:h})}var d=this.enableVerlet?"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\n\nfloat DAMP = 0.6;\nfloat COOL = 0.99998;\nfloat TEMP = max(0.02, pow(COOL, u_curIteration));\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 50000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = (combinedNodeSize - dist) / (dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * fScale) / (dist);\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, myPosition.zw);\n } else {\n vec2 prevVelocity = myPosition.zw;\n vec2 currentPos = myPosition.xy;\n vec2 prevPos = currentPos - prevVelocity;\n\n vec2 newPos = currentPos + TEMP * ( DAMP * (prevVelocity) + acceleration * TIMESTEP * TIMESTEP);\n vec2 newVelocity = newPos - currentPos;\n gl_FragColor = vec4(newPos, newVelocity);\n }\n}":"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 500000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = ((combinedNodeSize - dist) / dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * (fScale / 1.5)) / dist;\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, acceleration * TIMESTEP * 0.5);\n } else {\n myPosition.zw = myPosition.zw * VELOCITYDECAY;\n gl_FragColor = vec4(myPosition.xy + myPosition.zw * TIMESTEP, myPosition.zw + acceleration * TIMESTEP);\n }\n}";this.physShader=new Ei(t,Ni,d,{INTEL_WORKAROUND:this.intelWorkaround?1:0}),this.physShader.use(),this.physShader.setUniform("u_projection",this.physProjection),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_gravity",this.gravity)}},{key:"setupPhysicsForCoarse",value:function(){var t=this,e=this.gl;this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[];var n,r,i=this.subGraphs.length,o=function(t,e,r,i,o){n[4*t+0]=e,n[4*t+1]=r,n[4*t+2]=o.size(),n[4*t+3]=i||1};if(1===i){n=new Float32Array(262144);var a=this.subGraphs[0].nodes;a.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return a.length}})})),this.levelsClusterTexture[0]=this.newTexture(e,n,Ki)}else for(var s=function(){var i=t.subGraphs[u].nodes,a=u===t.subGraphs.length-1?[]:t.subGraphs[u+1].nodes;n=new Float32Array(262144),r=new Float32Array(65536);var s=0;if(a.length>0){var l=a.slice();l.sort((function(t,e){return t.previousIndex-e.previousIndex})),l.forEach((function(t,e){var n=s,u=a.indexOf(t);o(s,u,n,i[t.id].weight,t),r[s]=i[s].finestIndex,s++,t.planets.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++,e.moons.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++}))}))}))}else i.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return i.length}}),r[e]=i[e].finestIndex}));var c=t.newTexture(e,null,Ki),f=t.newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t.newTexture(e,n,Ki),t.levelsFinestIndexTexture[u]=t.newTexture(e,r,mr,e.FLOAT,e.ALPHA)},u=this.subGraphs.length-1;u>=0;u--)s();for(var l=new Float32Array(262144),c=0;c<l.length;c++)l[c]=0;this.initalLevelTexture=this.newTexture(e,l,Ki);var f=this.enableVerlet?"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat PI = 3.1415926535897932384626433832795;\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterRadius = (clusterSize * 0.5) + u_baseLength;\n float clusterArea = PI * clusterRadius * clusterRadius;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = (clusterArea * fScale) / (dist * dist);\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / sqrt(dist)) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / (dist * dist);\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}":"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = ((u_baseLength * u_baseLength) * (fScale / 1.5)) / dist;\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / dist) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / dist;\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}";this.apprxRepForceShader=new Ei(e,Ni,f),this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_projection",this.physSmallProjection)}},{key:"setupPinData",value:function(){var t=this.gl;this.pinTexture=t.createTexture(),this.pinData=new Uint8Array(65536);for(var e=0;e<65536;e++)this.pinData[e]=0;t.bindTexture(t.TEXTURE_2D,this.pinTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.UNSIGNED_BYTE,this.pinData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}},{key:"setupUpdates",value:function(){var t=this.gl;this.updateData=new Float32Array(65536),this.updateTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.updateTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.FLOAT,this.updateData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.updateShader=new Ei(t,Ni,"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_updateData;\nuniform float u_numNodesNew;\n\nconst float INDEX_FLAG = 999999.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5)*textureSide;\n\n if (index >= u_numNodesNew) {\n discard;\n }\n\n float firstValue = getTextureData(u_updateData, index * 2.0, 256.0).a;\n float secondValue = getTextureData(u_updateData, index * 2.0 + 1.0, 256.0).a;\n\n if (secondValue == INDEX_FLAG) {\n vec4 myPosition = getTextureData(u_physData, firstValue, 256.0);\n gl_FragColor = myPosition;\n } else {\n gl_FragColor = vec4(firstValue, secondValue, 0.0, 0.0);\n }\n}\n"),this.updateShader.use(),this.updateShader.setUniform("u_projection",this.physProjection)}},{key:"setupReadpixelWorkaround",value:function(){var t=this.gl;this.workaroundShader=new Ei(t,Ni,"precision lowp float;\n\nuniform sampler2D u_physData;\nuniform float u_index;\n\nfloat shift_right (float v, float amt) { \n v = floor(v) + 0.5; \n return floor(v / exp2(amt)); \n}\n\nfloat shift_left (float v, float amt) { \n return floor(v * exp2(amt) + 0.5); \n}\n\nfloat mask_last (float v, float bits) { \n return mod(v, shift_left(1.0, bits)); \n}\n\nfloat extract_bits (float num, float from, float to) { \n from = floor(from + 0.5); to = floor(to + 0.5); \n return mask_last(shift_right(num, from), to - from); \n}\n\n// From https://stackoverflow.com/questions/17981163/webgl-read-pixels-from-floating-point-render-target\nvec4 encode_float (float val) { \n if (val == 0.0) return vec4(0, 0, 0, 0); \n float sign = val > 0.0 ? 0.0 : 1.0; \n val = abs(val); \n float exponent = floor(log2(val)); \n float biased_exponent = exponent + 127.0; \n float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; \n float t = biased_exponent / 2.0; \n float last_bit_of_biased_exponent = fract(t) * 2.0; \n float remaining_bits_of_biased_exponent = floor(t); \n float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; \n float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; \n float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; \n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; \n return vec4(byte4, byte3, byte2, byte1); \n}\n\nvoid main(void) {\n vec4 texData = texture2D(u_physData, gl_FragCoord.xy / 255.0);\n float data;\n if (u_index == 0.0) {\n data = texData.x;\n } else if (u_index == 1.0) {\n data = texData.y;\n } else if (u_index == 2.0) {\n data = texData.z;\n } else if (u_index == 3.0) {\n data = texData.w;\n }\n\n gl_FragColor = encode_float(data);\n}\n"),this.workaroundShader.use(),this.workaroundShader.setUniform("u_projection",this.physProjection),this.workaroundData=[];for(var e=0;e<4;e++){var n=new Uint8Array(262144),r=this.newTexture(t,null,mr,t.UNSIGNED_BYTE),i=this.newFramebuffer(t,r);this.workaroundData.push({dataByte:n,dataFloat:new Float32Array(n.buffer),texture:r,frameBuffer:i})}}},{key:"doReadpixelWorkaround",value:function(){for(var t=this.gl,e=0;e<4;e++){var n=this.workaroundData[e];t.bindFramebuffer(t.FRAMEBUFFER,n.frameBuffer),t.viewport(0,0,mr,mr),this.workaroundShader.use(),this.workaroundShader.setUniform("u_index",e),this.workaroundShader.setUniform("u_physData",this.getPhysData(0).texture),t.bindBuffer(t.ARRAY_BUFFER,this.physVbo),this.workaroundShader.setAttributePointer("a_position",2,0,2),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.readPixels(0,0,mr,mr,t.RGBA,t.UNSIGNED_BYTE,n.dataByte)}}},{key:"definePhysicsArrays",value:function(){this.physData=[],this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[]}}],n&&Hi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(t){return function(t){if(Array.isArray(t))return no(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return no(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?no(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,oo(r.key),r)}}function io(t,e,n){return(e=oo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oo(t){var e=function(t,e){if("object"!=to(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=to(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==to(e)?e:String(e)}var ao="ForceCytoLayout",so="forceDirected",uo="coseBilkent",lo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),io(this,"physLayout",void 0),io(this,"coseBilkentLayout",void 0),io(this,"state",void 0),io(this,"currentLayoutType",void 0),io(this,"enableCytoscape",void 0),io(this,"currentLayout",void 0);var r=e.state,i=e.enableCytoscape;this.enableCytoscape=null==i||i,this.physLayout=new Qi(e),this.coseBilkentLayout=new gi({state:r,cytoCompleteCallback:function(){for(n.physLayout.update(!0),n.copyLayoutPositions(n.state.nodes.items,n.coseBilkentLayout,n.physLayout);n.physLayout.update(!1););n.copyLayoutPositions(n.state.nodes.items,n.physLayout,n.coseBilkentLayout)},animationCompleteCallback:function(){n.currentLayoutType===uo&&setTimeout((function(){return n.setLayout(so)}),50)}}),this.currentLayout=this.physLayout,this.currentLayoutType=so;var o=r.nodes,a=r.rels;o.addChannel(ao),a.addChannel(ao),this.state=r}var e,n;return e=t,n=[{key:"setOptions",value:function(t){void 0!==t&&(this.currentLayout.setOptions(t),this.enableCytoscape=t.enableCytoscape)}},{key:"getLayout",value:function(t){return t===uo?this.coseBilkentLayout:this.physLayout}},{key:"setLayout",value:function(t){if(t!==this.currentLayoutType){Gr.info("Switching to layout: ".concat(t," in ForceCyto"));var e=this.getLayout(t);this.currentLayout=e,this.currentLayoutType=t}}},{key:"copyLayoutPositions",value:function(t,e,n){var r=e.getNodePositions(t);n.updateNodes(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i=n.channels[ao],o=r.channels[ao],a=Object.values(i.adds).length,s=Object.values(o.adds).length,u=Object.values(i.adds).map((function(t){return t.id})),l=Object.values(o.adds).map((function(t){return t.id})),c=new Set(Object.keys(i.adds)),f=new Set(Object.keys(o.adds));if(n.clearChannel(ao),r.clearChannel(ao),this.currentLayoutType===so&&this.enableCytoscape&&n.items.length<=100&&a<100&&a>0&&s>0){var h=n.items.map((function(t){return t.id})),d=new Set([].concat(eo(h),eo(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(eo(p),eo(l)));if(d.size<=100&&v.size<=300){var y=function(t,e,n,r){var i,o=new Set(t),a=Tr(new Set(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=r.idToItem[s];if(u){var l=u.from,c=u.to;o.add(l),o.add(c)}}}catch(t){a.e(t)}finally{a.f()}var f,h=function(t){var e,n={},r={},i=Tr(t);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,a=o.from,s=o.to,u="".concat(a,"-").concat(s),l="".concat(s,"-").concat(a),c=0,f=[u,l];c<f.length;c++){var h=f[c];void 0!==r[h]?r[h].push(o):r[h]=[o]}n[a]||(n[a]=new Set),n[s]||(n[s]=new Set),n[a].add(s),n[s].add(a)}}catch(t){i.e(t)}finally{i.f()}return{adjNodesMap:n,relMap:r}}(r.items),d=h.adjNodesMap,p=h.relMap,v={},y={},m=function(t){var e=[];for(v[t]||e.push(t);e.length>0;){var r=e.shift();if(v[r]=n.idToItem[r],void 0!==d[r]){var i,o=Tr(d[r]);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!v[a]){e.push(a);var s=p["".concat(r,"-").concat(a)];if(s){var u,l=Tr(s);try{for(l.s();!(u=l.n()).done;){var c=u.value;y[c.id]||(y[c.id]=c)}}catch(t){l.e(t)}finally{l.f()}}}}}catch(t){o.e(t)}finally{o.f()}}}},g=Tr(o);try{for(g.s();!(f=g.n()).done;)m(f.value)}catch(t){g.e(t)}finally{g.f()}return{connectedNodes:v,connectedRels:y}}(c,f,n,r),m=y.connectedNodes,g=y.connectedRels,b=Object.values(m),w=Object.values(g),x=b.length,_=w.length;x===c.size&&_===f.size&&(f.size>0||c.size>0)?(this.setLayout(uo),this.coseBilkentLayout.update(!0,n.items,r.items)):_>0&&f.size/_>.25&&(this.setLayout(uo),this.coseBilkentLayout.update(!0,b,w))}}this.physLayout.update(t),this.coseBilkentLayout.update(t)}},{key:"getShouldUpdate",value:function(){return this.currentLayout.getShouldUpdate()}},{key:"getComputing",value:function(){return this.currentLayout.getComputing()}},{key:"updateNodes",value:function(t){this.setLayout(so),this.physLayout.updateNodes(t)}},{key:"getNodePositions",value:function(t){return this.currentLayout.getNodePositions(t)}},{key:"terminateUpdate",value:function(){this.physLayout.terminateUpdate(),this.coseBilkentLayout.terminateUpdate()}},{key:"destroy",value:function(){this.physLayout.destroy(),this.coseBilkentLayout.destroy()}}],n&&ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ho(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fo(Object(n),!0).forEach((function(e){mo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function po(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,go(r.key),r)}}function mo(t,e,n){return(e=go(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function go(t){var e=function(t,e){if("object"!=co(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==co(e)?e:String(e)}var bo="FreeLayout",wo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mo(this,"state",void 0),mo(this,"positions",void 0),mo(this,"shouldUpdate",void 0),mo(this,"stateDisposers",void 0);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(bo),a.addChannel(bo),this.shouldUpdate=!0,this.setOptions(),this.layout(o.items,o.idToItem,o.idToPosition)}var e,r;return e=t,r=[{key:"setOptions",value:function(){}},{key:"updateNodes",value:function(t){var e,n=po(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[bo].adds).length>0,o=Object.values(r.channels[bo].adds).length>0,a=Object.values(n.channels[bo].removes).length>0,s=Object.values(r.channels[bo].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(bo),r.clearChannel(bo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r){var i,o=void 0!==(i=t)?wn(i):i;if(!(0,n.isEmpty)(o)){for(var a={},s=0;s<o.length;++s){var u,l=o[s].id,c=null!==(u=r[l])&&void 0!==u?u:{},f=c.x,h=void 0===f?0:f,d=c.y,p=void 0===d?0:d;a[l]={id:l,x:h,y:p}}this.positions=a,this.shouldUpdate=!1}}},{key:"setNodePositions",value:function(t){this.positions=t}},{key:"getNodePositions",value:function(t){var e,n=[],r=po(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=ho({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){}},{key:"destroy",value:function(){this.state.nodes.removeChannel(bo),this.state.rels.removeChannel(bo)}}],r&&yo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xo(t){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(t)}function _o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function So(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_o(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Po(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function To(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ao(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ao(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Po(r.key),r)}}function Po(t){var e=function(t,e){if("object"!=xo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xo(e)?e:String(e)}var Eo="GridLayout",ko=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Eo),a.addChannel(Eo),this.shouldUpdate=!0,this.setOptions(e),this.layout(o.items,o.idToItem,o.idToPosition,a.items)}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e,n=To(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[Eo].adds).length>0,o=Object.values(r.channels[Eo].adds).length>0,a=Object.values(n.channels[Eo].removes).length>0,s=Object.values(r.channels[Eo].removes).length>0;(i||o||a||s)&&(this.layout(n.items,n.idToItem,n.idToPosition,r.items),n.idToPosition=this.positions),n.clearChannel(Eo),r.clearChannel(Eo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r,i){var o;if(t=(o=t)?wn(o):o,!(0,n.isEmpty)(t)){for(var a=t.length,s=Math.ceil(Math.sqrt(a)),u=new Array(a),l=0,c=0;c<s;++c){for(var f=0;f<s&&(u[l]={y:0+150*c,x:0+150*f},++l!==a);++f);if(l===a)break}for(var h=t.sort(),d={},p=0;p<a;++p){var v=h[p],y=u[p];v.x===y.x&&v.y===y.y||(d[v.id]=So({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{key:"getNodePositions",value:function(t){var e,n=[],r=To(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=So({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){this.shouldUpdate=!1}},{key:"destroy",value:function(){this.state.nodes.removeChannel(Eo),this.state.rels.removeChannel(Eo)}}],r&&Oo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Co=i(269),jo=i.n(Co);function Do(t){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(t)}function Ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Io(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Do(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Do(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Mo=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},r=0;r<t.length;r++)n.minX>t[r].x&&(n.minX=t[r].x),n.minY>t[r].y&&(n.minY=t[r].y),n.maxX<t[r].x&&(n.maxX=t[r].x),n.maxY<t[r].y&&(n.maxY=t[r].y);var i=(n.minX+n.maxX)/2,o=(n.minY+n.maxY)/2,a=2*e,s=_r()*a;return{centerX:i,centerY:o,nodesWidth:n.maxX-n.minX+a+s,nodesHeight:n.maxY-n.minY+a+s}},Lo=function(t,e,n,r){var i=1/0,o=1/0;return t>1&&(i=n/t),e>1&&(o=r/e),{zoomX:i,zoomY:o}},No=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=Math.min(t,e);return Math.min(r,Math.max(n,i))},Fo=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},Uo=function(t,e,n,r,i,o){var a=e;return function(t,e,n){return t<e&&t<n}(i,o,e)&&t.length>1?(a=function(t,e,n){var r=function(t){var e=new Array(4).fill(t[0]);return t.forEach((function(t){e[0]=t.x<e[0].x?e[0]:Io({},t),e[1]=t.y<e[1].y?e[1]:Io({},t),e[2]=t.x<e[2].x?Io({},t):e[2],e[3]=t.y<e[3].y?Io({},t):e[3]})),e}(t),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0,n=0,r=0;r<t.length;r++)for(var i=r+1;i<t.length;i++)e=Math.hypot(Math.abs(t[r].x-t[i].x),Math.abs(t[r].y-t[i].y)),n=Math.max(n,e);return n}(r),o=2*n,a=_r()*o,s=e.height<=e.width?e.height-o-a:e.width-o-a;return i>s?.9*s/i:.9*i/s}(t,r,25),Fo(i,o,Math.min(e,a),n)):Fo(i,o,e,n)};function zo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Bo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vo(t){this.channels[t]={adds:{},updates:{},removes:{}}}function Go(t){delete this.channels[t]}function Wo(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var Xo=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function Ho(t,e){var r,i=!1,o=zo(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.id;if(void 0===this.idToItem[s]){if(a=(0,n.cloneDeep)(a),this.items.push(a),this.idToItem[s]=a,this.idToPosition[s]={id:s,x:0,y:0},"x"in a&&"y"in a){var u=a,l=u.x,c=u.y;isNaN(l)||isNaN(c)||(this.idToPosition[s].x=l,this.idToPosition[s].y=c)}var f=Xo(a);if(f instanceof HTMLElement){var h=document.createElement("div");Object.assign(h.style,{position:"absolute"}),h.appendChild(f),this.idToHtmlOverlay[s]=h}for(var d=Object.values(this.channels),p=0,v=d;p<v.length;p++){var y=v[p];void 0===y.removes[s]?y.adds[s]=a:(delete y.removes[s],y.updates[s]=a)}i=!0}}}catch(t){o.e(t)}finally{o.f()}i&&(this.version+=1,void 0!==e&&(e.added=!0))}function Yo(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.id,s=this.idToItem[a];if(void 0!==s){Object.assign(s,o);var u=Xo(o);if(u instanceof HTMLElement){var l;null===(l=this.idToHtmlOverlay[a])||void 0===l||l.remove(),delete this.idToHtmlOverlay[a];var c=document.createElement("div");Object.assign(c.style,{position:"absolute"}),c.appendChild(u),this.idToHtmlOverlay[a]=c}for(var f=Object.values(this.channels),h=0,d=f;h<d.length;h++){var p=d[h];if(void 0===p.adds[a]){var v=p.updates[a];void 0===v&&(v={id:a},p.updates[a]=v),Object.assign(v,o)}}void 0!==e&&(e.updated=!0)}r=!0}}catch(t){i.e(t)}finally{i.f()}r&&(this.version+=1)}function $o(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=this.idToItem[o];if(void 0!==a){var s;r=!0,delete this.idToItem[a.id],delete this.idToPosition[a.id],null===(s=this.idToHtmlOverlay[a.id])||void 0===s||s.remove(),delete this.idToHtmlOverlay[a.id],this.items.splice(this.items.indexOf(a),1);for(var u=Object.values(this.channels),l=0,c=u;l<c.length;l++){var f=c[l];void 0!==f.adds[o]?delete f.adds[o]:(delete f.updates[o],f.removes[o]=a)}}}}catch(t){i.e(t)}finally{i.f()}r&&(void 0!==e&&(e.removed=!0),this.version+=1)}function qo(t){var e,n=zo(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(void 0!==this.idToPosition[r.id]){var i=this.idToPosition[r.id];Object.assign(i,r)}else this.idToPosition[r.id]={id:r.id,x:r.x,y:r.y,pinned:r.pinned}}}catch(t){n.e(t)}finally{n.f()}}function Zo(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var Ko=function(){return{idToItem:Vt.shallow({}),items:Vt.shallow([]),channels:Vt.shallow({}),idToPosition:Vt.shallow({}),idToHtmlOverlay:Vt.shallow({}),version:0,addChannel:ot(Vo),removeChannel:ot(Go),clearChannel:ot(Wo),add:ot(Ho),update:ot(Yo),remove:ot($o),updatePositions:ot(qo),updateHtmlOverlay:ot(Zo)}};function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ta(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qo(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Jo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Jo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jo(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ea="#bbb",na="#fff",ra="#45bff8",ia={selected:{rings:[{widthFactor:.05,color:na},{widthFactor:.1,color:ra}],shadow:{width:10,opacity:1,color:ea}},default:{rings:[]}},oa={selected:{rings:[{color:na,width:2},{color:ra,width:4}],shadow:{width:18,opacity:1,color:ea}},default:{rings:[]}},aa=.75,sa=new Set(["direction","packing"]),ua="forceDirected",la="hierarchical",ca="grid",fa="free",ha="d3Force",da="webgl",pa="canvas";function va(t){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(t)}function ya(t,e,n){return e=function(t){var e=function(t,e){if("object"!=va(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ma="down",ga=ya(ya(ya(ya({},"up","BT"),ma,"TB"),"left","RL"),"right","LR"),ba="bin",wa=[ba,"stack"],xa=["html"],_a=["html"],Sa=["captionHtml"];function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(t)}function Aa(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ia(r.key),r)}}function Pa(t,e,n){return e=ja(e),function(t,e){if(e&&("object"===Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ka(t)}(t,Ea()?Reflect.construct(e,n||[],ja(t).constructor):e.apply(t,n))}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function ka(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ca(){return Ca="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ja(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ca.apply(this,arguments)}function ja(t){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ja(t)}function Da(t,e){return Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Da(t,e)}function Ra(t,e,n){return(e=Ia(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ia(t){var e=function(t,e){if("object"!=Ta(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ta(e)?e:String(e)}var Ma="HierarchicalLayout",La=function(t){return void 0!==t?wn(t):t},Na=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ra(ka(n=Pa(this,e,[t])),"direction",void 0),Ra(ka(n),"packing",void 0),Ra(ka(n),"stateDisposers",void 0),Ra(ka(n),"oldComputing",void 0),Ra(ka(n),"computing",void 0),Ra(ka(n),"pendingLayoutData",void 0),Ra(ka(n),"worker",void 0),Ra(ka(n),"directionChanged",void 0),Ra(ka(n),"packingChanged",void 0),n.direction=ma,n.packing=ba;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(Ma),o.addChannel(Ma),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[Ma],e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,a=Object.values(t.updates),s=Pr(a);n.shouldUpdate=n.shouldUpdate||e||r||s}if(void 0!==o.version){var u=o.channels[Ma],l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;n.shouldUpdate=n.shouldUpdate||l||c}}))],n.shouldUpdate=!0,n.oldComputing=!1,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createHierarchicalLayoutWorker)(),n.worker.port.start(),n.setOptions(t),n.layout(i.items,i.idToItem,i.idToPosition,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Da(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){if(void 0!==t&&function(t){return Object.keys(t).every((function(t){return sa.has(t)}))}(t)){var e=t.direction,n=void 0===e?ma:e,r=t.packing,i=void 0===r?ba:r;Object.keys(ga).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),wa.includes(i)&&(this.packingChanged=this.packing&&this.packing!==i,this.packing=i),this.shouldUpdate=this.directionChanged||this.packingChanged}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var n=this.state,r=n.nodes,i=n.rels,o=this.directionChanged,a=this.packingChanged,s=Object.values(r.channels[Ma].adds).length>0,u=Object.values(i.channels[Ma].adds).length>0,l=Object.values(r.channels[Ma].removes).length>0,c=Object.values(i.channels[Ma].removes).length>0,f=Object.values(r.channels[Ma].updates),h=Pr(f);(t||s||u||l||c||o||a||h)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(Ma),i.clearChannel(Ma),this.directionChanged=!1,this.packingChanged=!1}Ca(ja(e.prototype),"update",this).call(this),this.shouldUpdate=!1,this.oldComputing=this.computing}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e,n,r){var i=this,o=La(t).map((function(t){return t.html,Aa(t,xa)})),a=La(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Aa(e,_a));s[t]=n}));var u=La(r).map((function(t){return t.captionHtml,Aa(t,Sa)})),l=La(n),c=this.direction,f=this.packing,h=window.devicePixelRatio,d={nodes:o,nodeIds:s,idToPosition:l,rels:u,direction:c,packing:f,pixelRatio:h,forcedDelay:0};this.computing?this.pendingLayoutData=d:(this.worker.port.onmessage=function(t){var e=t.data,n=e.positions,r=e.parents,o=e.waypoints;i.computing&&(i.positions=n),i.parents=r,i.state.setWaypoints(o),null!==i.pendingLayoutData?(i.worker.port.postMessage(i.pendingLayoutData),i.pendingLayoutData=null):i.computing=!1,i.shouldUpdate=!0,i.startAnimation()},this.computing=!0,this.worker.port.postMessage(d))}},{key:"terminateUpdate",value:function(){var t,e;this.computing=!1,this.shouldUpdate=!1,null===(t=this.state.nodes)||void 0===t||t.clearChannel(Ma),null===(e=this.state.rels)||void 0===e||e.clearChannel(Ma)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ma),this.state.rels.removeChannel(Ma),this.worker.port.close()}}],r&&Oa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti);function Fa(t){return Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fa(t)}function Ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ba(r.key),r)}}function za(t,e,n){return(e=Ba(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ba(t){var e=function(t,e){if("object"!=Fa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fa(e)?e:String(e)}var Va=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),za(this,"elementId",void 0),za(this,"currentValue",void 0),za(this,"startValue",void 0),za(this,"currentTime",void 0),za(this,"duration",void 0),za(this,"status",void 0),za(this,"endValue",void 0),za(this,"startTime",void 0),za(this,"endTime",void 0),za(this,"hasNextAnimation",void 0),this.elementId=e,this.startValue=n,this.status=0,this.currentValue=n,this.duration=0}var e,n;return e=t,(n=[{key:"setDuration",value:function(t){this.duration=t,this.setEndTime(this.startTime+this.duration)}},{key:"getStatus",value:function(){return this.status}},{key:"advance",value:function(){if(1!==this.status)return!1;this.currentTime=(new Date).getTime();var t,e=this.endTime-this.startTime;return(t=e>0?(this.currentTime-this.startTime)/e:1)>=1?(this.currentValue=this.endValue,this.status=2):(this.currentValue=this.startValue+t*(this.endValue-this.startValue),this.hasNextAnimation=!0),this.hasNextAnimation}},{key:"setEndValue",value:function(t){this.endValue!==t&&(t-this.currentValue!=0?(this.currentTime=(new Date).getTime(),this.status=1,this.startValue=this.currentValue,this.endValue=t,this.startTime=this.currentTime,this.setEndTime(this.startTime+this.duration)):this.endValue=t)}},{key:"setEndTime",value:function(t){this.endTime=Math.max(t,this.startTime)}}])&&Ua(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ga(t){return Ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ga(t)}function Wa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wa(Object(n),!0).forEach((function(e){Ya(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ha(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$a(r.key),r)}}function Ya(t,e,n){return(e=$a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $a(t){var e=function(t,e){if("object"!=Ga(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ga(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ga(e)?e:String(e)}var qa=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ya(this,"animations",void 0),Ya(this,"durations",void 0),Ya(this,"defaultDuration",void 0),Ya(this,"hasNextAnimation",void 0),Ya(this,"ignoreAnimationsFlag",void 0),this.animations=new Map,this.durations=[],this.durations[0]=0,this.durations[1]=0,this.defaultDuration=150,this.hasNextAnimation=!1,this.ignoreAnimationsFlag=!1}var e,n;return e=t,n=[{key:"advance",value:function(){var t=this;return this.hasNextAnimation=!1,this.animations.forEach((function(e){Object.values(e).forEach((function(e){e.advance()&&(t.hasNextAnimation=!0)}))})),this.hasNextAnimation}},{key:"ignoreAnimations",value:function(t){this.ignoreAnimationsFlag=t}},{key:"setOptions",value:function(t){void 0!==t.fadeDuration&&(this.durations[0]=t.fadeDuration),void 0!==t.sizeDuration&&(this.durations[1]=t.sizeDuration)}},{key:"needsToRun",value:function(){return this.hasNextAnimation}},{key:"getValueForAnimationName",value:function(t,e,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.ignoreAnimationsFlag)return n;var a=null!==(r=this.getById(t))&&void 0!==r?r:{};if(void 0===a[e]){var s=1===o?this.createSizeAnimation(0,t,e):this.createFadeAnimation(0,t,e);s.setEndValue(n),i=s.currentValue}else{var u=a[e];if(u.currentValue===n)return n;u.setEndValue(n),i=u.currentValue}return this.hasNextAnimation=!0,i}},{key:"createAnimation",value:function(t,e,n){var r,i=new Va(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Xa(Xa({},o),{},Ya({},n,i))),i}},{key:"getById",value:function(t){return this.animations.get(t)}},{key:"createFadeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[0])&&void 0!==r?r:this.defaultDuration),i}},{key:"createSizeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[1])&&void 0!==r?r:this.defaultDuration),i}}],n&&Ha(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Za(t){return Za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Za(t)}function Ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ja(r.key),r)}}function Ja(t){var e=function(t,e){if("object"!=Za(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Za(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Za(e)?e:String(e)}var Qa=64,ts=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=Ja(n="cache"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.cache={}}var e,n;return e=t,n=[{key:"getImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOrCreateEntry(t),r=e?"inverted":"image",i=n[r];return void 0===i&&(i=this.loadImage(t),n[r]=i),this.drawIfNeeded(i,e),i.canvas}},{key:"getOrCreateEntry",value:function(t){return void 0===this.cache[t]&&(this.cache[t]={}),this.cache[t]}},{key:"invertCanvas",value:function(t){for(var e=t.getImageData(0,0,Qa,Qa),n=e.data,r=0;r<4096;r++){var i=4*r;n[i]^=255,n[i+1]^=255,n[i+2]^=255}t.putImageData(e,0,0)}},{key:"loadImage",value:function(t){var e=document.createElement("canvas");e.width=Qa,e.height=Qa;var n=new Image;return n.src=t,n.crossOrigin="anonymous",{canvas:e,image:n,drawn:!1}}},{key:"drawIfNeeded",value:function(t,e){var n=t.image,r=t.canvas;if(!t.drawn&&n.complete){var i=r.getContext("2d");try{i.drawImage(n,0,0,Qa,Qa)}catch(t){Gr.error("Failed to draw image",n.src,t),i.beginPath(),i.strokeStyle="black",i.rect(0,0,Qa,Qa),i.moveTo(0,0),i.lineTo(Qa,Qa),i.moveTo(0,Qa),i.lineTo(Qa,0),i.stroke(),i.closePath()}e&&this.invertCanvas(i),t.drawn=!0}}}],n&&Ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const es=ts;function ns(t){return ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(t)}function rs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function is(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,as(r.key),r)}}function os(t,e,n){return(e=as(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function as(t){var e=function(t,e){if("object"!=ns(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ns(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ns(e)?e:String(e)}var ss=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),os(this,"key",void 0),os(this,"rels",void 0),os(this,"waypointPath",void 0),os(this,"selfReferring",void 0),os(this,"fromId",void 0),os(this,"toId",void 0),os(this,"angles",void 0),os(this,"labelInfo",void 0),this.key=e,this.rels=[],this.selfReferring=n===r,this.fromId=n,this.toId=r,this.labelInfo={},this.angles=[]}var e,r;return e=t,r=[{key:"insert",value:function(t){this.rels.push({rel:t})}},{key:"setLabelInfo",value:function(t,e){this.labelInfo[t]=e}},{key:"remove",value:function(t){var e=t.id,n=this.rels,r=n.findIndex((function(t){return t.rel.id===e}));if(-1!==r&&(n.splice(r,1),0===r&&n.length>0)){var i=n[0].rel,o=i.from,a=i.to;this.fromId=o,this.toId=a}}},{key:"size",value:function(){return this.rels.length}},{key:"maxFontSize",value:function(){return Math.max.apply(Math,function(t){if(Array.isArray(t))return rs(t)}(t=this.rels.map((function(t){var e=t.rel;return(0,n.isNumber)(e.captionSize)?e.captionSize:1})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return rs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rs(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var t}},{key:"relIsOppositeDirection",value:function(t){var e=t.from,n=t.to,r=this.fromId,i=this.toId;return e!==r&&n!==i||e===i&&n===r}},{key:"indexOf",value:function(t){var e=t.id;return this.rels.findIndex((function(t){return t.rel.id===e}))}},{key:"getRel",value:function(t){var e=this.rels;return t<0||t>=e.length?null:e[t].rel}},{key:"setWaypoints",value:function(t){this.waypointPath=t}},{key:"setAngles",value:function(t){this.angles=t}}],r&&is(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),us="#848484",ls=2*Math.PI/50,cs=.1*Math.PI,fs=wr;function hs(t){return hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(t)}function ds(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ps(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ps(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ps(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ms(r.key),r)}}function ys(t,e,n){return(e=ms(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ms(t){var e=function(t,e){if("object"!=hs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=hs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:String(e)}var gs=function(t){var e=[];if(0===t.length)e.push({size:2*Math.PI,start:0});else{for(var n=t.length-1;n>=0;n--){var r=void 0,i=void 0;0===n?(i=t[t.length-1],r=t[n]-t[t.length-1]+2*Math.PI):(i=t[n-1],r=t[n]-t[n-1]),e.push({size:r,start:i})}e.sort((function(t,e){return e.size-t.size}))}return e},bs=function(t,e){for(;e>t.length||t[0].size>2*t[e-1].size;)t.push({size:t[0].size/2,start:t[0].start}),t.push({size:t[0].size/2,start:t[0].start+t[0].size/2}),t.shift(),t.sort((function(t,e){return e.size-t.size}));return t},ws=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ys(this,"bundles",void 0),ys(this,"nodeToBundles",void 0),this.bundles={},this.nodeToBundles={};var r=e.reduce((function(t,e){return t[e.id]=e,t}),{});this.updateData(r,{},n)}var e,n;return e=t,n=[{key:"getBundle",value:function(t){var e=this.bundles,n=this.nodeToBundles,r=this.generatePairId(t.from,t.to),i=e[r];return void 0===i&&(i=new ss(r,t.from,t.to),e[r]=i,void 0===n[t.from]&&(n[t.from]=[]),void 0===n[t.to]&&(n[t.to]=[]),n[t.from].push(i),n[t.to].push(i)),i}},{key:"updateData",value:function(t,e,n){for(var r=this.bundles,i=this.nodeToBundles,o=function(t,e){var n=i[e].findIndex((function(e){return e===t}));-1!==n&&i[e].splice(n,1)},a=Object.values(t),s=Object.values(e),u=0,l=a;u<l.length;u++){var c=l[u];this.getBundle(c).insert(c)}for(var f=0,h=s;f<h.length;f++){var d=h[f],p=this.getBundle(d);p.remove(d),0===p.size()&&(delete r[p.key],o(p,d.from),o(p,d.to))}for(var v=0,y=Object.keys(r);v<y.length;v++){var m=r[y[v]];m.setWaypoints(n["".concat(m.fromId,"-").concat(m.toId)])}}},{key:"updatePositions",value:function(t){for(var e=this.nodeToBundles,n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],a=null!==(i=e[o])&&void 0!==i?i:[];if(0!==a.length){var s=a.find((function(t){return t.selfReferring})),u=a.filter((function(t){return!t.selfReferring}));if(void 0!==s){var l,c=[],f=ds(u);try{for(f.s();!(l=f.n()).done;)for(var h=l.value,d=t[h.fromId],p=t[h.toId],v=ls*h.size(),y=d.id===o?Math.atan2(p.y-d.y,p.x-d.x):Math.atan2(d.y-p.y,d.x-p.x),m=0;m<h.size();m++)c.push(y+v/2-m*ls)}catch(t){f.e(t)}finally{f.f()}var g=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),b=gs(g);bs(b,s.size());var w=b.map((function(t){return t.start+t.size/2})).slice(0,s.size());s.setAngles(w)}}}}},{key:"generatePairId",value:function(t,e){return[t.toString(),e.toString()].sort((function(t,e){return t.localeCompare(e)})).join("-")}}],n&&vs(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xs(t){return xs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(t)}function _s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ss(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,As(r.key),r)}}function Ts(t,e,n){return(e=As(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function As(t){var e=function(t,e){if("object"!=xs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xs(e)?e:String(e)}var Os=function(t,e){return(0,n.isFinite)(t.x)&&(0,n.isFinite)(t.y)&&(0,n.isFinite)(e.x)&&(0,n.isFinite)(e.y)},Ps=function(t,e){if(void 0===t||void 0===e||!Os(t,e))return!1;var n=e.x-t.x,r=e.y-t.y,i=_r();return n*n+r*r<100*i*i},Es=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ts(this,"p1",void 0),Ts(this,"p2",void 0),Ts(this,"unit",void 0),Ts(this,"norm",void 0),Ts(this,"length",void 0),Ts(this,"vector",void 0),this.p1=e,this.p2=n,this.vector=this.getVector(),this.length=this.getLength(),this.unit=this.getUnitVector(),this.norm=this.getUnitNormalVector()}var e,n;return e=t,n=[{key:"getVector",value:function(){return{x:this.p2.x-this.p1.x,y:this.p2.y-this.p1.y}}},{key:"getLength",value:function(){var t=this.vector,e=t.x,n=t.y;return Math.sqrt(e*e+n*n)}},{key:"getUnitVector",value:function(){var t=this.vector,e=this.length;return{x:t.x/e,y:t.y/e}}},{key:"getUnitNormalVector",value:function(){return{x:this.unit.y,y:-this.unit.x}}}],n&&Ss(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ks=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o=function(t,e){var r=(t.x*e.x+t.y*e.y)/(e.x*e.x+e.y*e.y);return(0,n.clamp)(r,0,1)}({x:r.x-t.x,y:r.y-t.y},i),a=t.x+o*i.x,s=t.y+o*i.y,u=a-r.x,l=s-r.y;return Math.sqrt(u*u+l*l)},Cs=function(t,e,n,r){if(e.x===n.x&&e.y===n.y)return e;var i=e.y-t.y,o=t.x-e.x,a=i*t.x+o*t.y,s=r.y-n.y,u=n.x-r.x,l=s*n.x+u*n.y,c=i*u-s*o;return 0===c?null:{x:(u*a-o*l)/c,y:(i*l-s*a)/c}},js=function(t,e,n,r){var i,o,a,s=1e9,u=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_s(Object(n),!0).forEach((function(e){Ts(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),l={x:0,y:0};for(o=1;o<10;o++)a=.1*o,l.x=Math.pow(1-a,2)*t.x+2*a*(1-a)*n.x+Math.pow(a,2)*e.x,l.y=Math.pow(1-a,2)*t.y+2*a*(1-a)*n.y+Math.pow(a,2)*e.y,o>0&&(s=(i=ks(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function Ds(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Rs=[[.04,1],[100,2]],Is=[[.8,1.1],[3,1.6],[8,2.5]],Ms=[[Is[0][0],1],[100,1.25]],Ls=function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba(".concat(n[0],",").concat(n[1],",").concat(n[2],",").concat(e,")")}var r=jo().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},Ns=function(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=r.headPosition,s=r.headAngle,u=r.headHeight,l=r.headChinHeight,c=r.headWidth;t.save(),t.lineWidth=e,t.strokeStyle=n,t.fillStyle=n,t.translate(a.x,a.y),t.rotate(s),function(t,e,n,r){if(t.beginPath(),e.length>0){var i=e[0];t.moveTo(i.x,i.y)}for(var o=1;o<e.length;o++){var a=e[o];t.lineTo(a.x,a.y)}t.closePath(),n&&t.fill(),r&&t.stroke()}(t,[{x:l-u,y:0},{x:-u,y:c/2},{x:0,y:0},{x:-u,y:-c/2}],i,o),t.restore()},Fs=function(t,e,n,r,i){var o=r;i.forEach((function(r){var i=r.width,a=r.color,s=o+i;t.beginPath(),t.fillStyle=a,t.arc(e,n,s,0,2*Math.PI,!1),t.arc(e,n,o,2*Math.PI,0,!0),t.fill(),t.closePath(),o=s}))},Us=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},zs=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,Us(t,e,n,i),t.fill(),t.closePath()};function Bs(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Vs=function(t,e,n,r,i,o,a,s,u){var l,c=r,f=0,h=0,d=null===(l=t.measureText("..."))||void 0===l?void 0:l.width;e.forEach((function(e){var r;t.font="normal ".concat(i,"px ").concat(o);var l,p=-(null===(r=t.measureText(e.text))||void 0===r?void 0:r.width)/2,v=e.text?function(t){if(Array.isArray(t))return Ds(t)}(l=e.text)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||function(t,e){if(t){if("string"==typeof t)return Ds(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ds(t,e):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[];e.hasHyphenChar||e.hasEllipsisChar||v.push(" "),v.forEach((function(r){var a,l,v,y,m,g;null!==(a=n[h])&&void 0!==a&&a.includes("italic")&&null!==(l=n[h])&&void 0!==l&&l.includes("bold")?t.font="italic 600 ".concat(i,"px ").concat(o):null!==(v=n[h])&&void 0!==v&&v.includes("italic")?t.font="italic 400 ".concat(i,"px ").concat(o):null!==(y=n[h])&&void 0!==y&&y.includes("bold")?t.font="bold ".concat(i,"px ").concat(o):t.font="normal ".concat(i,"px ").concat(o),null!==(m=n[h])&&void 0!==m&&m.includes("underline")&&t.fillRect(s+p+f,u+c+.2,null===(g=t.measureText(r))||void 0===g?void 0:g.width,.2),e.hasEllipsisChar?t.fillText(r,s+p+f-d/2,u+c):t.fillText(r,s+p+f,u+c),f+=t.measureText(r).width,h+=1})),t.font="normal ".concat(i,"px ").concat(o),e.hasHyphenChar&&t.fillText("-",s+p+f,u+c),e.hasEllipsisChar&&t.fillText("...",s+p+f-d/2,u+c),f=0,c+=a}))},Gs=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Ws=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Xs=function(t,e){return{x:t.x*e,y:t.y*e}},Hs=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Ws(t,e))},Ys=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};function $s(t){return $s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(t)}function qs(t){return function(t){if(Array.isArray(t))return Qs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Js(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ks(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zs(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=$s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=$s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$s(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Js(t,e){if(t){if("string"==typeof t)return Qs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qs(t,e):void 0}}function Qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tu=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},eu=function(t){var e=t[t.length-1],n=t[t.length-2];return!(!e||!isNaN(Number(e))||e.toLowerCase()===e.toUpperCase())&&!(!n||!isNaN(Number(n))||n.toLowerCase()===n.toUpperCase())&&tu(e)&&!tu(n)},nu=function(t,e,n,r){for(var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],s=[],u=0,l=0,c=!1,f=!1,h=0;h<r;h++)a[h]=n(h,r);for(var d,p=function(){i=t.slice(u,v);var n,h,d=e(i),p=a[l];if(d>p||(h=t[v-1],"\n\r\v".includes(h))){if(!(l<r-1)){if(o)return{v:[]};for(var y=v;d>p;){for(y-=1;n=t[y-1]," \t\n\r\v".includes(n);)y-=1;if(!(y-u>1)){i="",f=!0,c=!1;break}i=t.slice(u,y),d=e(i),f=!0,c=!1}return s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},{v:s}}c=!1,f=!1;var m=function(t){var e=t.length,n=Math.min(e-1,3);if(1===e)return{hyphen:!1,cnt:0};for(var r=0;r<n;r++){var i=t[t.length-(r+1)];if(" "===i||i.toLowerCase()===i.toUpperCase())return{hyphen:!1,cnt:r+1};var o=t.slice(0,t.length-r);if(eu(o))return{hyphen:!1,cnt:r+1}}return{hyphen:!0,cnt:1}}(i),g=v-m.cnt;if(m.hyphen)for(i=t.slice(u,g),d=e(i),c=!0;d>p;){if(!(g-u>1)){i=t[u],g=u+1,d=e(i),c=!1;break}g--,i=t.slice(u,g),d=e(i),c=!0}else i=(i=t.slice(u,g)).trim();s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},u=g,l+=1}},v=1;v<=t.length;v++)if(d=p())return d.v;return i=t.slice(u,t.length),s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:!1},s},ru=function(t,e,n,r,i,o,a,s){t.font="bold ".concat(r,"px ").concat(n).replace(/"/g,"");var u=function(e){var n;return null===(n=t.measureText(e))||void 0===n?void 0:n.width},l=2;a===Is[1][1]?l=3:a===Is[2][1]&&(l=4);for(var c=a<Is[2][1]?["",""]:[""],f=o?c.length:0,h=function(t,e){return function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top",i=.98*n,o=.89*n,a=.95*n;return 1===e?i:2===e?a:3===e&&"top"===r?0===t||2===t?o:i:4===e&&"top"===r?0===t||3===t?.78*n:a:5===e&&"top"===r?0===t||4===t?.65*n:1===t||3===t?o:a:i}(t+f,e+f,i)},d=1,p=[],v=function(){if(0===(p=function(t,e,n,r){var i,o=t.split(/\s/g).filter((function(t){return t.length>0})),a=[],s=null,u=function(t){return e(t)>n(a.length,r)},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Js(t))){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,f=s?"".concat(s," ").concat(c):c;if(e(f)<n(a.length,r))s=f;else{if(null!==s){var h=u(s);a.push({text:s,overflowed:h})}if(s=c,a.length>r)return[]}}}catch(t){l.e(t)}finally{l.f()}if(s){var d=u(s);a.push({text:s,overflowed:d})}return a.length<=r?a:[]}(e,u,h,d)).length)p=nu(e,u,h,d,l>d);else if(p.some((function(t){return t.overflowed}))){var t=d;p=p.reduce((function(e,n){var r=l-e.length;if(0===r){var i=e[e.length-1];return i.text.endsWith("…")||(u(i.text)+u("…")>h(e.length,t)?(e[e.length-1].text=i.text.slice(0,-2),e[e.length-1].hasEllipsisChar=!0):(e[e.length-1].text=i.text,e[e.length-1].hasEllipsisChar=!0)),e}if(n.overflowed){var o=nu(n.text,u,h,r);e=e.concat(o)}else e.push({text:n.text,hasEllipsisChar:!1,hasHyphenChar:!1});return e}),[])}else p=p.map((function(t){return Ks(Ks({},t),{},{hasEllipsisChar:!1,hasHyphenChar:!1})}));d+=1};0===p.length;)v();return Array.from(p)},iu=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e,n){var r=e.value;if(r){var i="".concat(n>0&&t.length?", ":"").concat(r);return[].concat(qs(t),[Ks(Ks({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:qs(null!==(o=e.styles)&&void 0!==o?o:[]):qs(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat(qs(t),qs(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function ou(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return au(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?au(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function au(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var su=2*Math.PI,uu=Math.PI/2,lu=function(t,e,n,r,i,o){var a={x:(t.x+e.x)/2,y:(t.y+e.y)/2},s={x:t.x,y:t.y},u={x:e.x,y:e.y},l=new Es(u,s),c=function(t,e){var n=0;return t&&(n+=t),e&&(n-=e),n}(r,n);a.x+=c/2*l.unit.x,a.y+=c/2*l.unit.y;var f=o.size()/2-o.indexOf(i);return a.x+=f*l.unit.x,a.y+=f*l.unit.y,a},cu=function(t){var e=_r(),n=t.size,r=t.selected;return((null!=n?n:br)+4+(!0===r?4:0))*e},fu=function(t,e){var n=_r();t.shadowColor=e.color,t.shadowBlur=e.width*n,t.shadowOffsetX=0,t.shadowOffsetY=0},hu=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},du=function(t,e,n,r,i){var o,a,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.norm.x,r=t.norm.y;return e?{x:-n,y:-r}:t.norm},l=_r(),c=e.indexOf(t),f=(e.size()-1)/2,h=c>f,d=Math.abs(c-f),p=i?17*e.maxFontSize():8,v=(e.size()-1)*p*l,y=function(t,e,n,r,i,o,a){var s,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=_r(),c=t.size(),f=c>1,h=t.relIsOppositeDirection(o),d=h?n:e,p=h?e:n,v=t.waypointPath,y=null==v?void 0:v.points,m=null==v?void 0:v.from,g=null==v?void 0:v.to,b=Ps(d,m)&&Ps(p,g)||Ps(p,m)&&Ps(d,g),w=b?y[1]:null,x=b?y[y.length-2]:null,_=cu(d),S=cu(p),T=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},A=Math.max(Math.PI,su/(c/2)),O=f?r*A*(a?1:-1)/(null!==(s=d.size)&&void 0!==s?s:br):0,P=T(b?w:p,d),E=b?T(p,x):P,k=function(t,e,n,r){return{x:t.x+Math.cos(e)*n*(r?-1:1),y:t.y+Math.sin(e)*n*(r?-1:1)}},C=function(t,e){return k(d,P+t,e,!1)},j=function(t,e){return k(p,E-t,e,!0)},D=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},R=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))*l},I=C(O,_),M=j(O,S),L=f?C(0,_):null,N=f?j(0,S):null,F=200*l,U=[];if(b){var z=R(I,w)<F;if(f&&!z){var B=D(L,w);U.push(new Es(I,B)),U.push(new Es(B,w))}else U.push(new Es(I,w));for(var V=2;V<y.length-1;V++)U.push(new Es(y[V-1],y[V]));var G=R(M,x)<F;if(f&&!G){var W=D(N,x);U.push(new Es(x,W)),U.push(new Es(W,M))}else U.push(new Es(x,M))}else{var X=f?R(L,N):0;if(f&&X>2*(30*l+Math.min(_,S)))if(u){var H=lu(d,p,_,S,o,t);U.push(new Es(I,H)),U.push(new Es(H,M))}else{var Y=r*i,$=30+_,q=Math.sqrt($*$+Y*Y),Z=30+S,K=Math.sqrt(Z*Z+Y*Y),J=C(0,q),Q=j(0,K);U.push(new Es(I,J)),U.push(new Es(J,Q)),U.push(new Es(Q,M))}else if(X>(_+S)/2){var tt=lu(d,p,_,S,o,t);U.push(new Es(I,tt)),U.push(new Es(tt,M))}else U.push(new Es(I,M))}return U}(e,n,r,d,p,t,h,s),m=[],g=y[0],b=u(g,h);m.push({x:g.p1.x+b.x,y:g.p1.y+b.y});for(var w=1;w<y.length;w++)if(1===e.size())m.push(y[w-1].p2);else{var x=y[w-1],_=y[w],S=u(x,h),T=u(_,h),A=Gs(x.p1,Xs(S,v/2)),O=Gs(x.p2,Xs(S,v/2)),P=Gs(_.p1,Xs(T,v/2)),E=Gs(_.p2,Xs(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=Cs(A,O,P,E));var C=null!==k?Ws(k,x.p2):Xs(S,v/2);m.push(Gs(x.p2,Xs(C,d/f)))}var j=y[y.length-1],D=u(j,h);return m.push({x:j.p2.x+D.x,y:j.p2.y+D.y}),e.relIsOppositeDirection(t)?m.reverse():m},pu=function(t,e,n,r,i,o){var a,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=_r(),l=i.selected,c=i.captions,f=void 0===c?[]:c,h=i.caption,d=void 0===h?"":h,p=i.width,v=i.disabled,y=i.captionAlign,m=void 0===y?"top":y,g=i.captionSize,b=void 0===g?1:g,w=f.length>0?null===(a=iu(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==w){var x=!0===v?"#DDDDDD":"#848484",_=6*b*u,S=!0===l?"bold":"normal",T=w;t.fillStyle=x,t.font="".concat(S," ").concat(_,"px ").concat('"Open Sans", sans-serif');var A=function(e){return t.measureText(e).width},O=(null!=p?p:1)*(!0===l?1.5:1),P=A(T);if(P>r){var E=nu(T,A,(function(){return r}),1,!1)[0];T=!0===E.hasEllipsisChar?"".concat(E.text,"..."):T,P=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-uu),t.translate(2*_,0),t.rotate(-uu)):t.rotate(n);var k=(1+b)*u,C="bottom"===m?_/2+O+k:-(O+k);t.fillText(T,-P/2,C),t.restore();var j=2*C*Math.sin(n),D=2*C*Math.cos(n),R={position:{x:e.x-j,y:e.y+D},rotation:s?n-Math.PI:n,width:r/u,height:(_+k)/u};o.setLabelInfo(i.id,R)}},vu=function(t,e,n,r,i){if(t.beginPath(),t.moveTo(e[0].x,e[0].y),i&&e.length>2){for(var o=1;o<e.length-2;){var a=(e[o].x+e[o+1].x)/2,s=(e[o].y+e[o+1].y)/2;t.quadraticCurveTo(e[o].x,e[o].y,a,s),o+=1}t.quadraticCurveTo(e[o].x,e[o].y,e[o+1].x,e[o+1].y)}else for(var u=1;u<e.length;u++)t.lineTo(e[u].x,e[u].y);t.lineWidth=n,t.strokeStyle=r,t.lineCap="round",t.stroke()},yu=function(t){return t.rings[0].width*_r()*1.5},mu=function(t){return 6*t*_r()},gu=function(t,e,n){var r,i;return{widthAlign:e/2*(null!==(r=t[0])&&void 0!==r?r:0),heightAlign:n/2*(null!==(i=t[1])&&void 0!==i?i:0)}},bu=function(t,e,n){var r,i,o=n.indexOf(t),a=null!==(r=n.angles[o])&&void 0!==r?r:0,s=a-cs/2,u=a+cs/2,l=null!==(i=t.width)&&void 0!==i?i:1,c=_r(),f=cu(e),h={x:e.x+Math.cos(s)*(f+l/2),y:e.y+Math.sin(s)*(f+l/2)},d={x:e.x+Math.cos(u)*(f+l/2),y:e.y+Math.sin(u)*(f+l/2)},p={x:e.x+Math.cos(a)*(f+35*c),y:e.y+Math.sin(a)*(f+35*c)};return{startAngle:s,endAngle:u,startPoint:h,endPoint:d,apexPoint:p,control1Point:{x:p.x+25*Math.cos(a-uu)*c/2,y:p.y+25*Math.sin(a-uu)*c/2},control2Point:{x:p.x+25*Math.cos(a+uu)*c/2,y:p.y+25*Math.sin(a+uu)*c/2}}},wu=function(t,e,n,r,i,o){t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(i.x,i.y,r.x,r.y),t.quadraticCurveTo(o.x,o.y,n.x,n.y),t.stroke()},xu=function(t,e,n,r,i,o,a,s){var u=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];Os(n,r)&&(n.id===r.id?function(t,e,n,r,i,o,a){var s=e.overlayIcon,u=e.selected,l=e.width,c=e.hovered,f=e.disabled,h=e.color,d=bu(e,n,r),p=d.startPoint,v=d.endPoint,y=d.apexPoint,m=d.control1Point,g=d.control2Point,b=a.rings,w=a.shadow,x=_r(),_=b[0].color,S=b[1].color,T=b[0].width*x,A=b[1].width*x,O=40*x,P=(null!=l?l:1)*x,E=P>1?P/2:1,k=9*E,C=2*E,j=7*E,D=!0===u,R=!0===f,I=void 0!==s,M=Math.atan2(v.y-g.y,v.x-g.x),L=D?T*Math.sqrt(1+2*k/j*(2*k/j)):0,N={x:v.x-Math.cos(M)*(.5*k-C+L),y:v.y-Math.sin(M)*(.5*k-C+L)},F={headPosition:{x:v.x+Math.cos(M)*(.5*k-C-L),y:v.y+Math.sin(M)*(.5*k-C-L)},headAngle:M,headHeight:k,headChinHeight:C,headWidth:j};if(t.save(),t.lineCap="round",D&&(fu(t,w),t.lineWidth=P+A,t.strokeStyle=S,wu(t,p,N,y,m,g),Ns(t,A,S,F,!1,!0),hu(t),t.lineWidth=P+T,t.strokeStyle=_,wu(t,p,N,y,m,g),Ns(t,T,_,F,!1,!0)),t.lineWidth=P,!0===c&&!D&&!R){var U=w.color;fu(t,w),t.strokeStyle=U,t.fillStyle=U,wu(t,p,N,y,m,g),Ns(t,P,U,F),hu(t)}var z=R?fs:null!=h?h:us;if(t.fillStyle=z,t.strokeStyle=z,wu(t,p,N,y,m,g),Ns(t,P,z,F),o||I){var B,V=r.indexOf(e),G=null!==(B=r.angles[V])&&void 0!==B?B:0,W=y.x-Math.cos(M)*(L/4),X=y.y-Math.sin(M)*(L/4),H=(G+uu)%su,Y=(G+su)%su<Math.PI;if(o&&pu(t,{x:W,y:X},H,O,e,r,Y),I){var $=s.position,q=void 0===$?[0,0]:$,Z=s.url,K=s.size,J=mu(void 0===K?1:K),Q=gu(q,O,J),tt=Q.widthAlign,et=Q.heightAlign+(D?yu(a):0)*(q[1]<0?-1:1),nt=tt*(Y?-1:1),rt=J/2;t.save(),t.translate(W,X),t.rotate(H);var it=-rt+nt,ot=-rt+et;t.drawImage(i.getImage(Z),it,ot,J,J),t.restore()}}t.restore()}(t,e,n,i,o,a,s):function(t,e,n,r,i,o,a,s,u){var l=e.overlayIcon,c=e.color,f=e.disabled,h=e.selected,d=e.width,p=e.hovered,v=e.captionAlign,y=!0===h,m=!0===f,g=void 0!==l,b=u.rings,w=u.shadow,x=du(e,i,n,r,a,s),_=_r(),S=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*_r()}(e),T=m?fs:null!=c?c:us,A=b[0].width*_,O=b[1].width*_,P=_*(d>1?d/2:1),E=9*P,k=2*P,C=7*P,j=Hs(x[x.length-2],x[x.length-1]),D=2*E,R=y?A*Math.sqrt(1+D/C*(D/C)):0,I=2-R,M=Math.floor(x.length/2);x.length>2&&y&&j<E+R-k&&(I+=j,R-=j/2+k,x.pop(),M=Math.floor(x.length/2));var L,N,F=x[x.length-2],U=x[x.length-1],z=(L=F,N=U,Math.atan2(N.y-L.y,N.x-L.x)),B=E/2+R,V=Math.cos(z),G=Math.sin(z);x[x.length-1]={x:U.x-V*B,y:U.y-G*B};var W,X={headPosition:{x:U.x+V*I,y:U.y+G*I},headAngle:z,headHeight:E,headChinHeight:k,headWidth:C},H=ou(x);try{for(H.s();!(W=H.n()).done;){var Y=W.value;Y.x=Math.round(Y.x),Y.y=Math.round(Y.y)}}catch(t){H.e(t)}finally{H.f()}if(t.save(),y){var $=b[0].color,q=b[1].color,Z=Math.atan2(x[1].y-x[0].y,x[1].x-x[0].x),K=Ys(Z,yu(u));x[0]=Gs(x[0],K),fu(t,w),vu(t,x,S+O,q,s),Ns(t,O,q,X,!1,!0),hu(t),vu(t,x,S+A,$,s),Ns(t,A,$,X,!1,!0)}if(!0===p&&!y&&!m){var J=w.color;fu(t,w),vu(t,x,S,J,s),Ns(t,S,J,X),hu(t)}if(vu(t,x,S,T,s),Ns(t,S,T,X),a||g){var Q,tt,et,nt,rt,it=n.x>r.x,ot=x[M];1==(1&x.length)?(Q=x[it?M+1:M-1],tt=x[it?M-1:M+1],s?(et=(ot.x+(Q.x+tt.x)/2)/2,nt=(ot.y+(Q.y+tt.y)/2)/2,rt=it?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Hs(ot,Q)>Hs(ot,tt)?tt=ot:Q=ot,et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x))):(Q=x[it?M:M-1],tt=x[it?M-1:M],et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x));var at=y?Ys(rt+uu,yu(u)):{x:0,y:0},st=Hs(Q,tt);if(a){var ut="bottom"===v?1:-1,lt={x:et+at.x*ut,y:nt+at.y*ut};pu(t,lt,rt,st,e,i)}if(g){var ct=l.position,ft=void 0===ct?[0,0]:ct,ht=l.url,dt=l.size,pt=mu(void 0===dt?1:dt),vt=gu(ft,st,pt),yt=vt.widthAlign,mt=vt.heightAlign,gt=ft[1]<0?-1:1,bt=at.x*gt,wt=at.y*gt,xt=pt/2;t.save(),t.translate(et,nt),t.rotate(rt);var _t=-xt+bt+yt,St=-xt+wt+mt;t.drawImage(o.getImage(ht),_t,St,pt,pt),t.restore()}}t.restore()}(t,e,n,r,i,o,a,u,s))},_u=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Os(n,r)?n.id===r.id?function(t,e,n){for(var r=bu(t,e,n),i={left:1/0,top:1/0,right:-1/0,bottom:-1/0},o=["startPoint","endPoint","apexPoint","control1Point","control2Point"],a=0;a<o.length;a++){var s=r[o[a]],u=s.x,l=s.y;u<i.left&&(i.left=u),u>i.right&&(i.right=u),l<i.top&&(i.top=l),l>i.bottom&&(i.bottom=l)}return i}(t,n,e):function(t,e,n,r,i,o){var a,s={left:1/0,top:1/0,right:-1/0,bottom:-1/0},u=ou(du(t,e,n,r,i,o));try{for(u.s();!(a=u.n()).done;){var l=a.value,c=l.x,f=l.y;c<s.left&&(s.left=c),c>s.right&&(s.right=c),f<s.top&&(s.top=f),f>s.bottom&&(s.bottom=f)}}catch(t){u.e(t)}finally{u.f()}return s}(t,e,n,r,i,o):null};function Su(t){return Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(t)}var Tu=/^\s+/,Au=/\s+$/;function Ou(t,e){if(e=e||{},(t=t||"")instanceof Ou)return t;if(!(this instanceof Ou))return new Ou(t,e);var n=function(t){var e,n,r,i={r:0,g:0,b:0},o=1,a=null,s=null,u=null,l=!1,c=!1;return"string"==typeof t&&(t=function(t){t=t.replace(Tu,"").replace(Au,"").toLowerCase();var e,n=!1;if(Gu[t])t=Gu[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=nl.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=nl.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=nl.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=nl.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=nl.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=nl.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=nl.hex8.exec(t))?{r:$u(e[1]),g:$u(e[2]),b:$u(e[3]),a:Ju(e[4]),format:n?"name":"hex8"}:(e=nl.hex6.exec(t))?{r:$u(e[1]),g:$u(e[2]),b:$u(e[3]),format:n?"name":"hex"}:(e=nl.hex4.exec(t))?{r:$u(e[1]+""+e[1]),g:$u(e[2]+""+e[2]),b:$u(e[3]+""+e[3]),a:Ju(e[4]+""+e[4]),format:n?"name":"hex8"}:!!(e=nl.hex3.exec(t))&&{r:$u(e[1]+""+e[1]),g:$u(e[2]+""+e[2]),b:$u(e[3]+""+e[3]),format:n?"name":"hex"}}(t)),"object"==Su(t)&&(rl(t.r)&&rl(t.g)&&rl(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*Hu(e,255),g:255*Hu(n,255),b:255*Hu(r,255)},l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):rl(t.h)&&rl(t.s)&&rl(t.v)?(a=Zu(t.s),s=Zu(t.v),i=function(t,e,n){t=6*Hu(t,360),e=Hu(e,100),n=Hu(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),u=r%6;return{r:255*[n,a,o,o,s,n][u],g:255*[s,n,n,a,o,o][u],b:255*[o,o,s,n,n,a][u]}}(t.h,a,s),l=!0,c="hsv"):rl(t.h)&&rl(t.s)&&rl(t.l)&&(a=Zu(t.s),u=Zu(t.l),i=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Hu(t,360),e=Hu(e,100),n=Hu(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,a,u),l=!0,c="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=Xu(o),{ok:l,format:t.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Pu(t,e,n){t=Hu(t,255),e=Hu(e,255),n=Hu(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function Eu(t,e,n){t=Hu(t,255),e=Hu(e,255),n=Hu(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function ku(t,e,n,r){var i=[qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Cu(t,e,n,r){return[qu(Ku(r)),qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16))].join("")}function ju(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.s-=e/100,n.s=Yu(n.s),Ou(n)}function Du(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.s+=e/100,n.s=Yu(n.s),Ou(n)}function Ru(t){return Ou(t).desaturate(100)}function Iu(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.l+=e/100,n.l=Yu(n.l),Ou(n)}function Mu(t,e){e=0===e?0:e||10;var n=Ou(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Ou(n)}function Lu(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.l-=e/100,n.l=Yu(n.l),Ou(n)}function Nu(t,e){var n=Ou(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Ou(n)}function Fu(t){var e=Ou(t).toHsl();return e.h=(e.h+180)%360,Ou(e)}function Uu(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ou(t).toHsl(),r=[Ou(t)],i=360/e,o=1;o<e;o++)r.push(Ou({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function zu(t){var e=Ou(t).toHsl(),n=e.h;return[Ou(t),Ou({h:(n+72)%360,s:e.s,l:e.l}),Ou({h:(n+216)%360,s:e.s,l:e.l})]}function Bu(t,e,n){e=e||6,n=n||30;var r=Ou(t).toHsl(),i=360/n,o=[Ou(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Ou(r));return o}function Vu(t,e){e=e||6;for(var n=Ou(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(Ou({h:r,s:i,v:o})),o=(o+s)%1;return a}Ou.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=Xu(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Eu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Eu(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Pu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Pu(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return ku(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16)),qu(Ku(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Hu(this._r,255))+"%",g:Math.round(100*Hu(this._g,255))+"%",b:Math.round(100*Hu(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Hu(this._r,255))+"%, "+Math.round(100*Hu(this._g,255))+"%, "+Math.round(100*Hu(this._b,255))+"%)":"rgba("+Math.round(100*Hu(this._r,255))+"%, "+Math.round(100*Hu(this._g,255))+"%, "+Math.round(100*Hu(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Wu[ku(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Cu(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Ou(t);n="#"+Cu(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ou(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Iu,arguments)},brighten:function(){return this._applyModification(Mu,arguments)},darken:function(){return this._applyModification(Lu,arguments)},desaturate:function(){return this._applyModification(ju,arguments)},saturate:function(){return this._applyModification(Du,arguments)},greyscale:function(){return this._applyModification(Ru,arguments)},spin:function(){return this._applyModification(Nu,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Bu,arguments)},complement:function(){return this._applyCombination(Fu,arguments)},monochromatic:function(){return this._applyCombination(Vu,arguments)},splitcomplement:function(){return this._applyCombination(zu,arguments)},triad:function(){return this._applyCombination(Uu,[3])},tetrad:function(){return this._applyCombination(Uu,[4])}},Ou.fromRatio=function(t,e){if("object"==Su(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Zu(t[r]));t=n}return Ou(t,e)},Ou.equals=function(t,e){return!(!t||!e)&&Ou(t).toRgbString()==Ou(e).toRgbString()},Ou.random=function(){return Ou.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ou.mix=function(t,e,n){n=0===n?0:n||50;var r=Ou(t).toRgb(),i=Ou(e).toRgb(),o=n/100;return Ou({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},Ou.readability=function(t,e){var n=Ou(t),r=Ou(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Ou.isReadable=function(t,e,n){var r,i,o,a,s,u=Ou.readability(t,e);switch(i=!1,"AA"!==(a=((o=(o=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(s=(o.size||"small").toLowerCase())&&"large"!==s&&(s="small"),(r={level:a,size:s}).level+r.size){case"AAsmall":case"AAAlarge":i=u>=4.5;break;case"AAlarge":i=u>=3;break;case"AAAsmall":i=u>=7}return i},Ou.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var l=0;l<e.length;l++)(r=Ou.readability(t,e[l]))>u&&(u=r,s=Ou(e[l]));return Ou.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,Ou.mostReadable(t,["#fff","#000"],n))};var Gu=Ou.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Wu=Ou.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Gu);function Xu(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Hu(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Yu(t){return Math.min(1,Math.max(0,t))}function $u(t){return parseInt(t,16)}function qu(t){return 1==t.length?"0"+t:""+t}function Zu(t){return t<=1&&(t=100*t+"%"),t}function Ku(t){return Math.round(255*parseFloat(t)).toString(16)}function Ju(t){return $u(t)/255}var Qu,tl,el,nl=(tl="[\\s|\\(]+("+(Qu="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")\\s*\\)?",el="[\\s|\\(]+("+Qu+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")\\s*\\)?",{CSS_UNIT:new RegExp(Qu),rgb:new RegExp("rgb"+tl),rgba:new RegExp("rgba"+el),hsl:new RegExp("hsl"+tl),hsla:new RegExp("hsla"+el),hsv:new RegExp("hsv"+tl),hsva:new RegExp("hsva"+el),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function rl(t){return!!nl.CSS_UNIT.exec(t)}var il=function(t){return Ou.mostReadable(t,["#1A1B1D","#FFFFFF"]).toString()};function ol(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return al(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?al(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function al(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var sl=function(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.size,a=void 0===o?br:o;return{top:i-a,left:n-a,right:n+a,bottom:i+a}},ul=function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=e.x,s=void 0===a?0:a,u=e.y,l=void 0===u?0:u,c=e.size,f=void 0===c?br:c,h=e.caption,d=void 0===h?"":h,p=e.captions,v=void 0===p?[]:p,y=e.captionAlign,m=void 0===y?"center":y,g=e.captionSize,b=void 0===g?1:g,w=e.disabled,x=e.activated,_=e.selected,S=e.hovered,T=e.id,A=e.icon,O=e.overlayIcon,P=i.selected,E=_r(),k=function(t,e,n){var r=t.selected?n.selected.rings:n.default.rings;if(!r.length){var i=e.getById(t.id);return void 0!==i&&Object.entries(i).forEach((function(t){var e=ol(t,2),n=e[0],r=e[1];n.startsWith("ring-")&&r.setEndValue(0)})),[{width:0,color:""}]}return r.map((function(n,r){var i=n.widthFactor,o=n.color,a=(t.size||br)*i*_r();return{width:e.getValueForAnimationName(t.id,"ring-".concat(r),a),color:o}}))}(e,r,i),C=k.reduce((function(t,e){return t+e.width}),0),j=P.shadow.width*E,D=P.shadow.opacity,R=P.shadow.color,I=f*E,M=2*I,L=function(t,e){if(!t||!e)return{nodeInfoLevel:0,fontInfoLevel:1.25,iconInfoLevel:1};var n=_r(),r=1600*n*(1200*n),i=Math.pow(t,2)*Math.PI*Math.pow(e,2)/(r/100);return{nodeInfoLevel:Bs(i,Rs),fontInfoLevel:Bs(i,Is),iconInfoLevel:Bs(i,Ms)}}(I,o),N=L.nodeInfoLevel,F=L.fontInfoLevel,U=L.iconInfoLevel,z=e.color||"#478BFF",B=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:br)/({1:3.5,2:2.75,3:2}[arguments.length>2&&void 0!==arguments[2]?arguments[2]:1]+(arguments.length>3&&void 0!==arguments[3]&&arguments[3]?1:0))/t}(F,I,b,Boolean(A)),V=il(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(A),$=Boolean(O);if(C>0&&(G=I+C),w)z="#EDEDED",V="#DDDDDD";else{if(x){var q=Date.now()%1e3/1e3,Z=q<.7?q/.7:0,K=Ls(z,.4-.4*Z);zs(t,s,l,K,I+.88*I*Z)}var J=_||S?j:0,Q=r.getValueForAnimationName(T,"shadowWidth",J);Q>0&&function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=i+o,u=t.createRadialGradient(e,n,i,e,n,s);u.addColorStop(0,"transparent"),u.addColorStop(.01,Ls(r,.5*a)),u.addColorStop(.05,Ls(r,.5*a)),u.addColorStop(.5,Ls(r,.12*a)),u.addColorStop(.75,Ls(r,.03*a)),u.addColorStop(1,Ls(r,0)),t.fillStyle=u,Us(t,e,n,s),t.fill()}(t,s,l,R,G,Q,D)}if(zs(t,s,l,z,I),C>0&&Fs(t,s,l,W,k),Y){var tt=N<2||!(X||H),et=N>0?1:0,nt=tt?1*I:.75*I;nt/=U;var rt=tt?.5*nt:nt*(1===U?"center"===m?1.3:"bottom"===m||tt?1.1:0:"center"===m?1.35:"bottom"===m||tt?1.1:0),it=nt/2;nt=r.getValueForAnimationName(T,"iconSize",nt),it=r.getValueForAnimationName(T,"iconXPos",it),rt=r.getValueForAnimationName(T,"iconYPos",rt),t.save();var ot=!0===w?.1:et;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",ot);var at="#fff"===V,st=n.getImage(A,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=M*(null!==(ut=O.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=O.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=O.position)||void 0===ht?void 0:ht[0])&&void 0!==ft?ft:0);t.save();var yt=!0===w?.1:1;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",yt);var mt=n.getImage(O.url);t.drawImage(mt,s-vt,l-pt,dt,dt),t.restore()}var gt=N<2?0:1,bt=r.getValueForAnimationName(T,"textOpacity",gt,0),wt=Ls(V,bt),xt='"Open Sans", sans-serif';if(X&&bt>0){var _t=ru(t,d,xt,B,.7*M,Y,F,null==e||e.captionAlign);t.fillStyle=wt,t.font="normal ".concat(B,"px ").concat(xt);var St=1+B,Tt=-(_t.length-2)*St/2,At=d.split("").map((function(t){return[]}));Vs(t,_t,At,Tt,B,xt,St,s,l)}if(H){var Ot=N<2?0:1,Pt=r.getValueForAnimationName(T,"textOpacity",Ot,0),Et=Ls(V,Pt),kt='"Open Sans", sans-serif',Ct=Boolean(A);if(Pt>0){var jt=iu(v),Dt=jt.stylesPerChar,Rt=jt.fullCaption,It="center"===m?.7*M:2*Math.sqrt(Math.pow(M/2,2)-Math.pow(M/3,2)),Mt=ru(t,Rt,kt,B,It,Ct,F,null==e||e.captionAlign);t.fillStyle=Et;var Lt,Nt=B,Ft=-(Mt.length-2)*Nt/2;Lt=m&&"center"!==m?"bottom"===m?Ft+I/Math.PI:Ft-I/Math.PI:Ft,Vs(t,Mt,Dt,Lt,B,kt,Nt,s,l)}}t.save(),t.restore()};function ll(t){return ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ll(t)}function cl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cl(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return dl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function dl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yl(r.key),r)}}function vl(t,e,n){return(e=yl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yl(t){var e=function(t,e){if("object"!=ll(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ll(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ll(e)?e:String(e)}var ml="canvasRenderer",gl=function(){function t(e,n,r){var i=this,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).relationshipThreshold,a=void 0===o?2.5:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vl(this,"arrowBundler",void 0),vl(this,"activeNodes",void 0),vl(this,"canvas",void 0),vl(this,"context",void 0),vl(this,"state",void 0),vl(this,"stateDisposers",void 0),vl(this,"relationshipThreshold",void 0),vl(this,"animationHandler",void 0),vl(this,"imageCache",void 0),vl(this,"needsRun",void 0),vl(this,"nodeVersion",void 0),vl(this,"relVersion",void 0),vl(this,"waypointVersion",void 0),this.activeNodes=new Set,this.canvas=e,this.context=n,this.state=r,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){void 0!==r.zoom&&(i.needsRun=!0),void 0!==r.panX&&(i.needsRun=!0),void 0!==r.panY&&(i.needsRun=!0),void 0!==r.nodes.version&&(i.needsRun=!0),void 0!==r.rels.version&&(i.needsRun=!0),r.waypoints.counter>0&&(i.needsRun=!0),void 0!==r.layout&&(i.needsRun=!0)}))),r.nodes.addChannel(ml),r.rels.addChannel(ml),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new qa,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new ws(r.rels.items,r.waypoints.data),this.imageCache=new es,this.needsRun=!0}var e,n;return e=t,n=[{key:"needsToRun",value:function(){return this.needsRun||this.animationHandler.needsToRun()||this.activeNodes.size>0}},{key:"processUpdates",value:function(){var t=this.state,e=!1,n=t.nodes.channels[ml],r=t.rels.channels[ml],i=n.adds,o=n.removes,a=r.adds,s=r.removes;this.nodeVersion<t.nodes.version&&(Object.keys(i).length>0||Object.keys(o).length,this.handleChannelUpdate(n,t.nodes,!0),this.nodeVersion=t.nodes.version,t.nodes.clearChannel(ml)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(ml),this.relVersion=t.rels.version),(e||this.waypointVersion<t.waypoints.counter)&&(this.arrowBundler.updateData(a,s,t.waypoints.data),this.waypointVersion=t.waypoints.counter)}},{key:"render",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state,o=this.animationHandler,a=this.arrowBundler,s=i.zoom,u=i.layout,l=i.nodes.idToPosition,c=null!==(e=r.canvas)&&void 0!==e?e:this.canvas,f=null!==(n=r.context)&&void 0!==n?n:this.context,h=_r(),d=c.clientWidth*h,p=c.clientHeight*h;f.save(),void 0!==r.backgroundColor?(f.fillStyle=r.backgroundColor,f.fillRect(0,0,d,p)):f.clearRect(0,0,d,p),this.zoomAndPan(f,c),o.ignoreAnimations(Boolean(r.ignoreAnimations)),!0!==r.ignoreAnimations&&o.advance(),a.updatePositions(l);var v=this.getRelationshipsToRender(r.showCaptions,d,p);this.renderRelationships(v,f,u!==la);var y=this.getNodesToRender(t,d,p);this.renderNodes(y,f,s),f.restore(),this.needsRun=!1}},{key:"getRelationshipsToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.arrowBundler,u=this.state,l=this.relationshipThreshold,c=u.layout,f=u.zoom,h=u.rels,d=u.nodes,p=d.idToItem,v=d.idToPosition,y=hl(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=fl(fl({},p[m.from]),v[m.from]),w=fl(fl({},p[m.to]),v[m.to]),x=t||f>l||void 0!==m.captionHtml,_=_u(m,g,b,w,x,c!==la);if(null!==_){var S,T,A,O,P,E,k=this.isBoundingBoxOffScreen(_,e,n),C=Hs({x:null!==(S=b.x)&&void 0!==S?S:0,y:null!==(T=b.y)&&void 0!==T?T:0},{x:null!==(A=w.x)&&void 0!==A?A:0,y:null!==(O=w.y)&&void 0!==O?O:0}),j=((null!==(P=b.size)&&void 0!==P?P:br)+(null!==(E=w.size)&&void 0!==E?E:br))*devicePixelRatio,D=b.id!==w.id&&j>C;k||D||(!0===m.disabled?o.push(fl(fl({},m),{},{fromNode:b,toNode:w,showLabel:x})):!0===m.selected?i.push(fl(fl({},m),{},{fromNode:b,toNode:w,showLabel:x})):a.push(fl(fl({},m),{},{fromNode:b,toNode:w,showLabel:x})))}}}catch(t){y.e(t)}finally{y.f()}return[].concat(o,a,i)}},{key:"getNodesToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.state.nodes.idToItem,u=hl(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=sl(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(fl({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(fl({},f)):a.push(fl({},f)))}}catch(t){u.e(t)}finally{u.f()}return[].concat(i,a,o)}},{key:"renderNodes",value:function(t,e,n){var r,i=this.imageCache,o=this.animationHandler,a=this.state,s=a.nodes.idToItem,u=a.nodeBorderStyles,l=hl(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;ul(e,fl(fl({},s[c.id]),c),i,o,u,n)}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderRelationships",value:function(t,e,n){var r,i=this.state.relationshipBorderStyles.selected,o=this.arrowBundler,a=this.imageCache,s=hl(t);try{for(s.s();!(r=s.n()).done;){var u=r.value,l=o.getBundle(u),c=u.fromNode,f=u.toNode,h=u.showLabel;xu(e,u,c,f,l,a,h,i,n)}}catch(t){s.e(t)}finally{s.f()}}},{key:"getNodesAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=this.state.nodes,o=i.items,a=i.idToPosition,s=_r(),u=hl(o);try{var l=function(){var i=e.value,o=i.id,u=i.size,l=void 0===u?br:u,c=a[o],f=c.x,h=c.y,d=Math.sqrt(Math.pow(t.x-f,2)+Math.pow(t.y-h,2));if(d<=(l+n)*s){var p=r.findIndex((function(t){return t.distance>d}));r.splice(-1!==p?p:r.length,0,{data:i,targetCoordinates:{x:f,y:h},pointerCoordinates:t,distanceVector:{x:t.x-f,y:t.y-h},insideNode:d<=l*s,distance:d})}};for(u.s();!(e=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return r}},{key:"getRelsAt",value:function(t){var e,n=[],r=this.state,i=this.arrowBundler,o=this.relationshipThreshold,a=r.zoom,s=r.rels.items,u=r.nodes.idToPosition,l=r.layout,c=a>o,f=hl(s);try{var h=function(){var r=e.value,o=i.getBundle(r),a=u[r.from],s=u[r.to];if(void 0!==a&&void 0!==s&&-1!==o.indexOf(r)){var f=function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(!Os(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=bu(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=js(o,s,u,t),f=js(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=du(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=js(s[0],s[2],s[1],t);else for(var l=1;l<s.length;l++){var c=s[l-1],f=s[l],h=ks(c,f,t);u=h<u?h:u}return u}(t,e,i,n,r,o,a);return s}(t,r,a,s,o,c,l!==la);if(f<10){var h=n.findIndex((function(t){return t.distance>f}));n.splice(-1!==h?h:n.length,0,{data:r,fromTargetCoordinates:a,toTargetCoordinates:s,pointerCoordinates:t,distance:f})}}};for(f.s();!(e=f.n()).done;)h()}catch(t){f.e(t)}finally{f.f()}return n}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(ml),this.state.rels.removeChannel(ml)}},{key:"isBoundingBoxOffScreen",value:function(t,e,n){var r=this.state,i=r.zoom,o=e/i,a=n/i,s=r.panX-o/2,u=r.panY-a/2,l=t.right<s,c=t.bottom<u,f=t.left>s+o,h=t.top>u+a;return l||f||c||h}},{key:"handleChannelUpdate",value:function(t,e,n){for(var r=Object.keys(t.adds),i=0;i<r.length;i++){var o=r[i];t.adds[o].activated&&this.activeNodes.add(o)}for(var a=Object.keys(t.removes),s=0;s<a.length;s++){var u=a[s];this.activeNodes.delete(u)}if(n)for(var l=Object.keys(t.updates),c=0;c<l.length;c++){var f=l[c];e.idToItem[f].activated?this.activeNodes.add(f):this.activeNodes.delete(f)}}},{key:"zoomAndPan",value:function(t,e){var n=e.width,r=e.height,i=this.state,o=i.zoom,a=i.panX,s=i.panY;t.translate(-n/2*o,-r/2*o),t.translate(-a*o,-s*o),t.scale(o,o),t.translate(n/2/o,r/2/o),t.translate(n/2,r/2)}}],n&&pl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),bl=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=function(t,e){if((0,n.isNil)(t)||(0,n.isNil)(e))return{offsetX:0,offsetY:0};var r=e.getBoundingClientRect(),i=window.devicePixelRatio||1;return{offsetX:i*(t.clientX-r.left-.5*r.width),offsetY:i*(t.clientY-r.top-.5*r.height)}}(t,e);return{x:i+a.offsetX/r,y:o+a.offsetY/r}};function wl(t){return wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wl(t)}function xl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Al(r.key),r)}}function Sl(t,e,n){return e&&_l(t.prototype,e),n&&_l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tl(t,e,n){return(e=Al(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Al(t){var e=function(t,e){if("object"!=wl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=wl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wl(e)?e:String(e)}var Ol="WebGLRenderer",Pl=function(){function t(e){var n=this;if(xl(this,t),Tl(this,"mainSceneRenderer",void 0),Tl(this,"minimapRenderer",void 0),Tl(this,"needsRun",void 0),Tl(this,"minimapMouseDown",void 0),Tl(this,"stateDisposers",void 0),Tl(this,"state",void 0),void 0===e.state)throw new Error("Renderer missing options: state - state object");var r=e.state,i=e.mainSceneRenderer,o=e.minimapRenderer,a=r.nodes,s=r.rels;this.mainSceneRenderer=i,this.minimapRenderer=o,this.needsRun=!1,this.minimapMouseDown=!1,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){n.updateMainViewport(r.zoom,r.panX,r.panY)}))),this.stateDisposers.push(r.autorun((function(){n.updateMinimapViewport(r.minimapZoom,r.minimapPanX,r.minimapPanY)}))),this.stateDisposers.push(r.autorun((function(){void 0!==r.nodes.version&&(n.needsRun=!0),void 0!==r.rels.version&&(n.needsRun=!0)}))),a.addChannel(Ol),s.addChannel(Ol),this.state=r,this.setupMinimapInteractions()}return Sl(t,[{key:"needsToRun",value:function(){return this.needsRun||Object.keys(this.mainSceneRenderer.activeNodes).length>0}},{key:"renderMainScene",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.mainSceneRenderer.render(t,n,r),this.needsRun=!1}},{key:"renderMinimap",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.minimapRenderer.render(t,n,r),this.minimapRenderer.renderViewbox(),this.needsRun=!1}},{key:"checkForUpdates",value:function(t,e){var n=Object.values(t.channels[Ol].adds).length>0,r=Object.values(e.channels[Ol].adds).length>0,i=Object.values(t.channels[Ol].removes).length>0,o=Object.values(e.channels[Ol].removes).length>0,a=Object.values(t.channels[Ol].updates),s=Object.values(e.channels[Ol].updates);n||r||i||o?(this.mainSceneRenderer.setData({nodes:t.items,rels:e.items}),this.minimapRenderer.setData({nodes:t.items,rels:e.items})):(a.length>0&&(this.mainSceneRenderer.updateNodes(a),this.minimapRenderer.updateNodes(a)),s.length>0&&(this.mainSceneRenderer.updateRelationships(e.items),this.minimapRenderer.updateRelationships(e.items))),t.clearChannel(Ol),e.clearChannel(Ol)}},{key:"onResize",value:function(){var t=this.state,e=t.zoom,n=t.panX,r=t.panY,i=t.minimapZoom,o=t.minimapPanX,a=t.minimapPanY;this.updateMainViewport(e,n,r),this.updateMinimapViewport(i,o,a)}},{key:"updateMainViewport",value:function(t,e,n){this.mainSceneRenderer.updateViewport(t,e,n);var r=this.mainSceneRenderer.canvas.clientWidth,i=this.mainSceneRenderer.canvas.clientHeight;this.minimapRenderer.updateViewportBox(t,e,n,r,i),this.needsRun=!0}},{key:"updateMinimapViewport",value:function(t,e,n){this.minimapRenderer.updateViewport(t,e,n),this.needsRun=!0}},{key:"handleMinimapDrag",value:function(t){var e=this.state,n=this.minimapRenderer,r=bl(t,n.canvas,e.minimapZoom,e.minimapPanX,e.minimapPanY),i=r.x,o=r.y;e.setPan(i,o)}},{key:"handleMinimapWheel",value:function(t){var e=this.state,r=this.mainSceneRenderer;e.setZoom(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,n.isNil)(t)||isNaN(t.deltaY)?e:e-t.deltaY/500*Math.min(1,e)}(t,e.zoom),r.canvas),t.preventDefault()}},{key:"setupMinimapInteractions",value:function(){var t=this,e=this.minimapRenderer.canvas;e.addEventListener("mousedown",(function(e){t.handleMinimapDrag(e),t.minimapMouseDown=!0})),e.addEventListener("mousemove",(function(e){t.minimapMouseDown&&t.handleMinimapDrag(e)})),e.addEventListener("mouseup",(function(){t.minimapMouseDown=!1})),e.addEventListener("mouseleave",(function(){t.minimapMouseDown=!1})),e.addEventListener("wheel",(function(e){t.handleMinimapWheel(e)}))}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ol),this.state.rels.removeChannel(Ol),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),El=function(){function t(){xl(this,t),Tl(this,"mainSceneRenderer",void 0),Tl(this,"minimapRenderer",void 0),Tl(this,"needsRun",void 0),Tl(this,"minimapMouseDown",void 0),Tl(this,"stateDisposers",void 0),Tl(this,"state",void 0)}return Sl(t,[{key:"renderMainScene",value:function(t){}},{key:"renderMinimap",value:function(t){}},{key:"checkForUpdates",value:function(t,e){}},{key:"onResize",value:function(){}},{key:"updateMainViewport",value:function(t,e,n){}},{key:"updateMinimapViewport",value:function(t,e,n){}},{key:"handleMinimapDrag",value:function(t){}},{key:"handleMinimapWheel",value:function(t){}},{key:"setupMinimapInteractions",value:function(){}},{key:"destroy",value:function(){}},{key:"needsToRun",value:function(){return!1}}]),t}();function kl(t){return kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(t)}function Cl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function jl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Dl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Il(r.key),r)}}function Rl(t,e,n){return(e=Il(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Il(t){var e=function(t,e){if("object"!=kl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=kl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kl(e)?e:String(e)}var Ml,Ll=24,Nl=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=jo().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},Fl=function(){function t(e,n,r,i){var o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rl(this,"nodeShader",void 0),Rl(this,"nodeAnimShader",void 0),Rl(this,"relShader",void 0),Rl(this,"relDataBuffer",void 0),Rl(this,"viewportBoxShader",void 0),Rl(this,"defaultRelColor",void 0),Rl(this,"defaultNodeColor",void 0),Rl(this,"disableRelColor",void 0),Rl(this,"disableNodeColor",void 0),Rl(this,"gl",void 0),Rl(this,"activeNodes",void 0),Rl(this,"canvas",void 0),Rl(this,"projection",void 0),Rl(this,"idToIndex",void 0),Rl(this,"posBuffer",void 0),Rl(this,"numRels",void 0),Rl(this,"numNodes",void 0),Rl(this,"nodeDataByte",void 0),Rl(this,"relIdToIndex",void 0),Rl(this,"relData",void 0),Rl(this,"viewportBoxBuffer",void 0),Rl(this,"relBuffer",void 0),Rl(this,"nodeBuffer",void 0),Rl(this,"posTexture",void 0),void 0===(null!==(o=e.getExtension("OES_texture_float"))&&void 0!==o?o:void 0))throw new Error("Renderer needs floating point texture support");this.nodeShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp float u_drawDefaultBorder;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}","uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float ringSize = 0.43;\nmediump float ringSize2 = 0.47;\nmediump float shadowSize = 0.51;\nlowp vec3 shadowColor = vec3(0.73);\nlowp vec3 lineColor = vec3(1.0);\n\nlowp float getShadowAlpha(lowp float size, lowp float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nlowp float getCircleAlpha(lowp float ringSize, lowp float nodeSize, lowp float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float nodeSize = 1.0 / varNodeSize;\n lowp float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n lowp float ringAlpha = getCircleAlpha(ringSize, nodeSize, dist);\n lowp vec3 finalColor = color.xyz;\n lowp float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize2, dist);\n lowp float ringAlpha2 = getCircleAlpha(ringSize2, nodeSize, dist);\n\n finalColor = mix(lineColor, finalColor, nodeAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n } else if (hovered > 0.0) {\n if (drawDefaultBorder > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize, dist);\n \n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n lowp float shadowAlpha = getShadowAlpha(circleSize, dist);\n\n finalColor = mix(shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = ringAlpha;\n }\n }\n gl_FragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n"),this.nodeAnimShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_active;\n\nvarying lowp float varNodeSize;\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = a_size * u_zoom * u_glAdjust;\n nodeSize = nodeSize * (0.4 / 0.5); // Remove extra space added for shadow and selection ring\n\n gl_PointSize = a_active > 0.5\n ? nodeSize + 0.88 * nodeSize * u_animPos\n : 0.0;\n\n color = a_color;\n varNodeSize = a_size;\n}","uniform mediump float u_zoom;\nuniform lowp float u_animPos;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float varNodeSize;\nmediump float circleSize = 0.50;\n\nvoid main(void) {\n\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float alpha = 1.0 - smoothstep(circleSize - (1.0 / (varNodeSize * 2.0 * u_zoom * u_glAdjust)), circleSize, dist);\n lowp float pulseAlpha = 0.9 - 0.9 * u_animPos;\n gl_FragColor = vec4(color.xyz, 1.0) * alpha * pulseAlpha;\n }\n}\n"),this.relShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nattribute vec2 a_from;\nattribute vec2 a_to;\nattribute lowp vec4 a_color;\nattribute lowp float a_triside;\nattribute float a_width;\n\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture2D(u_positions, a_from);\n vec4 to = texture2D(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n direction = vec2(-direction.y, direction.x);\n\n float width = a_width * u_glAdjust * 0.5;\n\n if (a_triside == 0.0) {\n from.y += (width / 2.0) * direction.y;\n from.x += (width / 2.0) * direction.x;\n } else {\n from.y -= (width / 2.0) * direction.y;\n from.x -= (width / 2.0) * direction.x;\n }\n\n color = a_color;\n gl_Position = u_projection * vec4(from.xy, 0.0, 1.0);\n}\n","varying lowp vec4 color;\n\nvoid main(void) {\n gl_FragColor = vec4(color.xyz, 1.0) * color.w;\n}\n"),this.viewportBoxShader=new Ei(e,"attribute vec2 coordinates;\nuniform mat4 u_projection;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n}\n","void main(void) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n"),this.setShaderUniforms(i),e.clearColor(0,0,0,0),e.disable(e.DEPTH_TEST),this.defaultRelColor=4284900966,this.defaultNodeColor=4294937415,this.disableRelColor="#EDEDED",this.disableNodeColor="#EDEDED",e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),this.gl=e,this.activeNodes={},this.canvas=e.canvas,this.projection=wi(),this.setData({nodes:n.items,rels:r.items}),this.createPositionTexture(),this.setupViewportRendering()}var e,r;return e=t,r=[{key:"setShaderUniforms",value:function(t){var e,n,r=jo().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=jo().get.rgb(null===(n=t.nodeBorderStyles.selected)||void 0===n||null===(n=n.rings[1])||void 0===n?void 0:n.color);if(this.nodeShader.use(),null!=r&&r.length){var o=r.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_nodeBorderColor",o),this.nodeShader.setUniform("u_drawDefaultBorder",1)}else this.nodeShader.setUniform("u_drawDefaultBorder",0);var a=i.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_selectedBorderColor",a)}},{key:"setData",value:function(t){var e=Or(t.rels);this.setupNodeRendering(t.nodes),this.setupRelationshipRendering(e)}},{key:"render",value:function(t,e,n){var r,i=this.gl,o=this.idToIndex,a=Cl(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=o[s.id];this.posBuffer[4*u+0]=s.x,this.posBuffer[4*u+1]=s.y}}catch(t){a.e(t)}finally{a.f()}i.bindTexture(i.TEXTURE_2D,this.posTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,mr,mr,0,i.RGBA,i.FLOAT,this.posBuffer),i.enable(i.BLEND),i.bindFramebuffer(i.FRAMEBUFFER,null),i.clear(i.COLOR_BUFFER_BIT),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),this.renderAnimations(this.posTexture),this.numRels>0&&(this.relShader.use(),this.relShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.relBuffer),this.relShader.setAttributePointerByteNorm("a_color",4,0,16),this.relShader.setAttributePointerByteNorm("a_from",2,4,16),this.relShader.setAttributePointerByteNorm("a_to",2,6,16),this.relShader.setAttributePointerByteNorm("a_triside",1,8,16),this.relShader.setAttributePointerFloat("a_width",1,12,16),i.drawArrays(i.TRIANGLES,0,6*this.numRels)),this.numNodes>0&&(this.nodeShader.use(),this.nodeShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.nodeBuffer),this.nodeShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeShader.setAttributePointerByteNorm("a_selected",1,4,12),this.nodeShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeShader.setAttributePointerByte("a_size",4,8,12),this.nodeShader.setAttributePointerByteNorm("a_hovered",1,9,12),i.drawArrays(i.POINTS,0,this.numNodes))}},{key:"renderViewbox",value:function(){var t=this.gl,e=this.projection,n=this.viewportBoxBuffer;this.viewportBoxShader.use(),this.viewportBoxShader.setUniform("u_projection",e),t.bindBuffer(t.ARRAY_BUFFER,n),this.viewportBoxShader.setAttributePointerFloat("coordinates",2,0,0),t.drawArrays(t.LINES,0,8)}},{key:"updateNodes",value:function(t){var e,r=this.gl,i=this.idToIndex,o=this.disableNodeColor,a=this.nodeBuffer,s=this.nodeDataByte,u=!1,l=Cl(t);try{for(l.s();!(e=l.n()).done;){var c=e.value,f=i[c.id];if(!(0,n.isNil)(c.color)||!0===c.disabled){var h=jo().get.rgb(!0===c.disabled?o:c.color);this.nodeDataByte[3*f*4+0]=h[0],this.nodeDataByte[3*f*4+1]=h[1],this.nodeDataByte[3*f*4+2]=h[2],this.nodeDataByte[3*f*4+3]=255*h[3],u=!0}if(void 0!==c.selected){var d=c.selected;this.nodeDataByte[3*f*4+4]=d?255:0,u=!0}if(void 0!==c.activated&&(this.nodeDataByte[3*f*4+7]=c.activated?255:0,u=!0,c.activated?this.activeNodes[c.id]=!0:delete this.activeNodes[c.id]),void 0!==c.hovered){var p=!0!==c.disabled&&c.hovered;this.nodeDataByte[3*f*4+9]=p?255:0,u=!0}if(void 0!==c.size){var v=c.size;this.nodeDataByte[3*f*4+8]=v||br,u=!0}}}catch(t){l.e(t)}finally{l.f()}u&&(r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,s,r.DYNAMIC_DRAW))}},{key:"updateRelationships",value:function(t){var e,n=Or(t),r=this.gl,i=!1,o=Cl(n);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=a.key,u=a.width,l=a.color,c=a.disabled,f=this.relIdToIndex[s],h=void 0===l?this.defaultRelColor:Nl(!0===c?this.disableRelColor:l);this.relData.positionsAndColors[f*Ll+0]=h,this.relData.positionsAndColors[f*Ll+4]=h,this.relData.positionsAndColors[f*Ll+8]=h,this.relData.positionsAndColors[f*Ll+12]=h,this.relData.positionsAndColors[f*Ll+16]=h,this.relData.positionsAndColors[f*Ll+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*Ll+3]=u,this.relData.widths[f*Ll+7]=u,this.relData.widths[f*Ll+11]=u,this.relData.widths[f*Ll+15]=u,this.relData.widths[f*Ll+19]=u,this.relData.widths[f*Ll+23]=u,i=!0)}}catch(t){o.e(t)}finally{o.f()}i&&(r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,this.relDataBuffer,r.DYNAMIC_DRAW))}},{key:"createPositionTexture",value:function(){var t=this.gl,e=t.createTexture(),n=new Float32Array(262144);t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,mr,mr,0,t.RGBA,t.FLOAT,n),this.posTexture=e,this.posBuffer=n}},{key:"updateViewportBox",value:function(t,e,n,r,i){var o=this.gl,a=_r(),s=r*a,u=i*a,l=(.5*s+e*t)/t,c=(.5*u+n*t)/t,f=(.5*-s+e*t)/t,h=(.5*-u+n*t)/t,d=[l,c,f,c,f,c,f,h,f,h,l,h,l,h,l,c];o.bindBuffer(o.ARRAY_BUFFER,this.viewportBoxBuffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array(d),o.DYNAMIC_DRAW)}},{key:"updateViewport",value:function(t,e,n){var r=this.gl,i=1/t,o=e-r.drawingBufferWidth*i*.5,a=n-r.drawingBufferHeight*i*.5,s=r.drawingBufferWidth*i,u=r.drawingBufferHeight*i,l=wi(),c=2.6315789473684212*_r();xi(l,o,o+s,a+u,a,0,1e6),this.nodeShader.use(),this.nodeShader.setUniform("u_zoom",t),this.nodeShader.setUniform("u_glAdjust",c),this.nodeShader.setUniform("u_projection",l),this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_zoom",t),this.nodeAnimShader.setUniform("u_glAdjust",c),this.nodeAnimShader.setUniform("u_projection",l),this.relShader.use(),this.relShader.setUniform("u_glAdjust",c),this.relShader.setUniform("u_projection",l),this.projection=l}},{key:"setupViewportRendering",value:function(){this.viewportBoxBuffer=this.gl.createBuffer()}},{key:"setupNodeRendering",value:function(t){var e=this.gl,r=new ArrayBuffer(8),i=new Uint32Array(r),o=new Uint8Array(r);void 0===this.nodeBuffer&&(this.nodeBuffer=e.createBuffer()),this.numNodes=t.length;var a=new ArrayBuffer(3*t.length*8),s=new Uint32Array(a),u={};this.activeNodes={};for(var l=0;l<t.length;l++){var c=t[l],f=c.selected,h=c.hovered,d=c.color,p=c.activated,v=c.size,y=c.id,m=c.disabled,g=(0,n.isNil)(d)?this.defaultNodeColor:Nl(d);s[3*l+0]=!0===m?Nl(this.disableNodeColor):g,o[0]=!0===f?255:0,o[1]=l%mr,o[2]=Math.floor(l/mr),o[3]=!0===p?255:0,o[4]=!1===m&&!0===h?255:0,!0===p&&(this.activeNodes[y]=!0),s[3*l+1]=i[0],s[3*l+2]=null!=v?v:br,s[3*l+3]=i[1],u[y]=l}e.bindBuffer(e.ARRAY_BUFFER,this.nodeBuffer),e.bufferData(e.ARRAY_BUFFER,s,e.DYNAMIC_DRAW),this.numNodes=t.length,this.nodeDataByte=new Uint8Array(a),this.idToIndex=u}},{key:"setupRelationshipRendering",value:function(t){var e=this,r=this.gl,i=new ArrayBuffer(4),o=new Uint32Array(i),a=new Uint8Array(i),s={};void 0===this.relBuffer&&(this.relBuffer=r.createBuffer());for(var u=new ArrayBuffer(t.length*Ll*4),l=new Uint32Array(u),c=new Float32Array(u),f=function(r){var i=t[r],u=i.from,f=i.to,h=i.color,d=i.width,p=i.key,v=i.disabled,y=e.idToIndex[u],m=e.idToIndex[f],g=y%mr,b=Math.floor(y/mr),w=m%mr,x=Math.floor(m/mr),_=[g,b,w,x],S=[w,x,g,b],T=(0,n.isNil)(h)?e.defaultRelColor:Nl(h),A=!0===v?Nl(e.disableRelColor):T,O=null!=d?d:1;s[p]=r;var P=0,E=function(t,e,n,i){l[r*Ll+P]=t,P+=1;for(var s=0;s<e.length;s++)a[s]=e[s];l[r*Ll+P]=o[0],P+=1,a[0]=n,l[r*Ll+P]=o[0],c[r*Ll+(P+=1)]=i,P+=1};E(A,_,255,O),E(A,S,0,O),E(A,_,0,O),E(A,S,0,O),E(A,_,0,O),E(A,S,255,O)},h=0;h<t.length;h++)f(h);r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,u,r.DYNAMIC_DRAW),this.numRels=t.length,this.relDataBuffer=u,this.relData={positionsAndColors:l,widths:c},this.relIdToIndex=s}},{key:"renderAnimations",value:function(t){var e=this.gl,n=this.nodeBuffer,r=this.numNodes,i=Date.now()%1e3/1e3,o=i<.7?i/.7:0;this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_positions",t),this.nodeAnimShader.setUniform("u_animPos",o),e.bindBuffer(e.ARRAY_BUFFER,n),this.nodeAnimShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeAnimShader.setAttributePointerByteNorm("a_active",1,7,12),this.nodeAnimShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeAnimShader.setAttributePointerByte("a_size",4,8,12),e.drawArrays(e.POINTS,0,r)}},{key:"destroy",value:function(){this.gl.deleteBuffer(this.nodeBuffer),this.gl.deleteBuffer(this.relBuffer),this.nodeShader.remove(),this.nodeAnimShader.remove(),this.relShader.remove()}}],r&&Dl(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ul=function(t,e,n){var r=_r();t.width=e*r,t.height=n*r,t.style.width="".concat(e,"px"),t.style.height="".concat(n,"px")},zl=function(t){Gr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==Ml&&Ml(t)},Bl=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;Ul(t,n,r)},Vl=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),Ul(n,t,e),n},Gl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,xr),void 0!==t&&(t.appendChild(n),Bl(n)),function(t,e){Ml=e,t.addEventListener("webglcontextlost",zl)}(n,e),n},Wl=function(t){t.width=0,t.height=0,t.remove()},Xl=function(t){return t.getContext("2d")},Hl=function(t){var e={antialias:!0},n=t.getContext("webgl",e);return null===n&&(n=t.getContext("experimental-webgl",e)),function(t){return t instanceof WebGLRenderingContext}(n)?n:null},Yl=function(t){t.canvas.removeEventListener("webglcontextlost",zl);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function $l(t){return function(t){if(Array.isArray(t))return Kl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Zl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ql(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Zl(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Zl(t,e){if(t){if("string"==typeof t)return Kl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kl(t,e):void 0}}function Kl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Jl=br*_r();function Ql(t){return Ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ql(t)}function tc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ec(r.key),r)}}function ec(t){var e=function(t,e){if("object"!=Ql(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ql(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ql(e)?e:String(e)}var nc=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=ec(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks={}}var e,n;return e=t,n=[{key:"register",value:function(t,e){this.isCallbackRegistered(t)||(this.callbacks[t]=[]),this.callbacks[t].push(e)}},{key:"isCallbackRegistered",value:function(t){return void 0!==this.callbacks[t]}},{key:"callIfRegistered",value:function(){var t,e=arguments,n=Array.prototype.slice.call(arguments)[0];t=n,u.includes(t)&&this.isCallbackRegistered(n)&&this.callbacks[n].slice(0).forEach((function(t){return t.apply(null,Array.prototype.slice.call(e,1))}))}}],n&&tc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),rc=i(481),ic=i.n(rc);function oc(t){return oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(t)}function ac(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uc(r.key),r)}}function sc(t,e,n){return(e=uc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uc(t){var e=function(t,e){if("object"!=oc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=oc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oc(e)?e:String(e)}var lc=5e-5,cc=function(){function t(e){var n,r=this,i=e.state,o=e.getNodePositions,a=e.canvas,s=e.defaultZoomLevel;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),sc(this,"xCtrl",void 0),sc(this,"yCtrl",void 0),sc(this,"zoomCtrl",void 0),sc(this,"getNodePositions",void 0),sc(this,"firstUpdate",void 0),sc(this,"state",void 0),sc(this,"canvas",void 0),sc(this,"defaultZoomLevel",void 0),sc(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(ic())(.35,lc,.05,1),this.yCtrl=new(ic())(.35,lc,.05,1),this.zoomCtrl=new(ic())(.3,1e-5,.01,1),this.defaultZoomLevel=s,this.stateDisposers=[],this.stateDisposers.push(i.autorun((function(){null===i.fitNodeIds&&(r.xCtrl.reset(),r.yCtrl.reset(),r.zoomCtrl.reset())}))),this.stateDisposers.push(i.autorun((function(){n!==i.fitNodeIds&&(n=i.fitNodeIds,r.firstUpdate=!0)}))),this.stateDisposers.push(i.autorun((function(){i.resetZoom&&(r.firstUpdate=!0)})))}var e,n;return e=t,n=[{key:"needsToRun",value:function(){var t=this.state,e=t.fitNodeIds,n=t.resetZoom;return e.length>0||n}},{key:"update",value:function(t){var e=this.state,n=e.fitNodeIds,r=e.resetZoom;n.length>0?this.fitNodes(n,t):r&&this.reset(t)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){return t()}))}},{key:"recalculateTarget",value:function(t,e,n,r){for(var i=this.xCtrl,o=this.yCtrl,a=this.zoomCtrl,s=this.state,u=this.defaultZoomLevel,l=[],c=0;c<t.length;c++)l.push({id:t[c]});var f=s.zoom,h=s.panX,d=s.panY,p=s.maxNodeRadius,v=s.nodes,y=this.getNodePositions(l);v.updatePositions(y);var m=Mo(y,p),g=m.centerX,b=m.centerY,w=m.nodesWidth,x=m.nodesHeight;if(isNaN(g)||isNaN(b))return Gr.info("fit() function couldn't calculate center point, not updating viewport"),!1;i.setTarget(!0===e.noPan?h:g),o.setTarget(!0===e.noPan?d:b);var _=Lo(w,x,n,r),S=_.zoomX,T=_.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var A=No(S,T,e.minZoom,e.maxZoom);!0===e.outOnly&&f<A?a.setTarget(f):a.setTarget(A)}return!0}},{key:"allNodesAreVisible",value:function(t,e,n){var r=Lo(e,n,this.canvas.width,this.canvas.height),i=r.zoomX,o=r.zoomY;return t<i&&t<o}},{key:"reset",value:function(t){var e=this.state,n=e.zoom,r=e.panX,i=e.panY,o=e.nodes,a=e.maxNodeRadius,s=e.defaultZoomLevel;if(this.firstUpdate||t){this.zoomCtrl.setTarget(s);var u=Mo(Object.values(o.idToPosition),a),l=u.centerX,c=u.centerY,f=u.nodesWidth,h=u.nodesHeight;this.allNodesAreVisible(n,f,h)?(this.xCtrl.setTarget(l),this.yCtrl.setTarget(c)):(this.xCtrl.setTarget(r),this.yCtrl.setTarget(i)),this.firstUpdate=!1}var d=n+this.zoomCtrl.update(n),p=r+this.xCtrl.update(r),v=i+this.yCtrl.update(i);this.state.updateZoomToFit(d,p,v,this.canvas),Math.abs(this.zoomCtrl.target-d)<.01&&(this.state.updateZoomToFit(s,p,v,this.canvas),this.state.clearReset())}},{key:"fitNodes",value:function(t,e){var n=this.state,r=n.zoomOptions,i=void 0===r?{}:r,o=n.zoom,a=n.panX,s=n.panY,u=!0;if(this.firstUpdate||e){var l=this.canvas,c=l.width,f=l.height;u=this.recalculateTarget(t,i,c,f),this.firstUpdate=!1}if(u){var h=a+this.xCtrl.update(a),d=s+this.yCtrl.update(s),p=o+this.zoomCtrl.update(o);this.state.updateZoomToFit(p,h,d,this.canvas);var v=Math.max(5,10/this.zoomCtrl.target),y=Math.min(.01,.01*this.zoomCtrl.target);!e&&Math.abs(this.zoomCtrl.target-p)<y&&Math.abs(this.xCtrl.target-h)<v&&Math.abs(this.yCtrl.target-d)<v&&(this.state.setZoom(this.zoomCtrl.target,this.canvas),this.state.clearFit())}}}],n&&ac(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fc(t){return fc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(t)}function hc(){hc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==fc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function j(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(fc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=j,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:j(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function dc(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vc(Object(n),!0).forEach((function(e){gc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bc(r.key),r)}}function gc(t,e,n){return(e=bc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bc(t){var e=function(t,e){if("object"!=fc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=fc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fc(e)?e:String(e)}var wc="NvlController",xc={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},_c="onError",Sc="onLayoutDone",Tc={},Ac=function(){var t;return null!==(t=Tc[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Tc).pop()},Oc=function(){function t(e,n){var r,i,o,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),gc(this,"destroyed",void 0),gc(this,"state",void 0),gc(this,"callbacks",void 0),gc(this,"instanceId",void 0),gc(this,"glController",void 0),gc(this,"webGLContext",void 0),gc(this,"webGLMinimapContext",void 0),gc(this,"htmlOverlay",void 0),gc(this,"hasResized",void 0),gc(this,"hierarchicalLayout",void 0),gc(this,"gridLayout",void 0),gc(this,"freeLayout",void 0),gc(this,"d3ForceLayout",void 0),gc(this,"forceLayout",void 0),gc(this,"canvasRenderer",void 0),gc(this,"glCanvas",void 0),gc(this,"canvasRect",void 0),gc(this,"glMinimapCanvas",void 0),gc(this,"c2dCanvas",void 0),gc(this,"isInRenderSwitchAnimation",void 0),gc(this,"justSwitchedRenderer",void 0),gc(this,"justSwitchedLayout",void 0),gc(this,"layoutUpdating",void 0),gc(this,"layoutComputing",void 0),gc(this,"isRenderingDisabled",void 0),gc(this,"setRenderSwitchAnimation",void 0),gc(this,"stateDisposers",void 0),gc(this,"zoomTransitionHandler",void 0),gc(this,"currentLayout",void 0),gc(this,"layoutTimeLimit",void 0),gc(this,"pixelRatio",void 0),gc(this,"removeResizeListener",void 0),gc(this,"removeMinimapResizeListener",void 0),gc(this,"pendingZoomOperation",void 0),gc(this,"layoutRunner",void 0),gc(this,"animationRequestId",void 0),gc(this,"layoutDoneCallback",void 0),gc(this,"layoutComputingCallback",void 0),gc(this,"currentLayoutType",void 0),this.destroyed=!1;var s=n.frame,u=n.minimapContainer,l=void 0===u?document.createElement("span"):u,c=n.layoutOptions,f=n.layout,h=n.instanceId,d=void 0===h?"default":h,p=e.nodes,v=e.rels,y=e.webGLVisible,m=e.disableWebGL;this.state=e,this.callbacks=new nc,this.instanceId=d;var g=s;g.setAttribute("instanceId",d),g.setAttribute("data-testid","nvl-parent"),null!==(r=g.style.height)&&void 0!==r&&r.length||Object.assign(g.style,{height:"100%"}),null!==(i=g.style.outline)&&void 0!==i&&i.length||Object.assign(g.style,{outline:"none"});var b=Gl(g,this.onWebGLContextLost.bind(this)),w=Gl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new El;else{var x=Hl(b),_=Hl(w);this.glController=new Pl({mainSceneRenderer:new Fl(x,p,v,this.state),minimapRenderer:new Fl(_,p,v,this.state),state:e}),this.webGLContext=x,this.webGLMinimapContext=_}var S=Gl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),A=document.createElement("div");Object.assign(A.style,yc(yc({},xr),{},{overflow:"hidden"})),g.appendChild(A),this.htmlOverlay=A,this.hasResized=!0,this.hierarchicalLayout=new Na(yc(yc({},c),{},{state:this.state})),this.gridLayout=new ko({state:this.state}),this.freeLayout=new wo({state:this.state}),this.d3ForceLayout=new Br({state:this.state}),this.forceLayout=m?this.d3ForceLayout:new lo(yc(yc({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var O=new gl(S,T,e,n);this.canvasRenderer=O,this.glCanvas=b,this.canvasRect=b.getBoundingClientRect(),this.glMinimapCanvas=w,this.c2dCanvas=S,this.glCanvas.style.opacity=y?"1":"0",this.c2dCanvas.style.opacity=y?"0":"1",this.isInRenderSwitchAnimation=!1,this.justSwitchedRenderer=!1,this.justSwitchedLayout=!1,this.hasResized=!1,this.layoutUpdating=!1,this.layoutComputing=!1,this.isRenderingDisabled=!1,p.addChannel(wc),v.addChannel(wc),this.setRenderSwitchAnimation=function(){a.isInRenderSwitchAnimation=!1},this.stateDisposers=[],this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("zoom",e.zoom)}))),this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("pan",{panX:e.panX,panY:e.panY})}))),this.stateDisposers.push(e.autorun((function(){a.setLayout(e.layout)}))),this.stateDisposers.push(e.autorun((function(){a.setLayoutOptions(e.layoutOptions)}))),this.stateDisposers.push(e.autorun((function(){var t=e.webGLVisible?"1":"0";t!==a.glCanvas.style.opacity&&(a.justSwitchedRenderer=!0,a.glCanvas.style.opacity=t,a.c2dCanvas.style.opacity=e.webGLVisible?"0":"1")}))),this.startMainLoop(),this.zoomTransitionHandler=new cc({state:e,getNodePositions:function(t){return a.currentLayout.getNodePositions(t)},canvas:b,defaultZoomLevel:aa}),this.layoutTimeLimit=null!==(o=n.layoutTimeLimit)&&void 0!==o?o:16,this.pixelRatio=_r(),this.removeResizeListener=Pn()(g,(function(){Bl(b),Bl(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=Pn()(l,(function(){Bl(w)})),Tc[d]=this,window.__Nvl_dumpNodes=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Ac(e))||void 0===n?void 0:n.on(Sc,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.getScale()},this.pendingZoomOperation=null}var e,n,r,i;return e=t,n=[{key:"onWebGLContextLost",value:function(t){this.callIfRegistered("onWebGLContextLost",t)}},{key:"updateMinimapZoom",value:function(){var t=this.state,e=t.nodes,n=t.maxNodeRadius,r=t.maxMinimapZoom,i=t.minMinimapZoom,o=Mo(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=Lo(u,l,this.glMinimapCanvas.width,this.glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=No(f,h,i,r);this.state.updateMinimapZoomToFit(d,a,s)}},{key:"startMainLoop",value:function(){var t=this,e=this.state,n=e.nodes,r=e.rels;this.currentLayout.update();var i=this.currentLayout.getNodePositions(n.items);n.updatePositions(i),this.isRenderingDisabled||(this.glController.renderMainScene(i),this.glController.renderMinimap(i),this.canvasRenderer.processUpdates(),this.canvasRenderer.render(i)),this.layoutRunner=setInterval((function(){try{!function(){var e=t.currentLayout.getShouldUpdate(),n=e||t.justSwitchedLayout,r=n&&!t.layoutUpdating&&!t.justSwitchedLayout;if(n)for(var i=window.performance.now(),o=r?0:50,a=0;a<o;a++){t.currentLayout.update(t.justSwitchedLayout),t.justSwitchedLayout=!1;var s=window.performance.now();if(!e||s-i>t.layoutTimeLimit)break}}()}catch(e){if(!t.callbacks.isCallbackRegistered(_c))throw e;t.callIfRegistered(_c,e)}}),13),this.animationRequestId=window.requestAnimationFrame((function e(){try{!function(e){if(t.destroyed)Gr.info("STEP IN A DESTROYED STRIP");else{var i=_r();if(i!==t.pixelRatio)return t.pixelRatio=i,void t.callIfRegistered("restart");var o=t.currentLayout.getShouldUpdate(),a=o||t.justSwitchedLayout,s=t.currentLayout.getComputing(),u=t.zoomTransitionHandler.needsToRun(),l=a&&!t.layoutUpdating&&!t.justSwitchedLayout,c=t.layoutComputing&&!s,f=t.state.webGLVisible&&t.glController.needsToRun(),h=!t.state.webGLVisible&&t.canvasRenderer.needsToRun(),d=t.isInRenderSwitchAnimation||t.justSwitchedRenderer,p=t.hasResized,v=null!==t.pendingZoomOperation,y=t.glController.minimapMouseDown;if(n.clearChannel(wc),r.clearChannel(wc),u||a||c||d||f||h||y||p||v){!t.pendingZoomOperation||l||t.currentLayout.getComputing()||(t.pendingZoomOperation(),t.pendingZoomOperation=null),t.zoomTransitionHandler.update(o||s||c),p&&t.glController.onResize();var m=t.currentLayout.getNodePositions(n.items);if(n.updatePositions(m),t.callIfRegistered("onLayoutStep",t.dumpNodes()),t.updateMinimapZoom(),t.glController.renderMinimap(m),!t.isRenderingDisabled){if((t.state.webGLVisible||d)&&t.glController.renderMainScene(m),!t.state.webGLVisible||d){t.canvasRenderer.processUpdates(),t.canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b=r.items[g].id,w=t.canvasRenderer.arrowBundler.getBundle(r.items[g]),x=r.idToHtmlOverlay[b],_=w.labelInfo[b];if(x&&_){var S=_.rotation,T=_.position,A=_.width,O=_.height,P=t.mapCanvasSpaceToRelativePosition(T.x,T.y),E=P.x,k=P.y,C=A>5&&!t.state.webGLVisible;Object.assign(x.style,{top:"".concat(k,"px"),left:"".concat(E,"px"),width:"".concat(A,"px"),height:"".concat(O,"px"),display:C?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),") rotate(").concat(S,"rad")})}}}for(var j=0;j<n.items.length;j++){var D=n.items[j],R=D.id,I=D.size,M=n.idToHtmlOverlay[R];if(M){var L=t.state.nodes.idToPosition[R],N=t.mapCanvasSpaceToRelativePosition(L.x,L.y),F=N.x,U=N.y,z="".concat(2*(null!=I?I:br),"px");Object.assign(M.style,{top:"".concat(U,"px"),left:"".concat(F,"px"),width:z,height:z,transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),")")})}}}}var B=!a&&t.layoutUpdating,V=s!==t.layoutComputing;t.layoutComputing=s,t.layoutUpdating=a,B&&t.callIfRegistered(Sc),V&&t.callIfRegistered("onLayoutComputing",s),t.justSwitchedRenderer=!1,t.hasResized=!1,void 0!==e&&e()}}((function(){t.animationRequestId=window.requestAnimationFrame(e)}))}catch(e){if(!t.callbacks.isCallbackRegistered(_c))throw e;t.callIfRegistered(_c,e)}}))}},{key:"updateHtmlOverlay",value:function(){this.state.nodes.updateHtmlOverlay(this.htmlOverlay),this.state.rels.updateHtmlOverlay(this.htmlOverlay)}},{key:"dumpNodes",value:function(){var t,e=this.state.nodes.items,n=this.state.nodes.idToPosition,r=[],i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id],s=this.mapCanvasSpaceToRelativePosition(a.x,a.y);r.push(yc(yc({},o),{},{x:s.x,y:s.y}))}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"dumpRelationships",value:function(){return wn(this.state.rels.items)}},{key:"mapCanvasSpaceToRelativePosition",value:function(t,e){var n=this.canvasRect,r=window.devicePixelRatio||1,i=(t-this.state.panX)*this.state.zoom/r,o=(e-this.state.panY)*this.state.zoom/r;return{x:i+.5*n.width,y:o+.5*n.height}}},{key:"mapRelativePositionToCanvasSpace",value:function(t,e){var n=this.glCanvas.getBoundingClientRect(),r=window.devicePixelRatio||1,i=r*(t-.5*n.width),o=r*(e-.5*n.height);return{x:this.state.panX+i/this.state.zoom,y:this.state.panY+o/this.state.zoom}}},{key:"getNodePositions",value:function(){return Object.values(wn(this.state.nodes.idToPosition))}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state.nodes.updatePositions(t),this.currentLayout.updateNodes(t),e||this.currentLayout.terminateUpdate(),this.hasResized=!0,0===this.getNodesOnScreen().nodes.length&&this.state.setPan(0,0),this.state.clearFit()}},{key:"isLayoutMoving",value:function(){return this.layoutUpdating}},{key:"getNodesOnScreen",value:function(){var t=this.glCanvas.getBoundingClientRect(),e=this.mapRelativePositionToCanvasSpace(0,0),n=e.x,r=e.y,i=this.mapRelativePositionToCanvasSpace(t.width,t.height);return function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:["node"],a=i.nodes,s=i.rels,u=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),h=[],d=[];if(o.includes("node"))for(var p=0,v=Object.values(a.idToPosition);p<v.length;p++){var y=v[p],m=y.x,g=y.y;void 0!==m&&void 0!==g&&m>u&&m<l&&g>c&&g<f&&h.push(y)}if(o.includes("relationship")){var b,w=ql(s.items);try{for(w.s();!(b=w.n()).done;){var x=b.value,_=x.from,S=x.to,T=a.idToPosition[_],A=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==A.x&&void 0!==A.y){var O=T.x>u&&T.x<l&&T.y>c&&T.y<f,P=A.x>u&&A.x<l&&A.y>c&&A.y<f;O&&P&&d.push(x)}}}catch(t){w.e(t)}finally{w.f()}}return{nodes:h,rels:d}}(n,r,i.x,i.y,this.state,["node"])}},{key:"registerDoneCallback",value:function(t){this.layoutDoneCallback=t}},{key:"registerComputingCallback",value:function(t){this.layoutComputingCallback=t}},{key:"getPosition",value:function(t){return this.currentLayout.getNodePositions([{id:t}])[0]}},{key:"getScale",value:function(){return this.state.zoom}},{key:"getPan",value:function(){return{x:this.state.panX,y:this.state.panY}}},{key:"setZoomLevel",value:function(t){var e=this;this.pendingZoomOperation=function(){return e.state.setZoom(t,e.glCanvas)}}},{key:"setPanCoordinates",value:function(t,e){this.state.setPan(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){var r=this;this.pendingZoomOperation=function(){return r.state.setZoomPan(t,e,n,r.glCanvas)}}},{key:"fit",value:function(t,e){var n=this;this.pendingZoomOperation=function(){return n.state.fitNodes(t,e)}}},{key:"resetZoom",value:function(){var t=this;this.pendingZoomOperation=function(){return t.state.setZoomReset()}}},{key:"setRenderer",value:function(t){this.state.setRenderer(t)}},{key:"on",value:function(t,e){this.callbacks.register(t,e)}},{key:"isDestroyed",value:function(){return this.destroyed}},{key:"destroy",value:function(){var t;this.destroyed||(this.animationRequestId&&window.cancelAnimationFrame(this.animationRequestId),void 0!==this.layoutRunner&&window.clearInterval(this.layoutRunner),this.glController.destroy(),this.glCanvas.removeEventListener("transitionend",this.setRenderSwitchAnimation),void 0!==this.webGLContext&&Yl(this.webGLContext),void 0!==this.webGLMinimapContext&&Yl(this.webGLMinimapContext),Wl(this.glCanvas),Wl(this.glMinimapCanvas),this.canvasRenderer.destroy(),Wl(this.c2dCanvas),this.removeResizeListener(),this.removeMinimapResizeListener(),this.forceLayout.destroy(),this.hierarchicalLayout.destroy(),this.gridLayout.destroy(),this.freeLayout.destroy(),this.htmlOverlay.remove(),this.zoomTransitionHandler.destroy(),this.stateDisposers.forEach((function(t){t()})),t=this.instanceId,delete Tc[t],this.destroyed=!0)}},{key:"callIfRegistered",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks.callIfRegistered.apply(this.callbacks,arguments)}},{key:"getCanvasRelsAt",value:function(t){return this.canvasRenderer.getRelsAt(t)}},{key:"getCanvasNodesAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.canvasRenderer.getNodesAt(t,e)}},{key:"getLayout",value:function(t){return t===la?this.hierarchicalLayout:t===ua?this.forceLayout:t===ca?this.gridLayout:t===fa?this.freeLayout:t===ha?this.d3ForceLayout:this.forceLayout}},{key:"setLayout",value:function(t){Gr.info("Switching to layout: ".concat(t));var e=this.currentLayoutType,n=this.getLayout(t);"free"===t&&n.setNodePositions(this.state.nodes.idToPosition),this.currentLayout=n,this.currentLayoutType=t,e&&e!==this.currentLayoutType&&(this.justSwitchedLayout=!0)}},{key:"setLayoutOptions",value:function(t){this.getLayout(this.state.layout).setOptions(t)}},{key:"createDownloadLink",value:function(t,e){var n=document.createElement("a");n.style.display="none",n.setAttribute("download",t);var r=e.toDataURL("image/png").replace(/^data:image\/png/,"data:application/octet-stream");return n.setAttribute("href",r),n}},{key:"saveToFile",value:function(t){var e=yc(yc({},xc),t),n=e.filename,r=e.backgroundColor,i=this.state.nodes.items;this.currentLayout.update(this.justSwitchedLayout),this.justSwitchedLayout=!1;var o=this.currentLayout.getNodePositions(i);this.state.nodes.updatePositions(o);var a=Vl(this.c2dCanvas.width,this.c2dCanvas.height),s=Xl(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),Wl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=yc(yc({},xc),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Mo(a,100),u=s.nodesWidth,l=s.nodesHeight,c=s.centerX,f=s.centerY,h=Math.max(Math.min(u+100,15e3),5e3),d=Math.max(Math.min(l+100,15e3),5e3);return this.isRenderingDisabled=!0,new Promise((function(t,n){try{e.setPanCoordinates(c,f);var r=Math.max(h/u-.02,e.state.minZoom),s=Math.max(d/l-.02,e.state.minZoom);e.setZoomLevel(Math.min(r,s))}catch(t){return Gr.error("An error occurred while downloading the file"),void n(t)}setTimeout((function(){try{e.currentLayout.update(e.justSwitchedLayout),e.justSwitchedLayout=!1,e.state.nodes.updatePositions(a);var r=Vl(h,d),s=Xl(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),Wl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=hc().mark((function t(e){var n,r,i,o;return hc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=yc(yc({},xc),e),r=this.state.zoom,i=this.state.panX,o=this.state.panY,t.prev=4,t.next=7,this.prepareLargeFileForDownload(n);case 7:t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(4),Gr.error("An error occurred while downloading the image"),!this.callbacks.isCallbackRegistered(_c)){t.next=16;break}this.callIfRegistered(_c,t.t0),t.next=17;break;case 16:throw t.t0;case 17:return t.prev=17,this.isRenderingDisabled=!1,this.setZoomLevel(r),this.setPanCoordinates(i,o),t.finish(17);case 22:case"end":return t.stop()}}),t,this,[[4,9,17,22]])})),i=function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function a(t){dc(o,n,i,a,s,"next",t)}function s(t){dc(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&mc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pc(t){return Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(t)}function Ec(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jc(r.key),r)}}function Cc(t,e,n){return e&&kc(t.prototype,e),n&&kc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function jc(t){var e=function(t,e){if("object"!=Pc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Pc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pc(e)?e:String(e)}var Dc=function(){function t(e,n){if(Ec(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Cc(t,[{key:"addChild",value:function(t){this.children.push(t)}},{key:"isRoot",value:function(){return null===this.parent}},{key:"print",value:function(){var t=this.data.name;this.isRoot()||(t=t+"\t\t"+function(t){for(var e=(Math.round(1e3*t)/1e3).toFixed(3);e.length<6;)e=" "+e;return e}(this.data._timeSpent())+" ms",this.parent.isRoot()||(t=t+"\t"+this._percentageOfParentSpent()+"%"));var e=this.noOfChildren()>0;for(var n in e?(t=t+"\t Children: "+this.noOfChildren(),console.groupCollapsed(t)):console.log(t),this.children)this.children[n].print();e&&console.groupEnd()}},{key:"noOfChildren",value:function(){return this.children.length}},{key:"_percentageOfParentSpent",value:function(){return Math.round(this.data._timeSpent()/this.parent.data._timeSpent()*100)}}]),t}(),Rc=function(){function t(e){Ec(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Cc(t,[{key:"close",value:function(){this.endTime=performance.now()}},{key:"_timeSpent",value:function(){if(null===this.startTime||null===this.endTime)throw new Error("You have an error in your performance measurements that makes the whole tree unreliable. You probably forgot to call performanceTestEnd on "+this.name);return this.endTime-this.startTime}}]),t}(),Ic=function(){function t(){Ec(this,t),this.root=new Dc(new Rc("Performance Tree"),null),this.current=this.root}return Cc(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Dc(t,this.current);this.current.addChild(e),this.current=e}else{if(this.root)throw new Error("Performance tree is screwed up");this.root=new Dc(t,null),this.current=this.root}}},{key:"close",value:function(){if(this.current.isRoot())throw new Error("Tried to close performance tree root. You probably have one too many Performance.endTest() in your code.");this.current.data.close(),this.current=this.current.parent}},{key:"getCurrentData",value:function(){return this.current.data}},{key:"print",value:function(){this.root.noOfChildren()>0&&this.root.print()}}]),t}(),Mc=function(){function t(){Ec(this,t),window.performance?(this.disabled=!1,this.tree=new Ic):(this.disabled=!0,this.tree=null)}return Cc(t,[{key:"startTest",value:function(t){if(!this.disabled){var e;t||(1,t="at"===(e=(new Error).stack.split("\n")[3].trim()).split(" ")[0]?e.split(" ")[1]:e.split("@")[0]);var n=new Rc(t);this.tree.add(n)}}},{key:"endTest",value:function(){this.disabled||this.tree.close()}},{key:"reset",value:function(){this.disabled||this.tree.clear()}},{key:"print",value:function(){this.disabled||this.tree.print()}}]),t}(),Lc=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};const Nc=(t=>{var e={};return i.d(e,t),e})({AnalyticsBrowser:()=>e.AnalyticsBrowser});var Fc,Uc=new Uint8Array(16);function zc(){if(!Fc&&!(Fc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fc(Uc)}const Bc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Vc=[],Gc=0;Gc<256;++Gc)Vc.push((Gc+256).toString(16).substr(1));const Wc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Vc[t[e+0]]+Vc[t[e+1]]+Vc[t[e+2]]+Vc[t[e+3]]+"-"+Vc[t[e+4]]+Vc[t[e+5]]+"-"+Vc[t[e+6]]+Vc[t[e+7]]+"-"+Vc[t[e+8]]+Vc[t[e+9]]+"-"+Vc[t[e+10]]+Vc[t[e+11]]+Vc[t[e+12]]+Vc[t[e+13]]+Vc[t[e+14]]+Vc[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&Bc.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n};var Xc,Hc,Yc=0,$c=0;const qc=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||Xc,a=void 0!==t.clockseq?t.clockseq:Hc;if(null==o||null==a){var s=t.random||(t.rng||zc)();null==o&&(o=Xc=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=Hc=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:$c+1,c=u-Yc+(l-$c)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||u>Yc)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yc=u,$c=l,Hc=a;var f=(1e4*(268435455&(u+=122192928e5))+l)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=255&f;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var d=0;d<6;++d)i[r+d]=o[d];return e||Wc(i)};function Zc(t){return Zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(t)}function Kc(){Kc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Zc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function j(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Zc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=j,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:j(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function Jc(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Qc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tf(r.key),r)}}function tf(t){var e=function(t,e){if("object"!=Zc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zc(e)?e:String(e)}var ef=window.localStorage,nf="neo4j.nvl.sTid",rf=!1,of=function(){function t(){var e,n,r;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),e=this,r=void 0,(n=tf(n="analytics"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r;var i=new Nc.AnalyticsBrowser;this.analytics=i}var e,n,r,i,o;return r=t,i=[{key:"init",value:function(t){this.analytics.load({writeKey:t}),this.analytics.addSourceMiddleware((function(t){var e=t.payload,n=t.next,r=e.obj.context.page;void 0!==r&&(r.url="",r.title="",r.search="",r.referrer="",r.path=""),n(e)}))}},{key:"trackEvent",value:(e=Kc().mark((function t(e){var n;return Kc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ready();case 2:n="".concat(e.eventPrefix?e.eventPrefix:"NVL_core","-").concat(e.event),this.analytics.track(n,e.properties).catch((function(t){Gr.warn("TRACKING: Event tracking is failed. err: ".concat(t))}));case 4:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){Jc(o,r,i,a,s,"next",t)}function s(t){Jc(o,r,i,a,s,"throw",t)}a(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"identify",value:function(){if(!rf){var t=this.getSegmentTrackingId();this.analytics.identify(t).catch((function(t){Gr.debug("TRACKING: Identifying user for Segment tracking failed. err: ".concat(t))})),rf=!0}}},{key:"loadSavedSegmentId",value:function(){try{var t=ef.getItem(nf);return"string"==typeof t?t:null}catch(t){return Gr.debug("TRACKING: Retrieving tracking Id failed. err: ".concat(t)),null}}},{key:"getSegmentTrackingId",value:function(){var t=this.loadSavedSegmentId(),e=null!=t?t:qc();return this.saveTrackingId(e),e}},{key:"saveTrackingId",value:function(t){ef.setItem(nf,t)}},{key:"ready",value:function(){return this.analytics.ready().catch((function(t){Gr.debug("TRACKING: segment track instance not ready. err: ".concat(t))}))}}],i&&Qc(r.prototype,i),o&&Qc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function af(t){return af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(t)}function sf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||lf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=lf(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function lf(t,e){if(t){if("string"==typeof t)return cf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cf(t,e):void 0}}function cf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ff(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function hf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ff(Object(n),!0).forEach((function(e){pf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function df(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vf(r.key),r)}}function pf(t,e,n){return(e=vf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vf(t){var e=function(t,e){if("object"!=af(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=af(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==af(e)?e:String(e)}var yf=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),pf(this,"externalCallbackHandler",void 0),pf(this,"performance",void 0),pf(this,"visState",void 0),pf(this,"nvlController",void 0),pf(this,"options",void 0),pf(this,"segmentTrack",void 0),!0!==i.disableTelemetry&&(this.segmentTrack=new of,this.segmentTrack.init("4SGwdwzuDm5WkFvQtz7D6ATQlo14yjmW"),this.segmentTrack.identify()),this.setupLogging(i),this.externalCallbackHandler=new l(o),this.performance=new Mc,this.options=i,this.options.frame=e,this.checkWebGLCompatibility(),this.initialise(n,r,i)}var e,r;return e=t,r=[{key:"restart",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getNodePositions(),r=this.visState,i=r.zoom,o=r.layout,a=r.layoutOptions,s=r.nodes,u=r.rels;this.nvlController.destroy(),Object.assign(this.options,t),this.initialise(s.items,u.items,this.options),this.setZoom(i),this.setLayout(o),this.setLayoutOptions(a),this.addAndUpdateElementsInGraph(s.items,u.items),e&&this.setNodePositions(n)}},{key:"addAndUpdateElementsInGraph",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.update(t,hf({},n)),this.visState.rels.update(e,hf({},n)),this.visState.nodes.add(t,hf({},n)),this.visState.rels.add(e,hf({},n)),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}},{key:"getSelectedNodes",value:function(){var t=this;return this.visState.nodes.items.filter((function(t){return t.selected})).map((function(e){return hf(hf({},e),t.visState.nodes.idToPosition[e.id])}))}},{key:"getSelectedRelationships",value:function(){return this.visState.rels.items.filter((function(t){return t.selected}))}},{key:"updateElementsInGraph",value:function(t,e){var n={added:!1,updated:!1};this.validateNodes(t),this.validateRelationships(e,t),this.visState.nodes.update(t,hf({},n)),this.visState.rels.update(e,hf({},n)),this.nvlController.updateHtmlOverlay()}},{key:"addElementsToGraph",value:function(t,e){this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.add(t,hf({},n)),this.visState.rels.add(e,hf({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,n.isEmpty)(t)){var e,r={},i=uf(t);try{for(i.s();!(e=i.n()).done;)r[e.value]=!0}catch(t){i.e(t)}finally{i.f()}var o,a=[],s=uf(this.visState.rels.items);try{for(s.s();!(o=s.n()).done;){var u=o.value;!0!==r[u.from]&&!0!==r[u.to]||a.push(u.id)}}catch(t){s.e(t)}finally{s.f()}a.length>0&&this.edgeRemoval(a),this.nodeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}}},{key:"removeRelationshipsWithIds",value:function(t){Array.isArray(t)&&!(0,n.isEmpty)(t)&&(this.edgeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay())}},{key:"getNodes",value:function(){return this.nvlController.dumpNodes()}},{key:"getRelationships",value:function(){return this.nvlController.dumpRelationships()}},{key:"getNodeById",value:function(t){return this.visState.nodes.idToItem[t]}},{key:"getRelationshipById",value:function(t){return this.visState.rels.idToItem[t]}},{key:"getPositionById",value:function(t){return this.visState.nodes.idToPosition[t]}},{key:"getCurrentOptions",value:function(){return this.options}},{key:"destroy",value:function(){this.nvlController.destroy()}},{key:"deselectAll",value:function(){this.updateElementsInGraph(this.visState.nodes.items.map((function(t){return hf(hf({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return hf(hf({},t),{},{selected:!1})})))}},{key:"fit",value:function(t,e){this.nvlController.fit(t,e)}},{key:"resetZoom",value:function(){this.nvlController.resetZoom()}},{key:"setUseWebGLRenderer",value:function(t){this.nvlController.setRenderer(t?da:pa)}},{key:"setRenderer",value:function(t){this.nvlController.setRenderer(t)}},{key:"setDisableWebGL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.options.disableWebGL!==t&&(this.options.disableWebGL=t,this.restart())}},{key:"pinNode",value:function(t){this.visState.nodes.update([{id:t,pinned:!0}],{})}},{key:"unPinNode",value:function(t){this.visState.nodes.update(t.map((function(t){return{id:t,pinned:!1}})),{})}},{key:"setLayout",value:function(t){this.visState.setLayout(t)}},{key:"setLayoutOptions",value:function(t){this.visState.setLayoutOptions(t)}},{key:"getNodesOnScreen",value:function(){return this.nvlController.getNodesOnScreen()}},{key:"getNodePositions",value:function(){return this.nvlController.getNodePositions()}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.nvlController.setNodePositions(t,e)}},{key:"isLayoutMoving",value:function(){return this.nvlController.isLayoutMoving()}},{key:"saveToFile",value:function(t){this.nvlController.saveToFile(t)}},{key:"saveFullGraphToLargeFile",value:function(t){this.nvlController.saveFullGraphToLargeFile(t)}},{key:"setZoom",value:function(t){this.nvlController.setZoomLevel(t)}},{key:"setPan",value:function(t,e){this.nvlController.setPanCoordinates(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){this.nvlController.setZoomAndPan(t,e,n)}},{key:"getScale",value:function(){return this.nvlController.getScale()}},{key:"getPan",value:function(){return this.nvlController.getPan()}},{key:"getHits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["node","relationship"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{hitNodeMarginWidth:0},r=this.options,i=this.visState,o=this.nvlController,a=i.zoom,s=i.panX,u=i.panY,l=i.webGLVisible,c=bl(t,r.frame,a,s,u),f=c.x,h=c.y,d=l?function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[],s=n.nodes,u=n.rels;return r.includes("node")&&o.push.apply(o,$l(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=[],a=ql(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a,s=n.value,u=r[s.id];if(void 0===(null==u?void 0:u.x)||void 0===u.y)return 1;var l=(null!==(a=s.size)&&void 0!==a?a:br)*_r(),c={x:u.x-t,y:u.y-e},f=Math.pow(l,2),h=Math.pow(l+i,2),d=Math.pow(c.x,2)+Math.pow(c.y,2),p=Math.sqrt(d);if(d<h){var v=o.findIndex((function(t){return t.distance>p}));o.splice(-1!==v?v:o.length,0,{data:s,targetCoordinates:{x:u.x,y:u.y},pointerCoordinates:{x:t,y:e},distanceVector:c,distance:p,insideNode:d<f})}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return o}(t,e,s.items,s.idToPosition,i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,$l(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=ql(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a=n.value,s=a.from,u=a.to;if(void 0===o["".concat(s,".").concat(u)]){var l=r[s],c=r[u];if(void 0===(null==l?void 0:l.x)||void 0===l.y)return 0;if(void 0===(null==c?void 0:c.x)||void 0===c.y)return 0;var f=ks({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=Jl){var h=i.findIndex((function(t){return t.distance>f}));i.splice(-1!==h?h:i.length,0,{data:a,fromTargetCoordinates:{x:l.x,y:l.y},toTargetCoordinates:{x:c.x,y:c.y},pointerCoordinates:{x:t,y:e},distance:f})}o["".concat(s,".").concat(u)]=1,o["".concat(u,".").concat(s)]=1}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return i}(t,e,u.items,s.idToPosition))),{nodes:o,relationships:a}}(f,h,i,e,n):function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[];return r.includes("node")&&o.push.apply(o,$l(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,$l(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return hf(hf({},t),{},{nvlTargets:d})}},{key:"getContainer",value:function(){return this.options.frame}},{key:"initialise",value:function(){var t,e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.visState=function(t){var e=t.minZoom,r=t.maxZoom,i=t.allowDynamicMinZoom,o=void 0===i||i,a=t.layout,s=t.layoutOptions,u=t.nodeDefaultBorderColor,l=t.selectedBorderColor,c=t.panX,f=void 0===c?0:c,h=t.panY,d=void 0===h?0:h,p=t.initialZoom,v=t.renderer,y=void 0===v?!1===t.useWebGL?pa:da:v,m=t.disableWebGL,g=void 0!==m&&m,b=t.disableTelemetry,w=void 0!==b&&b;Z(!0),xn.isolateGlobalState();var x=void 0!==e?e:.075,_=void 0!==r?r:10,S=ta({},ia.default);void 0!==u&&("string"==typeof u&&null!==jo().get.rgb(u)?S.rings=[{color:u,widthFactor:.05}]:Gr.warn("Invalid color string for nodeDefaultBorderColor:",u));var T=ta({},ia.selected),A=ta({},oa.selected);return void 0!==l&&("string"==typeof u&&null!==jo().get.rgb(l)?(T.rings[1].color=l,A.rings[1].color=l):Gr.warn("Invalid color string for selectedBorderColor:",l)),Vt({zoom:p||aa,minimapZoom:aa,defaultZoomLevel:aa,panX:f,panY:d,minimapPanX:0,minimapPanY:0,fitNodeIds:[],resetZoom:!1,zoomOptions:{},forceWebGL:!1,renderer:y,disableWebGL:g,disableTelemetry:w,fitMovement:0,layout:a,layoutOptions:s,maxDistance:0,maxNodeRadius:50,nodeBorderStyles:{default:S,selected:T},relationshipBorderStyles:{default:oa.default,selected:A},get minZoom(){return x},get maxZoom(){return _},get minMinimapZoom(){return 0},get maxMinimapZoom(){return.2},get webGLVisible(){var t=this.fitMovement>50;return this.renderer===da||t},nodes:Ko(),rels:Ko(),graphUpdates:0,waypoints:{data:Vt.shallow({}),counter:0},setGraphUpdated:ot((function(){this.graphUpdates++})),setRenderer:ot((function(t){ot((function(){this.graphUpdates++})),this.renderer=t})),setWaypoints:ot((function(t){this.waypoints.data=t,this.waypoints.counter+=1})),setZoomPan:ot((function(t,e,n,r){if(o){var i=Object.values(this.nodes.idToPosition),a=Uo(i,x,_,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=Fo(t,this.zoom,x,_);s!==this.zoom&&(this.zoom=s,this.panX=e,this.panY=n)}this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setZoom:ot((function(t,e){if(o){var n=Object.values(this.nodes.idToPosition);this.zoom=Uo(n,x,_,e,t,this.zoom)}else this.zoom=Fo(t,this.zoom,x,_);this.fitNodeIds=[],this.fitMovement=0,this.resetZoom=!1,this.forceWebGL=!1})),setPan:ot((function(t,e){this.panX=t,this.panY=e,this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setLayout:ot((function(t){this.layout=t})),setLayoutOptions:ot((function(t){this.layoutOptions=t})),fitNodes:ot((function(t,e){this.fitNodeIds=(0,n.intersection)(t,(0,n.map)(this.nodes.items,"id")),this.zoomOptions=null!=e?e:{}})),setZoomReset:ot((function(){this.resetZoom=!0})),clearFit:ot((function(){this.fitNodeIds=[],this.forceWebGL=!1,this.fitMovement=0})),clearReset:ot((function(){this.resetZoom=!1,this.fitMovement=0})),updateZoomToFit:ot((function(t,e,n,r){var i;if(this.fitMovement=Math.abs(t-this.zoom)+Math.abs(e-this.panX)+Math.abs(n-this.panY),o){var a=Object.values(this.nodes.idToPosition);i=Uo(a,x,_,r,t,this.zoom)}else i=Fo(t,this.zoom,x,_);this.zoom=i,this.panX=e,this.panY=n})),updateMinimapZoomToFit:ot((function(t,e,n){this.minimapZoom=t,this.minimapPanX=e,this.minimapPanY=n})),autorun:yt,reaction:mt})}(o),o.minimapContainer instanceof HTMLElement||delete o.minimapContainer,this.nvlController=new Oc(this.visState,o),this.addAndUpdateElementsInGraph(r,i),this.nvlController.on("restart",this.restart.bind(this));var a,s,u=uf((a=this.externalCallbackHandler.callbacks,Object.entries(a)));try{for(u.s();!(s=u.n()).done;){var l=sf(s.value,2),c=l[0];void 0!==l[1]&&this.nvlController.on(c,this.externalCallbackHandler[c].bind(this.externalCallbackHandler))}}catch(t){u.e(t)}finally{u.f()}var f=null===(t=this.options.frame)||void 0===t?void 0:t.getAttribute("id");!0!==this.options.disableTelemetry&&setTimeout((function(){e.nvlController.isDestroyed()||e.segmentTrack.trackEvent({eventPrefix:Sr.includes(f)?f:null,event:"instantiated",properties:{}})}),200)}},{key:"setupLogging",value:function(t){var e,n=t.logging;void 0!==(null==n?void 0:n.level)&&(e=n.level,Gr.setLevel(e),function(t,e){var n=t.methodFactory;t.methodFactory=function(t,r,i){var o=n(t,r,i);return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];"function"==typeof e.logger?e.logger.apply(e,[t].concat(r)):o.apply(void 0,r)}},t.setLevel(t.getLevel())}(Gr,n))}},{key:"nodeRemoval",value:function(t){var e=Array.isArray(t)?t:[t],n=this.visState,r=n.nodes,i=n.fitNodeIds,o=n.zoomOptions;r.remove(e,{removed:!1}),i.length&&void 0!==e.find((function(t){return i.includes(t)}))&&this.visState.fitNodes(i.filter((function(t){return!e.includes(t)})),o)}},{key:"edgeRemoval",value:function(t){var e=Array.isArray(t)?t:[t];this.visState.rels.remove(e,{removed:!1})}},{key:"update",value:function(t,e){this.visState[e].update(t,{added:!1,updated:!1})}},{key:"validateNodes",value:function(t){var e=t.find((function(t){return!function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0}(t)}));if(e){var n="";throw/^\d+$/.test(e.id)||(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported."),new TypeError("Invalid node provided: ".concat(JSON.stringify(e),".").concat(n))}}},{key:"validateRelationships",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n="",r=null,i=this.visState,o=i.nodes,a=i.rels,s={},u=0;u<e.length;u++){var l=e[u];s[l.id]=l}for(var c=hf(hf({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!Lc(d)){r=d,/^\d+$/.test(d.id)&&(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported.");break}if(void 0===f[d.id]){var p=c[d.from],v=c[d.to];if(void 0===p){n=' Node with id "'.concat(d.from,'" does not exist.'),r=d;break}if(void 0===v){n=' Node with id "'.concat(d.to,'" does not exist.'),r=d;break}}}if(null!==r)throw new TypeError("Invalid relationship provided: ".concat(JSON.stringify(r),".").concat(n))}},{key:"checkWebGLCompatibility",value:function(){if(void 0===this.options.disableWebGL||!this.options.disableWebGL){var t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.createElement("canvas");try{return Boolean(void 0!==window.WebGLRenderingContext&&(null!==t.getContext("webgl")||null!==t.getContext("experimental-webgl")))}catch(t){return!1}}();if(!t){if(void 0!==this.options.disableWebGL)throw new Li("Could not initialize WebGL");this.options.renderer=pa,console.warn("GPU acceleration is not available on your browser. Falling back to CPU layout and rendering. You can disable this warning by setting the disableWebGL option to true.")}void 0===this.options.disableWebGL&&(this.options.disableWebGL=!t)}}}],r&&df(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),mf={textColorForBackground:il};const gf=yf})();var a=o.RL,s=o.wK,u=o.x_,l=o.lv,c=o.YQ,f=o.BP,h=o.GZ,d=o.Vw,p=o.Ay,v=o._G;export{a as CompatibilityError,s as ForceDirectedLayoutType,u as FreeLayoutType,l as GridLayoutType,c as HierarchicalLayoutType,f as NVL,h as colorMapperFunctions,d as d3ForceLayoutType,p as default,v as drawCircleBand};
|
|
2
|
+
import*as t from"@neo4j-nvl/layout-workers";import*as e from"@segment/analytics-next";var n={931:t=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},269:(t,e,n)=>{var r=n(931),i=n(975),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},792:(t,e,n)=>{var r=n(45),i=n(360),o=n(804);t.exports=function(t,e){if(!e)return t;var n=Object.keys(e);if(0===n.length)return t;for(var a=r(t),s=n.length-1;s>=0;s--){var u=n[s],l=String(e[u]);l&&(l=" "+l),o(a,{type:"preprocessor",data:"#define "+u+l})}return i(a)}},804:t=>{t.exports=function(t,i){Array.isArray(i)||(i=[i]);var o=function(t){for(var e=-1,n=0;n<t.length;n++){var i=t[n];if("preprocessor"===i.type)/^#(extension|version)/.test(i.data)&&(e=Math.max(e,n));else if("keyword"===i.type&&"precision"===i.data){var o=r(t,n);if(-1===o)throw new Error("precision statement not followed by any semicolons!");e=Math.max(e,o)}}return e+1}(t),a=o>0?t[o-1]:null;a&&n.test(a.data)&&t.splice(o++,0,e),t.splice.apply(t,[o,0].concat(i));var s=o+i.length;return t[s]&&/[^\r\n]$/.test(t[s].data)&&t.splice(s,0,e),t};var e={data:"\n",type:"whitespace"},n=/[^\r\n]$/;function r(t,e){for(var n=e;n<t.length;n++)if("operator"===t[n].type&&";"===t[n].data)return n;return-1}},360:t=>{t.exports=function(t){for(var e=[],n=0;n<t.length;n++)"eof"!==t[n].type&&e.push(t[n].data);return e.join("")}},206:(t,e,n)=>{t.exports=function(t){var e,n,S,T=0,A=0,O=u,E=[],P=[],k=1,j=0,C=0,D=!1,R=!1,I="",L=o,M=r;"300 es"===(t=t||{}).version&&(L=s,M=a);var N={},F={};for(T=0;T<L.length;T++)N[L[T]]=!0;for(T=0;T<M.length;T++)F[M[T]]=!0;return function(t){return P=[],null!==t?function(t){var n;for(T=0,t.toString&&(t=t.toString()),I+=t.replace(/\r\n/g,"\n"),S=I.length;e=I[T],T<S;){switch(n=T,O){case c:T=G();break;case f:case h:T=V();break;case d:T=W();break;case p:T=Y();break;case x:T=H();break;case v:T=$();break;case l:T=q();break;case b:T=B();break;case u:T=z()}n!==T&&("\n"===I[n]?(j=0,++k):++j)}return A+=T,I=I.slice(T),P}(t):(E.length&&U(E.join("")),O=w,U("(eof)"),P)};function U(t){t.length&&P.push({type:_[O],data:t,position:C,line:k,column:j})}function z(){return E=E.length?[]:E,"/"===n&&"*"===e?(C=A+T-1,O=c,n=e,T+1):"/"===n&&"/"===e?(C=A+T-1,O=f,n=e,T+1):"#"===e?(O=h,C=A+T,T):/\s/.test(e)?(O=b,C=A+T,T):(D=/\d/.test(e),R=/[^\w_]/.test(e),C=A+T,O=D?p:R?d:l,T)}function B(){return/[^\s]/g.test(e)?(U(E.join("")),O=u,T):(E.push(e),n=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===n?(E.push(e),n=e,T+1):(U(E.join("")),O=u,T)}function G(){return"/"===e&&"*"===n?(E.push(e),U(E.join("")),O=u,T+1):(E.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return O=v,T;if("/"===n&&"*"===e)return O=c,T;if("/"===n&&"/"===e)return O=f,T;if("."===e&&E.length){for(;X(E););return O=v,T}if(";"===e||")"===e||"("===e){if(E.length)for(;X(E););return U(e),O=u,T+1}var t=2===E.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(E););return O=u,T}return E.push(e),n=e,T+1}function X(t){for(var e,n,r=0;;){if(e=i.indexOf(t.slice(0,t.length+r).join("")),n=i[e],-1===e){if(r--+t.length>0)continue;n=t.slice(0,1).join("")}return U(n),C+=n.length,(E=E.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(U(E.join("")),O=u,T):(E.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(E.push(e),O=v,n=e,T+1):"x"===e&&1===E.length&&"0"===E[0]?(O=x,E.push(e),n=e,T+1):/[^\d]/.test(e)?(U(E.join("")),O=u,T):(E.push(e),n=e,T+1)}function $(){return"f"===e&&(E.push(e),n=e,T+=1),/[eE]/.test(e)?(E.push(e),n=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(n))&&/[^\d]/.test(e)?(U(E.join("")),O=u,T):(E.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=E.join("");return O=F[t]?g:N[t]?m:y,U(E.join("")),O=u,T}return E.push(e),n=e,T+1}};var r=n(704),i=n(63),o=n(192),a=n(784),s=n(592),u=999,l=9999,c=0,f=1,h=2,d=3,p=4,v=5,y=6,m=7,g=8,b=9,w=10,x=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},592:(t,e,n)=>{var r=n(192);r=r.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},192:t=>{t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},784:(t,e,n)=>{var r=n(704);t.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},704:t=>{t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},63:t=>{t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},45:(t,e,n)=>{var r=n(206);t.exports=function(t,e){var n=r(e),i=[];return(i=i.concat(n(t))).concat(n(null))}},250:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",_="[object Map]",S="[object Number]",T="[object Object]",A="[object Promise]",O="[object RegExp]",E="[object Set]",P="[object String]",k="[object Symbol]",j="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",I="[object Float64Array]",L="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Y=RegExp(X.source),$=RegExp(H.source),q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,xt="\\ud800-\\udfff",_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pt="["+xt+"]",kt="["+Et+"]",jt="["+_t+"]",Ct="\\d+",Dt="["+St+"]",Rt="["+Tt+"]",It="[^"+xt+Et+Ct+St+Tt+At+"]",Lt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+xt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+At+"]",zt="\\u200d",Bt="(?:"+Rt+"|"+It+")",Vt="(?:"+Ut+"|"+It+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+jt+"|"+Lt+")?",Ht="["+Ot+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Mt,Nt,Ft].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Dt,Nt,Ft].join("|")+")"+Yt,qt="(?:"+[Mt+jt+"?",jt,Nt,Ft,Pt].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(jt,"g"),Jt=RegExp(Lt+"(?="+Lt+")|"+qt+Yt,"g"),Qt=RegExp([Ut+"?"+Rt+"+"+Gt+"(?="+[kt,Ut,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[kt,Ut+Bt,"$"].join("|")+")",Ut+"?"+Bt+"+"+Gt,Ut+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,$t].join("|"),"g"),te=RegExp("["+zt+xt+_t+Ot+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[R]=ie[I]=ie[L]=ie[M]=ie[N]=ie[F]=ie[U]=ie[z]=ie[B]=!0,ie[v]=ie[y]=ie[C]=ie[m]=ie[D]=ie[g]=ie[b]=ie[w]=ie[_]=ie[S]=ie[T]=ie[O]=ie[E]=ie[P]=ie[j]=!1;var oe={};oe[v]=oe[y]=oe[C]=oe[D]=oe[m]=oe[g]=oe[R]=oe[I]=oe[L]=oe[M]=oe[N]=oe[_]=oe[S]=oe[T]=oe[O]=oe[E]=oe[P]=oe[k]=oe[F]=oe[U]=oe[z]=oe[B]=!0,oe[b]=oe[w]=oe[j]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ve=pe&&le.process,ye=function(){try{return de&&de.require&&de.require("util").types||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,ge=ye&&ye.isDate,be=ye&&ye.isMap,we=ye&&ye.isRegExp,xe=ye&&ye.isSet,_e=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ee(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Pe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ke(t,e){return!(null==t||!t.length)&&Ue(t,e,0)>-1}function je(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function De(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Re(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Me=Ge("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Fe(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ue(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Fe(t,Be,n)}function ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?He(t,e)/n:h}function Ge(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function He(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function $e(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function qe(t){return function(e){return t(e)}}function Ze(t,e){return Ce(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Ue(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ue(e,t[n],0)>-1;);return n}var tn=We({À:"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"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Me(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,xt=e.Error,_t=e.Function,St=e.Math,Tt=e.Object,At=e.RegExp,Ot=e.String,Et=e.TypeError,Pt=r.prototype,kt=_t.prototype,jt=Tt.prototype,Ct=e["__core-js_shared__"],Dt=kt.toString,Rt=jt.hasOwnProperty,It=0,Lt=(n=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Mt=jt.toString,Nt=Dt.call(Tt),Ft=fe._,Ut=At("^"+Dt.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:i,Bt=e.Symbol,Vt=e.Uint8Array,Gt=zt?zt.allocUnsafe:i,Wt=an(Tt.getPrototypeOf,Tt),Xt=Tt.create,Ht=jt.propertyIsEnumerable,Yt=Pt.splice,$t=Bt?Bt.isConcatSpreadable:i,qt=Bt?Bt.iterator:i,Jt=Bt?Bt.toStringTag:i,te=function(){try{var t=uo(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=it&&it.now!==fe.Date.now&&it.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=St.ceil,de=St.floor,ve=Tt.getOwnPropertySymbols,ye=zt?zt.isBuffer:i,Me=e.isFinite,We=Pt.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,wn=St.random,xn=Pt.reverse,_n=uo(e,"DataView"),Sn=uo(e,"Map"),Tn=uo(e,"Promise"),An=uo(e,"Set"),On=uo(e,"WeakMap"),En=uo(Tt,"create"),Pn=On&&new On,kn={},jn=No(_n),Cn=No(Sn),Dn=No(Tn),Rn=No(An),In=No(On),Ln=Bt?Bt.prototype:i,Mn=Ln?Ln.valueOf:i,Nn=Ln?Ln.toString:i;function Fn(t){if(ts(t)&&!Ga(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(Rt.call(t,"__wrapped__"))return Fo(t)}return new Bn(t)}var Un=function(){function t(){}return function(e){if(!Qa(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function $n(t,e){var n=Ga(t),r=!n&&Va(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&us(t),a=n||r||i||o,s=a?Ye(t.length,Ot):[],u=s.length;for(var l in t)!e&&!Rt.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yo(l,u))||s.push(l);return s}function qn(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Do(Oi(t),or(e,0,t.length))}function Kn(t){return Do(Oi(t))}function Jn(t,e,n){(n!==i&&!Ua(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Rt.call(t,e)&&Ua(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Ua(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Ei(e,js(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:As(t,e[n]);return a}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ar(t,e,n,r,o,a){var s,u=1&e,l=2&e,c=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!Qa(t))return t;var f=Ga(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Oi(t,s)}else{var h=fo(t),d=h==w||h==x;if(Ya(t))return wi(t,u);if(h==T||h==v||d&&!o){if(s=l||d?{}:po(t),!u)return l?function(t,e){return Ei(t,co(t),e)}(t,function(t,e){return t&&Ei(e,Cs(e),t)}(s,t)):function(t,e){return Ei(t,lo(t),e)}(t,nr(s,t))}else{if(!oe[h])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case C:return xi(t);case m:case g:return new i(+t);case D:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case I:case L:case M:case N:case F:case U:case z:case B:return _i(t,n);case _:return new i;case S:case P:return new i(t);case O:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case E:return new i;case k:return r=t,Mn?Tt(Mn.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),os(t)?t.forEach((function(r){s.add(ar(r,e,n,r,t,a))})):es(t)&&t.forEach((function(r,i){s.set(i,ar(r,e,n,i,t,a))}));var y=f?i:(c?l?eo:to:l?Cs:js)(t);return Ae(y||t,(function(r,i){y&&(r=t[i=r]),Qn(s,i,ar(r,e,n,i,t,a))})),s}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new Et(o);return Po((function(){t.apply(i,n)}),e)}function lr(t,e,n,r){var i=-1,o=ke,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Ce(e,qe(n))),r?(o=je,a=!1):e.length>=200&&(o=Ke,a=!1,e=new Hn(e));t:for(;++i<s;){var c=t[i],f=null==n?c:n(c);if(c=r||0!==c?c:0,a&&f==f){for(var h=l;h--;)if(e[h]===f)continue t;u.push(c)}else o(e,f,r)||u.push(c)}return u}Fn.templateSettings={escape:q,evaluate:Z,interpolate:K,variable:"",imports:{_:Fn}},Fn.prototype=zn.prototype,Fn.prototype.constructor=Fn,Bn.prototype=Un(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Un(zn.prototype),Vn.prototype.constructor=Vn,Gn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(En){var n=e[t];return n===a?i:n}return Rt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return En?e[t]!==i:Rt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=En&&e===i?a:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Sn||Wn),string:new Gn}},Xn.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ao(this,t).get(t)},Xn.prototype.has=function(t){return ao(this,t).has(t)},Xn.prototype.set=function(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,a),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var cr=ji(gr),fr=ji(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,l=a}return l}function pr(t,e){var n=[];return cr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?vr(s,e-1,n,r,i):De(i,s):r||(i[i.length]=s)}return i}var yr=Ci(),mr=Ci(!0);function gr(t,e){return t&&yr(t,e,js)}function br(t,e){return t&&mr(t,e,js)}function wr(t,e){return Pe(e,(function(e){return Za(t[e])}))}function xr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Mo(e[n++])];return n&&n==r?t:i}function _r(t,e,n){var r=e(t);return Ga(t)?r:De(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Tt(t)?function(t){var e=Rt.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(t){}var o=Mt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Mt.call(t)}(t)}function Tr(t,e){return t>e}function Ar(t,e){return null!=t&&Rt.call(t,e)}function Or(t,e){return null!=t&&e in Tt(t)}function Er(t,e,n){for(var o=n?je:ke,a=t[0].length,s=t.length,u=s,l=r(s),c=1/0,f=[];u--;){var h=t[u];u&&e&&(h=Ce(h,qe(e))),c=mn(h.length,c),l[u]=!n&&(e||a>=120&&h.length>=120)?new Hn(u&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&f.length<c;){var v=h[d],y=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ke(p,y):o(f,y,n))){for(u=s;--u;){var m=l[u];if(!(m?Ke(m,y):o(t[u],y,n)))continue t}p&&p.push(y),f.push(v)}}return f}function Pr(t,e,n){var r=null==(t=Ao(t,e=yi(e,t)))?t:t[Mo(qo(e))];return null==r?i:Se(r,t,n)}function kr(t){return ts(t)&&Sr(t)==v}function jr(t,e,n,r,o){return t===e||(null==t||null==e||!ts(t)&&!ts(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=Ga(t),u=Ga(e),l=s?y:fo(t),c=u?y:fo(e),f=(l=l==v?T:l)==T,h=(c=c==v?T:c)==T,d=l==c;if(d&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||us(t)?Ji(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case D:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case m:case g:case S:return Ua(+t,+e);case b:return t.name==e.name&&t.message==e.message;case O:case P:return t==e+"";case _:var s=on;case E:var u=1&r;if(s||(s=un),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=Ji(s(t),s(e),r,i,o,a);return a.delete(t),c;case k:if(Mn)return Mn.call(t)==Mn.call(e)}return!1}(t,e,l,n,r,o,a);if(!(1&n)){var p=f&&Rt.call(t,"__wrapped__"),w=h&&Rt.call(e,"__wrapped__");if(p||w){var x=p?t.value():t,A=w?e.value():e;return a||(a=new Yn),o(x,A,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=to(t),l=u.length;if(l!=to(e).length&&!s)return!1;for(var c=l;c--;){var f=u[c];if(!(s?f in e:Rt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++c<l;){var y=t[f=u[c]],m=e[f];if(r)var g=s?r(m,y,f,e,t,a):r(y,m,f,t,e,a);if(!(g===i?y===m||o(y,m,n,r,a):g)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,jr,o))}function Cr(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=n[o])[0],c=t[l],f=u[1];if(s&&u[2]){if(c===i&&!(l in t))return!1}else{var h=new Yn;if(r)var d=r(c,f,l,t,e,h);if(!(d===i?jr(f,c,3,r,h):d))return!1}}return!0}function Dr(t){return!(!Qa(t)||(e=t,Lt&&Lt in e))&&(Za(t)?Ut:vt).test(No(t));var e}function Rr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Fr(t[0],t[1]):Nr(t):fu(t)}function Ir(t){if(!xo(t))return vn(t);var e=[];for(var n in Tt(t))Rt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t,e){return t<e}function Mr(t,e){var n=-1,i=Xa(t)?r(t.length):[];return cr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Cr(n,t,e)}}function Fr(t,e){return go(t)&&_o(e)?So(Mo(t),e):function(n){var r=As(n,t);return r===i&&r===e?Os(n,t):jr(e,r,3)}}function Ur(t,e,n,r,o){t!==e&&yr(e,(function(a,s){if(o||(o=new Yn),Qa(a))!function(t,e,n,r,o,a,s){var u=Oo(t,n),l=Oo(e,n),c=s.get(l);if(c)Jn(t,n,c);else{var f=a?a(u,l,n+"",t,e,s):i,h=f===i;if(h){var d=Ga(l),p=!d&&Ya(l),v=!d&&!p&&us(l);f=l,d||p||v?Ga(u)?f=u:Ha(u)?f=Oi(u):p?(h=!1,f=wi(l,!0)):v?(h=!1,f=_i(l,!0)):f=[]:rs(l)||Va(l)?(f=u,Va(u)?f=ys(u):Qa(u)&&!Za(u)||(f=po(l))):h=!1}h&&(s.set(l,f),o(f,l,r,a,s),s.delete(l)),Jn(t,n,f)}}(t,e,s,n,Ur,r,o);else{var u=r?r(Oo(t,s),a,s+"",t,e,o):i;u===i&&(u=a),Jn(t,s,u)}}),Cs)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Br(t,e,n){e=e.length?Ce(e,(function(t){return Ga(t)?function(e){return xr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=Ce(e,qe(oo()));var i=Mr(t,(function(t,n,i){var o=Ce(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Si(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=xr(t,a);n(s,a)&&Zr(o,yi(a,t),s)}return o}function Gr(t,e,n,r){var i=r?ze:Ue,o=-1,a=e.length,s=t;for(t===e&&(e=Oi(e)),n&&(s=Ce(t,qe(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Yt.call(s,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function Xr(t,e){return t+de(wn()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(To(t,e,nu),t+"")}function $r(t){return qn(Us(t))}function qr(t,e){var n=Us(t);return Do(n,or(e,0,n.length))}function Zr(t,e,n,r){if(!Qa(t))return t;for(var o=-1,a=(e=yi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=Mo(e[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var f=u[l];(c=r?r(f,l,u):i)===i&&(c=Qa(f)?f:yo(e[o+1])?[]:{})}Qn(u,l,c),u=u[l]}return t}var Kr=Pn?function(t,e){return Pn.set(t,e),t}:nu,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qs(e),writable:!0})}:nu;function Qr(t){return Do(Us(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ei(t,e){var n;return cr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=ss(e),c=e===i;o<a;){var f=de((o+a)/2),h=n(t[f]),d=h!==i,p=null===h,v=h==h,y=ss(h);if(s)var m=r||v;else m=c?v&&(r||d):u?v&&d&&(r||!p):l?v&&d&&!p&&(r||!y):!p&&!y&&(r?h<=e:h<e);m?o=f+1:a=f}return mn(a,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ua(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function oi(t){return"number"==typeof t?t:ss(t)?h:+t}function ai(t){if("string"==typeof t)return t;if(Ga(t))return Ce(t,ai)+"";if(ss(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=ke,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=je;else if(o>=200){var l=e?null:Hi(t);if(l)return un(l);a=!1,i=Ke,u=new Hn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(c)}else i(u,f,n)||(u!==s&&u.push(f),s.push(c))}return s}function ui(t,e){return null==(t=Ao(t,e=yi(e,t)))||delete t[Mo(qo(e))]}function li(t,e,n,r){return Zr(t,e,n(xr(t,e)),r)}function ci(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),Re(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=lr(a[o]||s,t[u],e,n));return si(vr(a,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function pi(t){return Ha(t)?t:[]}function vi(t){return"function"==typeof t?t:nu}function yi(t,e){return Ga(t)?t:go(t,e)?[t]:Lo(ms(t))}var mi=Yr;function gi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var bi=ae||function(t){return fe.clearTimeout(t)};function wi(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _i(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=ss(t),s=e!==i,u=null===e,l=e==e,c=ss(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!c&&t<e||c&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,l=e.length,c=yn(a-s,0),f=r(l+c),h=!i;++u<l;)f[u]=e[u];for(;++o<s;)(h||o<a)&&(f[n[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}function Ai(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,l=-1,c=e.length,f=yn(a-u,0),h=r(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++l<c;)h[p+l]=e[l];for(;++s<u;)(d||o<a)&&(h[p+n[s]]=t[o++]);return h}function Oi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ei(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=r?r(n[u],t[u],u,n,t):i;l===i&&(l=t[u]),o?rr(n,u,l):Qn(n,u,l)}return n}function Pi(t,e){return function(n,r){var i=Ga(n)?Te:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function ki(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&mo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function ji(t,e){return function(n,r){if(null==n)return n;if(!Xa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ci(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Di(t){return function(e){var n=rn(e=ms(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?gi(n,1).join(""):e.slice(1);return r[t]()+o}}function Ri(t){return function(e){return Re(Zs(Vs(e).replace(Zt,"")),t,"")}}function Ii(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=Un(t.prototype),r=t.apply(n,e);return Qa(r)?r:n}}function Li(t){return function(e,n,r){var o=Tt(e);if(!Xa(e)){var a=oo(n,3);e=js(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Mi(t){return Qi((function(e){var n=e.length,r=n,a=Bn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Et(o);if(a&&!u&&"wrapper"==ro(s))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var l=ro(s=e[r]),c="wrapper"==l?no(s):i;u=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ro(c[0])].apply(u,c[3]):1==s.length&&bo(s)?u[l]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ga(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,a,s,u,c,f,h){var d=e&l,p=1&e,v=2&e,y=24&e,m=512&e,g=v?i:Ii(t);return function l(){for(var b=arguments.length,w=r(b),x=b;x--;)w[x]=arguments[x];if(y)var _=io(l),S=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(w,_);if(o&&(w=Ti(w,o,a,y)),s&&(w=Ai(w,s,u,y)),b-=S,y&&b<h){var T=sn(w,_);return Wi(t,e,Ni,l.placeholder,n,w,T,c,f,h-b)}var A=p?n:this,O=v?A[t]:t;return b=w.length,c?w=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Oi(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}(w,c):m&&b>1&&w.reverse(),d&&f<b&&(w.length=f),this&&this!==fe&&this instanceof l&&(O=g||Ii(O)),O.apply(A,w)}}function Fi(t,e){return function(n,r){return function(t,e,n,r){return gr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ui(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ai(n),r=ai(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function zi(t){return Qi((function(e){return e=Ce(e,qe(oo())),Yr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Bi(t,e){var n=(e=e===i?" ":ai(e)).length;if(n<2)return n?Hr(e,t):e;var r=Hr(e,he(t/cn(e)));return rn(e)?gi(fn(r),0,t).join(""):r.slice(0,t)}function Vi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n,i){for(var o=-1,a=yn(he((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:hs(o),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vs(e),n=vs(n)),t(e,n)}}function Wi(t,e,n,r,o,a,s,l,c,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,l,c,f],p=n.apply(i,d);return bo(t)&&Eo(p,d),p.placeholder=r,jo(p,t,e)}function Xi(t){var e=St[t];return function(t,n){if(t=vs(t),(n=null==n?0:mn(ds(n),292))&&Me(t)){var r=(ms(t)+"e").split("e");return+((r=(ms(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Hi=An&&1/un(new An([,-0]))[1]==c?function(t){return new An(t)}:su;function Yi(t){return function(e){var n=fo(e);return n==_?on(e):n==E?ln(e):function(t,e){return Ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function $i(t,e,n,a,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Et(o);var v=a?a.length:0;if(v||(e&=-97,a=c=i),h=h===i?h:yn(ds(h),0),d=d===i?d:ds(d),v-=c?c.length:0,64&e){var y=a,m=c;a=c=i}var g=p?i:no(t),b=[t,e,n,a,c,y,m,f,h,d];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Ti(c,u,e[4]):u,t[4]=c?sn(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Ai(c,u,e[6]):u,t[6]=c?sn(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&l&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,g),t=b[0],e=b[1],n=b[2],a=b[3],c=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)w=8==e||16==e?function(t,e,n){var o=Ii(t);return function a(){for(var s=arguments.length,u=r(s),l=s,c=io(a);l--;)u[l]=arguments[l];var f=s<3&&u[0]!==c&&u[s-1]!==c?[]:sn(u,c);return(s-=f.length)<n?Wi(t,e,Ni,a.placeholder,i,u,f,i,i,n-s):Se(this&&this!==fe&&this instanceof a?o:t,this,u)}}(t,e,d):e!=u&&33!=e||c.length?Ni.apply(i,b):function(t,e,n,i){var o=1&e,a=Ii(t);return function e(){for(var s=-1,u=arguments.length,l=-1,c=i.length,f=r(c+u),h=this&&this!==fe&&this instanceof e?a:t;++l<c;)f[l]=i[l];for(;u--;)f[l++]=arguments[++s];return Se(h,o?n:this,f)}}(t,e,n,a);else var w=function(t,e,n){var r=1&e,i=Ii(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return jo((g?Kr:Eo)(w,b),t,e)}function qi(t,e,n,r){return t===i||Ua(t,jt[n])&&!Rt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return Qa(t)&&Qa(e)&&(a.set(e,t),Ur(t,e,i,Zi,a),a.delete(e)),t}function Ki(t){return rs(t)?i:t}function Ji(t,e,n,r,o,a){var s=1&n,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),f=a.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Hn:i;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],y=e[h];if(r)var m=s?r(y,v,h,e,t,a):r(v,y,h,t,e,a);if(m!==i){if(m)continue;d=!1;break}if(p){if(!Le(e,(function(t,e){if(!Ke(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==y&&!o(v,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Qi(t){return ko(To(t,i,Wo),t+"")}function to(t){return _r(t,js,lo)}function eo(t){return _r(t,Cs,co)}var no=Pn?function(t){return Pn.get(t)}:su;function ro(t){for(var e=t.name+"",n=kn[e],r=Rt.call(kn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Rt.call(Fn,"placeholder")?Fn:t).placeholder}function oo(){var t=Fn.iteratee||ru;return t=t===ru?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=js(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_o(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Dr(n)?n:i}var lo=ve?function(t){return null==t?[]:(t=Tt(t),Pe(ve(t),(function(e){return Ht.call(t,e)})))}:pu,co=ve?function(t){for(var e=[];t;)De(e,lo(t)),t=Wt(t);return e}:pu,fo=Sr;function ho(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Mo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ja(i)&&yo(a,i)&&(Ga(t)||Va(t))}function po(t){return"function"!=typeof t.constructor||xo(t)?{}:Un(Wt(t))}function vo(t){return Ga(t)||Va(t)||!!($t&&t&&t[$t])}function yo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!Qa(n))return!1;var r=typeof e;return!!("number"==r?Xa(n)&&yo(e,n.length):"string"==r&&e in n)&&Ua(n[e],t)}function go(t,e){if(Ga(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ss(t))||Q.test(t)||!J.test(t)||null!=e&&t in Tt(e)}function bo(t){var e=ro(t),n=Fn[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(_n&&fo(new _n(new ArrayBuffer(1)))!=D||Sn&&fo(new Sn)!=_||Tn&&fo(Tn.resolve())!=A||An&&fo(new An)!=E||On&&fo(new On)!=j)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?No(n):"";if(r)switch(r){case jn:return D;case Cn:return _;case Dn:return A;case Rn:return E;case In:return j}return e});var wo=Ct?Za:vu;function xo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||jt)}function _o(t){return t==t&&!Qa(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Tt(n))}}function To(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Se(t,this,u)}}function Ao(t,e){return e.length<2?t:xr(t,ti(e,0,-1))}function Oo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Eo=Co(Kr),Po=ce||function(t,e){return fe.setTimeout(t,e)},ko=Co(Jr);function jo(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(p,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function Co(t){var e=0,n=0;return function(){var r=gn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Do(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Ro,Io,Lo=(Ro=Ra((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Io.size&&Io.clear(),t})),Io=Ro.cache,Ro);function Mo(t){if("string"==typeof t||ss(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Fo(t){if(t instanceof Vn)return t.clone();var e=new Bn(t.__wrapped__,t.__chain__);return e.__actions__=Oi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Uo=Yr((function(t,e){return Ha(t)?lr(t,vr(e,1,Ha,!0)):[]})),zo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),oo(n,2)):[]})),Bo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Fe(t,oo(e,3),i)}function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ds(n),o=n<0?yn(r+o,0):mn(o,r-1)),Fe(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Xo(t){return t&&t.length?t[0]:i}var Ho=Yr((function(t){var e=Ce(t,pi);return e.length&&e[0]===t[0]?Er(e):[]})),Yo=Yr((function(t){var e=qo(t),n=Ce(t,pi);return e===qo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Er(n,oo(e,2)):[]})),$o=Yr((function(t){var e=qo(t),n=Ce(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Er(n,i,e):[]}));function qo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Zo=Yr(Ko);function Ko(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Jo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,Ce(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function Qo(t){return null==t?t:xn.call(t)}var ta=Yr((function(t){return si(vr(t,1,Ha,!0))})),ea=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),si(vr(t,1,Ha,!0),oo(e,2))})),na=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,si(vr(t,1,Ha,!0),i,e)}));function ra(t){if(!t||!t.length)return[];var e=0;return t=Pe(t,(function(t){if(Ha(t))return e=yn(t.length,e),!0})),Ye(e,(function(e){return Ce(t,Ge(e))}))}function ia(t,e){if(!t||!t.length)return[];var n=ra(t);return null==e?n:Ce(n,(function(t){return Se(e,i,t)}))}var oa=Yr((function(t,e){return Ha(t)?lr(t,e):[]})),aa=Yr((function(t){return hi(Pe(t,Ha))})),sa=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),hi(Pe(t,Ha),oo(e,2))})),ua=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,hi(Pe(t,Ha),i,e)})),la=Yr(ra),ca=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ia(t,n)}));function fa(t){var e=Fn(t);return e.__chain__=!0,e}function ha(t,e){return e(t)}var da=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),pa=Pi((function(t,e,n){Rt.call(t,n)?++t[n]:rr(t,n,1)})),va=Li(Vo),ya=Li(Go);function ma(t,e){return(Ga(t)?Ae:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Oe:fr)(t,oo(e,3))}var ba=Pi((function(t,e,n){Rt.call(t,n)?t[n].push(e):rr(t,n,[e])})),wa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=Xa(t)?r(t.length):[];return cr(t,(function(t){a[++i]=o?Se(e,t,n):Pr(t,e,n)})),a})),xa=Pi((function(t,e,n){rr(t,n,e)}));function _a(t,e){return(Ga(t)?Ce:Mr)(t,oo(e,3))}var Sa=Pi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,vr(e,1),[])})),Aa=le||function(){return fe.Date.now()};function Oa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,$i(t,l,i,i,i,i,e)}function Ea(t,e){var n;if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Pa=Yr((function(t,e,n){var r=1;if(n.length){var i=sn(n,io(Pa));r|=u}return $i(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=sn(n,io(ka));r|=u}return $i(e,r,t,n,i)}));function ja(t,e,n){var r,a,s,u,l,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Et(o);function v(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function y(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=s}function m(){var t=Aa();if(y(t))return g(t);l=Po(m,function(t){var n=e-(t-c);return d?mn(n,s-(t-f)):n}(t))}function g(t){return l=i,p&&r?v(t):(r=a=i,u)}function b(){var t=Aa(),n=y(t);if(r=arguments,a=this,c=t,n){if(l===i)return function(t){return f=t,l=Po(m,e),h?v(t):u}(c);if(d)return bi(l),l=Po(m,e),v(c)}return l===i&&(l=Po(m,e)),u}return e=vs(e)||0,Qa(n)&&(h=!!n.leading,s=(d="maxWait"in n)?yn(vs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==i&&bi(l),f=0,r=c=a=l=i},b.flush=function(){return l===i?u:g(Aa())},b}var Ca=Yr((function(t,e){return ur(t,1,e)})),Da=Yr((function(t,e,n){return ur(t,vs(e)||0,n)}));function Ra(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Et(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Xn),n}function Ia(t){if("function"!=typeof t)throw new Et(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ra.Cache=Xn;var La=mi((function(t,e){var n=(e=1==e.length&&Ga(e[0])?Ce(e[0],qe(oo())):Ce(vr(e,1),qe(oo()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Ma=Yr((function(t,e){var n=sn(e,io(Ma));return $i(t,u,i,e,n)})),Na=Yr((function(t,e){var n=sn(e,io(Na));return $i(t,64,i,e,n)})),Fa=Qi((function(t,e){return $i(t,256,i,i,i,e)}));function Ua(t,e){return t===e||t!=t&&e!=e}var za=Gi(Tr),Ba=Gi((function(t,e){return t>=e})),Va=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Rt.call(t,"callee")&&!Ht.call(t,"callee")},Ga=r.isArray,Wa=me?qe(me):function(t){return ts(t)&&Sr(t)==C};function Xa(t){return null!=t&&Ja(t.length)&&!Za(t)}function Ha(t){return ts(t)&&Xa(t)}var Ya=ye||vu,$a=ge?qe(ge):function(t){return ts(t)&&Sr(t)==g};function qa(t){if(!ts(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Za(t){if(!Qa(t))return!1;var e=Sr(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==ds(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=be?qe(be):function(t){return ts(t)&&fo(t)==_};function ns(t){return"number"==typeof t||ts(t)&&Sr(t)==S}function rs(t){if(!ts(t)||Sr(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==Nt}var is=we?qe(we):function(t){return ts(t)&&Sr(t)==O},os=xe?qe(xe):function(t){return ts(t)&&fo(t)==E};function as(t){return"string"==typeof t||!Ga(t)&&ts(t)&&Sr(t)==P}function ss(t){return"symbol"==typeof t||ts(t)&&Sr(t)==k}var us=_e?qe(_e):function(t){return ts(t)&&Ja(t.length)&&!!ie[Sr(t)]},ls=Gi(Lr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Oi(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=fo(t);return(e==_?on:e==E?un:Us)(t)}function hs(t){return t?(t=vs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ds(t){var e=hs(t),n=e%1;return e==e?n?e-n:e:0}function ps(t){return t?or(ds(t),0,d):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return h;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var n=pt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return Ei(t,Cs(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(xo(e)||Xa(e))Ei(e,js(e),t);else for(var n in e)Rt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Ei(e,Cs(e),t)})),ws=ki((function(t,e,n,r){Ei(e,Cs(e),t,r)})),xs=ki((function(t,e,n,r){Ei(e,js(e),t,r)})),_s=Qi(ir),Ss=Yr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=Cs(a),u=-1,l=s.length;++u<l;){var c=s[u],f=t[c];(f===i||Ua(f,jt[c])&&!Rt.call(t,c))&&(t[c]=a[c])}return t})),Ts=Yr((function(t){return t.push(i,Zi),Se(Rs,i,t)}));function As(t,e,n){var r=null==t?i:xr(t,e);return r===i?n:r}function Os(t,e){return null!=t&&ho(t,e,Or)}var Es=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=n}),Qs(nu)),Ps=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),Rt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),ks=Yr(Pr);function js(t){return Xa(t)?$n(t):Ir(t)}function Cs(t){return Xa(t)?$n(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=xo(t),n=[];for(var r in t)("constructor"!=r||!e&&Rt.call(t,r))&&n.push(r);return n}(t)}var Ds=ki((function(t,e,n){Ur(t,e,n)})),Rs=ki((function(t,e,n,r){Ur(t,e,n,r)})),Is=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ce(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ei(t,eo(t),n),r&&(n=ar(n,7,Ki));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ls=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return Os(t,n)}))}(t,e)}));function Ms(t,e){if(null==t)return{};var n=Ce(eo(t),(function(t){return[t]}));return e=oo(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var Ns=Yi(js),Fs=Yi(Cs);function Us(t){return null==t?[]:Ze(t,js(t))}var zs=Ri((function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)}));function Bs(t){return qs(ms(t).toLowerCase())}function Vs(t){return(t=ms(t))&&t.replace(gt,tn).replace(Kt,"")}var Gs=Ri((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Ri((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Di("toLowerCase"),Hs=Ri((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Ri((function(t,e,n){return t+(n?" ":"")+qs(e)})),$s=Ri((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),qs=Di("toUpperCase");function Zs(t,e,n){return t=ms(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ks=Yr((function(t,e){try{return Se(t,i,e)}catch(t){return qa(t)?t:new xt(t)}})),Js=Qi((function(t,e){return Ae(e,(function(e){e=Mo(e),rr(t,e,Pa(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Mi(),eu=Mi(!0);function nu(t){return t}function ru(t){return Rr("function"==typeof t?t:ar(t,1))}var iu=Yr((function(t,e){return function(n){return Pr(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Pr(t,n,e)}}));function au(t,e,n){var r=js(e),i=wr(e,r);null!=n||Qa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=wr(e,js(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=Za(t);return Ae(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,De([this.value()],arguments))})})),t}function su(){}var uu=zi(Ce),lu=zi(Ee),cu=zi(Le);function fu(t){return go(t)?Ge(Mo(t)):function(t){return function(e){return xr(e,t)}}(t)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var yu,mu=Ui((function(t,e){return t+e}),0),gu=Xi("ceil"),bu=Ui((function(t,e){return t/e}),1),wu=Xi("floor"),xu=Ui((function(t,e){return t*e}),1),_u=Xi("round"),Su=Ui((function(t,e){return t-e}),0);return Fn.after=function(t,e){if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){if(--t<1)return e.apply(this,arguments)}},Fn.ary=Oa,Fn.assign=gs,Fn.assignIn=bs,Fn.assignInWith=ws,Fn.assignWith=xs,Fn.at=_s,Fn.before=Ea,Fn.bind=Pa,Fn.bindAll=Js,Fn.bindKey=ka,Fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ga(t)?t:[t]},Fn.chain=fa,Fn.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(ds(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(he(o/e));a<o;)u[s++]=ti(t,a,a+=e);return u},Fn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Fn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return De(Ga(n)?Oi(n):[n],vr(e,1))},Fn.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?Ce(t,(function(t){if("function"!=typeof t[1])throw new Et(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Fn.conforms=function(t){return function(t){var e=js(t);return function(n){return sr(n,t,e)}}(ar(t,1))},Fn.constant=Qs,Fn.countBy=pa,Fn.create=function(t,e){var n=Un(t);return null==e?n:nr(n,e)},Fn.curry=function t(e,n,r){var o=$i(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.curryRight=function t(e,n,r){var o=$i(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.debounce=ja,Fn.defaults=Ss,Fn.defaultsDeep=Ts,Fn.defer=Ca,Fn.delay=Da,Fn.difference=Uo,Fn.differenceBy=zo,Fn.differenceWith=Bo,Fn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:ds(e))<0?0:e,r):[]},Fn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:ds(e)))<0?0:e):[]},Fn.dropRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0,!0):[]},Fn.dropWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0):[]},Fn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ds(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ds(r))<0&&(r+=o),r=n>r?0:ps(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Fn.filter=function(t,e){return(Ga(t)?Pe:pr)(t,oo(e,3))},Fn.flatMap=function(t,e){return vr(_a(t,e),1)},Fn.flatMapDeep=function(t,e){return vr(_a(t,e),c)},Fn.flatMapDepth=function(t,e,n){return n=n===i?1:ds(n),vr(_a(t,e),n)},Fn.flatten=Wo,Fn.flattenDeep=function(t){return null!=t&&t.length?vr(t,c):[]},Fn.flattenDepth=function(t,e){return null!=t&&t.length?vr(t,e=e===i?1:ds(e)):[]},Fn.flip=function(t){return $i(t,512)},Fn.flow=tu,Fn.flowRight=eu,Fn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Fn.functions=function(t){return null==t?[]:wr(t,js(t))},Fn.functionsIn=function(t){return null==t?[]:wr(t,Cs(t))},Fn.groupBy=ba,Fn.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Fn.intersection=Ho,Fn.intersectionBy=Yo,Fn.intersectionWith=$o,Fn.invert=Es,Fn.invertBy=Ps,Fn.invokeMap=wa,Fn.iteratee=ru,Fn.keyBy=xa,Fn.keys=js,Fn.keysIn=Cs,Fn.map=_a,Fn.mapKeys=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Fn.mapValues=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Fn.matches=function(t){return Nr(ar(t,1))},Fn.matchesProperty=function(t,e){return Fr(t,ar(e,1))},Fn.memoize=Ra,Fn.merge=Ds,Fn.mergeWith=Rs,Fn.method=iu,Fn.methodOf=ou,Fn.mixin=au,Fn.negate=Ia,Fn.nthArg=function(t){return t=ds(t),Yr((function(e){return zr(e,t)}))},Fn.omit=Is,Fn.omitBy=function(t,e){return Ms(t,Ia(oo(e)))},Fn.once=function(t){return Ea(2,t)},Fn.orderBy=function(t,e,n,r){return null==t?[]:(Ga(e)||(e=null==e?[]:[e]),Ga(n=r?i:n)||(n=null==n?[]:[n]),Br(t,e,n))},Fn.over=uu,Fn.overArgs=La,Fn.overEvery=lu,Fn.overSome=cu,Fn.partial=Ma,Fn.partialRight=Na,Fn.partition=Sa,Fn.pick=Ls,Fn.pickBy=Ms,Fn.property=fu,Fn.propertyOf=function(t){return function(e){return null==t?i:xr(t,e)}},Fn.pull=Zo,Fn.pullAll=Ko,Fn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,oo(n,2)):t},Fn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,i,n):t},Fn.pullAt=Jo,Fn.range=hu,Fn.rangeRight=du,Fn.rearg=Fa,Fn.reject=function(t,e){return(Ga(t)?Pe:pr)(t,Ia(oo(e,3)))},Fn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Wr(t,i),n},Fn.rest=function(t,e){if("function"!=typeof t)throw new Et(o);return Yr(t,e=e===i?e:ds(e))},Fn.reverse=Qo,Fn.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),(Ga(t)?Zn:qr)(t,e)},Fn.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Fn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Fn.shuffle=function(t){return(Ga(t)?Kn:Qr)(t)},Fn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:ds(e),n=n===i?r:ds(n)),ti(t,e,n)):[]},Fn.sortBy=Ta,Fn.sortedUniq=function(t){return t&&t.length?ii(t):[]},Fn.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Fn.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ms(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=ai(e))&&rn(t)?gi(fn(t),0,n):t.split(e,n):[]},Fn.spread=function(t,e){if("function"!=typeof t)throw new Et(o);return e=null==e?0:yn(ds(e),0),Yr((function(n){var r=n[e],i=gi(n,0,e);return r&&De(i,r),Se(t,this,i)}))},Fn.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Fn.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:ds(e))<0?0:e):[]},Fn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:ds(e)))<0?0:e,r):[]},Fn.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Fn.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Fn.tap=function(t,e){return e(t),t},Fn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Et(o);return Qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ja(t,e,{leading:r,maxWait:e,trailing:i})},Fn.thru=ha,Fn.toArray=fs,Fn.toPairs=Ns,Fn.toPairsIn=Fs,Fn.toPath=function(t){return Ga(t)?Ce(t,Mo):ss(t)?[t]:Oi(Lo(ms(t)))},Fn.toPlainObject=ys,Fn.transform=function(t,e,n){var r=Ga(t),i=r||Ya(t)||us(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qa(t)&&Za(o)?Un(Wt(t)):{}}return(i?Ae:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Oa(t,1)},Fn.union=ta,Fn.unionBy=ea,Fn.unionWith=na,Fn.uniq=function(t){return t&&t.length?si(t):[]},Fn.uniqBy=function(t,e){return t&&t.length?si(t,oo(e,2)):[]},Fn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Fn.unset=function(t,e){return null==t||ui(t,e)},Fn.unzip=ra,Fn.unzipWith=ia,Fn.update=function(t,e,n){return null==t?t:li(t,e,vi(n))},Fn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:li(t,e,vi(n),r)},Fn.values=Us,Fn.valuesIn=function(t){return null==t?[]:Ze(t,Cs(t))},Fn.without=oa,Fn.words=Zs,Fn.wrap=function(t,e){return Ma(vi(e),t)},Fn.xor=aa,Fn.xorBy=sa,Fn.xorWith=ua,Fn.zip=la,Fn.zipObject=function(t,e){return di(t||[],e||[],Qn)},Fn.zipObjectDeep=function(t,e){return di(t||[],e||[],Zr)},Fn.zipWith=ca,Fn.entries=Ns,Fn.entriesIn=Fs,Fn.extend=bs,Fn.extendWith=ws,au(Fn,Fn),Fn.add=mu,Fn.attempt=Ks,Fn.camelCase=zs,Fn.capitalize=Bs,Fn.ceil=gu,Fn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=vs(n))==n?n:0),e!==i&&(e=(e=vs(e))==e?e:0),or(vs(t),e,n)},Fn.clone=function(t){return ar(t,4)},Fn.cloneDeep=function(t){return ar(t,5)},Fn.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:i)},Fn.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:i)},Fn.conformsTo=function(t,e){return null==e||sr(t,e,js(e))},Fn.deburr=Vs,Fn.defaultTo=function(t,e){return null==t||t!=t?e:t},Fn.divide=bu,Fn.endsWith=function(t,e,n){t=ms(t),e=ai(e);var r=t.length,o=n=n===i?r:or(ds(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Fn.eq=Ua,Fn.escape=function(t){return(t=ms(t))&&$.test(t)?t.replace(H,en):t},Fn.escapeRegExp=function(t){return(t=ms(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Fn.every=function(t,e,n){var r=Ga(t)?Ee:hr;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.find=va,Fn.findIndex=Vo,Fn.findKey=function(t,e){return Ne(t,oo(e,3),gr)},Fn.findLast=ya,Fn.findLastIndex=Go,Fn.findLastKey=function(t,e){return Ne(t,oo(e,3),br)},Fn.floor=wu,Fn.forEach=ma,Fn.forEachRight=ga,Fn.forIn=function(t,e){return null==t?t:yr(t,oo(e,3),Cs)},Fn.forInRight=function(t,e){return null==t?t:mr(t,oo(e,3),Cs)},Fn.forOwn=function(t,e){return t&&gr(t,oo(e,3))},Fn.forOwnRight=function(t,e){return t&&br(t,oo(e,3))},Fn.get=As,Fn.gt=za,Fn.gte=Ba,Fn.has=function(t,e){return null!=t&&ho(t,e,Ar)},Fn.hasIn=Os,Fn.head=Xo,Fn.identity=nu,Fn.includes=function(t,e,n,r){t=Xa(t)?t:Us(t),n=n&&!r?ds(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),as(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ue(t,e,n)>-1},Fn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Ue(t,e,i)},Fn.inRange=function(t,e,n){return e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=vs(t),e,n)},Fn.invoke=ks,Fn.isArguments=Va,Fn.isArray=Ga,Fn.isArrayBuffer=Wa,Fn.isArrayLike=Xa,Fn.isArrayLikeObject=Ha,Fn.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Sr(t)==m},Fn.isBuffer=Ya,Fn.isDate=$a,Fn.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Fn.isEmpty=function(t){if(null==t)return!0;if(Xa(t)&&(Ga(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||us(t)||Va(t)))return!t.length;var e=fo(t);if(e==_||e==E)return!t.size;if(xo(t))return!Ir(t).length;for(var n in t)if(Rt.call(t,n))return!1;return!0},Fn.isEqual=function(t,e){return jr(t,e)},Fn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?jr(t,e,i,n):!!r},Fn.isError=qa,Fn.isFinite=function(t){return"number"==typeof t&&Me(t)},Fn.isFunction=Za,Fn.isInteger=Ka,Fn.isLength=Ja,Fn.isMap=es,Fn.isMatch=function(t,e){return t===e||Cr(t,e,so(e))},Fn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Cr(t,e,so(e),n)},Fn.isNaN=function(t){return ns(t)&&t!=+t},Fn.isNative=function(t){if(wo(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(t)},Fn.isNil=function(t){return null==t},Fn.isNull=function(t){return null===t},Fn.isNumber=ns,Fn.isObject=Qa,Fn.isObjectLike=ts,Fn.isPlainObject=rs,Fn.isRegExp=is,Fn.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=f},Fn.isSet=os,Fn.isString=as,Fn.isSymbol=ss,Fn.isTypedArray=us,Fn.isUndefined=function(t){return t===i},Fn.isWeakMap=function(t){return ts(t)&&fo(t)==j},Fn.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Sr(t)},Fn.join=function(t,e){return null==t?"":We.call(t,e)},Fn.kebabCase=Gs,Fn.last=qo,Fn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ds(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Fe(t,Be,o,!0)},Fn.lowerCase=Ws,Fn.lowerFirst=Xs,Fn.lt=ls,Fn.lte=cs,Fn.max=function(t){return t&&t.length?dr(t,nu,Tr):i},Fn.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Tr):i},Fn.mean=function(t){return Ve(t,nu)},Fn.meanBy=function(t,e){return Ve(t,oo(e,2))},Fn.min=function(t){return t&&t.length?dr(t,nu,Lr):i},Fn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Lr):i},Fn.stubArray=pu,Fn.stubFalse=vu,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xu,Fn.nth=function(t,e){return t&&t.length?zr(t,ds(e)):i},Fn.noConflict=function(){return fe._===this&&(fe._=Ft),this},Fn.noop=su,Fn.now=Aa,Fn.pad=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(de(i),n)+t+Bi(he(i),n)},Fn.padEnd=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?t+Bi(e-r,n):t},Fn.padStart=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Fn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ms(t).replace(rt,""),e||0)},Fn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=hs(t),e===i?(e=t,t=0):e=hs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=wn();return mn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Fn.reduce=function(t,e,n){var r=Ga(t)?Re:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,cr)},Fn.reduceRight=function(t,e,n){var r=Ga(t)?Ie:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Fn.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),Hr(ms(t),e)},Fn.replace=function(){var t=arguments,e=ms(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fn.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Mo(e[r])];a===i&&(r=o,a=n),t=Za(a)?a.call(t):a}return t},Fn.round=_u,Fn.runInContext=t,Fn.sample=function(t){return(Ga(t)?qn:$r)(t)},Fn.size=function(t){if(null==t)return 0;if(Xa(t))return as(t)?cn(t):t.length;var e=fo(t);return e==_||e==E?t.size:Ir(t).length},Fn.snakeCase=Hs,Fn.some=function(t,e,n){var r=Ga(t)?Le:ei;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.sortedIndex=function(t,e){return ni(t,e)},Fn.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Fn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Ua(t[r],e))return r}return-1},Fn.sortedLastIndex=function(t,e){return ni(t,e,!0)},Fn.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Fn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Ua(t[n],e))return n}return-1},Fn.startCase=Ys,Fn.startsWith=function(t,e,n){return t=ms(t),n=null==n?0:or(ds(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Fn.subtract=Su,Fn.sum=function(t){return t&&t.length?He(t,nu):0},Fn.sumBy=function(t,e){return t&&t.length?He(t,oo(e,2)):0},Fn.template=function(t,e,n){var r=Fn.templateSettings;n&&mo(t,e,n)&&(e=i),t=ms(t),e=ws({},e,r,qi);var o,a,s=ws({},e.imports,r.imports,qi),u=js(s),l=Ze(s,u),c=0,f=e.interpolate||bt,h="__p += '",d=At((e.escape||bt).source+"|"+f.source+"|"+(f===K?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Rt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),h+=t.slice(c,u).replace(wt,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var v=Rt.call(e,"variable")&&e.variable;if(v){if(lt.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(W,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ks((function(){return _t(u,p+"return "+h).apply(i,l)}));if(y.source=h,qa(y))throw y;return y},Fn.times=function(t,e){if((t=ds(t))<1||t>f)return[];var n=d,r=mn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Fn.toFinite=hs,Fn.toInteger=ds,Fn.toLength=ps,Fn.toLower=function(t){return ms(t).toLowerCase()},Fn.toNumber=vs,Fn.toSafeInteger=function(t){return t?or(ds(t),-9007199254740991,f):0===t?t:0},Fn.toString=ms,Fn.toUpper=function(t){return ms(t).toUpperCase()},Fn.trim=function(t,e,n){if((t=ms(t))&&(n||e===i))return $e(t);if(!t||!(e=ai(e)))return t;var r=fn(t),o=fn(e);return gi(r,Je(r,o),Qe(r,o)+1).join("")},Fn.trimEnd=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,0,Qe(r,fn(e))+1).join("")},Fn.trimStart=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,Je(r,fn(e))).join("")},Fn.truncate=function(t,e){var n=30,r="...";if(Qa(e)){var o="separator"in e?e.separator:o;n="length"in e?ds(e.length):n,r="omission"in e?ai(e.omission):r}var a=(t=ms(t)).length;if(rn(t)){var s=fn(t);a=s.length}if(n>=a)return t;var u=n-cn(r);if(u<1)return r;var l=s?gi(s,0,u).join(""):t.slice(0,u);if(o===i)return l+r;if(s&&(u+=l.length-u),is(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=At(o.source,ms(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(t.indexOf(ai(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Fn.unescape=function(t){return(t=ms(t))&&Y.test(t)?t.replace(X,dn):t},Fn.uniqueId=function(t){var e=++It;return ms(t)+e},Fn.upperCase=$s,Fn.upperFirst=qs,Fn.each=ma,Fn.eachRight=ga,Fn.first=Xo,au(Fn,(yu={},gr(Fn,(function(t,e){Rt.call(Fn.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Fn.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),Ae(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===i?1:yn(ds(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return Pr(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(Ia(oo(t)))},Vn.prototype.slice=function(t,e){t=ds(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ds(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},gr(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Fn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Fn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Vn,l=s[0],c=u||Ga(e),f=function(t){var e=o.apply(Fn,De([t],s));return r&&h?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&c){e=v?e:new Vn(this);var y=t.apply(e,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,h)}return p&&v?t.apply(this,s):(y=this.thru(f),p?r?y.value()[0]:y.value():y)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Pt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Fn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ga(i)?i:[],t)}return this[n]((function(n){return e.apply(Ga(n)?n:[],t)}))}})),gr(Vn.prototype,(function(t,e){var n=Fn[e];if(n){var r=n.name+"";Rt.call(kn,r)||(kn[r]=[]),kn[r].push({name:e,func:n})}})),kn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Oi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Oi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Oi(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ga(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=mn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,y=t[l+=e];++v<f;){var m=c[v],g=m.iteratee,b=m.type,w=g(y);if(2==b)y=w;else if(!w){if(1==b)continue t;break t}}p[h++]=y}return p},Fn.prototype.at=da,Fn.prototype.chain=function(){return fa(this)},Fn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Fo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:i}),new Bn(e,this.__chain__)}return this.thru(Qo)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,qt&&(Fn.prototype[qt]=function(){return this}),Fn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},880:function(t,e,n){var r,i;r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function l(t){return function(){typeof console!==e&&(u.call(this),this[t].apply(this,arguments))}}function c(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):t)}(r)||l.apply(this,arguments)}function f(t,n){var a,s,l,f=this,h="loglevel";function d(){var t;if(typeof window!==e&&h){try{t=window.localStorage[h]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(t=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(t){}return void 0===f.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==f.levels[e.toUpperCase()]&&(e=f.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=f.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?h+=":"+t:"symbol"==typeof t&&(h=void 0),f.name=t,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||c,f.getLevel=function(){return null!=l?l:null!=s?s:a},f.setLevel=function(t,n){return l=p(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(t){}}}(l),u.call(f)},f.setDefaultLevel=function(t){s=p(t),d()||f.setLevel(t,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==e&&h){try{window.localStorage.removeItem(h)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),u.call(f)},f.enableAll=function(t){f.setLevel(f.levels.TRACE,t)},f.disableAll=function(t){f.setLevel(f.levels.SILENT,t)},f.rebuild=function(){if(o!==f&&(a=p(o.getLevel())),u.call(f),o===f)for(var t in i)i[t].rebuild()},a=p(o?o.getLevel():"WARN");var v=d();null!=v&&(l=p(v)),u.call(f)}(o=new f).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=i[t];return e||(e=i[t]=new f(t,o.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},481:(t,e,n)=>{t.exports=n(137)},137:t=>{t.exports=class{constructor(t,e,n,r){let i;if("object"==typeof t){let o=t;t=o.k_p,e=o.k_i,n=o.k_d,r=o.dt,i=o.i_max}this.k_p="number"==typeof t?t:1,this.k_i=e||0,this.k_d=n||0,this.dt=r||0,this.i_max=i||0,this.sumError=0,this.lastError=0,this.lastTime=0,this.target=0}setTarget(t){this.target=t}update(t){this.currentValue=t;let e=this.dt;if(!e){let t=Date.now();e=0===this.lastTime?0:(t-this.lastTime)/1e3,this.lastTime=t}"number"==typeof e&&0!==e||(e=1);let n=this.target-this.currentValue;if(this.sumError=this.sumError+n*e,this.i_max>0&&Math.abs(this.sumError)>this.i_max){let t=this.sumError>0?1:-1;this.sumError=t*this.i_max}let r=(n-this.lastError)/e;return this.lastError=n,this.k_p*n+this.k_i*this.sumError+this.k_d*r}reset(){this.sumError=0,this.lastError=0,this.lastTime=0}}},803:t=>{var e,n,r=document.attachEvent,i=!1;function o(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function a(t){var e=this;o(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}if(!r){var s=(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return n(t)}),u=(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),l=!1,c="",f="animationstart",h="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(l=!0),!1===l)for(var v=0;v<h.length;v++)if(void 0!==p.style[h[v]+"AnimationName"]){c="-"+h[v].toLowerCase()+"-",f=d[v],l=!0;break}var y="resizeanim",m="@"+c+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",g=c+"animation: 1ms "+y+"; "}t.exports=function(t,e){return r?t.attachEvent("onresize",e):(t.__resizeTriggers__||("static"==getComputedStyle(t).position&&(t.style.position="relative"),function(){if(!i){var t=(m||"")+".resize-triggers { "+(g||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n),i=!0}}(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),o(t),t.addEventListener("scroll",a,!0),f&&t.__resizeTriggers__.addEventListener(f,(function(e){e.animationName==y&&o(t)}))),t.__resizeListeners__.push(e)),function(){r?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",a),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))}}},975:(t,e,n)=>{var r=n(101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},101:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},716:e=>{e.exports=t}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={id:t,loaded:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};(()=>{i.d(o,{RL:()=>Mi,wK:()=>ua,x_:()=>fa,lv:()=>ca,YQ:()=>la,BP:()=>kf,GZ:()=>Mf,Vw:()=>ha,Ay:()=>Nf,_G:()=>zs});var t=i(250);function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,a(r.key),r)}}function a(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:String(e)}var s=["onLayoutDone","onLayoutStep","onError","onLayoutComputing","onWebGLContextLost","restart"],u=function(){function t(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=a(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks=i}var e,n;return e=t,n=[{key:"onLayoutDone",value:function(){this.isValidFunction(this.callbacks.onLayoutDone)&&this.callbacks.onLayoutDone()}},{key:"onLayoutStep",value:function(t){this.isValidFunction(this.callbacks.onLayoutStep)&&this.callbacks.onLayoutStep(t)}},{key:"onLayoutComputing",value:function(t){this.isValidFunction(this.callbacks.onLayoutComputing)&&this.callbacks.onLayoutComputing(t)}},{key:"onError",value:function(t){this.isValidFunction(this.callbacks.onError)&&this.callbacks.onError(t)}},{key:"onWebGLContextLost",value:function(t){this.isValidFunction(this.callbacks.onWebGLContextLost)&&this.callbacks.onWebGLContextLost(t)}},{key:"isValidFunction",value:function(t){return void 0!==t&&"function"==typeof t}}],n&&r(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function c(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){function t(t){void 0===t&&(t="Atom@"+ne()),this.name=t,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Te.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){Xe(this)},t.prototype.reportChanged=function(){Ge(),function(t){if(t.lowestObserverState!==Te.STALE){t.lowestObserverState=Te.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Te.UP_TO_DATE&&(r.isTracing!==Ae.NONE&&He(r,t),r.onBecomeStale()),r.dependenciesState=Te.STALE}}}(this),We()},t.prototype.toString=function(){return this.name},t}(),h=function(t){function e(e,n,r){void 0===e&&(e="Atom@"+ne()),void 0===n&&(n=ue),void 0===r&&(r=ue);var i=t.call(this,e)||this;return i.name=e,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return c(e,t),e.prototype.reportObserved=function(){return Ge(),t.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),We(),!!Pe.trackingDerivation},e.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},e}(f),d=we("Atom",f);function p(t){return t.interceptors&&t.interceptors.length>0}function v(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),se((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function y(t,e){var n=nn();try{var r=t.interceptors;if(r)for(var i=0,o=r.length;i<o&&(ie(!(e=r[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{rn(n)}}function m(t){return t.changeListeners&&t.changeListeners.length>0}function g(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),se((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function b(t,e){var n=nn(),r=t.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](e);rn(n)}}function w(){return!!Pe.spyListeners.length}function x(t){if(Pe.spyListeners.length)for(var e=Pe.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function _(t){x(de({},t,{spyReportStart:!0}))}var S={spyReportEnd:!0};function T(t){x(t?de({},t,S):S)}function A(t){return Pe.spyListeners.push(t),se((function(){var e=Pe.spyListeners.indexOf(t);-1!==e&&Pe.spyListeners.splice(e,1)}))}var O="__$$iterating";function E(t){ie(!0!==t[O],"Illegal state: cannot recycle array as iterator"),me(t,O,!0);var e=-1;return me(t,"next",(function(){return{done:++e>=this.length,value:e<this.length?this[e]:void 0}})),t}function P(t,e){me(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var k,j,C=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,!1===t}(),D=0,R=function(){};k=R,j=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(k.prototype,j):void 0!==k.prototype.__proto__?k.prototype.__proto__=j:k.prototype=j,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(t){Object.defineProperty(R.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})}));var I=function(){function t(t,e,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new f(t||"ObservableArray@"+ne()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer?t.map(this.dehancer):t},t.prototype.intercept=function(t){return v(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),g(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=e,e>0&&t+e+1>D&&U(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Je(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=[]),p(this)){var o=y(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!o)return te;e=o.removedCount,n=o.added}var a=(n=n.map((function(t){return r.enhancer(t,void 0)}))).length-e;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(t,e,n){if(n.length<1e4)return(r=this.values).splice.apply(r,[t,e].concat(n));var r,i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&w(),i=m(this),o=i||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&_(o),this.atom.reportChanged(),i&&b(this,o),r&&T()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&w(),i=m(this),o=i||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&_(o),this.atom.reportChanged(),i&&b(this,o),r&&T()},t}(),L=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableArray@"+ne()),void 0===i&&(i=!1);var o=t.call(this)||this,a=new I(r,n,o,i);return me(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),C&&Object.defineProperty(a.array,"0",M),o}return c(e,t),e.prototype.intercept=function(t){return this.$mobx.intercept(t)},e.prototype.observe=function(t,e){return void 0===e&&(e=!1),this.$mobx.observe(t,e)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),t.map((function(t){return B(t)?t.peek():t})))},e.prototype.replace=function(t){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,t)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(t,e,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},e.prototype.findIndex=function(t,e,n){void 0===n&&(n=0);for(var r=this.peek(),i=r.length,o=n;o<i;o++)if(t.call(e,r[o],o,this))return o;return-1},e.prototype.splice=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(t);case 2:return this.$mobx.spliceWithArray(t,e)}return this.$mobx.spliceWithArray(t,e,n)},e.prototype.spliceWithArray=function(t,e,n){return this.$mobx.spliceWithArray(t,e,n)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,t),n.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(0,0,t),n.values.length},e.prototype.reverse=function(){var t=this.slice();return t.reverse.apply(t,arguments)},e.prototype.sort=function(t){var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.dehanceValues(this.$mobx.values).indexOf(t);return e>-1&&(this.splice(e,1),!0)},e.prototype.move=function(t,e){function n(t){if(t<0)throw new Error("[mobx.array] Index out of bounds: "+t+" is negative");var e=this.$mobx.values.length;if(t>=e)throw new Error("[mobx.array] Index out of bounds: "+t+" is not smaller than "+e)}if(n.call(this,t),n.call(this,e),t!==e){var r,i=this.$mobx.values;r=t<e?i.slice(0,t).concat(i.slice(t+1,e+1),[i[t]],i.slice(e+1)):i.slice(0,e).concat([i[t]],i.slice(e,t),i.slice(t+1)),this.replace(r)}},e.prototype.get=function(t){var e=this.$mobx;if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(t,e){var n=this.$mobx,r=n.values;if(t<r.length){Je(n.atom);var i=r[t];if(p(n)){var o=y(n,{type:"update",object:this,index:t,newValue:e});if(!o)return;e=o.newValue}(e=n.enhancer(e,i))!==i&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}},e}(R);P(L.prototype,(function(){return E(this.slice())})),Object.defineProperty(L.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(t){this.$mobx.setArrayLength(t)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach((function(t){var e=Array.prototype[t];ie("function"==typeof e,"Base function not defined on Array prototype: '"+t+"'"),ye(L.prototype,t,(function(){return e.apply(this.peek(),arguments)}))})),function(t,e){for(var n=0;n<e.length;n++)ye(t,e[n],t[e[n]])}(L.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var M=N(0);function N(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function F(t){Object.defineProperty(L.prototype,""+t,N(t))}function U(t){for(var e=D;e<t;e++)F(e);D=t}U(1e3);var z=we("ObservableArrayAdministration",I);function B(t){return fe(t)&&z(t.$mobx)}var V={},G=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableValue@"+ne()),void 0===i&&(i=!0);var o=t.call(this,r)||this;return o.enhancer=n,o.hasUnreportedChange=!1,o.dehancer=void 0,o.value=n(e,void 0,r),i&&w()&&x({type:"create",object:o,newValue:o.value}),o}return c(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){var e=this.value;if((t=this.prepareNewValue(t))!==V){var n=w();n&&_({type:"update",object:this,newValue:t,oldValue:e}),this.setNewValue(t),n&&T()}},e.prototype.prepareNewValue=function(t){if(Je(this),p(this)){var e=y(this,{object:this,type:"update",newValue:t});if(!e)return V;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.value!==t?t:V},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),m(this)&&b(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return v(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),g(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Se(this.get())},e}(f);G.prototype[_e()]=G.prototype.valueOf;var W=we("ObservableValue",G),X={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"};function H(t){return X[t]}function Y(t,e){ie("function"==typeof e,H("m026")),ie("string"==typeof t&&t.length>0,"actions should have valid names, got: '"+t+"'");var n=function(){return $(t,e,this,arguments)};return n.originalFn=e,n.isMobxAction=!0,n}function $(t,e,n,r){var i=function(t,e,n,r){var i=w()&&!!t,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];_({type:"action",name:t,fn:e,object:n,arguments:s})}var l=nn();return Ge(),{prevDerivation:l,prevAllowStateChanges:Z(!0),notifySpy:i,startTime:o}}(t,e,n,r);try{return e.apply(n,r)}finally{!function(t){K(t.prevAllowStateChanges),We(),rn(t.prevDerivation),t.notifySpy&&T({time:Date.now()-t.startTime})}(i)}}function q(t){ie(null===Pe.trackingDerivation,H("m028")),Pe.strictMode=t,Pe.allowStateChanges=!t}function Z(t){var e=Pe.allowStateChanges;return Pe.allowStateChanges=t,e}function K(t){Pe.allowStateChanges=t}function J(t,e,n,r,i){function o(o,a,s,u,l){if(void 0===l&&(l=0),ie(i||et(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){ve(o,"__mobxLazyInitializers")||ye(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var c=s.value,f=s.initializer;return o.__mobxLazyInitializers.push((function(e){t(e,a,f?f.call(e):c,u,s)})),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&tt(this),e.call(this,a)},set:function(t){!0!==this.__mobxDidRunLazyInitializers&&tt(this),n.call(this,a,t)}}}var h={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||Q(this,a,void 0,t,u,s),e.call(this,a)},set:function(e){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,e):Q(this,a,e,t,u,s)}};return(arguments.length<3||5===arguments.length&&l<3)&&Object.defineProperty(o,a,h),h}return i?function(){if(et(arguments))return o.apply(null,arguments);var t=arguments,e=arguments.length;return function(n,r,i){return o(n,r,i,t,e)}}:o}function Q(t,e,n,r,i,o){ve(t,"__mobxInitializedProps")||ye(t,"__mobxInitializedProps",{}),t.__mobxInitializedProps[e]=!0,r(t,e,n,i,o)}function tt(t){!0!==t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers&&(ye(t,"__mobxDidRunLazyInitializers",!0),t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers.forEach((function(e){return e(t)})))}function et(t){return(2===t.length||3===t.length)&&"string"==typeof t[1]}var nt=J((function(t,e,n,r,i){var o=r&&1===r.length?r[0]:n.name||e||"<unnamed action>";ye(t,e,it(o,n))}),(function(t){return this[t]}),(function(){ie(!1,H("m001"))}),!1,!0),rt=J((function(t,e,n){st(t,e,n)}),(function(t){return this[t]}),(function(){ie(!1,H("m001"))}),!1,!1),it=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?Y(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?Y(t,e):1===arguments.length&&"string"==typeof t?ot(t):ot(e).apply(null,arguments)};function ot(t){return function(e,n,r){if(r&&"function"==typeof r.value)return r.value=Y(t,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return nt(t).apply(this,arguments)}}function at(t){return"function"==typeof t&&!0===t.isMobxAction}function st(t,e,n){var r=function(){return $(e,n,t,arguments)};r.isMobxAction=!0,ye(t,e,r)}it.bound=function(t,e,n){if("function"==typeof t){var r=Y("<not yet bound action>",t);return r.autoBind=!0,r}return rt.apply(null,arguments)};var ut=Object.prototype.toString;function lt(t,e){return ct(t,e)}function ct(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&function(t,e,n,r){t=ft(t),e=ft(e);var i=ut.call(t);if(i!==ut.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!ct(t[u],e[u],n,r))return!1}else{var l,c=Object.keys(t);if(u=c.length,Object.keys(e).length!==u)return!1;for(;u--;)if(!ht(e,l=c[u])||!ct(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function ft(t){return B(t)?t.peek():Qt(t)?t.entries():xe(t)?function(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}(t.entries()):t}function ht(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function dt(t,e){return t===e}var pt={identity:dt,structural:function(t,e){return lt(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||dt(t,e)}};function vt(t,e,n){var r,i,o;"string"==typeof t?(r=t,i=e,o=n):(r=t.name||"Autorun@"+ne(),i=t,o=e),ie("function"==typeof i,H("m004")),ie(!1===at(i),H("m005")),o&&(i=i.bind(o));var a=new un(r,(function(){this.track(s)}));function s(){i(a)}return a.schedule(),a.getDisposer()}function yt(t,e,n){var r;arguments.length>3&&re(H("m007")),Gt(t)&&re(H("m008")),(r="object"==typeof n?n:{}).name=r.name||t.name||e.name||"Reaction@"+ne(),r.fireImmediately=!0===n||!0===r.fireImmediately,r.delay=r.delay||0,r.compareStructural=r.compareStructural||r.struct||!1,e=it(r.name,r.context?e.bind(r.context):e),r.context&&(t=t.bind(r.context));var i,o=!0,a=!1,s=r.equals?r.equals:r.compareStructural||r.struct?pt.structural:pt.default,u=new un(r.name,(function(){o||r.delay<1?l():a||(a=!0,setTimeout((function(){a=!1,l()}),r.delay))}));function l(){if(!u.isDisposed){var n=!1;u.track((function(){var e=t(u);n=o||!s(i,e),i=e})),o&&r.fireImmediately&&e(i,u),o||!0!==n||e(i,u),o&&(o=!1)}}return u.schedule(),u.getDisposer()}var mt=function(){function t(t,e,n,r,i){this.derivation=t,this.scope=e,this.equals=n,this.dependenciesState=Te.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Te.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+ne(),this.value=new $e(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Ae.NONE,this.name=r||"ComputedValue@"+ne(),i&&(this.setter=Y(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Te.UP_TO_DATE){t.lowestObserverState=Te.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Te.UP_TO_DATE&&(r.dependenciesState=Te.POSSIBLY_STALE,r.isTracing!==Ae.NONE&&He(r,t),r.onBecomeStale())}}}(this)},t.prototype.onBecomeUnobserved=function(){tn(this),this.value=void 0},t.prototype.get=function(){ie(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===Pe.inBatch?(Ge(),Ze(this)&&(this.isTracing!==Ae.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),We()):(Xe(this),Ze(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState!==Te.STALE){t.lowestObserverState=Te.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Te.POSSIBLY_STALE?r.dependenciesState=Te.STALE:r.dependenciesState===Te.UP_TO_DATE&&(t.lowestObserverState=Te.UP_TO_DATE)}}}(this));var t=this.value;if(qe(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(qe(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){ie(!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,t)}finally{this.isRunningSetter=!1}}else ie(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){w()&&x({object:this.scope,type:"compute",fn:this.derivation});var t=this.value,e=this.dependenciesState===Te.NOT_TRACKING,n=this.value=this.computeValue(!0);return e||qe(t)||qe(n)||!this.equals(t,n)},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,Pe.computationDepth++,t)e=Qe(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new $e(t)}return Pe.computationDepth--,this.isComputing=!1,e},t.prototype.observe=function(t,e){var n=this,r=!0,i=void 0;return vt((function(){var o=n.get();if(!r||e){var a=nn();t({type:"update",object:n,newValue:o,oldValue:i}),rn(a)}r=!1,i=o}))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Se(this.get())},t.prototype.whyRun=function(){var t=Boolean(Pe.trackingDerivation),e=le(this.isComputing?this.newObserving:this.observing).map((function(t){return t.name})),n=le(Ue(this).map((function(t){return t.name})));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(t?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Te.NOT_TRACKING?H("m032"):" * This computation will re-run if any of the following observables changes:\n "+ce(e)+"\n "+(this.isComputing&&t?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+H("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+ce(n)+"\n")},t}();mt.prototype[_e()]=mt.prototype.valueOf;var gt=we("ComputedValue",mt),bt=function(){function t(t,e){this.target=t,this.name=e,this.values={},this.changeListeners=null,this.interceptors=null}return t.prototype.observe=function(t,e){return ie(!0!==e,"`observe` doesn't support the fire immediately property for observable objects."),g(this,t)},t.prototype.intercept=function(t){return v(this,t)},t}();function wt(t,e){if(kt(t)&&t.hasOwnProperty("$mobx"))return t.$mobx;ie(Object.isExtensible(t),H("m035")),he(t)||(e=(t.constructor.name||"ObservableObject")+"@"+ne()),e||(e="ObservableObject@"+ne());var n=new bt(t,e);return me(t,"$mobx",n),n}function xt(t,e,n,r){if(t.values[e]&&!gt(t.values[e]))return ie("value"in n,"The property "+e+" in "+t.name+" is already observable, cannot redefine it as computed property"),void(t.target[e]=n.value);if("value"in n)if(Gt(n.value)){var i=n.value;_t(t,e,i.initialValue,i.enhancer)}else at(n.value)&&!0===n.value.autoBind?st(t.target,e,n.value.originalFn):gt(n.value)?function(t,e,n){var r=t.name+"."+e;n.name=r,n.scope||(n.scope=t.target),t.values[e]=n,Object.defineProperty(t.target,e,Ot(e))}(t,e,n.value):_t(t,e,n.value,r);else St(t,e,n.get,n.set,pt.default,!0)}function _t(t,e,n,r){if(be(t.target,e),p(t)){var i=y(t,{object:t.target,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(t.values[e]=new G(n,r,t.name+"."+e,!1)).value,Object.defineProperty(t.target,e,function(t){return Tt[t]||(Tt[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[t].get()},set:function(e){Et(this,t,e)}})}(e)),function(t,e,n,r){var i=m(t),o=w(),a=i||o?{type:"add",object:e,name:n,newValue:r}:null;o&&_(a),i&&b(t,a),o&&T()}(t,t.target,e,n)}function St(t,e,n,r,i,o){o&&be(t.target,e),t.values[e]=new mt(n,t.target,i,t.name+"."+e,r),o&&Object.defineProperty(t.target,e,Ot(e))}var Tt={},At={};function Ot(t){return At[t]||(At[t]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[t].get()},set:function(e){return this.$mobx.values[t].set(e)}})}function Et(t,e,n){var r=t.$mobx,i=r.values[e];if(p(r)){if(!(s=y(r,{type:"update",object:t,name:e,newValue:n})))return;n=s.newValue}if((n=i.prepareNewValue(n))!==V){var o=m(r),a=w(),s=o||a?{type:"update",object:t,oldValue:i.value,name:e,newValue:n}:null;a&&_(s),i.setNewValue(n),o&&b(r,s),a&&T()}}var Pt=we("ObservableObjectAdministration",bt);function kt(t){return!!fe(t)&&(tt(t),Pt(t.$mobx))}function jt(t,e){if(null==t)return!1;if(void 0!==e){if(B(t)||Qt(t))throw new Error(H("m019"));if(kt(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return kt(t)||!!t.$mobx||d(t)||pn(t)||gt(t)}function Ct(t){return ie(!!t,":("),J((function(e,n,r,i,o){be(e,n),ie(!o||!o.get,H("m022")),_t(wt(e,void 0),n,r,t)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){Et(this,t,e)}),!0,!1)}function Dt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return It(t,Xt,e)}function Rt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return It(t,Yt,e)}function It(t,e,n){ie(arguments.length>=2,H("m014")),ie("object"==typeof t,H("m015")),ie(!Qt(t),H("m016")),n.forEach((function(t){ie("object"==typeof t,H("m017")),ie(!jt(t),H("m018"))}));for(var r=wt(t),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&ve(a,s)){if(i[s]=!0,t===a&&!ge(t,s))continue;xt(r,s,Object.getOwnPropertyDescriptor(a,s),e)}}return t}var Lt=Ct(Xt),Mt=Ct(Ht),Nt=Ct(Yt),Ft=Ct($t),Ut=Ct(qt),zt={box:function(t,e){return arguments.length>2&&Vt("box"),new G(t,Xt,e)},shallowBox:function(t,e){return arguments.length>2&&Vt("shallowBox"),new G(t,Yt,e)},array:function(t,e){return arguments.length>2&&Vt("array"),new L(t,Xt,e)},shallowArray:function(t,e){return arguments.length>2&&Vt("shallowArray"),new L(t,Yt,e)},map:function(t,e){return arguments.length>2&&Vt("map"),new Jt(t,Xt,e)},shallowMap:function(t,e){return arguments.length>2&&Vt("shallowMap"),new Jt(t,Yt,e)},object:function(t,e){arguments.length>2&&Vt("object");var n={};return wt(n,e),Dt(n,t),n},shallowObject:function(t,e){arguments.length>2&&Vt("shallowObject");var n={};return wt(n,e),Rt(n,t),n},ref:function(){return arguments.length<2?Wt(Yt,arguments[0]):Nt.apply(null,arguments)},shallow:function(){return arguments.length<2?Wt(Ht,arguments[0]):Mt.apply(null,arguments)},deep:function(){return arguments.length<2?Wt(Xt,arguments[0]):Lt.apply(null,arguments)},struct:function(){return arguments.length<2?Wt($t,arguments[0]):Ft.apply(null,arguments)}},Bt=function(t){if(void 0===t&&(t=void 0),"string"==typeof arguments[1])return Lt.apply(null,arguments);if(ie(arguments.length<=1,H("m021")),ie(!Gt(t),H("m020")),jt(t))return t;var e=Xt(t,0,void 0);return e!==t?e:Bt.box(t)};function Vt(t){re("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function Gt(t){return"object"==typeof t&&null!==t&&!0===t.isMobxModifierDescriptor}function Wt(t,e){return ie(!Gt(e),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:e,enhancer:t}}function Xt(t,e,n){return Gt(t)&&re("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),jt(t)?t:Array.isArray(t)?Bt.array(t,n):he(t)?Bt.object(t,n):xe(t)?Bt.map(t,n):t}function Ht(t,e,n){return Gt(t)&&re("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),null==t||kt(t)||B(t)||Qt(t)?t:Array.isArray(t)?Bt.shallowArray(t,n):he(t)?Bt.shallowObject(t,n):xe(t)?Bt.shallowMap(t,n):re("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function Yt(t){return t}function $t(t,e,n){if(lt(t,e))return e;if(jt(t))return t;if(Array.isArray(t))return new L(t,$t,n);if(xe(t))return new Jt(t,$t,n);if(he(t)){var r={};return wt(r,n),It(r,$t,[t]),r}return t}function qt(t,e,n){return lt(t,e)?e:t}function Zt(t,e){void 0===e&&(e=void 0),Ge();try{return t.apply(e)}finally{We()}}Object.keys(zt).forEach((function(t){return Bt[t]=zt[t]})),Bt.deep.struct=Bt.struct,Bt.ref.struct=function(){return arguments.length<2?Wt(qt,arguments[0]):Ut.apply(null,arguments)};var Kt={},Jt=function(){function t(t,e,n){void 0===e&&(e=Xt),void 0===n&&(n="ObservableMap@"+ne()),this.enhancer=e,this.name=n,this.$mobx=Kt,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new L(void 0,Yt,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(t)}return t.prototype._has=function(t){return void 0!==this._data[t]},t.prototype.has=function(t){return!!this.isValidKey(t)&&(t=""+t,this._hasMap[t]?this._hasMap[t].get():this._updateHasMapEntry(t,!1).get())},t.prototype.set=function(t,e){this.assertValidKey(t),t=""+t;var n=this._has(t);if(p(this)){var r=y(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if(this.assertValidKey(t),t=""+t,p(this)&&!(i=y(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=w(),r=m(this),i=r||n?{type:"delete",object:this,oldValue:this._data[t].value,name:t}:null;return n&&_(i),Zt((function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data[t].setNewValue(void 0),e._data[t]=void 0})),r&&b(this,i),n&&T(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap[t];return n?n.setNewValue(e):n=this._hasMap[t]=new G(e,Yt,this.name+"."+t+"?",!1),n},t.prototype._updateValue=function(t,e){var n=this._data[t];if((e=n.prepareNewValue(e))!==V){var r=w(),i=m(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&_(o),n.setNewValue(e),i&&b(this,o),r&&T()}},t.prototype._addValue=function(t,e){var n=this;Zt((function(){var r=n._data[t]=new G(e,n.enhancer,n.name+"."+t,!1);e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)}));var r=w(),i=m(this),o=i||r?{type:"add",object:this,name:t,newValue:e}:null;r&&_(o),i&&b(this,o),r&&T()},t.prototype.get=function(t){return t=""+t,this.has(t)?this.dehanceValue(this._data[t].get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return E(this._keys.slice())},t.prototype.values=function(){return E(this._keys.map(this.get,this))},t.prototype.entries=function(){var t=this;return E(this._keys.map((function(e){return[e,t.get(e)]})))},t.prototype.forEach=function(t,e){var n=this;this.keys().forEach((function(r){return t.call(e,n.get(r),r,n)}))},t.prototype.merge=function(t){var e=this;return Qt(t)&&(t=t.toJS()),Zt((function(){he(t)?Object.keys(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=t[0],r=t[1];return e.set(n,r)})):xe(t)?t.forEach((function(t,n){return e.set(n,t)})):null!=t&&re("Cannot initialize map from "+t)})),this},t.prototype.clear=function(){var t=this;Zt((function(){en((function(){t.keys().forEach(t.delete,t)}))}))},t.prototype.replace=function(t){var e=this;return Zt((function(){var n,r=he(n=t)?Object.keys(n):Array.isArray(n)?n.map((function(t){return t[0]})):xe(n)?Array.from(n.keys()):Qt(n)?n.keys():re("Cannot get keys from "+n);e.keys().filter((function(t){return-1===r.indexOf(t)})).forEach((function(t){return e.delete(t)})),e.merge(t)})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toJS=function(){var t=this,e={};return this.keys().forEach((function(n){return e[n]=t.get(n)})),e},t.prototype.toJSON=function(){return this.toJS()},t.prototype.isValidKey=function(t){return null!=t&&("string"==typeof t||"number"==typeof t||"boolean"==typeof t)},t.prototype.assertValidKey=function(t){if(!this.isValidKey(t))throw new Error("[mobx.map] Invalid key: '"+t+"', only strings, numbers and booleans are accepted as key in observable maps.")},t.prototype.toString=function(){var t=this;return this.name+"[{ "+this.keys().map((function(e){return e+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return ie(!0!==e,H("m033")),g(this,t)},t.prototype.intercept=function(t){return v(this,t)},t}();P(Jt.prototype,(function(){return this.entries()}));var Qt=we("ObservableMap",Jt),te=[];function ee(){return"undefined"!=typeof window?window:i.g}function ne(){return++Pe.mobxGuid}function re(t,e){throw ie(!1,t,e),"X"}function ie(t,e,n){if(!t)throw new Error("[mobx] Invariant failed: "+e+(n?" in '"+n+"'":""))}Object.freeze(te);var oe=[];function ae(t){return-1===oe.indexOf(t)&&(oe.push(t),console.error("[mobx] Deprecated: "+t),!0)}function se(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ue=function(){};function le(t){var e=[];return t.forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),e}function ce(t,e,n){return void 0===e&&(e=100),void 0===n&&(n=" - "),t?t.slice(0,e).join(n)+(t.length>e?" (... and "+(t.length-e)+"more)":""):""}function fe(t){return null!==t&&"object"==typeof t}function he(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function de(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)ve(r,i)&&(t[i]=r[i])}return t}var pe=Object.prototype.hasOwnProperty;function ve(t,e){return pe.call(t,e)}function ye(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function me(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ge(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}function be(t,e){ie(ge(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function we(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return fe(t)&&!0===t[n]}}function xe(t){return void 0!==ee().Map&&t instanceof ee().Map}function _e(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function Se(t){return null===t?null:"object"==typeof t?""+t:t}var Te,Ae,Oe=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ee=function(){this.version=5,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.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]},Pe=new Ee,ke=!1,je=!1,Ce=!1,De=ee();function Re(t,e){if("object"==typeof t&&null!==t){if(B(t))return ie(void 0===e,H("m036")),t.$mobx.atom;if(Qt(t)){var n=t;return void 0===e?Re(n._keys):(ie(!!(r=n._data[e]||n._hasMap[e]),"the entry '"+e+"' does not exist in the observable map '"+Le(t)+"'"),r)}var r;if(tt(t),e&&!t.$mobx&&t[e],kt(t))return e?(ie(!!(r=t.$mobx.values[e]),"no observable property '"+e+"' found on the observable object '"+Le(t)+"'"),r):re("please specify a property");if(d(t)||gt(t)||pn(t))return t}else if("function"==typeof t&&pn(t.$mobx))return t.$mobx;return re("Cannot obtain atom from "+t)}function Ie(t,e){return ie(t,"Expecting some object"),void 0!==e?Ie(Re(t,e)):d(t)||gt(t)||pn(t)||Qt(t)?t:(tt(t),t.$mobx?t.$mobx:void ie(!1,"Cannot obtain administration from "+t))}function Le(t,e){return(void 0!==e?Re(t,e):kt(t)||Qt(t)?Ie(t):Re(t)).name}function Me(t,e){return Ne(Re(t,e))}function Ne(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=le(t.observing).map(Ne)),e}function Fe(t){var e={name:t.name};return function(t){return t.observers&&t.observers.length>0}(t)&&(e.observers=Ue(t).map(Fe)),e}function Ue(t){return t.observers}function ze(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Be(t,e){if(1===t.observers.length)t.observers.length=0,Ve(t);else{var n=t.observers,r=t.observersIndexes,i=n.pop();if(i!==e){var o=r[e.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[e.__mapid]}}function Ve(t){t.isPendingUnobservation||(t.isPendingUnobservation=!0,Pe.pendingUnobservations.push(t))}function Ge(){Pe.inBatch++}function We(){if(0==--Pe.inBatch){hn();for(var t=Pe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Pe.pendingUnobservations=[]}}function Xe(t){var e=Pe.trackingDerivation;null!==e?e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t):0===t.observers.length&&Ve(t)}function He(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Ae.BREAK){var n=[];Ye(Me(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof mt?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Ye(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Ye(t,e,n+1)})))}De.__mobxInstanceCount?(De.__mobxInstanceCount++,setTimeout((function(){ke||je||Ce||(Ce=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))}),1)):De.__mobxInstanceCount=1,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"}(Te||(Te={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Ae||(Ae={}));var $e=function(t){this.cause=t};function qe(t){return t instanceof $e}function Ze(t){switch(t.dependenciesState){case Te.UP_TO_DATE:return!1;case Te.NOT_TRACKING:case Te.STALE:return!0;case Te.POSSIBLY_STALE:for(var e=nn(),n=t.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(gt(o)){try{o.get()}catch(t){return rn(e),!0}if(t.dependenciesState===Te.STALE)return rn(e),!0}}return on(t),rn(e),!1}}function Ke(){return null!==Pe.trackingDerivation}function Je(t){var e=t.observers.length>0;Pe.computationDepth>0&&e&&re(H("m031")+t.name),!Pe.allowStateChanges&&e&&re(H(Pe.strictMode?"m030a":"m030b")+t.name)}function Qe(t,e,n){on(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Pe.runId;var r,i=Pe.trackingDerivation;Pe.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new $e(t)}return Pe.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Te.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++)0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState);for(n.length=i,t.newObserving=null,o=e.length;o--;)0===(s=e[o]).diffValue&&Be(s,t),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,ze(s,t))}r!==Te.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function tn(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Be(e[n],t);t.dependenciesState=Te.NOT_TRACKING}function en(t){var e=nn(),n=t();return rn(e),n}function nn(){var t=Pe.trackingDerivation;return Pe.trackingDerivation=null,t}function rn(t){Pe.trackingDerivation=t}function on(t){if(t.dependenciesState!==Te.UP_TO_DATE){t.dependenciesState=Te.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Te.UP_TO_DATE}}function an(t){return console.log(t),t}function sn(t){switch(t.length){case 0:return Pe.trackingDerivation;case 1:return Re(t[0]);case 2:return Re(t[0],t[1])}}var un=function(){function t(t,e){void 0===t&&(t="Reaction@"+ne()),this.name=t,this.onInvalidate=e,this.observing=[],this.newObserving=[],this.dependenciesState=Te.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+ne(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Ae.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Pe.pendingReactions.push(this),hn())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(Ge(),this._isScheduled=!1,Ze(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&w()&&x({object:this,type:"scheduled-reaction"})),We())},t.prototype.track=function(t){Ge();var e,n=w();n&&(e=Date.now(),_({object:this,type:"reaction",fn:t})),this._isRunning=!0;var r=Qe(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&tn(this),qe(r)&&this.reportExceptionInDerivation(r.cause),n&&T({time:Date.now()-e}),We()},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=H("m037");console.error(n||r,t),w()&&x({type:"error",message:n,error:t,object:this}),Pe.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ge(),tn(this),We()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t.$mobx=this,t.onError=ln,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.whyRun=function(){var t=le(this._isRunning?this.newObserving:this.observing).map((function(t){return t.name}));return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+ce(t)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+H("m038")+"\n"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=sn(t);if(!r)return re("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===Ae.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Ae.BREAK:Ae.LOG}(this,t)},t}();function ln(t){ie(this&&this.$mobx&&pn(this.$mobx),"Invalid `this`"),ie(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=t}var cn=100,fn=function(t){return t()};function hn(){Pe.inBatch>0||Pe.isRunningReactions||fn(dn)}function dn(){Pe.isRunningReactions=!0;for(var t=Pe.pendingReactions,e=0;t.length>0;){++e===cn&&(console.error("Reaction doesn't converge to a stable state after "+cn+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}Pe.isRunningReactions=!1}var pn=we("Reaction",un);function vn(t){return J((function(e,n,r,i,o){ie(void 0!==o,H("m009")),ie("function"==typeof o.get,H("m010")),St(wt(e,""),n,o.get,o.set,t,!1)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){this.$mobx.values[t].set(e)}),!1,!1)}var yn=vn(pt.default),mn=vn(pt.structural),gn=function(t,e,n){if("string"==typeof e)return yn.apply(null,arguments);ie("function"==typeof t,H("m011")),ie(arguments.length<3,H("m012"));var r="object"==typeof e?e:{};r.setter="function"==typeof e?e:r.setter;var i=r.equals?r.equals:r.compareStructural||r.struct?pt.structural:pt.default;return new mt(t,r.context,i,r.name||t.name||"",r.setter)};function bn(t,e,n){function r(r){return e&&n.push([t,r]),r}if(void 0===e&&(e=!0),void 0===n&&(n=[]),jt(t)){if(e&&null===n&&(n=[]),e&&null!==t&&"object"==typeof t)for(var i=0,o=n.length;i<o;i++)if(n[i][0]===t)return n[i][1];if(B(t)){var a=r([]),s=t.map((function(t){return bn(t,e,n)}));for(a.length=s.length,i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(kt(t)){for(var u in a=r({}),t)a[u]=bn(t[u],e,n);return a}if(Qt(t)){var l=r({});return t.forEach((function(t,r){return l[r]=bn(t,e,n)})),l}if(W(t))return bn(t.get(),e,n)}return t}gn.struct=mn,gn.equals=vn;var wn={allowStateChanges:function(t,e){var n,r=Z(t);try{n=e()}finally{K(r)}return n},deepEqual:lt,getAtom:Re,getDebugName:Le,getDependencyTree:Me,getAdministration:Ie,getGlobalState:function(){return Pe},getObserverTree:function(t,e){return Fe(Re(t,e))},interceptReads:function(t,e,n){var r;if(Qt(t)||B(t)||W(t))r=Ie(t);else{if(!kt(t))return re("Expected observable map, object or array as first array");if("string"!=typeof e)return re("InterceptReads can only be used with a specific property, not with an object in general");r=Ie(t,e)}return void 0!==r.dehancer?re("An intercept reader was already established"):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},isComputingDerivation:Ke,isSpyEnabled:w,onReactionError:function(t){return Pe.globalReactionErrorHandlers.push(t),function(){var e=Pe.globalReactionErrorHandlers.indexOf(t);e>=0&&Pe.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:U,resetGlobalState:function(){Pe.resetId++;var t=new Ee;for(var e in t)-1===Oe.indexOf(e)&&(Pe[e]=t[e]);Pe.allowStateChanges=!Pe.strictMode},isolateGlobalState:function(){je=!0,ee().__mobxInstanceCount--},shareGlobalState:function(){ae("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),ke=!0;var t=ee(),e=Pe;if(t.__mobservableTrackingStack||t.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(t.__mobxGlobal&&t.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");t.__mobxGlobal?Pe=t.__mobxGlobal:t.__mobxGlobal=e},spyReport:x,spyReportEnd:T,spyReportStart:_,setReactionScheduler:function(t){var e=fn;fn=function(n){return t((function(){return e(n)}))}}},xn={Reaction:un,untracked:en,Atom:h,BaseAtom:f,useStrict:q,isStrictModeEnabled:function(){return Pe.strictMode},spy:A,comparer:pt,asReference:function(t){return ae("asReference is deprecated, use observable.ref instead"),Bt.ref(t)},asFlat:function(t){return ae("asFlat is deprecated, use observable.shallow instead"),Bt.shallow(t)},asStructure:function(t){return ae("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),Bt.struct(t)},asMap:function(t){return ae("asMap is deprecated, use observable.map or observable.shallowMap instead"),Bt.map(t||{})},isModifierDescriptor:Gt,isObservableObject:kt,isBoxedObservable:W,isObservableArray:B,ObservableMap:Jt,isObservableMap:Qt,map:function(t){return ae("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),Bt.map(t)},transaction:Zt,observable:Bt,computed:gn,isObservable:jt,isComputed:function(t,e){if(null==t)return!1;if(void 0!==e){if(!1===kt(t))return!1;if(!t.$mobx.values[e])return!1;var n=Re(t,e);return gt(n)}return gt(t)},extendObservable:Dt,extendShallowObservable:Rt,observe:function(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return Ie(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Ie(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Ie(t,e).intercept(n)}(t,e,n):function(t,e){return Ie(t).intercept(e)}(t,e)},autorun:vt,autorunAsync:function(t,e,n,r){var i,o,a,s;"string"==typeof t?(i=t,o=e,a=n,s=r):(i=t.name||"AutorunAsync@"+ne(),o=t,a=e,s=n),ie(!1===at(o),H("m006")),void 0===a&&(a=1),s&&(o=o.bind(s));var u=!1,l=new un(i,(function(){u||(u=!0,setTimeout((function(){u=!1,l.isDisposed||l.track(c)}),a))}));function c(){o(l)}return l.schedule(),l.getDisposer()},when:function(t,e,n,r){var i,o,a,s;return"string"==typeof t?(i=t,o=e,a=n,s=r):(i="When@"+ne(),o=t,a=e,s=n),vt(i,(function(t){if(o.call(s)){t.dispose();var e=nn();a.call(s),rn(e)}}))},reaction:yt,action:it,isAction:at,runInAction:function(t,e,n){var r="string"==typeof t?t:t.name||"<unnamed action>",i="function"==typeof t?t:e,o="function"==typeof t?e:n;return ie("function"==typeof i,H("m002")),ie(0===i.length,H("m003")),ie("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),$(r,i,o,void 0)},expr:function(t,e){return Ke()||console.warn(H("m013")),gn(t,{context:e}).get()},toJS:bn,createTransformer:function(t,e){ie("function"==typeof t&&t.length<2,"createTransformer expects a function that accepts one argument");var n={},r=Pe.resetId,i=function(r){function i(e,n){var i=r.call(this,(function(){return t(n)}),void 0,pt.default,"Transformer-"+t.name+"-"+e,void 0)||this;return i.sourceIdentifier=e,i.sourceObject=n,i}return c(i,r),i.prototype.onBecomeUnobserved=function(){var t=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],e&&e(t,this.sourceObject)},i}(mt);return function(t){r!==Pe.resetId&&(n={},r=Pe.resetId);var e=function(t){if("string"==typeof t||"number"==typeof t)return t;if(null===t||"object"!=typeof t)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+t);var e=t.$transformId;return void 0===e&&ye(t,"$transformId",e=ne()),e}(t),o=n[e];return o?o.get():(o=n[e]=new i(e,t)).get()}},whyRun:function(t,e){return ae("`whyRun` is deprecated in favor of `trace`"),(t=sn(arguments))?gt(t)||pn(t)?an(t.whyRun()):re(H("m025")):an(H("m024"))},isArrayLike:function(t){return Array.isArray(t)||B(t)},extras:wn},_n=!1,Sn=function(t){var e=xn[t];Object.defineProperty(xn,t,{get:function(){return _n||(_n=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),e}})};for(var Tn in xn)Sn(Tn);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:A,extras:wn});var An=i(803),On=i.n(An),En={value:()=>{}};function Pn(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new kn(r)}function kn(t){this._=t}function jn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Cn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=En,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}kn.prototype=Pn.prototype={constructor:kn,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=Cn(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Cn(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=jn(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new kn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Dn=Pn;var Rn,In,Ln=0,Mn=0,Nn=0,Fn=1e3,Un=0,zn=0,Bn=0,Vn="object"==typeof performance&&performance.now?performance:Date,Gn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Wn(){return zn||(Gn(Xn),zn=Vn.now()+Bn)}function Xn(){zn=0}function Hn(){this._call=this._time=this._next=null}function Yn(t,e,n){var r=new Hn;return r.restart(t,e,n),r}function $n(){zn=(Un=Vn.now())+Bn,Ln=Mn=0;try{!function(){Wn(),++Ln;for(var t,e=Rn;e;)(t=zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ln}()}finally{Ln=0,function(){for(var t,e,n=Rn,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Rn=e);In=t,Zn(r)}(),zn=0}}function qn(){var t=Vn.now(),e=t-Un;e>Fn&&(Bn-=e,Un=t)}function Zn(t){Ln||(Mn&&(Mn=clearTimeout(Mn)),t-zn>24?(t<1/0&&(Mn=setTimeout($n,t-Vn.now()-Bn)),Nn&&(Nn=clearInterval(Nn))):(Nn||(Un=Vn.now(),Nn=setInterval(qn,Fn)),Ln=1,Gn($n)))}Hn.prototype=Yn.prototype={constructor:Hn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Wn():+n)+(null==e?0:+e),this._next||In===this||(In?In._next=this:Rn=this,In=this),this._call=t,this._time=n,Zn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zn())}};const Kn=4294967296;function Jn(t){return t.x}function Qn(t){return t.y}var tr=Math.PI*(3-Math.sqrt(5));function er(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,h,d=t._root,p={data:r},v=t._x0,y=t._y0,m=t._x1,g=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function nr(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function rr(t){return t[0]}function ir(t){return t[1]}function or(t,e,n){var r=new ar(null==e?rr:e,null==n?ir:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ar(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function sr(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ur=or.prototype=ar.prototype;function lr(t){return function(){return t}}function cr(t){return 1e-6*(t()-.5)}function fr(){var t,e,n,r,i,o=lr(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=or(t,Jn,Qn).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/u<p)return p<s&&(0===f&&(p+=(f=cr(n))*f),0===h&&(p+=(h=cr(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=cr(n))*f),0===h&&(p+=(h=cr(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:lr(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l}function hr(t){return t.x+t.vx}function dr(t){return t.y+t.vy}function pr(t){return t.index}function vr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}ur.copy=function(){var t,e,n=new ar(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=sr(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=sr(e));return n},ur.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return er(this.cover(e,n),e,n,t)},ur.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)er(this,a[n],s[n],t[n]);return this},ur.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},ur.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},ur.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ur.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new nr(v,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<c||(s=u.y1)<f))if(v.length){var y=(i+a)/2,m=(o+s)/2;p.push(new nr(v[3],y,m,a,s),new nr(v[2],i,m,y,s),new nr(v[1],y,o,a,m),new nr(v[0],i,o,y,m)),(l=(e>=m)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var g=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),w=g*g+b*b;if(w<n){var x=Math.sqrt(n=w);c=t-x,f=e-x,h=t+x,d=e+x,r=v.data}}return r},ur.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,h,d=this._root,p=this._x0,v=this._y0,y=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(v+m)/2))?v=u:m=u,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},ur.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},ur.root=function(){return this._root},ur.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},ur.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new nr(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new nr(n,l,c,o,a)),(n=u[2])&&s.push(new nr(n,r,c,l,a)),(n=u[1])&&s.push(new nr(n,l,i,o,c)),(n=u[0])&&s.push(new nr(n,r,i,l,c))}return this},ur.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new nr(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new nr(o,a,s,c,f)),(o=i[1])&&n.push(new nr(o,c,s,u,f)),(o=i[2])&&n.push(new nr(o,a,f,c,l)),(o=i[3])&&n.push(new nr(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},ur.x=function(t){return arguments.length?(this._x=t,this):this._x},ur.y=function(t){return arguments.length?(this._y=t,this):this._y};var yr=256,mr=4096,gr=25,br="#ededed",wr={position:"absolute",top:0,bottom:0,left:0,right:0},xr=function(){return window.devicePixelRatio||1},_r=["NVL_basic-wrapper","NVL_interactive-wrapper"];function Sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Tr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ar=function(e){var n=new Map;return e.forEach((function(t){var e=t.id,r=t.from,i=t.to,o=t.color,a=t.width,s=t.disabled,u=[r,i].sort(),l="".concat(u[0],".").concat(u[1]),c=n.get(l);c?c.bundledRels.push({id:e,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}):n.set(l,{bundledRels:[{id:e,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}],key:l,from:r,to:i,color:null!=o?o:void 0,disabled:null!=s&&s,width:0})})),n.forEach((function(e){var n=(0,t.uniqBy)(e.bundledRels,"disabled"),r=1===n.length&&!0===n[0].disabled,i=1===n.length&&!0!==n[0].disabled;if(r)e.color=br,e.width=1;else{var o=e.bundledRels.filter((function(t){return!0!==t.disabled})),a=(0,t.uniqBy)(o,"color");i?(e.color=a.length>1?void 0:e.bundledRels[0].color,e.bundledRels.forEach((function(t){e.width+=t.width}))):(e.color=1===a.length?a[0].color:void 0,e.disabled=!1,e.bundledRels.forEach((function(t){e.width+=!0!==t.disabled?t.width:0})))}})),Array.from(n.values())},Or=function(){return void 0!==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t}))};function Er(t){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(t)}var Pr=function(t){var e,n;return"number"==typeof t.source||"number"==typeof t.target||"string"==typeof t.source||"string"==typeof t.target?45*devicePixelRatio:(null!==(e=t.source.size)&&void 0!==e?e:gr)+(null!==(n=t.target.size)&&void 0!==n?n:gr)+90*devicePixelRatio};function kr(t){return"object"===Er(t)}var jr=function(t){var e;return(null!==(e=t.size)&&void 0!==e?e:gr)+25*devicePixelRatio},Cr=function(){return-400*Math.pow(devicePixelRatio,2)},Dr=function(){return 2*Cr()};function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nr(r.key),r)}}function Nr(t){var e=function(t,e){if("object"!=Rr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:String(e)}var Fr="d3ForceLayout",Ur=function(t){return t?bn(t):t},zr=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=t.state;this.state=r,this.d3Nodes={},this.d3RelList={},this.computing=!0,this.center={x:0,y:0},this.nodeRelCount=[];var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Fr),a.addChannel(Fr),this.simulation=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=Yn(f),l=Dn("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Kn)/Kn}();function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*tr;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}().velocityDecay(.4).force("charge",fr().strength(Cr)).force("centerX",function(t){var e,n,r,i=lr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=lr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:lr(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:lr(+e),a(),o):t},o}(0).strength(.03)).force("centerY",function(t){var e,n,r,i=lr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=lr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:lr(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:lr(+e),a(),o):t},o}(0).strength(.03)).alpha(1).alphaMin(.05).on("end",(function(){n.simulationStopped=!0,n.shouldUpdate=!1,n.shouldReheatNodes=!1,n.shouldCountNodeRels=!1})).stop(),this.simulationStopped=!0,this.shouldUpdate=!0,this.shouldReheatNodes=!1,this.shouldCountNodeRels=!0,this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){var t=o.channels[Fr];if(void 0!==o.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),s=Or(i);e||r||s?(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0):n.shouldReheatNodes=!1}var u=a.channels[Fr];if(void 0!==a.version&&u){var l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;(l||c)&&(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0)}})))}var n,r;return n=e,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e=this;t.forEach((function(t){void 0===e.d3Nodes[t.id]&&(e.d3Nodes[t.id]={id:t.id}),null!=t&&t.pinned?(e.d3Nodes[t.id].fx=t.x,e.d3Nodes[t.id].fy=t.y):(e.d3Nodes[t.id].x=t.x,e.d3Nodes[t.id].y=t.y),e.d3Nodes[t.id].vy=0,e.d3Nodes[t.id].vx=0})),this.shouldUpdate=!0,this.simulation.tick().alpha(.2)}},{key:"update",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||n){var r=this.state,i=r.nodes,o=r.rels,a=i.channels[Fr],s=o.channels[Fr],u=Object.values(a.adds).length>0,l=Object.values(s.adds).length>0,c=Object.values(a.removes).length>0,f=Object.values(s.removes).length>0,h=Object.values(a.updates).length>0;if(u||l||c||f||h){var d=u&&0===Object.keys(this.d3Nodes).length,p=Ur(a.removes);Object.keys(p).forEach((function(t){delete e.d3Nodes[t]}));var v=Ur(a.adds);if(Object.keys(v).forEach((function(t){e.d3Nodes[t]=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Nr(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},v[t])})),h&&Object.values(a.updates).forEach((function(t){!0===t.pinned?(e.d3Nodes[t.id].fx=e.d3Nodes[t.id].x,e.d3Nodes[t.id].fy=e.d3Nodes[t.id].y):!1===t.pinned&&(e.d3Nodes[t.id].fx=null,e.d3Nodes[t.id].fy=null),void 0!==t.size&&(e.d3Nodes[t.id].size=t.size)})),(l||f)&&(this.d3RelList=Ar(Ur(o.items)).filter((function(t){return t.from!==t.to})).map((function(t,e){return{source:t.from,target:t.to,index:e}}))),d){var y=Object.values(this.d3Nodes);!function(t,e,n){var r=t.filter((function(t){return void 0===t.x&&void 0===t.y}));r.forEach((function(t,i){t.x=e.x+n*Math.sin(2*Math.PI*i/r.length),t.y=e.y+n*Math.cos(2*Math.PI*i/r.length)}))}(y,this.center,(t=y.length,45*t/(2*Math.PI)))}this.layout(i.items,o.items,d)}i.clearChannel(Fr),o.clearChannel(Fr),this.shouldUpdate=!1,this.simulation.alpha()>this.simulation.alphaMin()&&(this.shouldUpdate=!0,this.simulationStopped&&(this.simulation.restart(),this.simulationStopped=!1))}}},{key:"layout",value:function(e,n,r){var i=this;if(!(0,t.isEmpty)(this.d3Nodes)){if(this.simulation.stop(),this.simulation.nodes(Object.values(this.d3Nodes)).force("collide",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=or(e,hr,dr).visitAfter(s),t=0;t<d;++t)u=e[t],f=n[u.index],h=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(v);function v(t,e,n,o,a){var s=t.data,d=t.r,p=f+d;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var v=l-s.x-s.vx,y=c-s.y-s.vy,m=v*v+y*y;m<p*p&&(0===v&&(m+=(v=cr(r))*v),0===y&&(m+=(y=cr(r))*y),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(v*=m)*(p=(d*=d)/(h+d)),u.vy+=(y*=m)*p,s.vx-=v*(p=1-p),s.vy-=y*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=lr(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:lr(+e),u(),a):t},a}().radius(jr)),this.shouldCountNodeRels&&(this.nodeRelCount=this.countNodeRels()),this.simulation.force("link",function(t){var e,n,r,i,o,a,s=pr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=lr(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,h,d,p,v,y=0;y<s;++y)l=(u=t[y]).source,h=(f=u.target).x+f.vx-l.x-l.vx||cr(a),d=f.y+f.vy-l.y-l.vy||cr(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[y])/p*r*e[y],d*=p,f.vx-=h*(v=o[y]),f.vy-=d*v,l.vx+=h*(v=1-v),l.vy+=d*v}function h(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=vr(f,u.source)),"object"!=typeof u.target&&(u.target=vr(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"==typeof t?t:lr(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:lr(+t),p(),f):l},f}(this.d3RelList).id((function(t){return t.id})).distance(Pr).strength((function(t){return function(t,e){if(!kr(t.source)||!kr(t.target))return 1;var n=1.2/(Math.min(e[t.source.index],e[t.target.index])+(Math.max(e[t.source.index],e[t.target.index])-1)/100);return Math.max(Math.min(n,1),.06)}(t,i.nodeRelCount)}))),r){var o=0;this.simulation.force("charge",fr().strength(Dr));for(var a=performance.now();performance.now()-a<300&&o<200;)this.simulation.alpha(1),this.simulation.tick(1),o+=1;this.simulation.force("charge",fr().strength(Cr));for(var s=performance.now();performance.now()-s<100&&this.simulation.alpha()>=this.simulation.alphaMin();)this.simulation.tick(1);return this.computing=!1,void this.simulation.restart()}this.shouldReheatNodes?this.simulation.alpha(1).restart():this.simulation.restart()}}},{key:"getNodePositions",value:function(t){var e,n=[],r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ir(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ir(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.d3Nodes[i.id];if(void 0!==o){var a={id:o.id,x:o.x,y:o.y};n.push(a)}}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return this.computing}},{key:"terminateUpdate",value:function(){this.simulation.alpha(this.simulation.alphaMin()).stop(),this.simulationStopped=!0}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Fr),this.state.rels.removeChannel(Fr),this.simulation.stop()}},{key:"setAlpha",value:function(t){this.simulation.alpha(t),this.simulation.restart(),this.simulation.shouldUpdate=!0}},{key:"countNodeRels",value:function(){for(var t=new Map(Object.entries(this.d3Nodes)),e=Object.values(this.d3RelList),n=new Array(t.length),r=0;r<e.length;++r){var i=e[r];i.index=r,"object"!==Rr(i.source)&&(i.source=t.get(i.source)),"object"!==Rr(i.target)&&(i.target=t.get(i.target)),n[i.source.index]=(n[i.source.index]||0)+1,n[i.target.index]=(n[i.target.index]||0)+1}return n}}],r&&Mr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(),Br=i(880),Vr=i.n(Br)().getLogger("NVL");function Gr(t){return Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(t)}function Wr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wr(Object(n),!0).forEach((function(e){qr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Yr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Yr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zr(r.key),r)}}function qr(t,e,n){return(e=Zr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zr(t){var e=function(t,e){if("object"!=Gr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gr(e)?e:String(e)}var Kr=function(t,e,n){return t+(e-t)*function(t){return t*t*(3-2*t)}(n)},Jr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),qr(this,"positions",void 0),qr(this,"oldPositions",void 0),qr(this,"startTime",void 0),qr(this,"t",void 0),qr(this,"currentT",void 0),qr(this,"state",void 0),qr(this,"shouldUpdateAnimator",void 0),qr(this,"parents",void 0),qr(this,"animationCompleteCallback",void 0),qr(this,"shouldUpdate",void 0);var n=e.state;this.positions={},this.oldPositions={},this.startTime=0,this.t=1,this.currentT=1,this.state=n,this.shouldUpdateAnimator=!1,this.parents={},this.animationCompleteCallback=e.animationCompleteCallback}var e,n;return e=t,n=[{key:"getPositionMapFromState",value:function(){var t,e=this.state.nodes,n=e.idToPosition,r={},i=Hr(e.items);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id];void 0!==a&&(r[o.id]={id:o.id,x:a.x,y:a.y})}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"updatePositionsFromState",value:function(){this.positions=Xr({},this.getPositionMapFromState())}},{key:"updateOldPositionFromState",value:function(){this.oldPositions=Xr({},this.getPositionMapFromState())}},{key:"startAnimation",value:function(){this.updateOldPositionFromState(),this.startTime=Date.now(),this.t=0,this.currentT=0,this.shouldUpdateAnimator=!0}},{key:"update",value:function(){var t=this.shouldUpdateAnimator,e=(Date.now()-this.startTime)/400;this.t=Math.min(e,1),this.currentT<1?this.shouldUpdateAnimator=!0:(this.shouldUpdateAnimator=!1,t&&!this.shouldUpdateAnimator&&void 0!==this.animationCompleteCallback&&this.animationCompleteCallback(),this.shouldUpdateAnimator||this.updatePositionsFromState())}},{key:"updateNodes",value:function(t){var e,n=Hr(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={id:r.id,x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"getNodePositions",value:function(t){var e,n=this.parents,r=this.state.nodes.idToPosition,i=function(t,e){for(var n={x:0,y:0},r=t.length,i=0,o=0;o<r;o++){var a=e[t[o].id];void 0===a||isNaN(a.x)||isNaN(a.y)||0===a.x||0===a.y||(n.x+=a.x,n.y+=a.y,i+=1)}return i>0?[n.x/i,n.y/i]:[0,0]}(t,r),o={x:i[0],y:i[1]},a=[],s=Hr(t);try{for(s.s();!(e=s.n()).done;){var u=e.value,l=this.positions[u.id],c=r[u.id],f={id:u.id};if(void 0!==l){for(var h,d,p,v=u.id,y=null!==(h=this.oldPositions[u.id])&&void 0!==h?h:Xr({},o);void 0===y&&void 0!==n[v];)v=n[v],y=this.oldPositions[v];y.x=null!==(d=y.x)&&void 0!==d?d:o.x,y.y=null!==(p=y.y)&&void 0!==p?p:o.y,f.x=Kr(y.x,l.x,this.t),f.y=Kr(y.y,l.y,this.t)}else void 0!==c&&(f.x=c.x||o.x,f.y=c.y||o.y);a.push(f)}}catch(t){s.e(t)}finally{s.f()}return this.currentT=this.t,a}}],n&&$r(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qr(t){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qr(t)}function ti(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ei(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ti(Object(n),!0).forEach((function(e){vi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ni(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ii(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ri(t){return function(t){if(Array.isArray(t))return oi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ii(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ii(t,e){if(t){if("string"==typeof t)return oi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oi(t,e):void 0}}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ai(){ai=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(C([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Qr(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Qr(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function si(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yi(r.key),r)}}function li(t,e,n){return e=di(e),function(t,e){if(e&&("object"===Qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fi(t)}(t,ci()?Reflect.construct(e,n||[],di(t).constructor):e.apply(t,n))}function ci(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ci=function(){return!!t})()}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hi(){return hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=di(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},hi.apply(this,arguments)}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(t)}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t,e,n){return(e=yi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yi(t){var e=function(t,e){if("object"!=Qr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qr(e)?e:String(e)}var mi=function(t){return void 0!==t?bn(t):t},gi=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),vi(fi(n=li(this,e,[t])),"stateDisposers",void 0),vi(fi(n),"cytoCompleteCallback",void 0),vi(fi(n),"computing",void 0),vi(fi(n),"pendingLayoutData",void 0),vi(fi(n),"worker",void 0),n.stateDisposers=[],n.stateDisposers.push(n.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)}))),n.cytoCompleteCallback=t.cytoCompleteCallback,n.shouldUpdate=!0,n.computing=!1,n.setOptions(),n.setupWorker().then((function(t){n.worker=t,n.worker.port.start(),n.pendingLayoutData=null})),n}var n,r,o,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(e,t),n=e,r=[{key:"setupWorker",value:(o=ai().mark((function t(){var e,n,r,o,a;return ai().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.resolve().then(i.bind(i,716));case 3:n=t.sent,r=n.createCoseBilkentLayoutWorker,e=r(),t.next=16;break;case 8:return t.prev=8,t.t0=t.catch(0),Vr.info("Failed to initialise shared worker: ",t.t0," Falling back to syncronous code."),t.next=13,Promise.resolve().then(i.bind(i,716));case 13:o=t.sent,a=o.coseBilkentLayoutFallbackWorker,e=a;case 16:return t.abrupt("return",new Promise((function(t,n){e||n("Cose-bilkent layout code could not be initialized"),t(e)})));case 17:case"end":return t.stop()}}),t,null,[[0,8]])})),a=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){si(i,n,r,a,s,"next",t)}function s(t){si(i,n,r,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"setOptions",value:function(){this.shouldUpdate=!0}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.shouldUpdate||t){var i=mi(n),o=mi(r);(i.length>0||o.length>0)&&(this.updatePositionsFromState(),this.layout(i,o))}hi(di(e.prototype),"update",this).call(this),this.shouldUpdate=!1}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e){var n=this;if(this.worker){if(t.length){var r=t.map((function(t){return{group:"nodes",data:{id:t.id}}})),i=e.map((function(t){return{group:"edges",data:{id:"rel".concat(t.id),source:t.from,target:t.to}}})),o={elements:[].concat(ri(r),ri(i)),spacingFactor:t.reduce((function(t,e){var n;return t+(null!==(n=e.size)&&void 0!==n?n:gr)}),0)/t.length*4.5/50*xr()};this.computing?this.pendingLayoutData=o:(this.computing=!0,this.worker.port.onmessage=function(t){var e=t.data.positions;if(n.computing){for(var r=0,i=Object.entries(e);r<i.length;r++){var o=ni(i[r],2),a=o[0],s=o[1];n.positions[a]=ei({id:a},s)}n.cytoCompleteCallback(),n.startAnimation()}n.computing=!1,n.shouldUpdate=!0},setTimeout((function(){n.computing&&n.worker.port.postMessage(o)}),0))}}else Vr.info("Cose-Bilkent layout code not yet initialised.")}},{key:"terminateUpdate",value:function(){this.computing=!1}},{key:"destroy",value:function(){var t;this.stateDisposers.forEach((function(t){t()})),null===(t=this.worker)||void 0===t||t.port.close()}}],r&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Jr),bi="undefined"!=typeof Float32Array?Float32Array:Array;function wi(){var t=new bi(16);return bi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var xi=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t},_i=i(792),Si=i.n(_i);function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ei(r.key),r)}}function Oi(t,e,n){return(e=Ei(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ei(t){var e=function(t,e){if("object"!=Ti(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:String(e)}var Pi=function(){function e(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Oi(this,"shaderProgram",void 0),Oi(this,"gl",void 0),Oi(this,"curTexture",void 0),Oi(this,"attributeInfo",void 0),Oi(this,"uniformInfo",void 0);var a=n.createShader(n.FRAGMENT_SHADER);if(!n.isShader(a))throw new Error("Could not create shader object");var s=Si()(i,o);n.shaderSource(a,s),n.compileShader(a),(0,t.isNil)(n.getShaderParameter(a,n.COMPILE_STATUS))&&Vr.info(n.getShaderInfoLog(a));var u=n.createShader(n.VERTEX_SHADER);if(!n.isShader(u))throw new Error("Could not create shader object");var l=Si()(r,o);if(n.shaderSource(u,l),n.compileShader(u),(0,t.isNil)(n.getShaderParameter(u,n.COMPILE_STATUS))&&Vr.info(n.getShaderInfoLog(u)),this.shaderProgram=n.createProgram(),n.attachShader(this.shaderProgram,a),n.attachShader(this.shaderProgram,u),n.linkProgram(this.shaderProgram),(0,t.isNil)(n.getProgramParameter(this.shaderProgram,n.LINK_STATUS)))throw new Error("Could not initialise shader");this.gl=n,this.curTexture=0,this.scanUniforms(),this.scanAttributes()}var n,r;return n=e,r=[{key:"setUniform",value:function(t,e){var n=this.gl,r=this.uniformInfo[t];if(void 0===r)throw new Error("Shader.setUniform - Uniform ".concat(t," not found in shader"));switch(r.type){case n.INT:n.uniform1i(r.location,e);break;case n.INT_VEC2:n.uniform2iv(r.location,e);break;case n.INT_VEC3:n.uniform3iv(r.location,e);break;case n.INT_VEC4:n.uniform4iv(r.location,e);break;case n.SAMPLER_2D:n.activeTexture(n.TEXTURE0+r.texture),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(r.location,r.texture);break;case n.SAMPLER_CUBE:case n.FLOAT:n.uniform1f(r.location,e);break;case n.FLOAT_VEC2:n.uniform2fv(r.location,e);break;case n.FLOAT_VEC3:n.uniform3fv(r.location,e);break;case n.FLOAT_VEC4:n.uniform4fv(r.location,e);break;case n.FLOAT_MAT2:n.uniformMatrix2fv(r.location,!1,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(r.location,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(r.location,!1,e)}}},{key:"setAttributePointer",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t],a=n*Float32Array.BYTES_PER_ELEMENT,s=r*Float32Array.BYTES_PER_ELEMENT;i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,s,a)}},{key:"setAttributePointerFloat",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,r,n)}},{key:"setAttributePointerUShort",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_SHORT,!1,r,n)}},{key:"setAttributePointerByteNorm",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!0,r,n)}},{key:"setAttributePointerByte",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!1,r,n)}},{key:"use",value:function(){this.gl.useProgram(this.shaderProgram)}},{key:"remove",value:function(){this.gl.deleteProgram(this.shaderProgram)}},{key:"scanAttributes",value:function(){var t=this.gl;this.attributeInfo={};for(var e,n,r=t.getProgramParameter(this.shaderProgram,t.ACTIVE_ATTRIBUTES),i=0;i<r;i++)e=t.getActiveAttrib(this.shaderProgram,i),n=t.getAttribLocation(this.shaderProgram,e.name),this.attributeInfo[e.name]={type:e.type,position:n}}},{key:"scanUniforms",value:function(){var t=this.gl;this.uniformInfo={};for(var e,n=t.getProgramParameter(this.shaderProgram,t.ACTIVE_UNIFORMS),r=0;r<n;r++){e=t.getActiveUniform(this.shaderProgram,r);var i=t.getUniformLocation(this.shaderProgram,e.name),o={type:e.type,location:i};e.type===t.SAMPLER_2D&&(o.texture=this.curTexture,this.curTexture+=1),this.uniformInfo[e.name]=o}}}],r&&Ai(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function ji(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ci(r.key),r)}}function Ci(t){var e=function(t,e){if("object"!=ki(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ki(e)?e:String(e)}function Di(t){var e="function"==typeof Map?new Map:void 0;return Di=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Ri())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ii(i,n.prototype),i}(t,arguments,Li(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ii(n,t)},Di(t)}function Ri(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ri=function(){return!!t})()}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Li(t){return Li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Li(t)}var Mi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=arguments,n=Li(n=e),function(t,e){if(e&&("object"===ki(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ri()?Reflect.construct(n,r||[],Li(t).constructor):n.apply(t,r));var t,n,r}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&ji(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Di(Error));const Ni="uniform mat4 u_projection;\n\nattribute vec2 a_position;\n//attribute float a_index;\n\n//varying highp float index;\n\nvoid main() {\n// index = a_index;\n gl_Position = u_projection * vec4(a_position, 0.0, 1.0);\n}";function Fi(t){return Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(t)}function Ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zi(r.key),r)}}function zi(t){var e=function(t,e){if("object"!=Fi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:String(e)}var Bi=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=this.constructGraphObjects(e,n),this.subGraphs=[],this.sunMap={}}var e,n;return e=t,n=[{key:"constructGraphObjects",value:function(t,e){var n=new Array(t.nodes.length),r=new Array(t.rels.length),i={},o=[];return t.nodes.forEach((function(t,e){n[e]=[],r[e]=[],o.push(t)})),t.rels.forEach((function(t){var o=e[t.from],a=e[t.to];void 0!==o&&void 0!==a&&(n[o].push(a),n[a].push(o),r[o].push(t.id),r[a].push(t.id),i[t.id]=t)})),this.relIdMap=r,{nodes:o,relationships:n,idToRel:i}}},{key:"coarsenTo",value:function(t){for(var e=this.graph,n=e.nodes.length,r=0;e.nodes.length>t&&e.relationships.some((function(t){return t.length>0}));){var i=this.coarsen(e,0===r);if(0===r&&(this.nodeSortMap=i.nodeSortMap),this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,r++}return this.subGraphs.push(e),e}},{key:"coarsenBy",value:function(t){for(var e=this.graph,n=e.nodes.length,r=t;t>0;){var i=this.coarsen(e,t===r);if(this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,t--}return this.subGraphs.push(e),e}},{key:"coarsen",value:function(t,e){var n=this,r=t.nodes,i=t.relationships,o=r.map((function(t,e){return e})),a={},s={};r.forEach((function(t,e){a[e]=t,s[t.id]=e}));for(var u=i.map((function(t){return t.slice()})),l={suns:{},planets:{},moons:{}},c=[],f=[],h=function(){var t=o[0];o.splice(o.indexOf(t),1),i[t].forEach((function(e){var n=o.indexOf(e);n>=0&&o.splice(n,1);var r=-1,i=u[e];i.forEach((function(e,n){var i=o.indexOf(e);i>=0?o.splice(i,1):e===t&&(r=n)})),i.splice(r,1)}));var n={id:t};if(e)n.originalId=a[t].id;else{var r=a[t];n.finestIndex=r.finestIndex,n.originalId=r.originalId}c.push(n),l.suns[t]=n};o.length>0;)h();c.forEach((function(t,e){f[e]=[]})),c.forEach((function(t,n){var r={},o=[];i[t.id].forEach((function(i){if(i!==t.id&&!r[i]){var s={id:i,parent:t,sunId:n,moons:[]},u=a[i];s.size=function(){return s.moons.length+1},s.weight=u.weight||1,s.children=function(){return s.moons},e?s.originalId=u.id:(s.finestIndex=u.finestIndex,s.originalId=u.originalId),o.push(s),r[i]=!0}})),o.forEach((function(t){l.planets[t.id]=t})),t.planets=o,t.children=function(){return t.planets},t.weight=t.planets.reduce((function(t,e){return t+(e.weight||1)}),0)+(a[t.id].weight||1),t.size=function(){return t.planets.reduce((function(t,e){return t+e.size()}),0)+1}}));var d=r.filter((function(t,e){return!c.find((function(t){return t.id===e}))&&!l.planets[e]})),p=[];d.forEach((function(t){for(var n=s[t.id],r=u[n],i=null,o=-1,c=0;c<r.length;c++){var f=r[c];if(f!==n&&(i=l.planets[f])){o=c;break}}if(r.splice(o,1),i){var h={id:n,size:function(){return 0}};h.weight=a[n].weight||1,h.parent=i,h.sunId=i.sunId,e?h.originalId=t.id:(h.finestIndex=t.finestIndex,h.originalId=t.originalId),l.moons[n]=h,i.moons.push(h),i.weight+=h.weight,i.parent.weight+=h.weight;var d=u[i.id];d.splice(d.indexOf(n),1)}else p.push(t)})),u.forEach((function(t,e){if(!l.suns[e]){var n=l.planets[e]||l.moons[e];u[e].forEach((function(t){var e=l.planets[t];if(e||(e=l.moons[t]),n.sunId!==e.sunId){var r=f[n.sunId];r.includes(e.sunId)||r.push(e.sunId)}}))}}));var v=[],y=0,m={};c.forEach((function(t,i){var o=r[t.id];m[t.id]=y,t.previousIndex=i,t.id=y++,e&&(o.finestIndex=t.id,t.finestIndex=t.id),v.push(o),t.planets.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o),i.moons.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o)}))}))}));var g=[],b=[];return i.forEach((function(t,r){var i=m[r];g[i]=t.map((function(t){return m[t]})),e&&(b[i]=t.map((function(t,e){return n.relIdMap[r][e]})))})),b&&b.length>0&&(this.relIdMap=b),{output:{nodes:c,relationships:f},sortedInput:{nodes:v,relationships:g},nodeSortMap:m}}}],n&&Ui(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vi=function(t,e,n){for(var r=2*Math.PI/n,i=[],o=0;o<n;o++){var a=r*o;i.push({x:t.x+e*Math.cos(a),y:t.y+e*Math.sin(a)})}return i};function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Wi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$i(r.key),r)}}function Yi(t,e,n){return(e=$i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $i(t){var e=function(t,e){if("object"!=Gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gi(e)?e:String(e)}var qi="PhysLayout",Zi=new Float32Array(4),Ki=256,Ji=function(t){for(var e={},n={},r=0;r<t.length;r++)e[t[r].id]=r,n[r]=t[r].id;return{nodeIdToIndex:e,nodeIndexToId:n}},Qi=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yi(this,"physVbo",void 0),Yi(this,"physSmallVbo",void 0),Yi(this,"physProjection",void 0),Yi(this,"physSmallProjection",void 0),Yi(this,"gl",void 0),Yi(this,"useReadpixelWorkaround",void 0),Yi(this,"averageNodeSize",void 0),Yi(this,"shouldUpdate",void 0),Yi(this,"iterationCount",void 0),Yi(this,"lastSpeedValues",void 0),Yi(this,"rollingAvgGraphSpeed",void 0),Yi(this,"nodeVariation",void 0),Yi(this,"nodeCenterPoint",void 0),Yi(this,"peakIterationMultiplier",void 0),Yi(this,"stateDisposers",void 0),Yi(this,"state",void 0),Yi(this,"dpr",void 0),Yi(this,"intelWorkaround",void 0),Yi(this,"simulationStopVelocitySquared",void 0),Yi(this,"gravity",void 0),Yi(this,"force",void 0),Yi(this,"nodeIdToIndex",void 0),Yi(this,"nodeIndexToId",void 0),Yi(this,"numNodes",void 0),Yi(this,"solarMerger",void 0),Yi(this,"subGraphs",void 0),Yi(this,"nodeSortMap",void 0),Yi(this,"firstUpdate",void 0),Yi(this,"curPhysData",void 0),Yi(this,"apprxRepForceShader",void 0),Yi(this,"levelsClusterTexture",void 0),Yi(this,"levelsFinestIndexTexture",void 0),Yi(this,"initalLevelTexture",void 0),Yi(this,"levelsData",void 0),Yi(this,"collisionDetectionMultiplier",void 0),Yi(this,"physShader",void 0),Yi(this,"physData",void 0),Yi(this,"workaroundData",void 0),Yi(this,"pinData",void 0),Yi(this,"updateData",void 0),Yi(this,"updateShader",void 0),Yi(this,"workaroundShader",void 0),Yi(this,"physPositions",void 0),Yi(this,"springTexture",void 0),Yi(this,"sizeTexture",void 0),Yi(this,"offsetTexture",void 0),Yi(this,"pinTexture",void 0),Yi(this,"addedNodes",void 0),Yi(this,"updateTexture",void 0),Yi(this,"enableVerlet",void 0);var r=e.state,i=e.webGLContext;if(Vr.info("layout - webGLContext",Boolean(i)),void 0===e.webGLContext)throw new Error("PhysLayout missing options: webGLContext - webgl context");if(void 0===e.state)throw new Error("PhysLayout missing options: state - state object");var o=i;this.checkCompatibility(o),this.printGlStats(o),this.physVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physVbo);var a=new Float32Array([0,0,yr,0,0,yr,yr,yr]);o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),this.physSmallVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physSmallVbo);var s=new Float32Array([0,0,Ki,0,0,Ki,Ki,Ki]);o.bufferData(o.ARRAY_BUFFER,s,o.STATIC_DRAW),this.physProjection=wi(),xi(this.physProjection,0,yr,yr,0,0,1e6),this.physSmallProjection=wi(),xi(this.physSmallProjection,0,Ki,Ki,0,0,1e6),o.disable(o.DEPTH_TEST),this.gl=o,this.useReadpixelWorkaround&&this.setupReadpixelWorkaround(),this.setupUpdates(),this.averageNodeSize=gr,this.shouldUpdate=!0,this.iterationCount=0,this.lastSpeedValues=[],this.rollingAvgGraphSpeed=0,this.nodeVariation=0,this.nodeCenterPoint=[0,0],this.peakIterationMultiplier=160,this.setOptions(e,!0),this.definePhysicsArrays();var u=r.nodes,l=r.rels;u.addChannel(qi),l.addChannel(qi),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[qi];if(void 0!==u.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),o=Or(i);(e||r||o)&&(n.shouldUpdate=!0,n.checkForUpdates())}var a=l.channels[qi];if(void 0!==l.version&&a){var s=Object.values(a.adds).length>0,c=Object.values(a.removes).length>0;(s||c)&&(n.shouldUpdate=!0,n.checkForUpdates())}}))),this.setData({nodes:u.items,rels:l.items}),this.state=r,this.dpr=window.devicePixelRatio||1}var e,n;return e=t,n=[{key:"setOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t.intelWorkaround,r=t.simulationStopVelocity,i=t.gravity,o=t.enableVerlet,a=void 0!==o&&o;e&&(this.intelWorkaround=n,this.enableVerlet=a);var s=this.enableVerlet?.1:null!=r?r:100;this.simulationStopVelocitySquared=s*s,this.gravity=null!=i?i:100,this.force=0}}},{key:"setData",value:function(t){var e=Ji(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this.nodeIdToIndex=n,this.nodeIndexToId=r,this.numNodes=t.nodes.length,this.solarMerger=new Bi(t,n),this.solarMerger.coarsenTo(1),this.subGraphs=this.solarMerger.subGraphs,this.nodeSortMap=this.solarMerger.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]),this.setupPhysics(),this.firstUpdate=!0,this.curPhysData=0,this.shouldUpdate=!0,this.iterationCount=0,this.subGraphs[0]}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.gl;if(this.checkForUpdates(t),!this.shouldUpdate)return e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,yr,yr,e.RGBA,e.FLOAT,this.physPositions),!1;e.disable(e.BLEND);for(var n=this.nodeVariation/(this.numNodes||1)>.3,r=this.getScaleNumber(this.iterationCount),i=this.subGraphs?this.subGraphs.length:0,o=this.getPhysData(0).texture,a=i-1;a>0;a--){var s=this.subGraphs[a].nodes.length,u=a===i-1;this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_physData",o),this.apprxRepForceShader.setUniform("u_clusterData",this.levelsClusterTexture[a]),this.apprxRepForceShader.setUniform("u_finestIndexes",this.levelsFinestIndexTexture[a]),this.apprxRepForceShader.setUniform("u_prevForce",u?this.initalLevelTexture:this.levelsData[a+1].texture),this.apprxRepForceShader.setUniform("u_numNodes",s),this.apprxRepForceShader.setUniform("u_iterationMultiplier",r),this.apprxRepForceShader.setUniform("u_baseLength",this.getBaseLength(s)),this.apprxRepForceShader.setUniform("u_isTopLevel",u?1:0),e.bindBuffer(e.ARRAY_BUFFER,this.physSmallVbo),this.apprxRepForceShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.levelsData[a].frameBuffer),e.viewport(0,0,Ki,Ki),e.drawArrays(e.TRIANGLE_STRIP,0,4)}if(this.collisionDetectionMultiplier=0,this.collisionDetectionMultiplier=n?Math.min(this.iterationCount/Math.min(this.numNodes,300),1):1,this.force=i<=1?this.initalLevelTexture:this.levelsData[1].texture,this.physShader.use(),this.physShader.setUniform("u_prevForce",i<=1?this.initalLevelTexture:this.levelsData[1].texture),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_physData",o),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_iterationMultiplier",r),this.physShader.setUniform("u_curIteration",this.iterationCount),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_clusterData",this.levelsClusterTexture[0]),this.physShader.setUniform("u_collisionMultiplier",this.collisionDetectionMultiplier),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.firstUpdate=!1,e.bindBuffer(e.ARRAY_BUFFER,this.physVbo),this.physShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(1).frameBuffer),e.viewport(0,0,yr,yr),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.useReadpixelWorkaround?this.doReadpixelWorkaround():(e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,yr,yr,e.RGBA,e.FLOAT,this.physPositions)),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.iterationCount+=1,this.numNodes<2)this.shouldUpdate=!1,this.iterationCount=0;else if(this.iterationCount%5==0){var l=this.iterationCount<300,c=l?this.getMaxSpeedSquared():this.getMedianSpeedSquared(this.addedNodes);this.lastSpeedValues.push(c),this.rollingAvgGraphSpeed=this.lastSpeedValues.reduce((function(t,e){return t+e}),0)/this.lastSpeedValues.length;var f=l&&c>=this.rollingAvgGraphSpeed,h=this.simulationStopVelocitySquared&&this.rollingAvgGraphSpeed<this.simulationStopVelocitySquared;this.lastSpeedValues.length>20&&this.lastSpeedValues.shift(),!f&&!0===h&&this.iterationCount>2&&this.terminateUpdate()}return this.shouldUpdate}},{key:"terminateUpdate",value:function(){Vr.info("Cooling down after ".concat(this.iterationCount," iterations at graph speed of ").concat(Math.sqrt(this.rollingAvgGraphSpeed))),this.shouldUpdate=!1,this.iterationCount=0,this.rollingAvgGraphSpeed=0,this.lastSpeedValues=[],this.addedNodes=null,this.nodeVariation=0}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"getNodePositions",value:function(t){var e=[];if(this.useReadpixelWorkaround){var n,r=Wi(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.nodeIdToIndex[i.id],a=i.id,s=void 0,u=void 0;void 0!==o&&(s=this.workaroundData[0].dataFloat[o],u=this.workaroundData[1].dataFloat[o]),e.push({id:a,x:s,y:u})}}catch(t){r.e(t)}finally{r.f()}}else{var l,c=Wi(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=this.nodeIdToIndex[f.id],d=f.id,p=void 0,v=void 0;void 0!==h&&(p=this.physPositions[4*h+0],v=this.physPositions[4*h+1]),e.push({id:d,x:p,y:v})}}catch(t){c.e(t)}finally{c.f()}}return e}},{key:"reheat",value:function(t){this.setupSize(this.subGraphs[0]),this.shouldUpdate=!0,this.iterationCount=0,this.nodeVariation=t.nodes.length}},{key:"updateNodes",value:function(t){var e=this.gl,n=new Set;e.bindTexture(e.TEXTURE_2D,this.getPhysData().texture);var r,i=Wi(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.nodeIdToIndex[o.id];if(void 0!==o.x&&void 0!==o.y){Zi[0]=o.x,Zi[1]=o.y,Zi[2]=0,Zi[3]=0;var s=a%yr,u=(a-s)/yr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,Zi),this.useReadpixelWorkaround?(this.workaroundData[0].dataFloat[a]=o.x,this.workaroundData[1].dataFloat[a]=o.y):(this.physPositions[4*a+0]=o.x,this.physPositions[4*a+1]=o.y)}void 0!==o.pinned&&(this.pinData[a]=o.pinned?255:0),Object.keys(o).forEach((function(t){return n.add(t)}))}}catch(t){i.e(t)}finally{i.f()}n.has("pinned")&&(e.bindTexture(e.TEXTURE_2D,this.pinTexture),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,yr,yr,0,e.ALPHA,e.UNSIGNED_BYTE,this.pinData)),(n.has("x")||n.has("y")||n.has("size"))&&(this.shouldUpdate=!0,this.iterationCount=0)}},{key:"addRemoveData",value:function(t,e){var n=this.gl;this.numNodes=t.nodes.length,this.physShader.use(),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_baseLength",this.getBaseLength());var r=Ji(t.nodes).nodeIdToIndex,i=new Bi(t,r);i.coarsenTo(1);var o=i.subGraphs[0],a=this.subGraphs[0],s=function(t){return a.nodes.findIndex((function(e){return e.id===t}))},u=Object.values(e.adds),l=Object.values(e.removes);this.addedNodes=u.length>0?{}:null,this.nodeVariation=u.length+l.length;for(var c,f=3*Math.sqrt(t.nodes.length),h={x:0,y:0},d=o.nodes.length,p=new Uint8Array(65536),v=0;v<d;v++){var y=0,m=0,g=o.nodes[v];if(c=g.id,Boolean(e.adds[c])){if(this.addedNodes[v]=g.id,y=g.position?g.position.x:void 0,m=g.position?g.position.y:void 0,void 0===y||void 0===m){var b=i.sunMap,w=void 0;for(w=b[g.id];void 0!==w;w=b[w]){var x=s(w);if(-1!==x){var _=this.getNodePosition(x);y=_.x+10*(Math.random()-.5),m=_.y+10*(Math.random()-.5);break}}void 0===w&&(y=this.nodeCenterPoint[0]+f*(Math.random()-.5),m=this.nodeCenterPoint[1]+f*(Math.random()-.5))}this.updateData[2*v]=y,this.updateData[2*v+1]=m,p[v]=g.pinned?255:0}else{var S=s(g.id),T=this.getNodePosition(S);y=T.x,m=T.y,this.updateData[2*v]=S,this.updateData[2*v+1]=999999,p[v]=this.pinData[S]}h.x+=y||0,h.y+=m||0}this.nodeCenterPoint=d?[h.x/d,h.y/d]:[0,0],this.pinData=p,this.subGraphs=i.subGraphs,this.nodeSortMap=i.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]);var A=Ji(this.subGraphs[0].nodes),O=A.nodeIdToIndex,E=A.nodeIndexToId;return this.nodeIdToIndex=O,this.nodeIndexToId=E,n.bindTexture(n.TEXTURE_2D,this.updateTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,yr,yr,0,n.ALPHA,n.FLOAT,this.updateData),Vr.info("Setting gravity center to ",this.nodeCenterPoint),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.updateShader.use(),this.updateShader.setUniform("u_numNodesNew",o.nodes.length),this.updateShader.setUniform("u_physData",this.getPhysData(0).texture),this.updateShader.setUniform("u_updateData",this.updateTexture),n.disable(n.BLEND),n.bindBuffer(n.ARRAY_BUFFER,this.physVbo),this.updateShader.setAttributePointer("a_position",2,0,2),n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData(1).frameBuffer),n.viewport(0,0,yr,yr),n.drawArrays(n.TRIANGLE_STRIP,0,4),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.useReadpixelWorkaround?this.doReadpixelWorkaround():(n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData().frameBuffer),n.readPixels(0,0,yr,yr,n.RGBA,n.FLOAT,this.physPositions)),(u.length>0||l.length>0)&&(n.bindTexture(n.TEXTURE_2D,this.pinTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,yr,yr,0,n.ALPHA,n.UNSIGNED_BYTE,this.pinData)),this.shouldUpdate=!0,this.iterationCount=0,this.setupPhysicsForCoarse(),this.subGraphs[0]}},{key:"destroy",value:function(){var t=this;this.gl.deleteBuffer(this.physVbo),this.gl.deleteBuffer(this.physSmallVbo),this.physData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsClusterTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.levelsFinestIndexTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.gl.deleteTexture(this.initalLevelTexture),this.gl.deleteTexture(this.sizeTexture),this.gl.deleteTexture(this.offsetTexture),this.gl.deleteTexture(this.springTexture),this.gl.deleteTexture(this.pinTexture),this.gl.deleteTexture(this.updateTexture),void 0!==this.apprxRepForceShader&&this.apprxRepForceShader.remove(),void 0!==this.updateShader&&this.updateShader.remove(),void 0!==this.physShader&&this.physShader.remove(),this.physPositions=null,this.gl=null,this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(qi),this.state.rels.removeChannel(qi)}},{key:"dumpTexture",value:function(t,e,n){var r=this.gl;Vr.info("--- Dumping texture ",n),r.bindFramebuffer(r.FRAMEBUFFER,t),r.readPixels(0,0,yr,yr,r.RGBA,r.FLOAT,this.physPositions);for(var i=0;i<e;i++)Vr.info(i,": ",this.physPositions[4*i+0],this.physPositions[4*i+1],this.physPositions[4*i+2],this.physPositions[4*i+3])}},{key:"getScaleNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e,n){return n+Math.pow(10,6)*Math.pow(t-120,-1.7)};return 0===t?0:t<300?200+-1/Math.pow(10,5)*3*Math.pow(Math.abs(t-200+12),3):e(t,200,10)}},{key:"getBaseLength",value:function(t){if(void 0===t||t===this.numNodes)return 100*this.dpr;var e=Math.pow(this.averageNodeSize/2,2)*Math.PI,n=this.numNodes/t*e;return(100+Math.sqrt(n/Math.PI)/2/t)*this.dpr}},{key:"checkForUpdates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i={nodes:n.items,rels:r.items},o=Object.values(n.channels[qi].adds).length>0,a=Object.values(r.channels[qi].adds).length>0,s=Object.values(n.channels[qi].removes).length>0,u=Object.values(r.channels[qi].removes).length>0,l=Object.values(n.channels[qi].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[qi].adds,removes:n.channels[qi].removes}),t?(this.updateNodes(i.nodes),this.reheat(i)):l.length>0&&(this.updateNodes(l),Or(l)&&this.reheat(i)),n.clearChannel(qi),r.clearChannel(qi)}},{key:"getNodePosition",value:function(t){return this.useReadpixelWorkaround?{x:this.workaroundData[0].dataFloat[t],y:this.workaroundData[1].dataFloat[t]}:{x:this.physPositions[4*t+0],y:this.physPositions[4*t+1]}}},{key:"getMaxSpeedSquared",value:function(){var t=0;if(this.useReadpixelWorkaround)for(var e=0;e<this.numNodes;e++){var n=this.workaroundData[2].dataFloat[e],r=this.workaroundData[3].dataFloat[e],i=n*n+r*r;i>t&&(t=i)}else for(var o=0;o<this.numNodes;o++){var a=this.physPositions[4*o+2],s=this.physPositions[4*o+3],u=a*a+s*s;u>t&&(t=u)}return t}},{key:"getMedianSpeedSquared",value:function(t){var e=[];if(this.useReadpixelWorkaround)for(var n=0;n<this.numNodes;n++){var r=this.workaroundData[2].dataFloat[n],i=this.workaroundData[3].dataFloat[n],o=r*r+i*i;e[n]=o}else for(var a=0;a<this.numNodes;a++)if(!t||t[a]){var s=this.physPositions[4*a+2],u=this.physPositions[4*a+3],l=s*s+u*u;e.push(l)}return e.sort((function(t,e){return t-e})),e[Math.floor(e.length/2)]}},{key:"getPhysData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.physData[(this.curPhysData+t)%this.physData.length]}},{key:"newTexture",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.FLOAT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.RGBA,o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,i,n,n,0,i,r,e),o}},{key:"newFramebuffer",value:function(t,e){var n=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),n}},{key:"checkCompatibility",value:function(t){function e(t){throw new Mi(t)}t||e("Could not initialize WebGL"),0===t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)&&e("Vertex shader texture access not available"),t.getExtension("OES_texture_float")||e("OES_texture_float extension not available");var n=t.getParameter(t.MAX_TEXTURE_SIZE),r=Math.max(yr,mr);n<r&&e("Need larger WebGL texture support. Avaliable: ".concat(n," needed: ").concat(r));var i=new Float32Array(4),o=this.newTexture(t,i,1),a=this.newFramebuffer(t,o);t.bindFramebuffer(t.FRAMEBUFFER,a),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),t.getError()!==t.NO_ERROR&&(Vr.info("gl.readPixels doesnt work for float texture, activating workaround"),this.useReadpixelWorkaround=!0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(a),t.deleteTexture(o)}},{key:"printGlStats",value:function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n="?",r="?";null!==e&&(n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),Vr.trace("Vendor: ".concat(n)),Vr.trace("Renderer: ".concat(r));var i=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);Vr.trace("Line width range: ".concat(i));var o=t.getSupportedExtensions();Vr.trace("Extentions:"),o.length>0&&o.forEach((function(t){return Vr.trace(t)}))}},{key:"adjustToGlSize",value:function(t){return t*this.dpr*2.5}},{key:"setupSize",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=new Float32Array(65536),n=t.nodes,r=n.length,i=0,o=0;o<r;o++){var a,s=parseInt(null!==(a=n[o].size)&&void 0!==a?a:gr,10);e[o]=this.adjustToGlSize(s),i+=s}this.averageNodeSize=r?i/r:gr;var u=this.gl;void 0===this.sizeTexture&&(this.sizeTexture=u.createTexture()),u.bindTexture(u.TEXTURE_2D,this.sizeTexture),u.texImage2D(u.TEXTURE_2D,0,u.ALPHA,yr,yr,0,u.ALPHA,u.FLOAT,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE)}},{key:"setupSprings",value:function(t){var e,n,r=this.gl,i=t.relationships,o=new Float32Array(16777216),a=new Float32Array(65536),s=0;for(e=0;e<t.nodes.length;e++)for(a[e]=s,o[s]=i[e].length,s+=1,n=0;n<i[e].length;n++)o[s]=i[e][n],s+=1;for(n=s;n<o.length;n++)o[n]=1;for(n=e;n<a.length;n++)a[n]=0;void 0===this.offsetTexture&&(this.offsetTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.offsetTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,yr,yr,0,r.ALPHA,r.FLOAT,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),void 0===this.springTexture&&(this.springTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.springTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,mr,mr,0,r.ALPHA,r.FLOAT,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}},{key:"setupPhysics",value:function(){this.setupPhysicsForCoarse(),this.setupPhysicsForNodes(),this.physPositions=new Float32Array(262144),this.setupPinData()}},{key:"setupPhysicsForNodes",value:function(){var t=this.gl,e=this.subGraphs.length,n=this.subGraphs[0].nodes,r=3*Math.sqrt(n.length),i=new Float32Array(262144),o=new Float32Array(262144);this.numNodes=n.length;for(var a=0;a<262144;a++)i[a]=0,o[a]=0;for(var s=function(t,e,n,r){r[4*t+0]=e,r[4*t+1]=n,r[4*t+2]=0,r[4*t+3]=0},u=e-1;u>=0;u--){var l=u===e-1?[]:this.subGraphs[u+1].nodes;0===l.length?this.subGraphs[u].nodes.forEach((function(t,e){var n=t.placement?t.placement.x:r*(Math.random()-.5),o=t.placement?t.placement.y:r*(Math.random()-.5);s(void 0===t.finestIndex?e:t.finestIndex,n,o,i)})):l.forEach((function(t){var e=t.finestIndex,n=i[4*t.finestIndex],r=i[4*t.finestIndex+1],o=Vi({x:n,y:r},10,t.planets.length+1);e++,t.planets.forEach((function(t,n){var r=o[n];s(e++,r.x,r.y,i);var a=Vi({x:r.x,y:r.y},10,t.moons.length+1);t.moons.forEach((function(t,n){var r=a[n];s(e++,r.x,r.y,i)}))}))}))}this.physData=[];for(var c=0;c<2;c++){var f=this.newTexture(t,0===c?i:o,yr),h=this.newFramebuffer(t,f);this.physData.push({texture:f,frameBuffer:h})}var d=this.enableVerlet?"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\n\nfloat DAMP = 0.6;\nfloat COOL = 0.99998;\nfloat TEMP = max(0.02, pow(COOL, u_curIteration));\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 50000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = (combinedNodeSize - dist) / (dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * fScale) / (dist);\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, myPosition.zw);\n } else {\n vec2 prevVelocity = myPosition.zw;\n vec2 currentPos = myPosition.xy;\n vec2 prevPos = currentPos - prevVelocity;\n\n vec2 newPos = currentPos + TEMP * ( DAMP * (prevVelocity) + acceleration * TIMESTEP * TIMESTEP);\n vec2 newVelocity = newPos - currentPos;\n gl_FragColor = vec4(newPos, newVelocity);\n }\n}":"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 500000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = ((combinedNodeSize - dist) / dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * (fScale / 1.5)) / dist;\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, acceleration * TIMESTEP * 0.5);\n } else {\n myPosition.zw = myPosition.zw * VELOCITYDECAY;\n gl_FragColor = vec4(myPosition.xy + myPosition.zw * TIMESTEP, myPosition.zw + acceleration * TIMESTEP);\n }\n}";this.physShader=new Pi(t,Ni,d,{INTEL_WORKAROUND:this.intelWorkaround?1:0}),this.physShader.use(),this.physShader.setUniform("u_projection",this.physProjection),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_gravity",this.gravity)}},{key:"setupPhysicsForCoarse",value:function(){var t=this,e=this.gl;this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[];var n,r,i=this.subGraphs.length,o=function(t,e,r,i,o){n[4*t+0]=e,n[4*t+1]=r,n[4*t+2]=o.size(),n[4*t+3]=i||1};if(1===i){n=new Float32Array(262144);var a=this.subGraphs[0].nodes;a.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return a.length}})})),this.levelsClusterTexture[0]=this.newTexture(e,n,Ki)}else for(var s=function(){var i=t.subGraphs[u].nodes,a=u===t.subGraphs.length-1?[]:t.subGraphs[u+1].nodes;n=new Float32Array(262144),r=new Float32Array(65536);var s=0;if(a.length>0){var l=a.slice();l.sort((function(t,e){return t.previousIndex-e.previousIndex})),l.forEach((function(t,e){var n=s,u=a.indexOf(t);o(s,u,n,i[t.id].weight,t),r[s]=i[s].finestIndex,s++,t.planets.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++,e.moons.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++}))}))}))}else i.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return i.length}}),r[e]=i[e].finestIndex}));var c=t.newTexture(e,null,Ki),f=t.newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t.newTexture(e,n,Ki),t.levelsFinestIndexTexture[u]=t.newTexture(e,r,yr,e.FLOAT,e.ALPHA)},u=this.subGraphs.length-1;u>=0;u--)s();for(var l=new Float32Array(262144),c=0;c<l.length;c++)l[c]=0;this.initalLevelTexture=this.newTexture(e,l,Ki);var f=this.enableVerlet?"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat PI = 3.1415926535897932384626433832795;\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterRadius = (clusterSize * 0.5) + u_baseLength;\n float clusterArea = PI * clusterRadius * clusterRadius;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = (clusterArea * fScale) / (dist * dist);\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / sqrt(dist)) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / (dist * dist);\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}":"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = ((u_baseLength * u_baseLength) * (fScale / 1.5)) / dist;\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / dist) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / dist;\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}";this.apprxRepForceShader=new Pi(e,Ni,f),this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_projection",this.physSmallProjection)}},{key:"setupPinData",value:function(){var t=this.gl;this.pinTexture=t.createTexture(),this.pinData=new Uint8Array(65536);for(var e=0;e<65536;e++)this.pinData[e]=0;t.bindTexture(t.TEXTURE_2D,this.pinTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,yr,yr,0,t.ALPHA,t.UNSIGNED_BYTE,this.pinData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}},{key:"setupUpdates",value:function(){var t=this.gl;this.updateData=new Float32Array(65536),this.updateTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.updateTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,yr,yr,0,t.ALPHA,t.FLOAT,this.updateData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.updateShader=new Pi(t,Ni,"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_updateData;\nuniform float u_numNodesNew;\n\nconst float INDEX_FLAG = 999999.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5)*textureSide;\n\n if (index >= u_numNodesNew) {\n discard;\n }\n\n float firstValue = getTextureData(u_updateData, index * 2.0, 256.0).a;\n float secondValue = getTextureData(u_updateData, index * 2.0 + 1.0, 256.0).a;\n\n if (secondValue == INDEX_FLAG) {\n vec4 myPosition = getTextureData(u_physData, firstValue, 256.0);\n gl_FragColor = myPosition;\n } else {\n gl_FragColor = vec4(firstValue, secondValue, 0.0, 0.0);\n }\n}\n"),this.updateShader.use(),this.updateShader.setUniform("u_projection",this.physProjection)}},{key:"setupReadpixelWorkaround",value:function(){var t=this.gl;this.workaroundShader=new Pi(t,Ni,"precision lowp float;\n\nuniform sampler2D u_physData;\nuniform float u_index;\n\nfloat shift_right (float v, float amt) { \n v = floor(v) + 0.5; \n return floor(v / exp2(amt)); \n}\n\nfloat shift_left (float v, float amt) { \n return floor(v * exp2(amt) + 0.5); \n}\n\nfloat mask_last (float v, float bits) { \n return mod(v, shift_left(1.0, bits)); \n}\n\nfloat extract_bits (float num, float from, float to) { \n from = floor(from + 0.5); to = floor(to + 0.5); \n return mask_last(shift_right(num, from), to - from); \n}\n\n// From https://stackoverflow.com/questions/17981163/webgl-read-pixels-from-floating-point-render-target\nvec4 encode_float (float val) { \n if (val == 0.0) return vec4(0, 0, 0, 0); \n float sign = val > 0.0 ? 0.0 : 1.0; \n val = abs(val); \n float exponent = floor(log2(val)); \n float biased_exponent = exponent + 127.0; \n float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; \n float t = biased_exponent / 2.0; \n float last_bit_of_biased_exponent = fract(t) * 2.0; \n float remaining_bits_of_biased_exponent = floor(t); \n float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; \n float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; \n float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; \n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; \n return vec4(byte4, byte3, byte2, byte1); \n}\n\nvoid main(void) {\n vec4 texData = texture2D(u_physData, gl_FragCoord.xy / 255.0);\n float data;\n if (u_index == 0.0) {\n data = texData.x;\n } else if (u_index == 1.0) {\n data = texData.y;\n } else if (u_index == 2.0) {\n data = texData.z;\n } else if (u_index == 3.0) {\n data = texData.w;\n }\n\n gl_FragColor = encode_float(data);\n}\n"),this.workaroundShader.use(),this.workaroundShader.setUniform("u_projection",this.physProjection),this.workaroundData=[];for(var e=0;e<4;e++){var n=new Uint8Array(262144),r=this.newTexture(t,null,yr,t.UNSIGNED_BYTE),i=this.newFramebuffer(t,r);this.workaroundData.push({dataByte:n,dataFloat:new Float32Array(n.buffer),texture:r,frameBuffer:i})}}},{key:"doReadpixelWorkaround",value:function(){for(var t=this.gl,e=0;e<4;e++){var n=this.workaroundData[e];t.bindFramebuffer(t.FRAMEBUFFER,n.frameBuffer),t.viewport(0,0,yr,yr),this.workaroundShader.use(),this.workaroundShader.setUniform("u_index",e),this.workaroundShader.setUniform("u_physData",this.getPhysData(0).texture),t.bindBuffer(t.ARRAY_BUFFER,this.physVbo),this.workaroundShader.setAttributePointer("a_position",2,0,2),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.readPixels(0,0,yr,yr,t.RGBA,t.UNSIGNED_BYTE,n.dataByte)}}},{key:"definePhysicsArrays",value:function(){this.physData=[],this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[]}}],n&&Hi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(t){return function(t){if(Array.isArray(t))return no(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return no(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?no(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,oo(r.key),r)}}function io(t,e,n){return(e=oo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oo(t){var e=function(t,e){if("object"!=to(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=to(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==to(e)?e:String(e)}var ao="ForceCytoLayout",so="forceDirected",uo="coseBilkent",lo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),io(this,"physLayout",void 0),io(this,"coseBilkentLayout",void 0),io(this,"state",void 0),io(this,"currentLayoutType",void 0),io(this,"enableCytoscape",void 0),io(this,"currentLayout",void 0);var r=e.state,i=e.enableCytoscape;this.enableCytoscape=null==i||i,this.physLayout=new Qi(e),this.coseBilkentLayout=new gi({state:r,cytoCompleteCallback:function(){for(n.physLayout.update(!0),n.copyLayoutPositions(n.state.nodes.items,n.coseBilkentLayout,n.physLayout);n.physLayout.update(!1););n.copyLayoutPositions(n.state.nodes.items,n.physLayout,n.coseBilkentLayout)},animationCompleteCallback:function(){n.currentLayoutType===uo&&setTimeout((function(){return n.setLayout(so)}),50)}}),this.currentLayout=this.physLayout,this.currentLayoutType=so;var o=r.nodes,a=r.rels;o.addChannel(ao),a.addChannel(ao),this.state=r}var e,n;return e=t,n=[{key:"setOptions",value:function(t){void 0!==t&&(this.currentLayout.setOptions(t),this.enableCytoscape=t.enableCytoscape)}},{key:"getLayout",value:function(t){return t===uo?this.coseBilkentLayout:this.physLayout}},{key:"setLayout",value:function(t){if(t!==this.currentLayoutType){Vr.info("Switching to layout: ".concat(t," in ForceCyto"));var e=this.getLayout(t);this.currentLayout=e,this.currentLayoutType=t}}},{key:"copyLayoutPositions",value:function(t,e,n){var r=e.getNodePositions(t);n.updateNodes(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i=n.channels[ao],o=r.channels[ao],a=Object.values(i.adds).length,s=Object.values(o.adds).length,u=Object.values(i.adds).map((function(t){return t.id})),l=Object.values(o.adds).map((function(t){return t.id})),c=new Set(Object.keys(i.adds)),f=new Set(Object.keys(o.adds));if(n.clearChannel(ao),r.clearChannel(ao),this.currentLayoutType===so&&this.enableCytoscape&&n.items.length<=100&&a<100&&a>0&&s>0){var h=n.items.map((function(t){return t.id})),d=new Set([].concat(eo(h),eo(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(eo(p),eo(l)));if(d.size<=100&&v.size<=300){var y=function(t,e,n,r){var i,o=new Set(t),a=Sr(new Set(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=r.idToItem[s];if(u){var l=u.from,c=u.to;o.add(l),o.add(c)}}}catch(t){a.e(t)}finally{a.f()}var f,h=function(t){var e,n={},r={},i=Sr(t);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,a=o.from,s=o.to,u="".concat(a,"-").concat(s),l="".concat(s,"-").concat(a),c=0,f=[u,l];c<f.length;c++){var h=f[c];void 0!==r[h]?r[h].push(o):r[h]=[o]}n[a]||(n[a]=new Set),n[s]||(n[s]=new Set),n[a].add(s),n[s].add(a)}}catch(t){i.e(t)}finally{i.f()}return{adjNodesMap:n,relMap:r}}(r.items),d=h.adjNodesMap,p=h.relMap,v={},y={},m=function(t){var e=[];for(v[t]||e.push(t);e.length>0;){var r=e.shift();if(v[r]=n.idToItem[r],void 0!==d[r]){var i,o=Sr(d[r]);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!v[a]){e.push(a);var s=p["".concat(r,"-").concat(a)];if(s){var u,l=Sr(s);try{for(l.s();!(u=l.n()).done;){var c=u.value;y[c.id]||(y[c.id]=c)}}catch(t){l.e(t)}finally{l.f()}}}}}catch(t){o.e(t)}finally{o.f()}}}},g=Sr(o);try{for(g.s();!(f=g.n()).done;)m(f.value)}catch(t){g.e(t)}finally{g.f()}return{connectedNodes:v,connectedRels:y}}(c,f,n,r),m=y.connectedNodes,g=y.connectedRels,b=Object.values(m),w=Object.values(g),x=b.length,_=w.length;x===c.size&&_===f.size&&(f.size>0||c.size>0)?(this.setLayout(uo),this.coseBilkentLayout.update(!0,n.items,r.items)):_>0&&f.size/_>.25&&(this.setLayout(uo),this.coseBilkentLayout.update(!0,b,w))}}this.physLayout.update(t),this.coseBilkentLayout.update(t)}},{key:"getShouldUpdate",value:function(){return this.currentLayout.getShouldUpdate()}},{key:"getComputing",value:function(){return this.currentLayout.getComputing()}},{key:"updateNodes",value:function(t){this.setLayout(so),this.physLayout.updateNodes(t)}},{key:"getNodePositions",value:function(t){return this.currentLayout.getNodePositions(t)}},{key:"terminateUpdate",value:function(){this.physLayout.terminateUpdate(),this.coseBilkentLayout.terminateUpdate()}},{key:"destroy",value:function(){this.physLayout.destroy(),this.coseBilkentLayout.destroy()}}],n&&ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ho(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fo(Object(n),!0).forEach((function(e){mo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function po(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,go(r.key),r)}}function mo(t,e,n){return(e=go(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function go(t){var e=function(t,e){if("object"!=co(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==co(e)?e:String(e)}var bo="FreeLayout",wo=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),mo(this,"state",void 0),mo(this,"positions",void 0),mo(this,"shouldUpdate",void 0),mo(this,"stateDisposers",void 0);var r=t.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(bo),a.addChannel(bo),this.shouldUpdate=!0,this.setOptions(),this.layout(o.items,o.idToItem,o.idToPosition)}var n,r;return n=e,r=[{key:"setOptions",value:function(){}},{key:"updateNodes",value:function(t){var e,n=po(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[bo].adds).length>0,o=Object.values(r.channels[bo].adds).length>0,a=Object.values(n.channels[bo].removes).length>0,s=Object.values(r.channels[bo].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(bo),r.clearChannel(bo)}this.shouldUpdate=!1}},{key:"layout",value:function(e,n,r){var i,o=void 0!==(i=e)?bn(i):i;if(!(0,t.isEmpty)(o)){for(var a={},s=0;s<o.length;++s){var u,l=o[s].id,c=null!==(u=r[l])&&void 0!==u?u:{},f=c.x,h=void 0===f?0:f,d=c.y,p=void 0===d?0:d;a[l]={id:l,x:h,y:p}}this.positions=a,this.shouldUpdate=!1}}},{key:"setNodePositions",value:function(t){this.positions=t}},{key:"getNodePositions",value:function(t){var e,n=[],r=po(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=ho({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){}},{key:"destroy",value:function(){this.state.nodes.removeChannel(bo),this.state.rels.removeChannel(bo)}}],r&&yo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();function xo(t){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(t)}function _o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function So(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_o(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Eo(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function To(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ao(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ao(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Eo(r.key),r)}}function Eo(t){var e=function(t,e){if("object"!=xo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xo(e)?e:String(e)}var Po="GridLayout",ko=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=t.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Po),a.addChannel(Po),this.shouldUpdate=!0,this.setOptions(t),this.layout(o.items,o.idToItem,o.idToPosition,a.items)}var n,r;return n=e,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e,n=To(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[Po].adds).length>0,o=Object.values(r.channels[Po].adds).length>0,a=Object.values(n.channels[Po].removes).length>0,s=Object.values(r.channels[Po].removes).length>0;(i||o||a||s)&&(this.layout(n.items,n.idToItem,n.idToPosition,r.items),n.idToPosition=this.positions),n.clearChannel(Po),r.clearChannel(Po)}this.shouldUpdate=!1}},{key:"layout",value:function(e,n,r,i){var o;if(e=(o=e)?bn(o):o,!(0,t.isEmpty)(e)){for(var a=e.length,s=Math.ceil(Math.sqrt(a)),u=new Array(a),l=0,c=0;c<s;++c){for(var f=0;f<s&&(u[l]={y:0+150*c,x:0+150*f},++l!==a);++f);if(l===a)break}for(var h=e.sort(),d={},p=0;p<a;++p){var v=h[p],y=u[p];v.x===y.x&&v.y===y.y||(d[v.id]=So({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{key:"getNodePositions",value:function(t){var e,n=[],r=To(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=So({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){this.shouldUpdate=!1}},{key:"destroy",value:function(){this.state.nodes.removeChannel(Po),this.state.rels.removeChannel(Po)}}],r&&Oo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(),jo=i(269),Co=i.n(jo);function Do(t){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(t)}function Ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Io(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Do(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Do(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Lo=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},r=0;r<t.length;r++)n.minX>t[r].x&&(n.minX=t[r].x),n.minY>t[r].y&&(n.minY=t[r].y),n.maxX<t[r].x&&(n.maxX=t[r].x),n.maxY<t[r].y&&(n.maxY=t[r].y);var i=(n.minX+n.maxX)/2,o=(n.minY+n.maxY)/2,a=2*e,s=xr()*a;return{centerX:i,centerY:o,nodesWidth:n.maxX-n.minX+a+s,nodesHeight:n.maxY-n.minY+a+s}},Mo=function(t,e,n,r){var i=1/0,o=1/0;return t>1&&(i=n/t),e>1&&(o=r/e),{zoomX:i,zoomY:o}},No=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=Math.min(t,e);return Math.min(r,Math.max(n,i))},Fo=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},Uo=function(t,e,n,r,i,o){var a=e;return function(t,e,n){return t<e&&t<n}(i,o,e)&&t.length>1?(a=function(t,e,n){var r=function(t){var e=new Array(4).fill(t[0]);return t.forEach((function(t){e[0]=t.x<e[0].x?e[0]:Io({},t),e[1]=t.y<e[1].y?e[1]:Io({},t),e[2]=t.x<e[2].x?Io({},t):e[2],e[3]=t.y<e[3].y?Io({},t):e[3]})),e}(t),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0,n=0,r=0;r<t.length;r++)for(var i=r+1;i<t.length;i++)e=Math.hypot(Math.abs(t[r].x-t[i].x),Math.abs(t[r].y-t[i].y)),n=Math.max(n,e);return n}(r),o=2*n,a=xr()*o,s=e.height<=e.width?e.height-o-a:e.width-o-a;return i>s?.9*s/i:.9*i/s}(t,r,25),Fo(i,o,Math.min(e,a),n)):Fo(i,o,e,n)};function zo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Bo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vo(t){this.channels[t]={adds:{},updates:{},removes:{}}}function Go(t){delete this.channels[t]}function Wo(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var Xo=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function Ho(e,n){var r,i=!1,o=zo(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.id;if(void 0===this.idToItem[s]){if(a=(0,t.cloneDeep)(a),this.items.push(a),this.idToItem[s]=a,this.idToPosition[s]={id:s,x:0,y:0},"x"in a&&"y"in a){var u=a,l=u.x,c=u.y;isNaN(l)||isNaN(c)||(this.idToPosition[s].x=l,this.idToPosition[s].y=c)}var f=Xo(a);if(f instanceof HTMLElement){var h=document.createElement("div");Object.assign(h.style,{position:"absolute"}),h.appendChild(f),this.idToHtmlOverlay[s]=h}for(var d=Object.values(this.channels),p=0,v=d;p<v.length;p++){var y=v[p];void 0===y.removes[s]?y.adds[s]=a:(delete y.removes[s],y.updates[s]=a)}i=!0}}}catch(t){o.e(t)}finally{o.f()}i&&(this.version+=1,void 0!==n&&(n.added=!0))}function Yo(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.id,s=this.idToItem[a];if(void 0!==s){Object.assign(s,o);var u=Xo(o);if(u instanceof HTMLElement){var l;null===(l=this.idToHtmlOverlay[a])||void 0===l||l.remove(),delete this.idToHtmlOverlay[a];var c=document.createElement("div");Object.assign(c.style,{position:"absolute"}),c.appendChild(u),this.idToHtmlOverlay[a]=c}for(var f=Object.values(this.channels),h=0,d=f;h<d.length;h++){var p=d[h];if(void 0===p.adds[a]){var v=p.updates[a];void 0===v&&(v={id:a},p.updates[a]=v),Object.assign(v,o)}}void 0!==e&&(e.updated=!0)}r=!0}}catch(t){i.e(t)}finally{i.f()}r&&(this.version+=1)}function $o(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=this.idToItem[o];if(void 0!==a){var s;r=!0,delete this.idToItem[a.id],delete this.idToPosition[a.id],null===(s=this.idToHtmlOverlay[a.id])||void 0===s||s.remove(),delete this.idToHtmlOverlay[a.id],this.items.splice(this.items.indexOf(a),1);for(var u=Object.values(this.channels),l=0,c=u;l<c.length;l++){var f=c[l];void 0!==f.adds[o]?delete f.adds[o]:(delete f.updates[o],f.removes[o]=a)}}}}catch(t){i.e(t)}finally{i.f()}r&&(void 0!==e&&(e.removed=!0),this.version+=1)}function qo(t){var e,n=zo(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(void 0!==this.idToPosition[r.id]){var i=this.idToPosition[r.id];Object.assign(i,r)}else this.idToPosition[r.id]={id:r.id,x:r.x,y:r.y,pinned:r.pinned}}}catch(t){n.e(t)}finally{n.f()}}function Zo(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var Ko=function(){return{idToItem:Bt.shallow({}),items:Bt.shallow([]),channels:Bt.shallow({}),idToPosition:Bt.shallow({}),idToHtmlOverlay:Bt.shallow({}),version:0,addChannel:it(Vo),removeChannel:it(Go),clearChannel:it(Wo),add:it(Ho),update:it(Yo),remove:it($o),updatePositions:it(qo),updateHtmlOverlay:it(Zo)}};function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ta(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qo(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Jo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Jo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jo(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ea="#bbb",na="#fff",ra="#45bff8",ia={selected:{rings:[{widthFactor:.05,color:na},{widthFactor:.1,color:ra}],shadow:{width:10,opacity:1,color:ea}},default:{rings:[]}},oa={selected:{rings:[{color:na,width:2},{color:ra,width:4}],shadow:{width:18,opacity:1,color:ea}},default:{rings:[]}},aa=.75,sa=new Set(["direction","packing"]),ua="forceDirected",la="hierarchical",ca="grid",fa="free",ha="d3Force",da="webgl",pa="canvas";function va(t){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(t)}function ya(t,e,n){return e=function(t){var e=function(t,e){if("object"!=va(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ma="down",ga=ya(ya(ya(ya({},"up","BT"),ma,"TB"),"left","RL"),"right","LR"),ba="bin",wa=[ba,"stack"],xa=["html"],_a=["html"],Sa=["captionHtml"];function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(t)}function Aa(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Oa(){Oa=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(C([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Ta(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Ta(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function Ea(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Pa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ma(r.key),r)}}function ka(t,e,n){return e=Ra(e),function(t,e){if(e&&("object"===Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ca(t)}(t,ja()?Reflect.construct(e,n||[],Ra(t).constructor):e.apply(t,n))}function ja(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ja=function(){return!!t})()}function Ca(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Da(){return Da="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ra(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Da.apply(this,arguments)}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}function Ia(t,e){return Ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ia(t,e)}function La(t,e,n){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){var e=function(t,e){if("object"!=Ta(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ta(e)?e:String(e)}var Na="HierarchicalLayout",Fa=function(t){return void 0!==t?bn(t):t},Ua=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),La(Ca(n=ka(this,e,[t])),"direction",void 0),La(Ca(n),"packing",void 0),La(Ca(n),"stateDisposers",void 0),La(Ca(n),"oldComputing",void 0),La(Ca(n),"computing",void 0),La(Ca(n),"pendingLayoutData",void 0),La(Ca(n),"worker",void 0),La(Ca(n),"directionChanged",void 0),La(Ca(n),"packingChanged",void 0),n.direction=ma,n.packing=ba;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(Na),o.addChannel(Na),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[Na],e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,a=Object.values(t.updates),s=Or(a);n.shouldUpdate=n.shouldUpdate||e||r||s}if(void 0!==o.version){var u=o.channels[Na],l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;n.shouldUpdate=n.shouldUpdate||l||c}}))],n.shouldUpdate=!0,n.oldComputing=!1,n.computing=!1,n.setOptions(t),n.setupWorker().then((function(t){n.worker=t,n.worker.port.start(),n.pendingLayoutData=null,n.layout(i.items,i.idToItem,i.idToPosition,o.items)})),n}var n,r,o,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ia(t,e)}(e,t),n=e,r=[{key:"setupWorker",value:(o=Oa().mark((function t(){var e,n,r,o,a;return Oa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.resolve().then(i.bind(i,716));case 3:n=t.sent,r=n.createHierarchicalLayoutWorker,e=r(),t.next=16;break;case 8:return t.prev=8,t.t0=t.catch(0),Vr.info("Failed to initialise shared worker: ",t.t0," Falling back to syncronous code."),t.next=13,Promise.resolve().then(i.bind(i,716));case 13:o=t.sent,a=o.hierarchicalLayoutFallbackWorker,e=a;case 16:return t.abrupt("return",new Promise((function(t,n){e||n("Hierarchical layout code could not be initialised"),t(e)})));case 17:case"end":return t.stop()}}),t,null,[[0,8]])})),a=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){Ea(i,n,r,a,s,"next",t)}function s(t){Ea(i,n,r,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"setOptions",value:function(t){if(void 0!==t&&function(t){return Object.keys(t).every((function(t){return sa.has(t)}))}(t)){var e=t.direction,n=void 0===e?ma:e,r=t.packing,i=void 0===r?ba:r;Object.keys(ga).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),wa.includes(i)&&(this.packingChanged=this.packing&&this.packing!==i,this.packing=i),this.shouldUpdate=this.directionChanged||this.packingChanged}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var n=this.state,r=n.nodes,i=n.rels,o=this.directionChanged,a=this.packingChanged,s=Object.values(r.channels[Na].adds).length>0,u=Object.values(i.channels[Na].adds).length>0,l=Object.values(r.channels[Na].removes).length>0,c=Object.values(i.channels[Na].removes).length>0,f=Object.values(r.channels[Na].updates),h=Or(f);(t||s||u||l||c||o||a||h)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(Na),i.clearChannel(Na),this.directionChanged=!1,this.packingChanged=!1}Da(Ra(e.prototype),"update",this).call(this),this.shouldUpdate=!1,this.oldComputing=this.computing}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e,n,r){var i=this;if(this.worker){var o=Fa(t).map((function(t){return t.html,Aa(t,xa)})),a=Fa(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Aa(e,_a));s[t]=n}));var u=Fa(r).map((function(t){return t.captionHtml,Aa(t,Sa)})),l=Fa(n),c=this.direction,f=this.packing,h=window.devicePixelRatio,d={nodes:o,nodeIds:s,idToPosition:l,rels:u,direction:c,packing:f,pixelRatio:h,forcedDelay:0};this.computing?this.pendingLayoutData=d:(this.worker.port.onmessage=function(t){var e=t.data,n=e.positions,r=e.parents,o=e.waypoints;i.computing&&(i.positions=n),i.parents=r,i.state.setWaypoints(o),null!==i.pendingLayoutData?(i.worker.port.postMessage(i.pendingLayoutData),i.pendingLayoutData=null):i.computing=!1,i.shouldUpdate=!0,i.startAnimation()},this.computing=!0,this.worker.port.postMessage(d))}else Vr.info("Hierarchical layout code not yet initialised.")}},{key:"terminateUpdate",value:function(){var t,e;this.computing=!1,this.shouldUpdate=!1,null===(t=this.state.nodes)||void 0===t||t.clearChannel(Na),null===(e=this.state.rels)||void 0===e||e.clearChannel(Na)}},{key:"destroy",value:function(){var t;this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Na),this.state.rels.removeChannel(Na),null===(t=this.worker)||void 0===t||t.port.close()}}],r&&Pa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Jr);function za(t){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(t)}function Ba(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ga(r.key),r)}}function Va(t,e,n){return(e=Ga(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ga(t){var e=function(t,e){if("object"!=za(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=za(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==za(e)?e:String(e)}var Wa=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Va(this,"elementId",void 0),Va(this,"currentValue",void 0),Va(this,"startValue",void 0),Va(this,"currentTime",void 0),Va(this,"duration",void 0),Va(this,"status",void 0),Va(this,"endValue",void 0),Va(this,"startTime",void 0),Va(this,"endTime",void 0),Va(this,"hasNextAnimation",void 0),this.elementId=e,this.startValue=n,this.status=0,this.currentValue=n,this.duration=0}var e,n;return e=t,(n=[{key:"setDuration",value:function(t){this.duration=t,this.setEndTime(this.startTime+this.duration)}},{key:"getStatus",value:function(){return this.status}},{key:"advance",value:function(){if(1!==this.status)return!1;this.currentTime=(new Date).getTime();var t,e=this.endTime-this.startTime;return(t=e>0?(this.currentTime-this.startTime)/e:1)>=1?(this.currentValue=this.endValue,this.status=2):(this.currentValue=this.startValue+t*(this.endValue-this.startValue),this.hasNextAnimation=!0),this.hasNextAnimation}},{key:"setEndValue",value:function(t){this.endValue!==t&&(t-this.currentValue!=0?(this.currentTime=(new Date).getTime(),this.status=1,this.startValue=this.currentValue,this.endValue=t,this.startTime=this.currentTime,this.setEndTime(this.startTime+this.duration)):this.endValue=t)}},{key:"setEndTime",value:function(t){this.endTime=Math.max(t,this.startTime)}}])&&Ba(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xa(t){return Xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xa(t)}function Ha(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ya(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ha(Object(n),!0).forEach((function(e){qa(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ha(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Za(r.key),r)}}function qa(t,e,n){return(e=Za(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Za(t){var e=function(t,e){if("object"!=Xa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xa(e)?e:String(e)}var Ka=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),qa(this,"animations",void 0),qa(this,"durations",void 0),qa(this,"defaultDuration",void 0),qa(this,"hasNextAnimation",void 0),qa(this,"ignoreAnimationsFlag",void 0),this.animations=new Map,this.durations=[],this.durations[0]=0,this.durations[1]=0,this.defaultDuration=150,this.hasNextAnimation=!1,this.ignoreAnimationsFlag=!1}var e,n;return e=t,n=[{key:"advance",value:function(){var t=this;return this.hasNextAnimation=!1,this.animations.forEach((function(e){Object.values(e).forEach((function(e){e.advance()&&(t.hasNextAnimation=!0)}))})),this.hasNextAnimation}},{key:"ignoreAnimations",value:function(t){this.ignoreAnimationsFlag=t}},{key:"setOptions",value:function(t){void 0!==t.fadeDuration&&(this.durations[0]=t.fadeDuration),void 0!==t.sizeDuration&&(this.durations[1]=t.sizeDuration)}},{key:"needsToRun",value:function(){return this.hasNextAnimation}},{key:"getValueForAnimationName",value:function(t,e,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.ignoreAnimationsFlag)return n;var a=null!==(r=this.getById(t))&&void 0!==r?r:{};if(void 0===a[e]){var s=1===o?this.createSizeAnimation(0,t,e):this.createFadeAnimation(0,t,e);s.setEndValue(n),i=s.currentValue}else{var u=a[e];if(u.currentValue===n)return n;u.setEndValue(n),i=u.currentValue}return this.hasNextAnimation=!0,i}},{key:"createAnimation",value:function(t,e,n){var r,i=new Wa(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Ya(Ya({},o),{},qa({},n,i))),i}},{key:"getById",value:function(t){return this.animations.get(t)}},{key:"createFadeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[0])&&void 0!==r?r:this.defaultDuration),i}},{key:"createSizeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[1])&&void 0!==r?r:this.defaultDuration),i}}],n&&$a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ja(t){return Ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ja(t)}function Qa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ts(r.key),r)}}function ts(t){var e=function(t,e){if("object"!=Ja(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ja(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ja(e)?e:String(e)}var es=64,ns=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=ts(n="cache"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.cache={}}var e,n;return e=t,n=[{key:"getImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOrCreateEntry(t),r=e?"inverted":"image",i=n[r];return void 0===i&&(i=this.loadImage(t),n[r]=i),this.drawIfNeeded(i,e),i.canvas}},{key:"getOrCreateEntry",value:function(t){return void 0===this.cache[t]&&(this.cache[t]={}),this.cache[t]}},{key:"invertCanvas",value:function(t){for(var e=t.getImageData(0,0,es,es),n=e.data,r=0;r<4096;r++){var i=4*r;n[i]^=255,n[i+1]^=255,n[i+2]^=255}t.putImageData(e,0,0)}},{key:"loadImage",value:function(t){var e=document.createElement("canvas");e.width=es,e.height=es;var n=new Image;return n.src=t,n.crossOrigin="anonymous",{canvas:e,image:n,drawn:!1}}},{key:"drawIfNeeded",value:function(t,e){var n=t.image,r=t.canvas;if(!t.drawn&&n.complete){var i=r.getContext("2d");try{i.drawImage(n,0,0,es,es)}catch(t){Vr.error("Failed to draw image",n.src,t),i.beginPath(),i.strokeStyle="black",i.rect(0,0,es,es),i.moveTo(0,0),i.lineTo(es,es),i.moveTo(0,es),i.lineTo(es,0),i.stroke(),i.closePath()}e&&this.invertCanvas(i),t.drawn=!0}}}],n&&Qa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const rs=ns;function is(t){return is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},is(t)}function os(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function as(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,us(r.key),r)}}function ss(t,e,n){return(e=us(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function us(t){var e=function(t,e){if("object"!=is(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=is(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==is(e)?e:String(e)}var ls=function(){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ss(this,"key",void 0),ss(this,"rels",void 0),ss(this,"waypointPath",void 0),ss(this,"selfReferring",void 0),ss(this,"fromId",void 0),ss(this,"toId",void 0),ss(this,"angles",void 0),ss(this,"labelInfo",void 0),this.key=t,this.rels=[],this.selfReferring=n===r,this.fromId=n,this.toId=r,this.labelInfo={},this.angles=[]}var n,r;return n=e,r=[{key:"insert",value:function(t){this.rels.push({rel:t})}},{key:"setLabelInfo",value:function(t,e){this.labelInfo[t]=e}},{key:"remove",value:function(t){var e=t.id,n=this.rels,r=n.findIndex((function(t){return t.rel.id===e}));if(-1!==r&&(n.splice(r,1),0===r&&n.length>0)){var i=n[0].rel,o=i.from,a=i.to;this.fromId=o,this.toId=a}}},{key:"size",value:function(){return this.rels.length}},{key:"maxFontSize",value:function(){return Math.max.apply(Math,function(t){if(Array.isArray(t))return os(t)}(e=this.rels.map((function(e){var n=e.rel;return(0,t.isNumber)(n.captionSize)?n.captionSize:1})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return os(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?os(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var e}},{key:"relIsOppositeDirection",value:function(t){var e=t.from,n=t.to,r=this.fromId,i=this.toId;return e!==r&&n!==i||e===i&&n===r}},{key:"indexOf",value:function(t){var e=t.id;return this.rels.findIndex((function(t){return t.rel.id===e}))}},{key:"getRel",value:function(t){var e=this.rels;return t<0||t>=e.length?null:e[t].rel}},{key:"setWaypoints",value:function(t){this.waypointPath=t}},{key:"setAngles",value:function(t){this.angles=t}}],r&&as(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(),cs="#848484",fs=2*Math.PI/50,hs=.1*Math.PI,ds=br;function ps(t){return ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ps(t)}function vs(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ys(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ys(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ys(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ms(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bs(r.key),r)}}function gs(t,e,n){return(e=bs(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bs(t){var e=function(t,e){if("object"!=ps(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ps(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ps(e)?e:String(e)}var ws=function(t){var e=[];if(0===t.length)e.push({size:2*Math.PI,start:0});else{for(var n=t.length-1;n>=0;n--){var r=void 0,i=void 0;0===n?(i=t[t.length-1],r=t[n]-t[t.length-1]+2*Math.PI):(i=t[n-1],r=t[n]-t[n-1]),e.push({size:r,start:i})}e.sort((function(t,e){return e.size-t.size}))}return e},xs=function(t,e){for(;e>t.length||t[0].size>2*t[e-1].size;)t.push({size:t[0].size/2,start:t[0].start}),t.push({size:t[0].size/2,start:t[0].start+t[0].size/2}),t.shift(),t.sort((function(t,e){return e.size-t.size}));return t},_s=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),gs(this,"bundles",void 0),gs(this,"nodeToBundles",void 0),this.bundles={},this.nodeToBundles={};var r=e.reduce((function(t,e){return t[e.id]=e,t}),{});this.updateData(r,{},n)}var e,n;return e=t,n=[{key:"getBundle",value:function(t){var e=this.bundles,n=this.nodeToBundles,r=this.generatePairId(t.from,t.to),i=e[r];return void 0===i&&(i=new ls(r,t.from,t.to),e[r]=i,void 0===n[t.from]&&(n[t.from]=[]),void 0===n[t.to]&&(n[t.to]=[]),n[t.from].push(i),n[t.to].push(i)),i}},{key:"updateData",value:function(t,e,n){for(var r=this.bundles,i=this.nodeToBundles,o=function(t,e){var n=i[e].findIndex((function(e){return e===t}));-1!==n&&i[e].splice(n,1),0===i[e].length&&delete i[e]},a=Object.values(t),s=Object.values(e),u=0,l=a;u<l.length;u++){var c=l[u];this.getBundle(c).insert(c)}for(var f=0,h=s;f<h.length;f++){var d=h[f],p=this.getBundle(d);p.remove(d),0===p.size()&&(delete r[p.key],o(p,d.from),o(p,d.to))}for(var v=0,y=Object.keys(r);v<y.length;v++){var m=r[y[v]];m.setWaypoints(n["".concat(m.fromId,"-").concat(m.toId)])}}},{key:"updatePositions",value:function(t){for(var e=this.nodeToBundles,n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],a=null!==(i=e[o])&&void 0!==i?i:[];if(0!==a.length){var s=a.find((function(t){return t.selfReferring})),u=a.filter((function(t){return!t.selfReferring}));if(void 0!==s){var l,c=[],f=vs(u);try{for(f.s();!(l=f.n()).done;){var h=l.value,d=t[h.fromId],p=t[h.toId];if(void 0!==d&&void 0!==p)for(var v=fs*h.size(),y=d.id===o?Math.atan2(p.y-d.y,p.x-d.x):Math.atan2(d.y-p.y,d.x-p.x),m=0;m<h.size();m++)c.push(y+v/2-m*fs);else{var g=void 0===d?h.fromId:h.toId;Vr.warn("Arrowbundler: Node with id ".concat(g," is not in position map"))}}}catch(t){f.e(t)}finally{f.f()}var b=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),w=ws(b);xs(w,s.size());var x=w.map((function(t){return t.start+t.size/2})).slice(0,s.size());s.setAngles(x)}}}}},{key:"generatePairId",value:function(t,e){return[t.toString(),e.toString()].sort((function(t,e){return t.localeCompare(e)})).join("-")}}],n&&ms(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ss(t){return Ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(t)}function Ts(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function As(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Es(r.key),r)}}function Os(t,e,n){return(e=Es(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Es(t){var e=function(t,e){if("object"!=Ss(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ss(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ss(e)?e:String(e)}var Ps=function(e,n){return(0,t.isFinite)(e.x)&&(0,t.isFinite)(e.y)&&(0,t.isFinite)(n.x)&&(0,t.isFinite)(n.y)},ks=function(t,e){if(void 0===t||void 0===e||!Ps(t,e))return!1;var n=e.x-t.x,r=e.y-t.y,i=xr();return n*n+r*r<100*i*i},js=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Os(this,"p1",void 0),Os(this,"p2",void 0),Os(this,"unit",void 0),Os(this,"norm",void 0),Os(this,"length",void 0),Os(this,"vector",void 0),this.p1=e,this.p2=n,this.vector=this.getVector(),this.length=this.getLength(),this.unit=this.getUnitVector(),this.norm=this.getUnitNormalVector()}var e,n;return e=t,n=[{key:"getVector",value:function(){return{x:this.p2.x-this.p1.x,y:this.p2.y-this.p1.y}}},{key:"getLength",value:function(){var t=this.vector,e=t.x,n=t.y;return Math.sqrt(e*e+n*n)}},{key:"getUnitVector",value:function(){var t=this.vector,e=this.length;return{x:t.x/e,y:t.y/e}}},{key:"getUnitNormalVector",value:function(){return{x:this.unit.y,y:-this.unit.x}}}],n&&As(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Cs=function(e,n,r){var i={x:n.x-e.x,y:n.y-e.y},o=function(e,n){var r=(e.x*n.x+e.y*n.y)/(n.x*n.x+n.y*n.y);return(0,t.clamp)(r,0,1)}({x:r.x-e.x,y:r.y-e.y},i),a=e.x+o*i.x,s=e.y+o*i.y,u=a-r.x,l=s-r.y;return Math.sqrt(u*u+l*l)},Ds=function(t,e,n,r){if(e.x===n.x&&e.y===n.y)return e;var i=e.y-t.y,o=t.x-e.x,a=i*t.x+o*t.y,s=r.y-n.y,u=n.x-r.x,l=s*n.x+u*n.y,c=i*u-s*o;return 0===c?null:{x:(u*a-o*l)/c,y:(i*l-s*a)/c}},Rs=function(t,e,n,r){var i,o,a,s=1e9,u=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ts(Object(n),!0).forEach((function(e){Os(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),l={x:0,y:0};for(o=1;o<10;o++)a=.1*o,l.x=Math.pow(1-a,2)*t.x+2*a*(1-a)*n.x+Math.pow(a,2)*e.x,l.y=Math.pow(1-a,2)*t.y+2*a*(1-a)*n.y+Math.pow(a,2)*e.y,o>0&&(s=(i=Cs(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function Is(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ls=[[.04,1],[100,2]],Ms=[[.8,1.1],[3,1.6],[8,2.5]],Ns=[[Ms[0][0],1],[100,1.25]],Fs=function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba(".concat(n[0],",").concat(n[1],",").concat(n[2],",").concat(e,")")}var r=Co().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},Us=function(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=r.headPosition,s=r.headAngle,u=r.headHeight,l=r.headChinHeight,c=r.headWidth;t.save(),t.lineWidth=e,t.strokeStyle=n,t.fillStyle=n,t.translate(a.x,a.y),t.rotate(s),function(t,e,n,r){if(t.beginPath(),e.length>0){var i=e[0];t.moveTo(i.x,i.y)}for(var o=1;o<e.length;o++){var a=e[o];t.lineTo(a.x,a.y)}t.closePath(),n&&t.fill(),r&&t.stroke()}(t,[{x:l-u,y:0},{x:-u,y:c/2},{x:0,y:0},{x:-u,y:-c/2}],i,o),t.restore()},zs=function(t,e,n,r,i){var o=r;i.forEach((function(r){var i=r.width,a=r.color,s=o+i;t.beginPath(),t.fillStyle=a,t.arc(e,n,s,0,2*Math.PI,!1),t.arc(e,n,o,2*Math.PI,0,!0),t.fill(),t.closePath(),o=s}))},Bs=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},Vs=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,Bs(t,e,n,i),t.fill(),t.closePath()};function Gs(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Ws=function(t,e,n,r,i,o,a,s,u){var l,c=r,f=0,h=0,d=null===(l=t.measureText("..."))||void 0===l?void 0:l.width;e.forEach((function(e){var r;t.font="normal ".concat(i,"px ").concat(o);var l,p=-(null===(r=t.measureText(e.text))||void 0===r?void 0:r.width)/2,v=e.text?function(t){if(Array.isArray(t))return Is(t)}(l=e.text)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||function(t,e){if(t){if("string"==typeof t)return Is(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Is(t,e):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[];e.hasHyphenChar||e.hasEllipsisChar||v.push(" "),v.forEach((function(r){var a,l,v,y,m,g;null!==(a=n[h])&&void 0!==a&&a.includes("italic")&&null!==(l=n[h])&&void 0!==l&&l.includes("bold")?t.font="italic 600 ".concat(i,"px ").concat(o):null!==(v=n[h])&&void 0!==v&&v.includes("italic")?t.font="italic 400 ".concat(i,"px ").concat(o):null!==(y=n[h])&&void 0!==y&&y.includes("bold")?t.font="bold ".concat(i,"px ").concat(o):t.font="normal ".concat(i,"px ").concat(o),null!==(m=n[h])&&void 0!==m&&m.includes("underline")&&t.fillRect(s+p+f,u+c+.2,null===(g=t.measureText(r))||void 0===g?void 0:g.width,.2),e.hasEllipsisChar?t.fillText(r,s+p+f-d/2,u+c):t.fillText(r,s+p+f,u+c),f+=t.measureText(r).width,h+=1})),t.font="normal ".concat(i,"px ").concat(o),e.hasHyphenChar&&t.fillText("-",s+p+f,u+c),e.hasEllipsisChar&&t.fillText("...",s+p+f-d/2,u+c),f=0,c+=a}))},Xs=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Hs=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Ys=function(t,e){return{x:t.x*e,y:t.y*e}},$s=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Hs(t,e))},qs=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};function Zs(t){return Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(t)}function Ks(t){return function(t){if(Array.isArray(t))return eu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||tu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Js(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Zs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Zs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zs(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Js(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function tu(t,e){if(t){if("string"==typeof t)return eu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eu(t,e):void 0}}function eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var nu=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},ru=function(t){var e=t[t.length-1],n=t[t.length-2];return!(!e||!isNaN(Number(e))||e.toLowerCase()===e.toUpperCase())&&!(!n||!isNaN(Number(n))||n.toLowerCase()===n.toUpperCase())&&nu(e)&&!nu(n)},iu=function(t,e,n,r){for(var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],s=[],u=0,l=0,c=!1,f=!1,h=0;h<r;h++)a[h]=n(h,r);for(var d,p=function(){i=t.slice(u,v);var n,h,d=e(i),p=a[l];if(d>p||(h=t[v-1],"\n\r\v".includes(h))){if(!(l<r-1)){if(o)return{v:[]};for(var y=v;d>p;){for(y-=1;n=t[y-1]," \t\n\r\v".includes(n);)y-=1;if(!(y-u>1)){i="",f=!0,c=!1;break}i=t.slice(u,y),d=e(i),f=!0,c=!1}return s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},{v:s}}c=!1,f=!1;var m=function(t){var e=t.length,n=Math.min(e-1,3);if(1===e)return{hyphen:!1,cnt:0};for(var r=0;r<n;r++){var i=t[t.length-(r+1)];if(" "===i||i.toLowerCase()===i.toUpperCase())return{hyphen:!1,cnt:r+1};var o=t.slice(0,t.length-r);if(ru(o))return{hyphen:!1,cnt:r+1}}return{hyphen:!0,cnt:1}}(i),g=v-m.cnt;if(m.hyphen)for(i=t.slice(u,g),d=e(i),c=!0;d>p;){if(!(g-u>1)){i=t[u],g=u+1,d=e(i),c=!1;break}g--,i=t.slice(u,g),d=e(i),c=!0}else i=(i=t.slice(u,g)).trim();s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},u=g,l+=1}},v=1;v<=t.length;v++)if(d=p())return d.v;return i=t.slice(u,t.length),s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:!1},s},ou=function(t,e,n,r,i,o,a,s){t.font="bold ".concat(r,"px ").concat(n).replace(/"/g,"");var u=function(e){var n;return null===(n=t.measureText(e))||void 0===n?void 0:n.width},l=2;a===Ms[1][1]?l=3:a===Ms[2][1]&&(l=4);for(var c=a<Ms[2][1]?["",""]:[""],f=o?c.length:0,h=function(t,e){return function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top",i=.98*n,o=.89*n,a=.95*n;return 1===e?i:2===e?a:3===e&&"top"===r?0===t||2===t?o:i:4===e&&"top"===r?0===t||3===t?.78*n:a:5===e&&"top"===r?0===t||4===t?.65*n:1===t||3===t?o:a:i}(t+f,e+f,i)},d=1,p=[],v=function(){if(0===(p=function(t,e,n,r){var i,o=t.split(/\s/g).filter((function(t){return t.length>0})),a=[],s=null,u=function(t){return e(t)>n(a.length,r)},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=tu(t))){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,f=s?"".concat(s," ").concat(c):c;if(e(f)<n(a.length,r))s=f;else{if(null!==s){var h=u(s);a.push({text:s,overflowed:h})}if(s=c,a.length>r)return[]}}}catch(t){l.e(t)}finally{l.f()}if(s){var d=u(s);a.push({text:s,overflowed:d})}return a.length<=r?a:[]}(e,u,h,d)).length)p=iu(e,u,h,d,l>d);else if(p.some((function(t){return t.overflowed}))){var t=d;p=p.reduce((function(e,n){var r=l-e.length;if(0===r){var i=e[e.length-1];return i.text.endsWith("…")||(u(i.text)+u("…")>h(e.length,t)?(e[e.length-1].text=i.text.slice(0,-2),e[e.length-1].hasEllipsisChar=!0):(e[e.length-1].text=i.text,e[e.length-1].hasEllipsisChar=!0)),e}if(n.overflowed){var o=iu(n.text,u,h,r);e=e.concat(o)}else e.push({text:n.text,hasEllipsisChar:!1,hasHyphenChar:!1});return e}),[])}else p=p.map((function(t){return Qs(Qs({},t),{},{hasEllipsisChar:!1,hasHyphenChar:!1})}));d+=1};0===p.length;)v();return Array.from(p)},au=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e,n){var r=e.value;if(r){var i="".concat(n>0&&t.length?", ":"").concat(r);return[].concat(Ks(t),[Qs(Qs({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:Ks(null!==(o=e.styles)&&void 0!==o?o:[]):Ks(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat(Ks(t),Ks(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function su(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return uu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var lu=2*Math.PI,cu=Math.PI/2,fu=function(t,e,n,r,i,o){var a={x:(t.x+e.x)/2,y:(t.y+e.y)/2},s={x:t.x,y:t.y},u={x:e.x,y:e.y},l=new js(u,s),c=function(t,e){var n=0;return t&&(n+=t),e&&(n-=e),n}(r,n);a.x+=c/2*l.unit.x,a.y+=c/2*l.unit.y;var f=o.size()/2-o.indexOf(i);return a.x+=f*l.unit.x,a.y+=f*l.unit.y,a},hu=function(t){var e=xr(),n=t.size,r=t.selected;return((null!=n?n:gr)+4+(!0===r?4:0))*e},du=function(t,e){var n=xr();t.shadowColor=e.color,t.shadowBlur=e.width*n,t.shadowOffsetX=0,t.shadowOffsetY=0},pu=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},vu=function(t,e,n,r,i){var o,a,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.norm.x,r=t.norm.y;return e?{x:-n,y:-r}:t.norm},l=xr(),c=e.indexOf(t),f=(e.size()-1)/2,h=c>f,d=Math.abs(c-f),p=i?17*e.maxFontSize():8,v=(e.size()-1)*p*l,y=function(t,e,n,r,i,o,a){var s,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=xr(),c=t.size(),f=c>1,h=t.relIsOppositeDirection(o),d=h?n:e,p=h?e:n,v=t.waypointPath,y=null==v?void 0:v.points,m=null==v?void 0:v.from,g=null==v?void 0:v.to,b=ks(d,m)&&ks(p,g)||ks(p,m)&&ks(d,g),w=b?y[1]:null,x=b?y[y.length-2]:null,_=hu(d),S=hu(p),T=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},A=Math.max(Math.PI,lu/(c/2)),O=f?r*A*(a?1:-1)/(null!==(s=d.size)&&void 0!==s?s:gr):0,E=T(b?w:p,d),P=b?T(p,x):E,k=function(t,e,n,r){return{x:t.x+Math.cos(e)*n*(r?-1:1),y:t.y+Math.sin(e)*n*(r?-1:1)}},j=function(t,e){return k(d,E+t,e,!1)},C=function(t,e){return k(p,P-t,e,!0)},D=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},R=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))*l},I=j(O,_),L=C(O,S),M=f?j(0,_):null,N=f?C(0,S):null,F=200*l,U=[];if(b){var z=R(I,w)<F;if(f&&!z){var B=D(M,w);U.push(new js(I,B)),U.push(new js(B,w))}else U.push(new js(I,w));for(var V=2;V<y.length-1;V++)U.push(new js(y[V-1],y[V]));var G=R(L,x)<F;if(f&&!G){var W=D(N,x);U.push(new js(x,W)),U.push(new js(W,L))}else U.push(new js(x,L))}else{var X=f?R(M,N):0;if(f&&X>2*(30*l+Math.min(_,S)))if(u){var H=fu(d,p,_,S,o,t);U.push(new js(I,H)),U.push(new js(H,L))}else{var Y=r*i,$=30+_,q=Math.sqrt($*$+Y*Y),Z=30+S,K=Math.sqrt(Z*Z+Y*Y),J=j(0,q),Q=C(0,K);U.push(new js(I,J)),U.push(new js(J,Q)),U.push(new js(Q,L))}else if(X>(_+S)/2){var tt=fu(d,p,_,S,o,t);U.push(new js(I,tt)),U.push(new js(tt,L))}else U.push(new js(I,L))}return U}(e,n,r,d,p,t,h,s),m=[],g=y[0],b=u(g,h);m.push({x:g.p1.x+b.x,y:g.p1.y+b.y});for(var w=1;w<y.length;w++)if(1===e.size())m.push(y[w-1].p2);else{var x=y[w-1],_=y[w],S=u(x,h),T=u(_,h),A=Xs(x.p1,Ys(S,v/2)),O=Xs(x.p2,Ys(S,v/2)),E=Xs(_.p1,Ys(T,v/2)),P=Xs(_.p2,Ys(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=Ds(A,O,E,P));var j=null!==k?Hs(k,x.p2):Ys(S,v/2);m.push(Xs(x.p2,Ys(j,d/f)))}var C=y[y.length-1],D=u(C,h);return m.push({x:C.p2.x+D.x,y:C.p2.y+D.y}),e.relIsOppositeDirection(t)?m.reverse():m},yu=function(t,e,n,r,i,o){var a,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=xr(),l=i.selected,c=i.captions,f=void 0===c?[]:c,h=i.caption,d=void 0===h?"":h,p=i.width,v=i.disabled,y=i.captionAlign,m=void 0===y?"top":y,g=i.captionSize,b=void 0===g?1:g,w=f.length>0?null===(a=au(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==w){var x=!0===v?"#DDDDDD":"#848484",_=6*b*u,S=!0===l?"bold":"normal",T=w;t.fillStyle=x,t.font="".concat(S," ").concat(_,"px ").concat('"Open Sans", sans-serif');var A=function(e){return t.measureText(e).width},O=(null!=p?p:1)*(!0===l?1.5:1),E=A(T);if(E>r){var P=iu(T,A,(function(){return r}),1,!1)[0];T=!0===P.hasEllipsisChar?"".concat(P.text,"..."):T,E=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-cu),t.translate(2*_,0),t.rotate(-cu)):t.rotate(n);var k=(1+b)*u,j="bottom"===m?_/2+O+k:-(O+k);t.fillText(T,-E/2,j),t.restore();var C=2*j*Math.sin(n),D=2*j*Math.cos(n),R={position:{x:e.x-C,y:e.y+D},rotation:s?n-Math.PI:n,width:r/u,height:(_+k)/u};o.setLabelInfo(i.id,R)}},mu=function(t,e,n,r,i){if(t.beginPath(),t.moveTo(e[0].x,e[0].y),i&&e.length>2){for(var o=1;o<e.length-2;){var a=(e[o].x+e[o+1].x)/2,s=(e[o].y+e[o+1].y)/2;t.quadraticCurveTo(e[o].x,e[o].y,a,s),o+=1}t.quadraticCurveTo(e[o].x,e[o].y,e[o+1].x,e[o+1].y)}else for(var u=1;u<e.length;u++)t.lineTo(e[u].x,e[u].y);t.lineWidth=n,t.strokeStyle=r,t.lineCap="round",t.stroke()},gu=function(t){return t.rings[0].width*xr()*1.5},bu=function(t){return 6*t*xr()},wu=function(t,e,n){var r,i;return{widthAlign:e/2*(null!==(r=t[0])&&void 0!==r?r:0),heightAlign:n/2*(null!==(i=t[1])&&void 0!==i?i:0)}},xu=function(t,e,n){var r,i,o=n.indexOf(t),a=null!==(r=n.angles[o])&&void 0!==r?r:0,s=a-hs/2,u=a+hs/2,l=null!==(i=t.width)&&void 0!==i?i:1,c=xr(),f=hu(e),h={x:e.x+Math.cos(s)*(f+l/2),y:e.y+Math.sin(s)*(f+l/2)},d={x:e.x+Math.cos(u)*(f+l/2),y:e.y+Math.sin(u)*(f+l/2)},p={x:e.x+Math.cos(a)*(f+35*c),y:e.y+Math.sin(a)*(f+35*c)};return{startAngle:s,endAngle:u,startPoint:h,endPoint:d,apexPoint:p,control1Point:{x:p.x+25*Math.cos(a-cu)*c/2,y:p.y+25*Math.sin(a-cu)*c/2},control2Point:{x:p.x+25*Math.cos(a+cu)*c/2,y:p.y+25*Math.sin(a+cu)*c/2}}},_u=function(t,e,n,r,i,o){t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(i.x,i.y,r.x,r.y),t.quadraticCurveTo(o.x,o.y,n.x,n.y),t.stroke()},Su=function(t,e,n,r,i,o,a,s){var u=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];Ps(n,r)&&(n.id===r.id?function(t,e,n,r,i,o,a){var s=e.overlayIcon,u=e.selected,l=e.width,c=e.hovered,f=e.disabled,h=e.color,d=xu(e,n,r),p=d.startPoint,v=d.endPoint,y=d.apexPoint,m=d.control1Point,g=d.control2Point,b=a.rings,w=a.shadow,x=xr(),_=b[0].color,S=b[1].color,T=b[0].width*x,A=b[1].width*x,O=40*x,E=(null!=l?l:1)*x,P=E>1?E/2:1,k=9*P,j=2*P,C=7*P,D=!0===u,R=!0===f,I=void 0!==s,L=Math.atan2(v.y-g.y,v.x-g.x),M=D?T*Math.sqrt(1+2*k/C*(2*k/C)):0,N={x:v.x-Math.cos(L)*(.5*k-j+M),y:v.y-Math.sin(L)*(.5*k-j+M)},F={headPosition:{x:v.x+Math.cos(L)*(.5*k-j-M),y:v.y+Math.sin(L)*(.5*k-j-M)},headAngle:L,headHeight:k,headChinHeight:j,headWidth:C};if(t.save(),t.lineCap="round",D&&(du(t,w),t.lineWidth=E+A,t.strokeStyle=S,_u(t,p,N,y,m,g),Us(t,A,S,F,!1,!0),pu(t),t.lineWidth=E+T,t.strokeStyle=_,_u(t,p,N,y,m,g),Us(t,T,_,F,!1,!0)),t.lineWidth=E,!0===c&&!D&&!R){var U=w.color;du(t,w),t.strokeStyle=U,t.fillStyle=U,_u(t,p,N,y,m,g),Us(t,E,U,F),pu(t)}var z=R?ds:null!=h?h:cs;if(t.fillStyle=z,t.strokeStyle=z,_u(t,p,N,y,m,g),Us(t,E,z,F),o||I){var B,V=r.indexOf(e),G=null!==(B=r.angles[V])&&void 0!==B?B:0,W=y.x-Math.cos(L)*(M/4),X=y.y-Math.sin(L)*(M/4),H=(G+cu)%lu,Y=(G+lu)%lu<Math.PI;if(o&&yu(t,{x:W,y:X},H,O,e,r,Y),I){var $=s.position,q=void 0===$?[0,0]:$,Z=s.url,K=s.size,J=bu(void 0===K?1:K),Q=wu(q,O,J),tt=Q.widthAlign,et=Q.heightAlign+(D?gu(a):0)*(q[1]<0?-1:1);t.save(),t.translate(W,X),Y?(t.rotate(H-Math.PI),t.translate(2*-tt,2*-et)):t.rotate(H);var nt=J/2,rt=-nt+tt,it=-nt+et;t.drawImage(i.getImage(Z),rt,it,J,J),t.restore()}}t.restore()}(t,e,n,i,o,a,s):function(t,e,n,r,i,o,a,s,u){var l=e.overlayIcon,c=e.color,f=e.disabled,h=e.selected,d=e.width,p=e.hovered,v=e.captionAlign,y=!0===h,m=!0===f,g=void 0!==l,b=u.rings,w=u.shadow,x=vu(e,i,n,r,a,s),_=xr(),S=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*xr()}(e),T=m?ds:null!=c?c:cs,A=b[0].width*_,O=b[1].width*_,E=_*(d>1?d/2:1),P=9*E,k=2*E,j=7*E,C=$s(x[x.length-2],x[x.length-1]),D=2*P,R=y?A*Math.sqrt(1+D/j*(D/j)):0,I=2-R,L=Math.floor(x.length/2);x.length>2&&y&&C<P+R-k&&(I+=C,R-=C/2+k,x.pop(),L=Math.floor(x.length/2));var M,N,F=x[x.length-2],U=x[x.length-1],z=(M=F,N=U,Math.atan2(N.y-M.y,N.x-M.x)),B=P/2+R,V=Math.cos(z),G=Math.sin(z);x[x.length-1]={x:U.x-V*B,y:U.y-G*B};var W,X={headPosition:{x:U.x+V*I,y:U.y+G*I},headAngle:z,headHeight:P,headChinHeight:k,headWidth:j},H=su(x);try{for(H.s();!(W=H.n()).done;){var Y=W.value;Y.x=Math.round(Y.x),Y.y=Math.round(Y.y)}}catch(t){H.e(t)}finally{H.f()}if(t.save(),y){var $=b[0].color,q=b[1].color,Z=Math.atan2(x[1].y-x[0].y,x[1].x-x[0].x),K=qs(Z,gu(u));x[0]=Xs(x[0],K),du(t,w),mu(t,x,S+O,q,s),Us(t,O,q,X,!1,!0),pu(t),mu(t,x,S+A,$,s),Us(t,A,$,X,!1,!0)}if(!0===p&&!y&&!m){var J=w.color;du(t,w),mu(t,x,S,J,s),Us(t,S,J,X),pu(t)}if(mu(t,x,S,T,s),Us(t,S,T,X),a||g){var Q,tt,et,nt,rt,it=n.x>r.x,ot=x[L];1==(1&x.length)?(Q=x[it?L+1:L-1],tt=x[it?L-1:L+1],s?(et=(ot.x+(Q.x+tt.x)/2)/2,nt=(ot.y+(Q.y+tt.y)/2)/2,rt=it?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):($s(ot,Q)>$s(ot,tt)?tt=ot:Q=ot,et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x))):(Q=x[it?L:L-1],tt=x[it?L-1:L],et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x));var at=y?qs(rt+cu,gu(u)):{x:0,y:0},st=$s(Q,tt);if(a){var ut="bottom"===v?1:-1,lt={x:et+at.x*ut,y:nt+at.y*ut};yu(t,lt,rt,st,e,i)}if(g){var ct=l.position,ft=void 0===ct?[0,0]:ct,ht=l.url,dt=l.size,pt=bu(void 0===dt?1:dt),vt=wu(ft,st,pt),yt=vt.widthAlign,mt=vt.heightAlign,gt=ft[1]<0?-1:1,bt=at.x*gt,wt=at.y*gt,xt=pt/2;t.save(),t.translate(et,nt),t.rotate(rt);var _t=-xt+bt+yt,St=-xt+wt+mt;t.drawImage(o.getImage(ht),_t,St,pt,pt),t.restore()}}t.restore()}(t,e,n,r,i,o,a,u,s))},Tu=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Ps(n,r)?n.id===r.id?function(t,e,n){for(var r=xu(t,e,n),i={left:1/0,top:1/0,right:-1/0,bottom:-1/0},o=["startPoint","endPoint","apexPoint","control1Point","control2Point"],a=0;a<o.length;a++){var s=r[o[a]],u=s.x,l=s.y;u<i.left&&(i.left=u),u>i.right&&(i.right=u),l<i.top&&(i.top=l),l>i.bottom&&(i.bottom=l)}return i}(t,n,e):function(t,e,n,r,i,o){var a,s={left:1/0,top:1/0,right:-1/0,bottom:-1/0},u=su(vu(t,e,n,r,i,o));try{for(u.s();!(a=u.n()).done;){var l=a.value,c=l.x,f=l.y;c<s.left&&(s.left=c),c>s.right&&(s.right=c),f<s.top&&(s.top=f),f>s.bottom&&(s.bottom=f)}}catch(t){u.e(t)}finally{u.f()}return s}(t,e,n,r,i,o):null};function Au(t){return Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(t)}var Ou=/^\s+/,Eu=/\s+$/;function Pu(t,e){if(e=e||{},(t=t||"")instanceof Pu)return t;if(!(this instanceof Pu))return new Pu(t,e);var n=function(t){var e,n,r,i={r:0,g:0,b:0},o=1,a=null,s=null,u=null,l=!1,c=!1;return"string"==typeof t&&(t=function(t){t=t.replace(Ou,"").replace(Eu,"").toLowerCase();var e,n=!1;if(Xu[t])t=Xu[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=il.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=il.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=il.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=il.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=il.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=il.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=il.hex8.exec(t))?{r:Zu(e[1]),g:Zu(e[2]),b:Zu(e[3]),a:tl(e[4]),format:n?"name":"hex8"}:(e=il.hex6.exec(t))?{r:Zu(e[1]),g:Zu(e[2]),b:Zu(e[3]),format:n?"name":"hex"}:(e=il.hex4.exec(t))?{r:Zu(e[1]+""+e[1]),g:Zu(e[2]+""+e[2]),b:Zu(e[3]+""+e[3]),a:tl(e[4]+""+e[4]),format:n?"name":"hex8"}:!!(e=il.hex3.exec(t))&&{r:Zu(e[1]+""+e[1]),g:Zu(e[2]+""+e[2]),b:Zu(e[3]+""+e[3]),format:n?"name":"hex"}}(t)),"object"==Au(t)&&(ol(t.r)&&ol(t.g)&&ol(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*$u(e,255),g:255*$u(n,255),b:255*$u(r,255)},l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):ol(t.h)&&ol(t.s)&&ol(t.v)?(a=Ju(t.s),s=Ju(t.v),i=function(t,e,n){t=6*$u(t,360),e=$u(e,100),n=$u(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),u=r%6;return{r:255*[n,a,o,o,s,n][u],g:255*[s,n,n,a,o,o][u],b:255*[o,o,s,n,n,a][u]}}(t.h,a,s),l=!0,c="hsv"):ol(t.h)&&ol(t.s)&&ol(t.l)&&(a=Ju(t.s),u=Ju(t.l),i=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=$u(t,360),e=$u(e,100),n=$u(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,a,u),l=!0,c="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=Yu(o),{ok:l,format:t.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function ku(t,e,n){t=$u(t,255),e=$u(e,255),n=$u(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function ju(t,e,n){t=$u(t,255),e=$u(e,255),n=$u(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function Cu(t,e,n,r){var i=[Ku(Math.round(t).toString(16)),Ku(Math.round(e).toString(16)),Ku(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Du(t,e,n,r){return[Ku(Qu(r)),Ku(Math.round(t).toString(16)),Ku(Math.round(e).toString(16)),Ku(Math.round(n).toString(16))].join("")}function Ru(t,e){e=0===e?0:e||10;var n=Pu(t).toHsl();return n.s-=e/100,n.s=qu(n.s),Pu(n)}function Iu(t,e){e=0===e?0:e||10;var n=Pu(t).toHsl();return n.s+=e/100,n.s=qu(n.s),Pu(n)}function Lu(t){return Pu(t).desaturate(100)}function Mu(t,e){e=0===e?0:e||10;var n=Pu(t).toHsl();return n.l+=e/100,n.l=qu(n.l),Pu(n)}function Nu(t,e){e=0===e?0:e||10;var n=Pu(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Pu(n)}function Fu(t,e){e=0===e?0:e||10;var n=Pu(t).toHsl();return n.l-=e/100,n.l=qu(n.l),Pu(n)}function Uu(t,e){var n=Pu(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Pu(n)}function zu(t){var e=Pu(t).toHsl();return e.h=(e.h+180)%360,Pu(e)}function Bu(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Pu(t).toHsl(),r=[Pu(t)],i=360/e,o=1;o<e;o++)r.push(Pu({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function Vu(t){var e=Pu(t).toHsl(),n=e.h;return[Pu(t),Pu({h:(n+72)%360,s:e.s,l:e.l}),Pu({h:(n+216)%360,s:e.s,l:e.l})]}function Gu(t,e,n){e=e||6,n=n||30;var r=Pu(t).toHsl(),i=360/n,o=[Pu(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Pu(r));return o}function Wu(t,e){e=e||6;for(var n=Pu(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(Pu({h:r,s:i,v:o})),o=(o+s)%1;return a}Pu.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=Yu(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=ju(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=ju(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=ku(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ku(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Cu(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[Ku(Math.round(t).toString(16)),Ku(Math.round(e).toString(16)),Ku(Math.round(n).toString(16)),Ku(Qu(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*$u(this._r,255))+"%",g:Math.round(100*$u(this._g,255))+"%",b:Math.round(100*$u(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*$u(this._r,255))+"%, "+Math.round(100*$u(this._g,255))+"%, "+Math.round(100*$u(this._b,255))+"%)":"rgba("+Math.round(100*$u(this._r,255))+"%, "+Math.round(100*$u(this._g,255))+"%, "+Math.round(100*$u(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Hu[Cu(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Du(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Pu(t);n="#"+Du(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Pu(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Mu,arguments)},brighten:function(){return this._applyModification(Nu,arguments)},darken:function(){return this._applyModification(Fu,arguments)},desaturate:function(){return this._applyModification(Ru,arguments)},saturate:function(){return this._applyModification(Iu,arguments)},greyscale:function(){return this._applyModification(Lu,arguments)},spin:function(){return this._applyModification(Uu,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Gu,arguments)},complement:function(){return this._applyCombination(zu,arguments)},monochromatic:function(){return this._applyCombination(Wu,arguments)},splitcomplement:function(){return this._applyCombination(Vu,arguments)},triad:function(){return this._applyCombination(Bu,[3])},tetrad:function(){return this._applyCombination(Bu,[4])}},Pu.fromRatio=function(t,e){if("object"==Au(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Ju(t[r]));t=n}return Pu(t,e)},Pu.equals=function(t,e){return!(!t||!e)&&Pu(t).toRgbString()==Pu(e).toRgbString()},Pu.random=function(){return Pu.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Pu.mix=function(t,e,n){n=0===n?0:n||50;var r=Pu(t).toRgb(),i=Pu(e).toRgb(),o=n/100;return Pu({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},Pu.readability=function(t,e){var n=Pu(t),r=Pu(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Pu.isReadable=function(t,e,n){var r,i,o,a,s,u=Pu.readability(t,e);switch(i=!1,"AA"!==(a=((o=(o=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(s=(o.size||"small").toLowerCase())&&"large"!==s&&(s="small"),(r={level:a,size:s}).level+r.size){case"AAsmall":case"AAAlarge":i=u>=4.5;break;case"AAlarge":i=u>=3;break;case"AAAsmall":i=u>=7}return i},Pu.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var l=0;l<e.length;l++)(r=Pu.readability(t,e[l]))>u&&(u=r,s=Pu(e[l]));return Pu.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,Pu.mostReadable(t,["#fff","#000"],n))};var Xu=Pu.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Hu=Pu.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Xu);function Yu(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function $u(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function qu(t){return Math.min(1,Math.max(0,t))}function Zu(t){return parseInt(t,16)}function Ku(t){return 1==t.length?"0"+t:""+t}function Ju(t){return t<=1&&(t=100*t+"%"),t}function Qu(t){return Math.round(255*parseFloat(t)).toString(16)}function tl(t){return Zu(t)/255}var el,nl,rl,il=(nl="[\\s|\\(]+("+(el="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+el+")[,|\\s]+("+el+")\\s*\\)?",rl="[\\s|\\(]+("+el+")[,|\\s]+("+el+")[,|\\s]+("+el+")[,|\\s]+("+el+")\\s*\\)?",{CSS_UNIT:new RegExp(el),rgb:new RegExp("rgb"+nl),rgba:new RegExp("rgba"+rl),hsl:new RegExp("hsl"+nl),hsla:new RegExp("hsla"+rl),hsv:new RegExp("hsv"+nl),hsva:new RegExp("hsva"+rl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function ol(t){return!!il.CSS_UNIT.exec(t)}var al=function(t){return Pu.mostReadable(t,["#1A1B1D","#FFFFFF"]).toString()};function sl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ul(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ul(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ul(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ll=function(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.size,a=void 0===o?gr:o;return{top:i-a,left:n-a,right:n+a,bottom:i+a}},cl=function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=e.x,s=void 0===a?0:a,u=e.y,l=void 0===u?0:u,c=e.size,f=void 0===c?gr:c,h=e.caption,d=void 0===h?"":h,p=e.captions,v=void 0===p?[]:p,y=e.captionAlign,m=void 0===y?"center":y,g=e.captionSize,b=void 0===g?1:g,w=e.disabled,x=e.activated,_=e.selected,S=e.hovered,T=e.id,A=e.icon,O=e.overlayIcon,E=i.selected,P=xr(),k=function(t,e,n){var r=t.selected?n.selected.rings:n.default.rings;if(!r.length){var i=e.getById(t.id);return void 0!==i&&Object.entries(i).forEach((function(t){var e=sl(t,2),n=e[0],r=e[1];n.startsWith("ring-")&&r.setEndValue(0)})),[{width:0,color:""}]}return r.map((function(n,r){var i=n.widthFactor,o=n.color,a=(t.size||gr)*i*xr();return{width:e.getValueForAnimationName(t.id,"ring-".concat(r),a),color:o}}))}(e,r,i),j=k.reduce((function(t,e){return t+e.width}),0),C=E.shadow.width*P,D=E.shadow.opacity,R=E.shadow.color,I=f*P,L=2*I,M=function(t,e){if(!t||!e)return{nodeInfoLevel:0,fontInfoLevel:1.25,iconInfoLevel:1};var n=xr(),r=1600*n*(1200*n),i=Math.pow(t,2)*Math.PI*Math.pow(e,2)/(r/100);return{nodeInfoLevel:Gs(i,Ls),fontInfoLevel:Gs(i,Ms),iconInfoLevel:Gs(i,Ns)}}(I,o),N=M.nodeInfoLevel,F=M.fontInfoLevel,U=M.iconInfoLevel,z=e.color||"#478BFF",B=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:gr)/({1:3.5,2:2.75,3:2}[arguments.length>2&&void 0!==arguments[2]?arguments[2]:1]+(arguments.length>3&&void 0!==arguments[3]&&arguments[3]?1:0))/t}(F,I,b,Boolean(A)),V=al(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(A),$=Boolean(O);if(j>0&&(G=I+j),w)z="#EDEDED",V="#DDDDDD";else{if(x){var q=Date.now()%1e3/1e3,Z=q<.7?q/.7:0,K=Fs(z,.4-.4*Z);Vs(t,s,l,K,I+.88*I*Z)}var J=_||S?C:0,Q=r.getValueForAnimationName(T,"shadowWidth",J);Q>0&&function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=i+o,u=t.createRadialGradient(e,n,i,e,n,s);u.addColorStop(0,"transparent"),u.addColorStop(.01,Fs(r,.5*a)),u.addColorStop(.05,Fs(r,.5*a)),u.addColorStop(.5,Fs(r,.12*a)),u.addColorStop(.75,Fs(r,.03*a)),u.addColorStop(1,Fs(r,0)),t.fillStyle=u,Bs(t,e,n,s),t.fill()}(t,s,l,R,G,Q,D)}if(Vs(t,s,l,z,I),j>0&&zs(t,s,l,W,k),Y){var tt=N<2||!(X||H),et=N>0?1:0,nt=tt?1*I:.75*I;nt/=U;var rt=tt?.5*nt:nt*(1===U?"center"===m?1.3:"bottom"===m||tt?1.1:0:"center"===m?1.35:"bottom"===m||tt?1.1:0),it=nt/2;nt=r.getValueForAnimationName(T,"iconSize",nt),it=r.getValueForAnimationName(T,"iconXPos",it),rt=r.getValueForAnimationName(T,"iconYPos",rt),t.save();var ot=!0===w?.1:et;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",ot);var at="#fff"===V,st=n.getImage(A,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=L*(null!==(ut=O.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=O.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=O.position)||void 0===ht?void 0:ht[0])&&void 0!==ft?ft:0);t.save();var yt=!0===w?.1:1;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",yt);var mt=n.getImage(O.url);t.drawImage(mt,s-vt,l-pt,dt,dt),t.restore()}var gt=N<2?0:1,bt=r.getValueForAnimationName(T,"textOpacity",gt,0),wt=Fs(V,bt),xt='"Open Sans", sans-serif';if(X&&bt>0){var _t=ou(t,d,xt,B,.7*L,Y,F,null==e||e.captionAlign);t.fillStyle=wt,t.font="normal ".concat(B,"px ").concat(xt);var St=1+B,Tt=-(_t.length-2)*St/2,At=d.split("").map((function(t){return[]}));Ws(t,_t,At,Tt,B,xt,St,s,l)}if(H){var Ot=N<2?0:1,Et=r.getValueForAnimationName(T,"textOpacity",Ot,0),Pt=Fs(V,Et),kt='"Open Sans", sans-serif',jt=Boolean(A);if(Et>0){var Ct=au(v),Dt=Ct.stylesPerChar,Rt=Ct.fullCaption,It="center"===m?.7*L:2*Math.sqrt(Math.pow(L/2,2)-Math.pow(L/3,2)),Lt=ou(t,Rt,kt,B,It,jt,F,null==e||e.captionAlign);t.fillStyle=Pt;var Mt,Nt=B,Ft=-(Lt.length-2)*Nt/2;Mt=m&&"center"!==m?"bottom"===m?Ft+I/Math.PI:Ft-I/Math.PI:Ft,Ws(t,Lt,Dt,Mt,B,kt,Nt,s,l)}}t.save(),t.restore()};function fl(t){return fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fl(t)}function hl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hl(Object(n),!0).forEach((function(e){ml(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function pl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gl(r.key),r)}}function ml(t,e,n){return(e=gl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gl(t){var e=function(t,e){if("object"!=fl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=fl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fl(e)?e:String(e)}var bl="canvasRenderer",wl=function(){function t(e,n,r){var i=this,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).relationshipThreshold,a=void 0===o?2.5:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ml(this,"arrowBundler",void 0),ml(this,"activeNodes",void 0),ml(this,"canvas",void 0),ml(this,"context",void 0),ml(this,"state",void 0),ml(this,"stateDisposers",void 0),ml(this,"relationshipThreshold",void 0),ml(this,"animationHandler",void 0),ml(this,"imageCache",void 0),ml(this,"needsRun",void 0),ml(this,"nodeVersion",void 0),ml(this,"relVersion",void 0),ml(this,"waypointVersion",void 0),this.activeNodes=new Set,this.canvas=e,this.context=n,this.state=r,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){void 0!==r.zoom&&(i.needsRun=!0),void 0!==r.panX&&(i.needsRun=!0),void 0!==r.panY&&(i.needsRun=!0),void 0!==r.nodes.version&&(i.needsRun=!0),void 0!==r.rels.version&&(i.needsRun=!0),r.waypoints.counter>0&&(i.needsRun=!0),void 0!==r.layout&&(i.needsRun=!0)}))),r.nodes.addChannel(bl),r.rels.addChannel(bl),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new Ka,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new _s(r.rels.items,r.waypoints.data),this.imageCache=new rs,this.needsRun=!0}var e,n;return e=t,n=[{key:"needsToRun",value:function(){return this.needsRun||this.animationHandler.needsToRun()||this.activeNodes.size>0}},{key:"processUpdates",value:function(){var t=this.state,e=!1,n=t.nodes.channels[bl],r=t.rels.channels[bl],i=n.adds,o=n.removes,a=r.adds,s=r.removes;this.nodeVersion<t.nodes.version&&(Object.keys(i).length>0||Object.keys(o).length,this.handleChannelUpdate(n,t.nodes,!0),this.nodeVersion=t.nodes.version,t.nodes.clearChannel(bl)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(bl),this.relVersion=t.rels.version),(e||this.waypointVersion<t.waypoints.counter)&&(this.arrowBundler.updateData(a,s,t.waypoints.data),this.waypointVersion=t.waypoints.counter)}},{key:"render",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state,o=this.animationHandler,a=this.arrowBundler,s=i.zoom,u=i.layout,l=i.nodes.idToPosition,c=null!==(e=r.canvas)&&void 0!==e?e:this.canvas,f=null!==(n=r.context)&&void 0!==n?n:this.context,h=xr(),d=c.clientWidth*h,p=c.clientHeight*h;f.save(),void 0!==r.backgroundColor?(f.fillStyle=r.backgroundColor,f.fillRect(0,0,d,p)):f.clearRect(0,0,d,p),this.zoomAndPan(f,c),o.ignoreAnimations(Boolean(r.ignoreAnimations)),!0!==r.ignoreAnimations&&o.advance(),a.updatePositions(l);var v=this.getRelationshipsToRender(r.showCaptions,d,p);this.renderRelationships(v,f,u!==la);var y=this.getNodesToRender(t,d,p);this.renderNodes(y,f,s),f.restore(),this.needsRun=!1}},{key:"getRelationshipsToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.arrowBundler,u=this.state,l=this.relationshipThreshold,c=u.layout,f=u.zoom,h=u.rels,d=u.nodes,p=d.idToItem,v=d.idToPosition,y=pl(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=dl(dl({},p[m.from]),v[m.from]),w=dl(dl({},p[m.to]),v[m.to]),x=t||f>l||void 0!==m.captionHtml,_=Tu(m,g,b,w,x,c!==la);if(null!==_){var S,T,A,O,E,P,k=this.isBoundingBoxOffScreen(_,e,n),j=$s({x:null!==(S=b.x)&&void 0!==S?S:0,y:null!==(T=b.y)&&void 0!==T?T:0},{x:null!==(A=w.x)&&void 0!==A?A:0,y:null!==(O=w.y)&&void 0!==O?O:0}),C=((null!==(E=b.size)&&void 0!==E?E:gr)+(null!==(P=w.size)&&void 0!==P?P:gr))*devicePixelRatio,D=b.id!==w.id&&C>j;k||D||(!0===m.disabled?o.push(dl(dl({},m),{},{fromNode:b,toNode:w,showLabel:x})):!0===m.selected?i.push(dl(dl({},m),{},{fromNode:b,toNode:w,showLabel:x})):a.push(dl(dl({},m),{},{fromNode:b,toNode:w,showLabel:x})))}}}catch(t){y.e(t)}finally{y.f()}return[].concat(o,a,i)}},{key:"getNodesToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.state.nodes.idToItem,u=pl(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=ll(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(dl({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(dl({},f)):a.push(dl({},f)))}}catch(t){u.e(t)}finally{u.f()}return[].concat(i,a,o)}},{key:"renderNodes",value:function(t,e,n){var r,i=this.imageCache,o=this.animationHandler,a=this.state,s=a.nodes.idToItem,u=a.nodeBorderStyles,l=pl(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;cl(e,dl(dl({},s[c.id]),c),i,o,u,n)}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderRelationships",value:function(t,e,n){var r,i=this.state.relationshipBorderStyles.selected,o=this.arrowBundler,a=this.imageCache,s=pl(t);try{for(s.s();!(r=s.n()).done;){var u=r.value,l=o.getBundle(u),c=u.fromNode,f=u.toNode,h=u.showLabel;Su(e,u,c,f,l,a,h,i,n)}}catch(t){s.e(t)}finally{s.f()}}},{key:"getNodesAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=this.state.nodes,o=i.items,a=i.idToPosition,s=xr(),u=pl(o);try{var l=function(){var i=e.value,o=i.id,u=i.size,l=void 0===u?gr:u,c=a[o],f=c.x,h=c.y,d=Math.sqrt(Math.pow(t.x-f,2)+Math.pow(t.y-h,2));if(d<=(l+n)*s){var p=r.findIndex((function(t){return t.distance>d}));r.splice(-1!==p?p:r.length,0,{data:i,targetCoordinates:{x:f,y:h},pointerCoordinates:t,distanceVector:{x:t.x-f,y:t.y-h},insideNode:d<=l*s,distance:d})}};for(u.s();!(e=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return r}},{key:"getRelsAt",value:function(t){var e,n=[],r=this.state,i=this.arrowBundler,o=this.relationshipThreshold,a=r.zoom,s=r.rels.items,u=r.nodes.idToPosition,l=r.layout,c=a>o,f=pl(s);try{var h=function(){var r=e.value,o=i.getBundle(r),a=u[r.from],s=u[r.to];if(void 0!==a&&void 0!==s&&-1!==o.indexOf(r)){var f=function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(!Ps(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=xu(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=Rs(o,s,u,t),f=Rs(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=vu(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=Rs(s[0],s[2],s[1],t);else for(var l=1;l<s.length;l++){var c=s[l-1],f=s[l],h=Cs(c,f,t);u=h<u?h:u}return u}(t,e,i,n,r,o,a);return s}(t,r,a,s,o,c,l!==la);if(f<10){var h=n.findIndex((function(t){return t.distance>f}));n.splice(-1!==h?h:n.length,0,{data:r,fromTargetCoordinates:a,toTargetCoordinates:s,pointerCoordinates:t,distance:f})}}};for(f.s();!(e=f.n()).done;)h()}catch(t){f.e(t)}finally{f.f()}return n}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(bl),this.state.rels.removeChannel(bl)}},{key:"isBoundingBoxOffScreen",value:function(t,e,n){var r=this.state,i=r.zoom,o=e/i,a=n/i,s=r.panX-o/2,u=r.panY-a/2,l=t.right<s,c=t.bottom<u,f=t.left>s+o,h=t.top>u+a;return l||f||c||h}},{key:"handleChannelUpdate",value:function(t,e,n){for(var r=Object.keys(t.adds),i=0;i<r.length;i++){var o=r[i];t.adds[o].activated&&this.activeNodes.add(o)}for(var a=Object.keys(t.removes),s=0;s<a.length;s++){var u=a[s];this.activeNodes.delete(u)}if(n)for(var l=Object.keys(t.updates),c=0;c<l.length;c++){var f=l[c];e.idToItem[f].activated?this.activeNodes.add(f):this.activeNodes.delete(f)}}},{key:"zoomAndPan",value:function(t,e){var n=e.width,r=e.height,i=this.state,o=i.zoom,a=i.panX,s=i.panY;t.translate(-n/2*o,-r/2*o),t.translate(-a*o,-s*o),t.scale(o,o),t.translate(n/2/o,r/2/o),t.translate(n/2,r/2)}}],n&&yl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),xl=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=function(e,n){if((0,t.isNil)(e)||(0,t.isNil)(n))return{offsetX:0,offsetY:0};var r=n.getBoundingClientRect(),i=window.devicePixelRatio||1;return{offsetX:i*(e.clientX-r.left-.5*r.width),offsetY:i*(e.clientY-r.top-.5*r.height)}}(e,n);return{x:i+a.offsetX/r,y:o+a.offsetY/r}};function _l(t){return _l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_l(t)}function Sl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,El(r.key),r)}}function Al(t,e,n){return e&&Tl(t.prototype,e),n&&Tl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ol(t,e,n){return(e=El(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function El(t){var e=function(t,e){if("object"!=_l(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=_l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_l(e)?e:String(e)}var Pl="WebGLRenderer",kl=function(){function e(t){var n=this;if(Sl(this,e),Ol(this,"mainSceneRenderer",void 0),Ol(this,"minimapRenderer",void 0),Ol(this,"needsRun",void 0),Ol(this,"minimapMouseDown",void 0),Ol(this,"stateDisposers",void 0),Ol(this,"state",void 0),void 0===t.state)throw new Error("Renderer missing options: state - state object");var r=t.state,i=t.mainSceneRenderer,o=t.minimapRenderer,a=r.nodes,s=r.rels;this.mainSceneRenderer=i,this.minimapRenderer=o,this.needsRun=!1,this.minimapMouseDown=!1,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){n.updateMainViewport(r.zoom,r.panX,r.panY)}))),this.stateDisposers.push(r.autorun((function(){n.updateMinimapViewport(r.minimapZoom,r.minimapPanX,r.minimapPanY)}))),this.stateDisposers.push(r.autorun((function(){void 0!==r.nodes.version&&(n.needsRun=!0),void 0!==r.rels.version&&(n.needsRun=!0)}))),a.addChannel(Pl),s.addChannel(Pl),this.state=r,this.setupMinimapInteractions()}return Al(e,[{key:"needsToRun",value:function(){return this.needsRun||Object.keys(this.mainSceneRenderer.activeNodes).length>0}},{key:"renderMainScene",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.mainSceneRenderer.render(t,n,r),this.needsRun=!1}},{key:"renderMinimap",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.minimapRenderer.render(t,n,r),this.minimapRenderer.renderViewbox(),this.needsRun=!1}},{key:"checkForUpdates",value:function(t,e){var n=Object.values(t.channels[Pl].adds).length>0,r=Object.values(e.channels[Pl].adds).length>0,i=Object.values(t.channels[Pl].removes).length>0,o=Object.values(e.channels[Pl].removes).length>0,a=Object.values(t.channels[Pl].updates),s=Object.values(e.channels[Pl].updates);n||r||i||o?(this.mainSceneRenderer.setData({nodes:t.items,rels:e.items}),this.minimapRenderer.setData({nodes:t.items,rels:e.items})):(a.length>0&&(this.mainSceneRenderer.updateNodes(a),this.minimapRenderer.updateNodes(a)),s.length>0&&(this.mainSceneRenderer.updateRelationships(e.items),this.minimapRenderer.updateRelationships(e.items))),t.clearChannel(Pl),e.clearChannel(Pl)}},{key:"onResize",value:function(){var t=this.state,e=t.zoom,n=t.panX,r=t.panY,i=t.minimapZoom,o=t.minimapPanX,a=t.minimapPanY;this.updateMainViewport(e,n,r),this.updateMinimapViewport(i,o,a)}},{key:"updateMainViewport",value:function(t,e,n){this.mainSceneRenderer.updateViewport(t,e,n);var r=this.mainSceneRenderer.canvas.clientWidth,i=this.mainSceneRenderer.canvas.clientHeight;this.minimapRenderer.updateViewportBox(t,e,n,r,i),this.needsRun=!0}},{key:"updateMinimapViewport",value:function(t,e,n){this.minimapRenderer.updateViewport(t,e,n),this.needsRun=!0}},{key:"handleMinimapDrag",value:function(t){var e=this.state,n=this.minimapRenderer,r=xl(t,n.canvas,e.minimapZoom,e.minimapPanX,e.minimapPanY),i=r.x,o=r.y;e.setPan(i,o)}},{key:"handleMinimapWheel",value:function(e){var n=this.state,r=this.mainSceneRenderer;n.setZoom(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,t.isNil)(e)||isNaN(e.deltaY)?n:n-e.deltaY/500*Math.min(1,n)}(e,n.zoom),r.canvas),e.preventDefault()}},{key:"setupMinimapInteractions",value:function(){var t=this,e=this.minimapRenderer.canvas;e.addEventListener("mousedown",(function(e){t.handleMinimapDrag(e),t.minimapMouseDown=!0})),e.addEventListener("mousemove",(function(e){t.minimapMouseDown&&t.handleMinimapDrag(e)})),e.addEventListener("mouseup",(function(){t.minimapMouseDown=!1})),e.addEventListener("mouseleave",(function(){t.minimapMouseDown=!1})),e.addEventListener("wheel",(function(e){t.handleMinimapWheel(e)}))}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Pl),this.state.rels.removeChannel(Pl),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),e}(),jl=function(){function t(){Sl(this,t),Ol(this,"mainSceneRenderer",void 0),Ol(this,"minimapRenderer",void 0),Ol(this,"needsRun",void 0),Ol(this,"minimapMouseDown",void 0),Ol(this,"stateDisposers",void 0),Ol(this,"state",void 0)}return Al(t,[{key:"renderMainScene",value:function(t){}},{key:"renderMinimap",value:function(t){}},{key:"checkForUpdates",value:function(t,e){}},{key:"onResize",value:function(){}},{key:"updateMainViewport",value:function(t,e,n){}},{key:"updateMinimapViewport",value:function(t,e,n){}},{key:"handleMinimapDrag",value:function(t){}},{key:"handleMinimapWheel",value:function(t){}},{key:"setupMinimapInteractions",value:function(){}},{key:"destroy",value:function(){}},{key:"needsToRun",value:function(){return!1}}]),t}();function Cl(t){return Cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cl(t)}function Dl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Rl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Il(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ml(r.key),r)}}function Ll(t,e,n){return(e=Ml(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ml(t){var e=function(t,e){if("object"!=Cl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Cl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cl(e)?e:String(e)}var Nl,Fl=24,Ul=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=Co().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},zl=function(){function e(t,n,r,i){var o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ll(this,"nodeShader",void 0),Ll(this,"nodeAnimShader",void 0),Ll(this,"relShader",void 0),Ll(this,"relDataBuffer",void 0),Ll(this,"viewportBoxShader",void 0),Ll(this,"defaultRelColor",void 0),Ll(this,"defaultNodeColor",void 0),Ll(this,"disableRelColor",void 0),Ll(this,"disableNodeColor",void 0),Ll(this,"gl",void 0),Ll(this,"activeNodes",void 0),Ll(this,"canvas",void 0),Ll(this,"projection",void 0),Ll(this,"idToIndex",void 0),Ll(this,"posBuffer",void 0),Ll(this,"numRels",void 0),Ll(this,"numNodes",void 0),Ll(this,"nodeDataByte",void 0),Ll(this,"relIdToIndex",void 0),Ll(this,"relData",void 0),Ll(this,"viewportBoxBuffer",void 0),Ll(this,"relBuffer",void 0),Ll(this,"nodeBuffer",void 0),Ll(this,"posTexture",void 0),void 0===(null!==(o=t.getExtension("OES_texture_float"))&&void 0!==o?o:void 0))throw new Error("Renderer needs floating point texture support");this.nodeShader=new Pi(t,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp float u_drawDefaultBorder;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}","uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float ringSize = 0.43;\nmediump float ringSize2 = 0.47;\nmediump float shadowSize = 0.51;\nlowp vec3 shadowColor = vec3(0.73);\nlowp vec3 lineColor = vec3(1.0);\n\nlowp float getShadowAlpha(lowp float size, lowp float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nlowp float getCircleAlpha(lowp float ringSize, lowp float nodeSize, lowp float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float nodeSize = 1.0 / varNodeSize;\n lowp float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n lowp float ringAlpha = getCircleAlpha(ringSize, nodeSize, dist);\n lowp vec3 finalColor = color.xyz;\n lowp float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize2, dist);\n lowp float ringAlpha2 = getCircleAlpha(ringSize2, nodeSize, dist);\n\n finalColor = mix(lineColor, finalColor, nodeAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n } else if (hovered > 0.0) {\n if (drawDefaultBorder > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize, dist);\n \n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n lowp float shadowAlpha = getShadowAlpha(circleSize, dist);\n\n finalColor = mix(shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = ringAlpha;\n }\n }\n gl_FragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n"),this.nodeAnimShader=new Pi(t,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_active;\n\nvarying lowp float varNodeSize;\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = a_size * u_zoom * u_glAdjust;\n nodeSize = nodeSize * (0.4 / 0.5); // Remove extra space added for shadow and selection ring\n\n gl_PointSize = a_active > 0.5\n ? nodeSize + 0.88 * nodeSize * u_animPos\n : 0.0;\n\n color = a_color;\n varNodeSize = a_size;\n}","uniform mediump float u_zoom;\nuniform lowp float u_animPos;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float varNodeSize;\nmediump float circleSize = 0.50;\n\nvoid main(void) {\n\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float alpha = 1.0 - smoothstep(circleSize - (1.0 / (varNodeSize * 2.0 * u_zoom * u_glAdjust)), circleSize, dist);\n lowp float pulseAlpha = 0.9 - 0.9 * u_animPos;\n gl_FragColor = vec4(color.xyz, 1.0) * alpha * pulseAlpha;\n }\n}\n"),this.relShader=new Pi(t,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nattribute vec2 a_from;\nattribute vec2 a_to;\nattribute lowp vec4 a_color;\nattribute lowp float a_triside;\nattribute float a_width;\n\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture2D(u_positions, a_from);\n vec4 to = texture2D(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n direction = vec2(-direction.y, direction.x);\n\n float width = a_width * u_glAdjust * 0.5;\n\n if (a_triside == 0.0) {\n from.y += (width / 2.0) * direction.y;\n from.x += (width / 2.0) * direction.x;\n } else {\n from.y -= (width / 2.0) * direction.y;\n from.x -= (width / 2.0) * direction.x;\n }\n\n color = a_color;\n gl_Position = u_projection * vec4(from.xy, 0.0, 1.0);\n}\n","varying lowp vec4 color;\n\nvoid main(void) {\n gl_FragColor = vec4(color.xyz, 1.0) * color.w;\n}\n"),this.viewportBoxShader=new Pi(t,"attribute vec2 coordinates;\nuniform mat4 u_projection;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n}\n","void main(void) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n"),this.setShaderUniforms(i),t.clearColor(0,0,0,0),t.disable(t.DEPTH_TEST),this.defaultRelColor=4284900966,this.defaultNodeColor=4294937415,this.disableRelColor="#EDEDED",this.disableNodeColor="#EDEDED",t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.gl=t,this.activeNodes={},this.canvas=t.canvas,this.projection=wi(),this.setData({nodes:n.items,rels:r.items}),this.createPositionTexture(),this.setupViewportRendering()}var n,r;return n=e,r=[{key:"setShaderUniforms",value:function(t){var e,n,r=Co().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=Co().get.rgb(null===(n=t.nodeBorderStyles.selected)||void 0===n||null===(n=n.rings[1])||void 0===n?void 0:n.color);if(this.nodeShader.use(),null!=r&&r.length){var o=r.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_nodeBorderColor",o),this.nodeShader.setUniform("u_drawDefaultBorder",1)}else this.nodeShader.setUniform("u_drawDefaultBorder",0);var a=i.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_selectedBorderColor",a)}},{key:"setData",value:function(t){var e=Ar(t.rels);this.setupNodeRendering(t.nodes),this.setupRelationshipRendering(e)}},{key:"render",value:function(t,e,n){var r,i=this.gl,o=this.idToIndex,a=Dl(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=o[s.id];this.posBuffer[4*u+0]=s.x,this.posBuffer[4*u+1]=s.y}}catch(t){a.e(t)}finally{a.f()}i.bindTexture(i.TEXTURE_2D,this.posTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,yr,yr,0,i.RGBA,i.FLOAT,this.posBuffer),i.enable(i.BLEND),i.bindFramebuffer(i.FRAMEBUFFER,null),i.clear(i.COLOR_BUFFER_BIT),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),this.renderAnimations(this.posTexture),this.numRels>0&&(this.relShader.use(),this.relShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.relBuffer),this.relShader.setAttributePointerByteNorm("a_color",4,0,16),this.relShader.setAttributePointerByteNorm("a_from",2,4,16),this.relShader.setAttributePointerByteNorm("a_to",2,6,16),this.relShader.setAttributePointerByteNorm("a_triside",1,8,16),this.relShader.setAttributePointerFloat("a_width",1,12,16),i.drawArrays(i.TRIANGLES,0,6*this.numRels)),this.numNodes>0&&(this.nodeShader.use(),this.nodeShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.nodeBuffer),this.nodeShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeShader.setAttributePointerByteNorm("a_selected",1,4,12),this.nodeShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeShader.setAttributePointerByte("a_size",4,8,12),this.nodeShader.setAttributePointerByteNorm("a_hovered",1,9,12),i.drawArrays(i.POINTS,0,this.numNodes))}},{key:"renderViewbox",value:function(){var t=this.gl,e=this.projection,n=this.viewportBoxBuffer;this.viewportBoxShader.use(),this.viewportBoxShader.setUniform("u_projection",e),t.bindBuffer(t.ARRAY_BUFFER,n),this.viewportBoxShader.setAttributePointerFloat("coordinates",2,0,0),t.drawArrays(t.LINES,0,8)}},{key:"updateNodes",value:function(e){var n,r=this.gl,i=this.idToIndex,o=this.disableNodeColor,a=this.nodeBuffer,s=this.nodeDataByte,u=!1,l=Dl(e);try{for(l.s();!(n=l.n()).done;){var c=n.value,f=i[c.id];if(!(0,t.isNil)(c.color)||!0===c.disabled){var h=Co().get.rgb(!0===c.disabled?o:c.color);this.nodeDataByte[3*f*4+0]=h[0],this.nodeDataByte[3*f*4+1]=h[1],this.nodeDataByte[3*f*4+2]=h[2],this.nodeDataByte[3*f*4+3]=255*h[3],u=!0}if(void 0!==c.selected){var d=c.selected;this.nodeDataByte[3*f*4+4]=d?255:0,u=!0}if(void 0!==c.activated&&(this.nodeDataByte[3*f*4+7]=c.activated?255:0,u=!0,c.activated?this.activeNodes[c.id]=!0:delete this.activeNodes[c.id]),void 0!==c.hovered){var p=!0!==c.disabled&&c.hovered;this.nodeDataByte[3*f*4+9]=p?255:0,u=!0}if(void 0!==c.size){var v=c.size;this.nodeDataByte[3*f*4+8]=v||gr,u=!0}}}catch(t){l.e(t)}finally{l.f()}u&&(r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,s,r.DYNAMIC_DRAW))}},{key:"updateRelationships",value:function(t){var e,n=Ar(t),r=this.gl,i=!1,o=Dl(n);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=a.key,u=a.width,l=a.color,c=a.disabled,f=this.relIdToIndex[s],h=void 0===l?this.defaultRelColor:Ul(!0===c?this.disableRelColor:l);this.relData.positionsAndColors[f*Fl+0]=h,this.relData.positionsAndColors[f*Fl+4]=h,this.relData.positionsAndColors[f*Fl+8]=h,this.relData.positionsAndColors[f*Fl+12]=h,this.relData.positionsAndColors[f*Fl+16]=h,this.relData.positionsAndColors[f*Fl+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*Fl+3]=u,this.relData.widths[f*Fl+7]=u,this.relData.widths[f*Fl+11]=u,this.relData.widths[f*Fl+15]=u,this.relData.widths[f*Fl+19]=u,this.relData.widths[f*Fl+23]=u,i=!0)}}catch(t){o.e(t)}finally{o.f()}i&&(r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,this.relDataBuffer,r.DYNAMIC_DRAW))}},{key:"createPositionTexture",value:function(){var t=this.gl,e=t.createTexture(),n=new Float32Array(262144);t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,yr,yr,0,t.RGBA,t.FLOAT,n),this.posTexture=e,this.posBuffer=n}},{key:"updateViewportBox",value:function(t,e,n,r,i){var o=this.gl,a=xr(),s=r*a,u=i*a,l=(.5*s+e*t)/t,c=(.5*u+n*t)/t,f=(.5*-s+e*t)/t,h=(.5*-u+n*t)/t,d=[l,c,f,c,f,c,f,h,f,h,l,h,l,h,l,c];o.bindBuffer(o.ARRAY_BUFFER,this.viewportBoxBuffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array(d),o.DYNAMIC_DRAW)}},{key:"updateViewport",value:function(t,e,n){var r=this.gl,i=1/t,o=e-r.drawingBufferWidth*i*.5,a=n-r.drawingBufferHeight*i*.5,s=r.drawingBufferWidth*i,u=r.drawingBufferHeight*i,l=wi(),c=2.6315789473684212*xr();xi(l,o,o+s,a+u,a,0,1e6),this.nodeShader.use(),this.nodeShader.setUniform("u_zoom",t),this.nodeShader.setUniform("u_glAdjust",c),this.nodeShader.setUniform("u_projection",l),this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_zoom",t),this.nodeAnimShader.setUniform("u_glAdjust",c),this.nodeAnimShader.setUniform("u_projection",l),this.relShader.use(),this.relShader.setUniform("u_glAdjust",c),this.relShader.setUniform("u_projection",l),this.projection=l}},{key:"setupViewportRendering",value:function(){this.viewportBoxBuffer=this.gl.createBuffer()}},{key:"setupNodeRendering",value:function(e){var n=this.gl,r=new ArrayBuffer(8),i=new Uint32Array(r),o=new Uint8Array(r);void 0===this.nodeBuffer&&(this.nodeBuffer=n.createBuffer()),this.numNodes=e.length;var a=new ArrayBuffer(3*e.length*8),s=new Uint32Array(a),u={};this.activeNodes={};for(var l=0;l<e.length;l++){var c=e[l],f=c.selected,h=c.hovered,d=c.color,p=c.activated,v=c.size,y=c.id,m=c.disabled,g=(0,t.isNil)(d)?this.defaultNodeColor:Ul(d);s[3*l+0]=!0===m?Ul(this.disableNodeColor):g,o[0]=!0===f?255:0,o[1]=l%yr,o[2]=Math.floor(l/yr),o[3]=!0===p?255:0,o[4]=!1===m&&!0===h?255:0,!0===p&&(this.activeNodes[y]=!0),s[3*l+1]=i[0],s[3*l+2]=null!=v?v:gr,s[3*l+3]=i[1],u[y]=l}n.bindBuffer(n.ARRAY_BUFFER,this.nodeBuffer),n.bufferData(n.ARRAY_BUFFER,s,n.DYNAMIC_DRAW),this.numNodes=e.length,this.nodeDataByte=new Uint8Array(a),this.idToIndex=u}},{key:"setupRelationshipRendering",value:function(e){var n=this,r=this.gl,i=new ArrayBuffer(4),o=new Uint32Array(i),a=new Uint8Array(i),s={};void 0===this.relBuffer&&(this.relBuffer=r.createBuffer());for(var u=new ArrayBuffer(e.length*Fl*4),l=new Uint32Array(u),c=new Float32Array(u),f=function(r){var i=e[r],u=i.from,f=i.to,h=i.color,d=i.width,p=i.key,v=i.disabled,y=n.idToIndex[u],m=n.idToIndex[f],g=y%yr,b=Math.floor(y/yr),w=m%yr,x=Math.floor(m/yr),_=[g,b,w,x],S=[w,x,g,b],T=(0,t.isNil)(h)?n.defaultRelColor:Ul(h),A=!0===v?Ul(n.disableRelColor):T,O=null!=d?d:1;s[p]=r;var E=0,P=function(t,e,n,i){l[r*Fl+E]=t,E+=1;for(var s=0;s<e.length;s++)a[s]=e[s];l[r*Fl+E]=o[0],E+=1,a[0]=n,l[r*Fl+E]=o[0],c[r*Fl+(E+=1)]=i,E+=1};P(A,_,255,O),P(A,S,0,O),P(A,_,0,O),P(A,S,0,O),P(A,_,0,O),P(A,S,255,O)},h=0;h<e.length;h++)f(h);r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,u,r.DYNAMIC_DRAW),this.numRels=e.length,this.relDataBuffer=u,this.relData={positionsAndColors:l,widths:c},this.relIdToIndex=s}},{key:"renderAnimations",value:function(t){var e=this.gl,n=this.nodeBuffer,r=this.numNodes,i=Date.now()%1e3/1e3,o=i<.7?i/.7:0;this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_positions",t),this.nodeAnimShader.setUniform("u_animPos",o),e.bindBuffer(e.ARRAY_BUFFER,n),this.nodeAnimShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeAnimShader.setAttributePointerByteNorm("a_active",1,7,12),this.nodeAnimShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeAnimShader.setAttributePointerByte("a_size",4,8,12),e.drawArrays(e.POINTS,0,r)}},{key:"destroy",value:function(){this.gl.deleteBuffer(this.nodeBuffer),this.gl.deleteBuffer(this.relBuffer),this.nodeShader.remove(),this.nodeAnimShader.remove(),this.relShader.remove()}}],r&&Il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(),Bl=function(t,e,n){var r=xr();t.width=e*r,t.height=n*r,t.style.width="".concat(e,"px"),t.style.height="".concat(n,"px")},Vl=function(t){Vr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==Nl&&Nl(t)},Gl=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;Bl(t,n,r)},Wl=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),Bl(n,t,e),n},Xl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,wr),void 0!==t&&(t.appendChild(n),Gl(n)),function(t,e){Nl=e,t.addEventListener("webglcontextlost",Vl)}(n,e),n},Hl=function(t){t.width=0,t.height=0,t.remove()},Yl=function(t){return t.getContext("2d")},$l=function(t){var e={antialias:!0},n=t.getContext("webgl",e);return null===n&&(n=t.getContext("experimental-webgl",e)),function(t){return t instanceof WebGLRenderingContext}(n)?n:null},ql=function(t){t.canvas.removeEventListener("webglcontextlost",Vl);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function Zl(t){return function(t){if(Array.isArray(t))return Ql(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Jl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Jl(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Jl(t,e){if(t){if("string"==typeof t)return Ql(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ql(t,e):void 0}}function Ql(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tc=gr*xr();function ec(t){return ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(t)}function nc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rc(r.key),r)}}function rc(t){var e=function(t,e){if("object"!=ec(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ec(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ec(e)?e:String(e)}var ic=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=rc(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks={}}var e,n;return e=t,n=[{key:"register",value:function(t,e){this.isCallbackRegistered(t)||(this.callbacks[t]=[]),this.callbacks[t].push(e)}},{key:"isCallbackRegistered",value:function(t){return void 0!==this.callbacks[t]}},{key:"callIfRegistered",value:function(){var t,e=arguments,n=Array.prototype.slice.call(arguments)[0];t=n,s.includes(t)&&this.isCallbackRegistered(n)&&this.callbacks[n].slice(0).forEach((function(t){return t.apply(null,Array.prototype.slice.call(e,1))}))}}],n&&nc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),oc=i(481),ac=i.n(oc);function sc(t){return sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(t)}function uc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cc(r.key),r)}}function lc(t,e,n){return(e=cc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cc(t){var e=function(t,e){if("object"!=sc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=sc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sc(e)?e:String(e)}var fc=5e-5,hc=function(){function t(e){var n,r=this,i=e.state,o=e.getNodePositions,a=e.canvas,s=e.defaultZoomLevel;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),lc(this,"xCtrl",void 0),lc(this,"yCtrl",void 0),lc(this,"zoomCtrl",void 0),lc(this,"getNodePositions",void 0),lc(this,"firstUpdate",void 0),lc(this,"state",void 0),lc(this,"canvas",void 0),lc(this,"defaultZoomLevel",void 0),lc(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(ac())(.35,fc,.05,1),this.yCtrl=new(ac())(.35,fc,.05,1),this.zoomCtrl=new(ac())(.3,1e-5,.01,1),this.defaultZoomLevel=s,this.stateDisposers=[],this.stateDisposers.push(i.autorun((function(){null===i.fitNodeIds&&(r.xCtrl.reset(),r.yCtrl.reset(),r.zoomCtrl.reset())}))),this.stateDisposers.push(i.autorun((function(){n!==i.fitNodeIds&&(n=i.fitNodeIds,r.firstUpdate=!0)}))),this.stateDisposers.push(i.autorun((function(){i.resetZoom&&(r.firstUpdate=!0)})))}var e,n;return e=t,n=[{key:"needsToRun",value:function(){var t=this.state,e=t.fitNodeIds,n=t.resetZoom;return e.length>0||n}},{key:"update",value:function(t){var e=this.state,n=e.fitNodeIds,r=e.resetZoom;n.length>0?this.fitNodes(n,t):r&&this.reset(t)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){return t()}))}},{key:"recalculateTarget",value:function(t,e,n,r){for(var i=this.xCtrl,o=this.yCtrl,a=this.zoomCtrl,s=this.state,u=this.defaultZoomLevel,l=[],c=0;c<t.length;c++)l.push({id:t[c]});var f=s.zoom,h=s.panX,d=s.panY,p=s.maxNodeRadius,v=s.nodes,y=this.getNodePositions(l);v.updatePositions(y);var m=Lo(y,p),g=m.centerX,b=m.centerY,w=m.nodesWidth,x=m.nodesHeight;if(isNaN(g)||isNaN(b))return Vr.info("fit() function couldn't calculate center point, not updating viewport"),!1;i.setTarget(!0===e.noPan?h:g),o.setTarget(!0===e.noPan?d:b);var _=Mo(w,x,n,r),S=_.zoomX,T=_.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var A=No(S,T,e.minZoom,e.maxZoom);!0===e.outOnly&&f<A?a.setTarget(f):a.setTarget(A)}return!0}},{key:"allNodesAreVisible",value:function(t,e,n){var r=Mo(e,n,this.canvas.width,this.canvas.height),i=r.zoomX,o=r.zoomY;return t<i&&t<o}},{key:"reset",value:function(t){var e=this.state,n=e.zoom,r=e.panX,i=e.panY,o=e.nodes,a=e.maxNodeRadius,s=e.defaultZoomLevel;if(this.firstUpdate||t){this.zoomCtrl.setTarget(s);var u=Lo(Object.values(o.idToPosition),a),l=u.centerX,c=u.centerY,f=u.nodesWidth,h=u.nodesHeight;this.allNodesAreVisible(n,f,h)?(this.xCtrl.setTarget(l),this.yCtrl.setTarget(c)):(this.xCtrl.setTarget(r),this.yCtrl.setTarget(i)),this.firstUpdate=!1}var d=n+this.zoomCtrl.update(n),p=r+this.xCtrl.update(r),v=i+this.yCtrl.update(i);this.state.updateZoomToFit(d,p,v,this.canvas),Math.abs(this.zoomCtrl.target-d)<.01&&(this.state.updateZoomToFit(s,p,v,this.canvas),this.state.clearReset())}},{key:"fitNodes",value:function(t,e){var n=this.state,r=n.zoomOptions,i=void 0===r?{}:r,o=n.zoom,a=n.panX,s=n.panY,u=!0;if(this.firstUpdate||e){var l=this.canvas,c=l.width,f=l.height;u=this.recalculateTarget(t,i,c,f),this.firstUpdate=!1}if(u){var h=a+this.xCtrl.update(a),d=s+this.yCtrl.update(s),p=o+this.zoomCtrl.update(o);this.state.updateZoomToFit(p,h,d,this.canvas);var v=Math.max(5,10/this.zoomCtrl.target),y=Math.min(.01,.01*this.zoomCtrl.target);!e&&Math.abs(this.zoomCtrl.target-p)<y&&Math.abs(this.xCtrl.target-h)<v&&Math.abs(this.yCtrl.target-d)<v&&(this.state.setZoom(this.zoomCtrl.target,this.canvas),this.state.clearFit())}}}],n&&uc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function dc(t){return dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(t)}function pc(){pc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(C([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==dc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(dc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function vc(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function yc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mc(Object(n),!0).forEach((function(e){wc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xc(r.key),r)}}function wc(t,e,n){return(e=xc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xc(t){var e=function(t,e){if("object"!=dc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=dc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dc(e)?e:String(e)}var _c="NvlController",Sc={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},Tc="onError",Ac="onLayoutDone",Oc={},Ec=function(){var t;return null!==(t=Oc[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Oc).pop()},Pc=function(){function t(e,n){var r,i,o,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),wc(this,"destroyed",void 0),wc(this,"state",void 0),wc(this,"callbacks",void 0),wc(this,"instanceId",void 0),wc(this,"glController",void 0),wc(this,"webGLContext",void 0),wc(this,"webGLMinimapContext",void 0),wc(this,"htmlOverlay",void 0),wc(this,"hasResized",void 0),wc(this,"hierarchicalLayout",void 0),wc(this,"gridLayout",void 0),wc(this,"freeLayout",void 0),wc(this,"d3ForceLayout",void 0),wc(this,"forceLayout",void 0),wc(this,"canvasRenderer",void 0),wc(this,"glCanvas",void 0),wc(this,"canvasRect",void 0),wc(this,"glMinimapCanvas",void 0),wc(this,"c2dCanvas",void 0),wc(this,"isInRenderSwitchAnimation",void 0),wc(this,"justSwitchedRenderer",void 0),wc(this,"justSwitchedLayout",void 0),wc(this,"layoutUpdating",void 0),wc(this,"layoutComputing",void 0),wc(this,"isRenderingDisabled",void 0),wc(this,"setRenderSwitchAnimation",void 0),wc(this,"stateDisposers",void 0),wc(this,"zoomTransitionHandler",void 0),wc(this,"currentLayout",void 0),wc(this,"layoutTimeLimit",void 0),wc(this,"pixelRatio",void 0),wc(this,"removeResizeListener",void 0),wc(this,"removeMinimapResizeListener",void 0),wc(this,"pendingZoomOperation",void 0),wc(this,"layoutRunner",void 0),wc(this,"animationRequestId",void 0),wc(this,"layoutDoneCallback",void 0),wc(this,"layoutComputingCallback",void 0),wc(this,"currentLayoutType",void 0),this.destroyed=!1;var s=n.frame,u=n.minimapContainer,l=void 0===u?document.createElement("span"):u,c=n.layoutOptions,f=n.layout,h=n.instanceId,d=void 0===h?"default":h,p=e.nodes,v=e.rels,y=e.webGLVisible,m=e.disableWebGL;this.state=e,this.callbacks=new ic,this.instanceId=d;var g=s;g.setAttribute("instanceId",d),g.setAttribute("data-testid","nvl-parent"),null!==(r=g.style.height)&&void 0!==r&&r.length||Object.assign(g.style,{height:"100%"}),null!==(i=g.style.outline)&&void 0!==i&&i.length||Object.assign(g.style,{outline:"none"});var b=Xl(g,this.onWebGLContextLost.bind(this)),w=Xl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new jl;else{var x=$l(b),_=$l(w);this.glController=new kl({mainSceneRenderer:new zl(x,p,v,this.state),minimapRenderer:new zl(_,p,v,this.state),state:e}),this.webGLContext=x,this.webGLMinimapContext=_}var S=Xl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),A=document.createElement("div");Object.assign(A.style,gc(gc({},wr),{},{overflow:"hidden"})),g.appendChild(A),this.htmlOverlay=A,this.hasResized=!0,this.hierarchicalLayout=new Ua(gc(gc({},c),{},{state:this.state})),this.gridLayout=new ko({state:this.state}),this.freeLayout=new wo({state:this.state}),this.d3ForceLayout=new zr({state:this.state}),this.forceLayout=m?this.d3ForceLayout:new lo(gc(gc({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var O=new wl(S,T,e,n);this.canvasRenderer=O,this.glCanvas=b,this.canvasRect=b.getBoundingClientRect(),this.glMinimapCanvas=w,this.c2dCanvas=S,this.glCanvas.style.opacity=y?"1":"0",this.c2dCanvas.style.opacity=y?"0":"1",this.isInRenderSwitchAnimation=!1,this.justSwitchedRenderer=!1,this.justSwitchedLayout=!1,this.hasResized=!1,this.layoutUpdating=!1,this.layoutComputing=!1,this.isRenderingDisabled=!1,p.addChannel(_c),v.addChannel(_c),this.setRenderSwitchAnimation=function(){a.isInRenderSwitchAnimation=!1},this.stateDisposers=[],this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("zoom",e.zoom)}))),this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("pan",{panX:e.panX,panY:e.panY})}))),this.stateDisposers.push(e.autorun((function(){a.setLayout(e.layout)}))),this.stateDisposers.push(e.autorun((function(){a.setLayoutOptions(e.layoutOptions)}))),this.stateDisposers.push(e.autorun((function(){var t=e.webGLVisible?"1":"0";t!==a.glCanvas.style.opacity&&(a.justSwitchedRenderer=!0,a.glCanvas.style.opacity=t,a.c2dCanvas.style.opacity=e.webGLVisible?"0":"1")}))),this.startMainLoop(),this.zoomTransitionHandler=new hc({state:e,getNodePositions:function(t){return a.currentLayout.getNodePositions(t)},canvas:b,defaultZoomLevel:aa}),this.layoutTimeLimit=null!==(o=n.layoutTimeLimit)&&void 0!==o?o:16,this.pixelRatio=xr(),this.removeResizeListener=On()(g,(function(){Gl(b),Gl(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=On()(l,(function(){Gl(w)})),Oc[d]=this,window.__Nvl_dumpNodes=function(t){var e;return null===(e=Ec(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Ec(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Ec(e))||void 0===n?void 0:n.on(Ac,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Ec(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Ec(t))||void 0===e?void 0:e.getScale()},this.pendingZoomOperation=null}var e,n,r,i;return e=t,n=[{key:"onWebGLContextLost",value:function(t){this.callIfRegistered("onWebGLContextLost",t)}},{key:"updateMinimapZoom",value:function(){var t=this.state,e=t.nodes,n=t.maxNodeRadius,r=t.maxMinimapZoom,i=t.minMinimapZoom,o=Lo(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=Mo(u,l,this.glMinimapCanvas.width,this.glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=No(f,h,i,r);this.state.updateMinimapZoomToFit(d,a,s)}},{key:"startMainLoop",value:function(){var t=this,e=this.state,n=e.nodes,r=e.rels;this.currentLayout.update();var i=this.currentLayout.getNodePositions(n.items);n.updatePositions(i),this.isRenderingDisabled||(this.glController.renderMainScene(i),this.glController.renderMinimap(i),this.canvasRenderer.processUpdates(),this.canvasRenderer.render(i)),this.layoutRunner=setInterval((function(){try{!function(){var e=t.currentLayout.getShouldUpdate(),n=e||t.justSwitchedLayout,r=n&&!t.layoutUpdating&&!t.justSwitchedLayout;if(n)for(var i=window.performance.now(),o=r?0:50,a=0;a<o;a++){t.currentLayout.update(t.justSwitchedLayout),t.justSwitchedLayout=!1;var s=window.performance.now();if(!e||s-i>t.layoutTimeLimit)break}}()}catch(e){if(!t.callbacks.isCallbackRegistered(Tc))throw e;t.callIfRegistered(Tc,e)}}),13),this.animationRequestId=window.requestAnimationFrame((function e(){try{!function(e){if(t.destroyed)Vr.info("STEP IN A DESTROYED STRIP");else{var i=xr();if(i!==t.pixelRatio)return t.pixelRatio=i,void t.callIfRegistered("restart");var o=t.currentLayout.getShouldUpdate(),a=o||t.justSwitchedLayout,s=t.currentLayout.getComputing(),u=t.zoomTransitionHandler.needsToRun(),l=a&&!t.layoutUpdating&&!t.justSwitchedLayout,c=t.layoutComputing&&!s,f=t.state.webGLVisible&&t.glController.needsToRun(),h=!t.state.webGLVisible&&t.canvasRenderer.needsToRun(),d=t.isInRenderSwitchAnimation||t.justSwitchedRenderer,p=t.hasResized,v=null!==t.pendingZoomOperation,y=t.glController.minimapMouseDown;if(n.clearChannel(_c),r.clearChannel(_c),u||a||c||d||f||h||y||p||v){!t.pendingZoomOperation||l||t.currentLayout.getComputing()||(t.pendingZoomOperation(),t.pendingZoomOperation=null),t.zoomTransitionHandler.update(o||s||c),p&&t.glController.onResize();var m=t.currentLayout.getNodePositions(n.items);if(n.updatePositions(m),t.callIfRegistered("onLayoutStep",t.dumpNodes()),t.updateMinimapZoom(),t.glController.renderMinimap(m),!t.isRenderingDisabled){if((t.state.webGLVisible||d)&&t.glController.renderMainScene(m),!t.state.webGLVisible||d){t.canvasRenderer.processUpdates(),t.canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b=r.items[g].id,w=t.canvasRenderer.arrowBundler.getBundle(r.items[g]),x=r.idToHtmlOverlay[b],_=w.labelInfo[b];if(x&&_){var S=_.rotation,T=_.position,A=_.width,O=_.height,E=t.mapCanvasSpaceToRelativePosition(T.x,T.y),P=E.x,k=E.y,j=A>5&&!t.state.webGLVisible;Object.assign(x.style,{top:"".concat(k,"px"),left:"".concat(P,"px"),width:"".concat(A,"px"),height:"".concat(O,"px"),display:j?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),") rotate(").concat(S,"rad")})}}}for(var C=0;C<n.items.length;C++){var D=n.items[C],R=D.id,I=D.size,L=n.idToHtmlOverlay[R];if(L){var M=t.state.nodes.idToPosition[R],N=t.mapCanvasSpaceToRelativePosition(M.x,M.y),F=N.x,U=N.y,z="".concat(2*(null!=I?I:gr),"px");Object.assign(L.style,{top:"".concat(U,"px"),left:"".concat(F,"px"),width:z,height:z,transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),")")})}}}}var B=!a&&t.layoutUpdating,V=s!==t.layoutComputing;t.layoutComputing=s,t.layoutUpdating=a,B&&t.callIfRegistered(Ac),V&&t.callIfRegistered("onLayoutComputing",s),t.justSwitchedRenderer=!1,t.hasResized=!1,void 0!==e&&e()}}((function(){t.animationRequestId=window.requestAnimationFrame(e)}))}catch(e){if(!t.callbacks.isCallbackRegistered(Tc))throw e;t.callIfRegistered(Tc,e)}}))}},{key:"updateHtmlOverlay",value:function(){this.state.nodes.updateHtmlOverlay(this.htmlOverlay),this.state.rels.updateHtmlOverlay(this.htmlOverlay)}},{key:"dumpNodes",value:function(){var t,e=this.state.nodes.items,n=this.state.nodes.idToPosition,r=[],i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return yc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id],s=this.mapCanvasSpaceToRelativePosition(a.x,a.y);r.push(gc(gc({},o),{},{x:s.x,y:s.y}))}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"dumpRelationships",value:function(){return bn(this.state.rels.items)}},{key:"mapCanvasSpaceToRelativePosition",value:function(t,e){var n=this.canvasRect,r=window.devicePixelRatio||1,i=(t-this.state.panX)*this.state.zoom/r,o=(e-this.state.panY)*this.state.zoom/r;return{x:i+.5*n.width,y:o+.5*n.height}}},{key:"mapRelativePositionToCanvasSpace",value:function(t,e){var n=this.glCanvas.getBoundingClientRect(),r=window.devicePixelRatio||1,i=r*(t-.5*n.width),o=r*(e-.5*n.height);return{x:this.state.panX+i/this.state.zoom,y:this.state.panY+o/this.state.zoom}}},{key:"getNodePositions",value:function(){return Object.values(bn(this.state.nodes.idToPosition))}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state.nodes.updatePositions(t),this.currentLayout.updateNodes(t),e||this.currentLayout.terminateUpdate(),this.hasResized=!0,0===this.getNodesOnScreen().nodes.length&&this.state.setPan(0,0),this.state.clearFit()}},{key:"isLayoutMoving",value:function(){return this.layoutUpdating}},{key:"getNodesOnScreen",value:function(){var t=this.glCanvas.getBoundingClientRect(),e=this.mapRelativePositionToCanvasSpace(0,0),n=e.x,r=e.y,i=this.mapRelativePositionToCanvasSpace(t.width,t.height);return function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:["node"],a=i.nodes,s=i.rels,u=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),h=[],d=[];if(o.includes("node"))for(var p=0,v=Object.values(a.idToPosition);p<v.length;p++){var y=v[p],m=y.x,g=y.y;void 0!==m&&void 0!==g&&m>u&&m<l&&g>c&&g<f&&h.push(y)}if(o.includes("relationship")){var b,w=Kl(s.items);try{for(w.s();!(b=w.n()).done;){var x=b.value,_=x.from,S=x.to,T=a.idToPosition[_],A=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==A.x&&void 0!==A.y){var O=T.x>u&&T.x<l&&T.y>c&&T.y<f,E=A.x>u&&A.x<l&&A.y>c&&A.y<f;O&&E&&d.push(x)}}}catch(t){w.e(t)}finally{w.f()}}return{nodes:h,rels:d}}(n,r,i.x,i.y,this.state,["node"])}},{key:"registerDoneCallback",value:function(t){this.layoutDoneCallback=t}},{key:"registerComputingCallback",value:function(t){this.layoutComputingCallback=t}},{key:"getPosition",value:function(t){return this.currentLayout.getNodePositions([{id:t}])[0]}},{key:"getScale",value:function(){return this.state.zoom}},{key:"getPan",value:function(){return{x:this.state.panX,y:this.state.panY}}},{key:"setZoomLevel",value:function(t){var e=this;this.pendingZoomOperation=function(){return e.state.setZoom(t,e.glCanvas)}}},{key:"setPanCoordinates",value:function(t,e){this.state.setPan(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){var r=this;this.pendingZoomOperation=function(){return r.state.setZoomPan(t,e,n,r.glCanvas)}}},{key:"fit",value:function(t,e){var n=this;this.pendingZoomOperation=function(){return n.state.fitNodes(t,e)}}},{key:"resetZoom",value:function(){var t=this;this.pendingZoomOperation=function(){return t.state.setZoomReset()}}},{key:"setRenderer",value:function(t){this.state.setRenderer(t)}},{key:"on",value:function(t,e){this.callbacks.register(t,e)}},{key:"isDestroyed",value:function(){return this.destroyed}},{key:"destroy",value:function(){var t;this.destroyed||(this.animationRequestId&&window.cancelAnimationFrame(this.animationRequestId),void 0!==this.layoutRunner&&window.clearInterval(this.layoutRunner),this.glController.destroy(),this.glCanvas.removeEventListener("transitionend",this.setRenderSwitchAnimation),void 0!==this.webGLContext&&ql(this.webGLContext),void 0!==this.webGLMinimapContext&&ql(this.webGLMinimapContext),Hl(this.glCanvas),Hl(this.glMinimapCanvas),this.canvasRenderer.destroy(),Hl(this.c2dCanvas),this.removeResizeListener(),this.removeMinimapResizeListener(),this.forceLayout.destroy(),this.hierarchicalLayout.destroy(),this.gridLayout.destroy(),this.freeLayout.destroy(),this.htmlOverlay.remove(),this.zoomTransitionHandler.destroy(),this.stateDisposers.forEach((function(t){t()})),t=this.instanceId,delete Oc[t],this.destroyed=!0)}},{key:"callIfRegistered",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks.callIfRegistered.apply(this.callbacks,arguments)}},{key:"getCanvasRelsAt",value:function(t){return this.canvasRenderer.getRelsAt(t)}},{key:"getCanvasNodesAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.canvasRenderer.getNodesAt(t,e)}},{key:"getLayout",value:function(t){return t===la?this.hierarchicalLayout:t===ua?this.forceLayout:t===ca?this.gridLayout:t===fa?this.freeLayout:t===ha?this.d3ForceLayout:this.forceLayout}},{key:"setLayout",value:function(t){Vr.info("Switching to layout: ".concat(t));var e=this.currentLayoutType,n=this.getLayout(t);"free"===t&&n.setNodePositions(this.state.nodes.idToPosition),this.currentLayout=n,this.currentLayoutType=t,e&&e!==this.currentLayoutType&&(this.justSwitchedLayout=!0)}},{key:"setLayoutOptions",value:function(t){this.getLayout(this.state.layout).setOptions(t)}},{key:"createDownloadLink",value:function(t,e){var n=document.createElement("a");n.style.display="none",n.setAttribute("download",t);var r=e.toDataURL("image/png").replace(/^data:image\/png/,"data:application/octet-stream");return n.setAttribute("href",r),n}},{key:"saveToFile",value:function(t){var e=gc(gc({},Sc),t),n=e.filename,r=e.backgroundColor,i=this.state.nodes.items;this.currentLayout.update(this.justSwitchedLayout),this.justSwitchedLayout=!1;var o=this.currentLayout.getNodePositions(i);this.state.nodes.updatePositions(o);var a=Wl(this.c2dCanvas.width,this.c2dCanvas.height),s=Yl(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),Hl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=gc(gc({},Sc),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Lo(a,100),u=s.nodesWidth,l=s.nodesHeight,c=s.centerX,f=s.centerY,h=Math.max(Math.min(u+100,15e3),5e3),d=Math.max(Math.min(l+100,15e3),5e3);return this.isRenderingDisabled=!0,new Promise((function(t,n){try{e.setPanCoordinates(c,f);var r=Math.max(h/u-.02,e.state.minZoom),s=Math.max(d/l-.02,e.state.minZoom);e.setZoomLevel(Math.min(r,s))}catch(t){return Vr.error("An error occurred while downloading the file"),void n(t)}setTimeout((function(){try{e.currentLayout.update(e.justSwitchedLayout),e.justSwitchedLayout=!1,e.state.nodes.updatePositions(a);var r=Wl(h,d),s=Yl(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),Hl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=pc().mark((function t(e){var n,r,i,o;return pc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=gc(gc({},Sc),e),r=this.state.zoom,i=this.state.panX,o=this.state.panY,t.prev=4,t.next=7,this.prepareLargeFileForDownload(n);case 7:t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(4),Vr.error("An error occurred while downloading the image"),!this.callbacks.isCallbackRegistered(Tc)){t.next=16;break}this.callIfRegistered(Tc,t.t0),t.next=17;break;case 16:throw t.t0;case 17:return t.prev=17,this.isRenderingDisabled=!1,this.setZoomLevel(r),this.setPanCoordinates(i,o),t.finish(17);case 22:case"end":return t.stop()}}),t,this,[[4,9,17,22]])})),i=function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function a(t){vc(o,n,i,a,s,"next",t)}function s(t){vc(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&bc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function kc(t){return kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(t)}function jc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rc(r.key),r)}}function Dc(t,e,n){return e&&Cc(t.prototype,e),n&&Cc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rc(t){var e=function(t,e){if("object"!=kc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=kc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kc(e)?e:String(e)}var Ic=function(){function t(e,n){if(jc(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Dc(t,[{key:"addChild",value:function(t){this.children.push(t)}},{key:"isRoot",value:function(){return null===this.parent}},{key:"print",value:function(){var t=this.data.name;this.isRoot()||(t=t+"\t\t"+function(t){for(var e=(Math.round(1e3*t)/1e3).toFixed(3);e.length<6;)e=" "+e;return e}(this.data._timeSpent())+" ms",this.parent.isRoot()||(t=t+"\t"+this._percentageOfParentSpent()+"%"));var e=this.noOfChildren()>0;for(var n in e?(t=t+"\t Children: "+this.noOfChildren(),console.groupCollapsed(t)):console.log(t),this.children)this.children[n].print();e&&console.groupEnd()}},{key:"noOfChildren",value:function(){return this.children.length}},{key:"_percentageOfParentSpent",value:function(){return Math.round(this.data._timeSpent()/this.parent.data._timeSpent()*100)}}]),t}(),Lc=function(){function t(e){jc(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Dc(t,[{key:"close",value:function(){this.endTime=performance.now()}},{key:"_timeSpent",value:function(){if(null===this.startTime||null===this.endTime)throw new Error("You have an error in your performance measurements that makes the whole tree unreliable. You probably forgot to call performanceTestEnd on "+this.name);return this.endTime-this.startTime}}]),t}(),Mc=function(){function t(){jc(this,t),this.root=new Ic(new Lc("Performance Tree"),null),this.current=this.root}return Dc(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Ic(t,this.current);this.current.addChild(e),this.current=e}else{if(this.root)throw new Error("Performance tree is screwed up");this.root=new Ic(t,null),this.current=this.root}}},{key:"close",value:function(){if(this.current.isRoot())throw new Error("Tried to close performance tree root. You probably have one too many Performance.endTest() in your code.");this.current.data.close(),this.current=this.current.parent}},{key:"getCurrentData",value:function(){return this.current.data}},{key:"print",value:function(){this.root.noOfChildren()>0&&this.root.print()}}]),t}(),Nc=function(){function t(){jc(this,t),window.performance?(this.disabled=!1,this.tree=new Mc):(this.disabled=!0,this.tree=null)}return Dc(t,[{key:"startTest",value:function(t){if(!this.disabled){var e;t||(1,t="at"===(e=(new Error).stack.split("\n")[3].trim()).split(" ")[0]?e.split(" ")[1]:e.split("@")[0]);var n=new Lc(t);this.tree.add(n)}}},{key:"endTest",value:function(){this.disabled||this.tree.close()}},{key:"reset",value:function(){this.disabled||this.tree.clear()}},{key:"print",value:function(){this.disabled||this.tree.print()}}]),t}(),Fc=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};const Uc=(t=>{var e={};return i.d(e,t),e})({AnalyticsBrowser:()=>e.AnalyticsBrowser});var zc,Bc=new Uint8Array(16);function Vc(){if(!zc&&!(zc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return zc(Bc)}const Gc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Wc=[],Xc=0;Xc<256;++Xc)Wc.push((Xc+256).toString(16).substr(1));const Hc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Wc[t[e+0]]+Wc[t[e+1]]+Wc[t[e+2]]+Wc[t[e+3]]+"-"+Wc[t[e+4]]+Wc[t[e+5]]+"-"+Wc[t[e+6]]+Wc[t[e+7]]+"-"+Wc[t[e+8]]+Wc[t[e+9]]+"-"+Wc[t[e+10]]+Wc[t[e+11]]+Wc[t[e+12]]+Wc[t[e+13]]+Wc[t[e+14]]+Wc[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&Gc.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n};var Yc,$c,qc=0,Zc=0;const Kc=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||Yc,a=void 0!==t.clockseq?t.clockseq:$c;if(null==o||null==a){var s=t.random||(t.rng||Vc)();null==o&&(o=Yc=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=$c=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:Zc+1,c=u-qc+(l-Zc)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||u>qc)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");qc=u,Zc=l,$c=a;var f=(1e4*(268435455&(u+=122192928e5))+l)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=255&f;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var d=0;d<6;++d)i[r+d]=o[d];return e||Hc(i)};function Jc(t){return Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(t)}function Qc(){Qc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(C([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Jc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Jc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function tf(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function ef(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nf(r.key),r)}}function nf(t){var e=function(t,e){if("object"!=Jc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Jc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jc(e)?e:String(e)}var rf=window.localStorage,of="neo4j.nvl.sTid",af=!1,sf=function(){function t(){var e,n,r;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),e=this,r=void 0,(n=nf(n="analytics"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r;var i=new Uc.AnalyticsBrowser;this.analytics=i}var e,n,r,i,o;return r=t,i=[{key:"init",value:function(t){this.analytics.load({writeKey:t}),this.analytics.addSourceMiddleware((function(t){var e=t.payload,n=t.next,r=e.obj.context.page;void 0!==r&&(r.url="",r.title="",r.search="",r.referrer="",r.path=""),n(e)}))}},{key:"trackEvent",value:(e=Qc().mark((function t(e){var n;return Qc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ready();case 2:n="".concat(e.eventPrefix?e.eventPrefix:"NVL_core","-").concat(e.event),this.analytics.track(n,e.properties).catch((function(t){Vr.warn("TRACKING: Event tracking is failed. err: ".concat(t))}));case 4:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){tf(o,r,i,a,s,"next",t)}function s(t){tf(o,r,i,a,s,"throw",t)}a(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"identify",value:function(){if(!af){var t=this.getSegmentTrackingId();this.analytics.identify(t).catch((function(t){Vr.debug("TRACKING: Identifying user for Segment tracking failed. err: ".concat(t))})),af=!0}}},{key:"loadSavedSegmentId",value:function(){try{var t=rf.getItem(of);return"string"==typeof t?t:null}catch(t){return Vr.debug("TRACKING: Retrieving tracking Id failed. err: ".concat(t)),null}}},{key:"getSegmentTrackingId",value:function(){var t=this.loadSavedSegmentId(),e=null!=t?t:Kc();return this.saveTrackingId(e),e}},{key:"saveTrackingId",value:function(t){rf.setItem(of,t)}},{key:"ready",value:function(){return this.analytics.ready().catch((function(t){Vr.debug("TRACKING: segment track instance not ready. err: ".concat(t))}))}}],i&&ef(r.prototype,i),o&&ef(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function uf(t){return uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uf(t)}function lf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ff(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ff(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ff(t,e){if(t){if("string"==typeof t)return hf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hf(t,e):void 0}}function hf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function df(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?df(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=yf(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):df(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yf(r.key),r)}}function yf(t){var e=function(t,e){if("object"!=uf(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=uf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uf(e)?e:String(e)}function mf(t,e,n){gf(t,e),e.set(t,n)}function gf(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bf(t,e){return t.get(xf(t,e))}function wf(t,e,n){return t.set(xf(t,e),n),n}function xf(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _f=new WeakMap,Sf=new WeakMap,Tf=new WeakMap,Af=new WeakMap,Of=new WeakMap,Ef=new WeakMap,Pf=new WeakSet,kf=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),gf(this,n=Pf),n.add(this),mf(this,_f,void 0),mf(this,Sf,void 0),mf(this,Tf,void 0),mf(this,Af,void 0),mf(this,Of,void 0),mf(this,Ef,void 0),!0!==o.disableTelemetry&&(wf(Ef,this,new sf),bf(Ef,this).init("4SGwdwzuDm5WkFvQtz7D6ATQlo14yjmW"),bf(Ef,this).identify()),xf(Pf,this,Cf).call(this,o),wf(_f,this,new u(a)),wf(Sf,this,new Nc),wf(Of,this,o),bf(Of,this).frame=t,this.checkWebGLCompatibility(),xf(Pf,this,jf).call(this,r,i,o)}var n,r;return n=e,r=[{key:"restart",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getNodePositions(),r=bf(Tf,this),i=r.zoom,o=r.layout,a=r.layoutOptions,s=r.nodes,u=r.rels;bf(Af,this).destroy(),Object.assign(bf(Of,this),t),xf(Pf,this,jf).call(this,s.items,u.items,bf(Of,this)),this.setZoom(i),this.setLayout(o),this.setLayoutOptions(a),this.addAndUpdateElementsInGraph(s.items,u.items),e&&this.setNodePositions(n)}},{key:"addAndUpdateElementsInGraph",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];xf(Pf,this,If).call(this,t),xf(Pf,this,Lf).call(this,e,t);var n={added:!1,updated:!1};bf(Tf,this).nodes.update(t,pf({},n)),bf(Tf,this).rels.update(e,pf({},n)),bf(Tf,this).nodes.add(t,pf({},n)),bf(Tf,this).rels.add(e,pf({},n)),bf(Tf,this).setGraphUpdated(),bf(Af,this).updateHtmlOverlay()}},{key:"getSelectedNodes",value:function(){var t=this;return bf(Tf,this).nodes.items.filter((function(t){return t.selected})).map((function(e){return pf(pf({},e),bf(Tf,t).nodes.idToPosition[e.id])}))}},{key:"getSelectedRelationships",value:function(){return bf(Tf,this).rels.items.filter((function(t){return t.selected}))}},{key:"updateElementsInGraph",value:function(t,e){var n={added:!1,updated:!1};xf(Pf,this,If).call(this,t),xf(Pf,this,Lf).call(this,e,t),bf(Tf,this).nodes.update(t,pf({},n)),bf(Tf,this).rels.update(e,pf({},n)),bf(Af,this).updateHtmlOverlay()}},{key:"addElementsToGraph",value:function(t,e){xf(Pf,this,If).call(this,t),xf(Pf,this,Lf).call(this,e,t);var n={added:!1,updated:!1};bf(Tf,this).nodes.add(t,pf({},n)),bf(Tf,this).rels.add(e,pf({},n)),bf(Af,this).updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(e){if(Array.isArray(e)&&!(0,t.isEmpty)(e)){var n,r={},i=cf(e);try{for(i.s();!(n=i.n()).done;)r[n.value]=!0}catch(t){i.e(t)}finally{i.f()}var o,a=[],s=cf(bf(Tf,this).rels.items);try{for(s.s();!(o=s.n()).done;){var u=o.value;!0!==r[u.from]&&!0!==r[u.to]||a.push(u.id)}}catch(t){s.e(t)}finally{s.f()}a.length>0&&xf(Pf,this,Rf).call(this,a),xf(Pf,this,Df).call(this,e),bf(Tf,this).setGraphUpdated(),bf(Af,this).updateHtmlOverlay()}}},{key:"removeRelationshipsWithIds",value:function(e){Array.isArray(e)&&!(0,t.isEmpty)(e)&&(xf(Pf,this,Rf).call(this,e),bf(Tf,this).setGraphUpdated(),bf(Af,this).updateHtmlOverlay())}},{key:"getNodes",value:function(){return bf(Af,this).dumpNodes()}},{key:"getRelationships",value:function(){return bf(Af,this).dumpRelationships()}},{key:"getNodeById",value:function(t){return bf(Tf,this).nodes.idToItem[t]}},{key:"getRelationshipById",value:function(t){return bf(Tf,this).rels.idToItem[t]}},{key:"getPositionById",value:function(t){return bf(Tf,this).nodes.idToPosition[t]}},{key:"getCurrentOptions",value:function(){return bf(Of,this)}},{key:"destroy",value:function(){bf(Af,this).destroy()}},{key:"deselectAll",value:function(){this.updateElementsInGraph(bf(Tf,this).nodes.items.map((function(t){return pf(pf({},t),{},{selected:!1})})),bf(Tf,this).rels.items.map((function(t){return pf(pf({},t),{},{selected:!1})})))}},{key:"fit",value:function(t,e){bf(Af,this).fit(t,e)}},{key:"resetZoom",value:function(){bf(Af,this).resetZoom()}},{key:"setUseWebGLRenderer",value:function(t){bf(Af,this).setRenderer(t?da:pa)}},{key:"setRenderer",value:function(t){bf(Af,this).setRenderer(t)}},{key:"setDisableWebGL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bf(Of,this).disableWebGL!==t&&(bf(Of,this).disableWebGL=t,this.restart())}},{key:"pinNode",value:function(t){bf(Tf,this).nodes.update([{id:t,pinned:!0}],{})}},{key:"unPinNode",value:function(t){bf(Tf,this).nodes.update(t.map((function(t){return{id:t,pinned:!1}})),{})}},{key:"setLayout",value:function(t){bf(Tf,this).setLayout(t)}},{key:"setLayoutOptions",value:function(t){bf(Tf,this).setLayoutOptions(t)}},{key:"getNodesOnScreen",value:function(){return bf(Af,this).getNodesOnScreen()}},{key:"getNodePositions",value:function(){return bf(Af,this).getNodePositions()}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];bf(Af,this).setNodePositions(t,e)}},{key:"isLayoutMoving",value:function(){return bf(Af,this).isLayoutMoving()}},{key:"saveToFile",value:function(t){bf(Af,this).saveToFile(t)}},{key:"saveFullGraphToLargeFile",value:function(t){bf(Af,this).saveFullGraphToLargeFile(t)}},{key:"setZoom",value:function(t){bf(Af,this).setZoomLevel(t)}},{key:"setPan",value:function(t,e){bf(Af,this).setPanCoordinates(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){bf(Af,this).setZoomAndPan(t,e,n)}},{key:"getScale",value:function(){return bf(Af,this).getScale()}},{key:"getPan",value:function(){return bf(Af,this).getPan()}},{key:"getHits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["node","relationship"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{hitNodeMarginWidth:0},r=bf(Tf,this),i=r.zoom,o=r.panX,a=r.panY,s=r.webGLVisible,u=xl(t,bf(Of,this).frame,i,o,a),l=u.x,c=u.y,f=s?function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[],s=n.nodes,u=n.rels;return r.includes("node")&&o.push.apply(o,Zl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=[],a=Kl(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a,s=n.value,u=r[s.id];if(void 0===(null==u?void 0:u.x)||void 0===u.y)return 1;var l=(null!==(a=s.size)&&void 0!==a?a:gr)*xr(),c={x:u.x-t,y:u.y-e},f=Math.pow(l,2),h=Math.pow(l+i,2),d=Math.pow(c.x,2)+Math.pow(c.y,2),p=Math.sqrt(d);if(d<h){var v=o.findIndex((function(t){return t.distance>p}));o.splice(-1!==v?v:o.length,0,{data:s,targetCoordinates:{x:u.x,y:u.y},pointerCoordinates:{x:t,y:e},distanceVector:c,distance:p,insideNode:d<f})}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return o}(t,e,s.items,s.idToPosition,i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,Zl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=Kl(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a=n.value,s=a.from,u=a.to;if(void 0===o["".concat(s,".").concat(u)]){var l=r[s],c=r[u];if(void 0===(null==l?void 0:l.x)||void 0===l.y)return 0;if(void 0===(null==c?void 0:c.x)||void 0===c.y)return 0;var f=Cs({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=tc){var h=i.findIndex((function(t){return t.distance>f}));i.splice(-1!==h?h:i.length,0,{data:a,fromTargetCoordinates:{x:l.x,y:l.y},toTargetCoordinates:{x:c.x,y:c.y},pointerCoordinates:{x:t,y:e},distance:f})}o["".concat(s,".").concat(u)]=1,o["".concat(u,".").concat(s)]=1}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return i}(t,e,u.items,s.idToPosition))),{nodes:o,relationships:a}}(l,c,bf(Tf,this),e,n):function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[];return r.includes("node")&&o.push.apply(o,Zl(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,Zl(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(l,c,bf(Af,this),e,n);return pf(pf({},t),{},{nvlTargets:f})}},{key:"getContainer",value:function(){return bf(Of,this).frame}},{key:"checkWebGLCompatibility",value:function(){var t=bf(Of,this).disableWebGL;if(void 0===t||!t){var e=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.createElement("canvas");try{return Boolean(void 0!==window.WebGLRenderingContext&&(null!==t.getContext("webgl")||null!==t.getContext("experimental-webgl")))}catch(t){return!1}}();if(!e){if(void 0!==t)throw new Mi("Could not initialize WebGL");bf(Of,this).renderer=pa,console.warn("GPU acceleration is not available on your browser. Falling back to CPU layout and rendering. You can disable this warning by setting the disableWebGL option to true.")}void 0===t&&(bf(Of,this).disableWebGL=!e)}}}],r&&vf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();function jf(){var e,n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wf(Tf,this,function(e){var n=e.minZoom,r=e.maxZoom,i=e.allowDynamicMinZoom,o=void 0===i||i,a=e.layout,s=e.layoutOptions,u=e.nodeDefaultBorderColor,l=e.selectedBorderColor,c=e.panX,f=void 0===c?0:c,h=e.panY,d=void 0===h?0:h,p=e.initialZoom,v=e.renderer,y=void 0===v?!1===e.useWebGL?pa:da:v,m=e.disableWebGL,g=void 0!==m&&m,b=e.disableTelemetry,w=void 0!==b&&b;q(!0),wn.isolateGlobalState();var x=void 0!==n?n:.075,_=void 0!==r?r:10,S=ta({},ia.default);void 0!==u&&("string"==typeof u&&null!==Co().get.rgb(u)?S.rings=[{color:u,widthFactor:.05}]:Vr.warn("Invalid color string for nodeDefaultBorderColor:",u));var T=ta({},ia.selected),A=ta({},oa.selected);return void 0!==l&&("string"==typeof u&&null!==Co().get.rgb(l)?(T.rings[1].color=l,A.rings[1].color=l):Vr.warn("Invalid color string for selectedBorderColor:",l)),Bt({zoom:p||aa,minimapZoom:aa,defaultZoomLevel:aa,panX:f,panY:d,minimapPanX:0,minimapPanY:0,fitNodeIds:[],resetZoom:!1,zoomOptions:{},forceWebGL:!1,renderer:y,disableWebGL:g,disableTelemetry:w,fitMovement:0,layout:a,layoutOptions:s,maxDistance:0,maxNodeRadius:50,nodeBorderStyles:{default:S,selected:T},relationshipBorderStyles:{default:oa.default,selected:A},get minZoom(){return x},get maxZoom(){return _},get minMinimapZoom(){return 0},get maxMinimapZoom(){return.2},get webGLVisible(){var t=this.fitMovement>50;return this.renderer===da||t},nodes:Ko(),rels:Ko(),graphUpdates:0,waypoints:{data:Bt.shallow({}),counter:0},setGraphUpdated:it((function(){this.graphUpdates++})),setRenderer:it((function(t){it((function(){this.graphUpdates++})),this.renderer=t})),setWaypoints:it((function(t){this.waypoints.data=t,this.waypoints.counter+=1})),setZoomPan:it((function(t,e,n,r){if(o){var i=Object.values(this.nodes.idToPosition),a=Uo(i,x,_,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=Fo(t,this.zoom,x,_);s!==this.zoom&&(this.zoom=s,this.panX=e,this.panY=n)}this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setZoom:it((function(t,e){if(o){var n=Object.values(this.nodes.idToPosition);this.zoom=Uo(n,x,_,e,t,this.zoom)}else this.zoom=Fo(t,this.zoom,x,_);this.fitNodeIds=[],this.fitMovement=0,this.resetZoom=!1,this.forceWebGL=!1})),setPan:it((function(t,e){this.panX=t,this.panY=e,this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setLayout:it((function(t){this.layout=t})),setLayoutOptions:it((function(t){this.layoutOptions=t})),fitNodes:it((function(e,n){this.fitNodeIds=(0,t.intersection)(e,(0,t.map)(this.nodes.items,"id")),this.zoomOptions=null!=n?n:{}})),setZoomReset:it((function(){this.resetZoom=!0})),clearFit:it((function(){this.fitNodeIds=[],this.forceWebGL=!1,this.fitMovement=0})),clearReset:it((function(){this.resetZoom=!1,this.fitMovement=0})),updateZoomToFit:it((function(t,e,n,r){var i;if(this.fitMovement=Math.abs(t-this.zoom)+Math.abs(e-this.panX)+Math.abs(n-this.panY),o){var a=Object.values(this.nodes.idToPosition);i=Uo(a,x,_,r,t,this.zoom)}else i=Fo(t,this.zoom,x,_);this.zoom=i,this.panX=e,this.panY=n})),updateMinimapZoomToFit:it((function(t,e,n){this.minimapZoom=t,this.minimapPanX=e,this.minimapPanY=n})),autorun:vt,reaction:yt})}(o)),o.minimapContainer instanceof HTMLElement||delete o.minimapContainer,wf(Af,this,new Pc(bf(Tf,this),o)),this.addAndUpdateElementsInGraph(r,i),bf(Af,this).on("restart",this.restart.bind(this));var a,s,u=cf((a=bf(_f,this).callbacks,Object.entries(a)));try{for(u.s();!(s=u.n()).done;){var l=lf(s.value,2),c=l[0];void 0!==l[1]&&bf(Af,this).on(c,bf(_f,this)[c].bind(bf(_f,this)))}}catch(t){u.e(t)}finally{u.f()}var f=null===(e=bf(Of,this).frame)||void 0===e?void 0:e.getAttribute("id");!0!==bf(Of,this).disableTelemetry&&setTimeout((function(){bf(Af,n).isDestroyed()||bf(Ef,n).trackEvent({eventPrefix:_r.includes(f)?f:null,event:"instantiated",properties:{}})}),200)}function Cf(t){var e,n=t.logging;void 0!==(null==n?void 0:n.level)&&(e=n.level,Vr.setLevel(e),function(t,e){var n=t.methodFactory;t.methodFactory=function(t,r,i){var o=n(t,r,i);return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];"function"==typeof e.logger?e.logger.apply(e,[t].concat(r)):o.apply(void 0,r)}},t.setLevel(t.getLevel())}(Vr,n))}function Df(t){var e=Array.isArray(t)?t:[t],n=bf(Tf,this),r=n.nodes,i=n.fitNodeIds,o=n.zoomOptions;r.remove(e,{removed:!1}),i.length&&void 0!==e.find((function(t){return i.includes(t)}))&&bf(Tf,this).fitNodes(i.filter((function(t){return!e.includes(t)})),o)}function Rf(t){var e=Array.isArray(t)?t:[t];bf(Tf,this).rels.remove(e,{removed:!1})}function If(t){var e=t.find((function(t){return!function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0}(t)}));if(e){var n="";throw/^\d+$/.test(e.id)||(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported."),new TypeError("Invalid node provided: ".concat(JSON.stringify(e),".").concat(n))}}function Lf(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n="",r=null,i=bf(Tf,this),o=i.nodes,a=i.rels,s={},u=0;u<e.length;u++){var l=e[u];s[l.id]=l}for(var c=pf(pf({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!Fc(d)){r=d,/^\d+$/.test(d.id)&&(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported.");break}if(void 0===f[d.id]){var p=c[d.from],v=c[d.to];if(void 0===p){n=' Node with id "'.concat(d.from,'" does not exist.'),r=d;break}if(void 0===v){n=' Node with id "'.concat(d.to,'" does not exist.'),r=d;break}}}if(null!==r)throw new TypeError("Invalid relationship provided: ".concat(JSON.stringify(r),".").concat(n))}var Mf={textColorForBackground:al};const Nf=kf})();var a=o.RL,s=o.wK,u=o.x_,l=o.lv,c=o.YQ,f=o.BP,h=o.GZ,d=o.Vw,p=o.Ay,v=o._G;export{a as CompatibilityError,s as ForceDirectedLayoutType,u as FreeLayoutType,l as GridLayoutType,c as HierarchicalLayoutType,f as NVL,h as colorMapperFunctions,d as d3ForceLayoutType,p as default,v as drawCircleBand};
|